From b283e37c81397ff2a2d6b34dd5b8986266236843 Mon Sep 17 00:00:00 2001 From: michael1011 Date: Thu, 22 Aug 2024 21:56:03 +0200 Subject: [PATCH] refactor: use new hold plugin --- .github/workflows/ci.yml | 6 +- .gitignore | 1 + .gitmodules | 3 + docker/regtest/Dockerfile | 1 + docker/regtest/startRegtest.sh | 2 + hold | 1 + lib/VersionCheck.ts | 4 +- lib/lightning/cln/ClnClient.ts | 156 +- lib/lightning/cln/Router.ts | 82 + .../ClnPendingPaymentTracker.ts | 2 +- lib/proto/hold/hold_grpc_pb.d.ts | 51 - lib/proto/hold/hold_grpc_pb.js | 101 - lib/proto/hold/hold_pb.d.ts | 666 +-- lib/proto/hold/hold_pb.js | 4873 +++++------------ lib/proto/mpay/mpay_pb.d.ts | 30 + lib/proto/mpay/mpay_pb.js | 240 +- package-lock.json | 21 +- package.json | 9 +- protos.js | 2 +- test/integration/lightning/cln/Router.spec.ts | 47 + tools/plugins/hold/__init__.py | 0 tools/plugins/hold/config.py | 34 - tools/plugins/hold/consts.py | 21 - tools/plugins/hold/datastore.py | 85 - tools/plugins/hold/encoder.py | 108 - tools/plugins/hold/enums.py | 35 - tools/plugins/hold/errors.py | 20 - tools/plugins/hold/hold.py | 131 - tools/plugins/hold/htlc_handler.py | 181 - tools/plugins/hold/invoice.py | 194 - tools/plugins/hold/plugin.py | 240 - tools/plugins/hold/protos/__init__.py | 4 - tools/plugins/hold/protos/hold.proto | 198 - tools/plugins/hold/protos/hold_pb2.py | 92 - tools/plugins/hold/protos/hold_pb2.pyi | 299 - tools/plugins/hold/protos/hold_pb2_grpc.py | 491 -- tools/plugins/hold/route_hints.py | 31 - tools/plugins/hold/router.py | 115 - tools/plugins/hold/server.py | 196 - tools/plugins/hold/settler.py | 110 - tools/plugins/hold/tests/__init__.py | 0 tools/plugins/hold/tests/test_certs.py | 42 - tools/plugins/hold/tests/test_encoder.py | 171 - tools/plugins/hold/tests/test_grpc.py | 593 -- tools/plugins/hold/tests/test_plugin.py | 724 --- tools/plugins/hold/tests/test_route_hints.py | 39 - tools/plugins/hold/tests/test_router.py | 63 - tools/plugins/hold/tests/test_server.py | 88 - tools/plugins/hold/tests/test_tracker.py | 116 - tools/plugins/hold/tracker.py | 88 - tools/plugins/hold/transformers.py | 213 - tools/plugins/hold/utils.py | 30 - tools/plugins/mpay/config.py | 5 +- tools/plugins/mpay/consts.py | 12 + .../mpay/data/tests/test_network_info.py | 2 +- tools/plugins/mpay/pay/invoice_check.py | 19 +- tools/plugins/mpay/pay/tests/test_channels.py | 2 +- .../mpay/pay/tests/test_invoice_check.py | 8 +- tools/plugins/mpay/pay/tests/test_route.py | 2 +- tools/plugins/mpay/protos/mpay_pb2.py | 12 +- tools/plugins/mpay/protos/mpay_pb2_grpc.py | 9 +- tools/plugins/{hold => mpay/rpc}/certs.py | 2 +- .../plugins/{hold => mpay/rpc}/grpc_server.py | 2 +- tools/plugins/mpay/rpc/server.py | 2 +- tools/plugins/mpay/rpc/tests/test_server.py | 18 +- tools/plugins/{hold => mpay}/tests/utils.py | 108 +- tools/plugins/mpay/utils.py | 6 + tools/poetry.lock | 830 ++- tools/pyproject.toml | 18 +- 69 files changed, 2402 insertions(+), 9705 deletions(-) create mode 100644 .gitmodules create mode 160000 hold create mode 100644 lib/lightning/cln/Router.ts create mode 100644 test/integration/lightning/cln/Router.spec.ts delete mode 100644 tools/plugins/hold/__init__.py delete mode 100644 tools/plugins/hold/config.py delete mode 100644 tools/plugins/hold/consts.py delete mode 100644 tools/plugins/hold/datastore.py delete mode 100644 tools/plugins/hold/encoder.py delete mode 100644 tools/plugins/hold/enums.py delete mode 100644 tools/plugins/hold/errors.py delete mode 100644 tools/plugins/hold/hold.py delete mode 100644 tools/plugins/hold/htlc_handler.py delete mode 100644 tools/plugins/hold/invoice.py delete mode 100755 tools/plugins/hold/plugin.py delete mode 100644 tools/plugins/hold/protos/__init__.py delete mode 100644 tools/plugins/hold/protos/hold.proto delete mode 100644 tools/plugins/hold/protos/hold_pb2.py delete mode 100644 tools/plugins/hold/protos/hold_pb2.pyi delete mode 100644 tools/plugins/hold/protos/hold_pb2_grpc.py delete mode 100644 tools/plugins/hold/route_hints.py delete mode 100644 tools/plugins/hold/router.py delete mode 100644 tools/plugins/hold/server.py delete mode 100644 tools/plugins/hold/settler.py delete mode 100644 tools/plugins/hold/tests/__init__.py delete mode 100644 tools/plugins/hold/tests/test_certs.py delete mode 100644 tools/plugins/hold/tests/test_encoder.py delete mode 100644 tools/plugins/hold/tests/test_grpc.py delete mode 100644 tools/plugins/hold/tests/test_plugin.py delete mode 100644 tools/plugins/hold/tests/test_route_hints.py delete mode 100644 tools/plugins/hold/tests/test_router.py delete mode 100644 tools/plugins/hold/tests/test_server.py delete mode 100644 tools/plugins/hold/tests/test_tracker.py delete mode 100644 tools/plugins/hold/tracker.py delete mode 100644 tools/plugins/hold/transformers.py delete mode 100644 tools/plugins/hold/utils.py rename tools/plugins/{hold => mpay/rpc}/certs.py (98%) rename tools/plugins/{hold => mpay/rpc}/grpc_server.py (98%) rename tools/plugins/{hold => mpay}/tests/utils.py (55%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3ce8b0e..131cecfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + with: + submodules: 'true' - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 @@ -68,7 +70,7 @@ jobs: run: npm run python:lint - name: Start hold invoice plugin - run: docker exec regtest lightning-cli plugin start /root/hold.sh + run: npm run docker:cln:hold - name: Start mpay plugin run: docker exec regtest lightning-cli plugin start /root/mpay.sh @@ -80,7 +82,7 @@ jobs: run: node run-int.js - name: Stop hold invoice plugin - run: docker exec regtest lightning-cli plugin stop /root/hold.sh + run: docker exec regtest lightning-cli plugin stop /root/.lightning/plugins/hold - name: Stop mpay plugin run: docker exec regtest lightning-cli plugin stop /root/mpay.sh diff --git a/.gitignore b/.gitignore index 6c236015..1a064192 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ docker/regtest/data/core/cookies/ docker/regtest/data/cln/hold docker/regtest/data/cln/certs docker/regtest/data/cln/mpay +docker/regtest/data/cln/plugins diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..a629f16a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hold"] + path = hold + url = https://github.com/boltzExchange/hold diff --git a/docker/regtest/Dockerfile b/docker/regtest/Dockerfile index 81520a46..34fff93f 100644 --- a/docker/regtest/Dockerfile +++ b/docker/regtest/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get update && \ python3 \ libtool \ autoconf \ + libpq-dev \ libdb-dev \ pkg-config \ python3-pip \ diff --git a/docker/regtest/startRegtest.sh b/docker/regtest/startRegtest.sh index 2d32b9e1..29aa1a7d 100755 --- a/docker/regtest/startRegtest.sh +++ b/docker/regtest/startRegtest.sh @@ -8,6 +8,7 @@ docker run \ --volume "${PWD}"/docker/regtest/data/cln/hold:/root/.lightning/regtest/hold \ --volume "${PWD}"/docker/regtest/data/cln/mpay:/root/.lightning/regtest/mpay \ --volume "${PWD}"/tools:/tools \ + --volume "${PWD}"/docker/regtest/data/cln/plugins:/root/.lightning/plugins \ -p 29000:29000 \ -p 29001:29001 \ -p 29002:29002 \ @@ -32,3 +33,4 @@ docker run \ docker exec regtest bash -c "cp /root/.lightning/regtest/*.pem /root/.lightning/regtest/certs" docker exec regtest chmod -R 777 /root/.lightning/regtest/certs +docker exec regtest chmod -R 777 /root/.lightning/plugins diff --git a/hold b/hold new file mode 160000 index 00000000..50c69bad --- /dev/null +++ b/hold @@ -0,0 +1 @@ +Subproject commit 50c69bada94c49886e22b2e96927f4f4fb367e49 diff --git a/lib/VersionCheck.ts b/lib/VersionCheck.ts index 30f10fdf..f0586993 100644 --- a/lib/VersionCheck.ts +++ b/lib/VersionCheck.ts @@ -86,8 +86,8 @@ class VersionCheck { maximal: '24.05', }, [ClnClient.serviceNameHold]: { - minimal: '0.0.3', - maximal: '0.0.5', + minimal: '0.1.0', + maximal: '0.1.0', }, [MpayClient.serviceName]: { minimal: '0.1.0', diff --git a/lib/lightning/cln/ClnClient.ts b/lib/lightning/cln/ClnClient.ts index 2a3404a4..b62a7e12 100644 --- a/lib/lightning/cln/ClnClient.ts +++ b/lib/lightning/cln/ClnClient.ts @@ -21,12 +21,7 @@ import * as primitivesrpc from '../../proto/cln/primitives_pb'; import { HoldClient } from '../../proto/hold/hold_grpc_pb'; import * as holdrpc from '../../proto/hold/hold_pb'; import { WalletBalance } from '../../wallet/providers/WalletProviderInterface'; -import { - msatToSat, - satToMsat, - scidClnToLnd, - scidLndToCln, -} from '../ChannelUtils'; +import { msatToSat, satToMsat, scidClnToLnd } from '../ChannelUtils'; import Errors from '../Errors'; import { grpcOptions, unaryCall } from '../GrpcUtils'; import { @@ -47,6 +42,7 @@ import { calculatePaymentFee, } from '../LightningClient'; import Mpay from './MpayClient'; +import { getRoute } from './Router'; import { ClnConfig, createSsl } from './Types'; import ListpaysPaysStatus = ListpaysPays.ListpaysPaysStatus; @@ -354,14 +350,26 @@ class ClnClient }; public routingHints = async (node: string): Promise => { - const req = new holdrpc.RoutingHintsRequest(); - req.setNode(node); + const req = new noderpc.ListpeerchannelsRequest(); + req.setId(node); - const res = await this.unaryHoldCall< - holdrpc.RoutingHintsRequest, - holdrpc.RoutingHintsResponse.AsObject - >('routingHints', req); - return ClnClient.routingHintsFromGrpc(res.hintsList); + const channels = await this.unaryNodeCall< + noderpc.ListpeerchannelsRequest, + noderpc.ListpeerchannelsResponse.AsObject + >('listPeerChannels', req, true); + + return channels.channelsList + .filter((chan) => chan.pb_private) + .map((channel) => [ + { + nodeId: node, + chanId: scidClnToLnd(getHexString(Buffer.from(channel.channelId))), + feeBaseMsat: channel.updates!.remote!.feeBaseMsat!.msat, + feeProportionalMillionths: + channel.updates!.remote!.feeProportionalMillionths, + cltvExpiryDelta: channel.updates!.remote!.cltvExpiryDelta, + }, + ]); }; public addHoldInvoice = async ( @@ -375,7 +383,7 @@ class ClnClient ): Promise => { const req = new holdrpc.InvoiceRequest(); req.setAmountMsat(satToMsat(value)); - req.setPaymentHash(getHexString(preimageHash)); + req.setPaymentHash(preimageHash); if (cltvExpiry) { req.setMinFinalCltvExpiry(cltvExpiry); @@ -386,11 +394,11 @@ class ClnClient } if (memo) { - req.setDescription(memo); + req.setMemo(memo); } if (descriptionHash) { - req.setDescriptionHash(getHexString(descriptionHash)); + req.setHash(descriptionHash); } if (routingHints) { @@ -407,7 +415,7 @@ class ClnClient public lookupHoldInvoice = async (preimageHash: Buffer): Promise => { const req = new holdrpc.ListRequest(); - req.setPaymentHash(getHexString(preimageHash)); + req.setPaymentHash(preimageHash); const res = await this.unaryHoldCall< holdrpc.ListRequest, @@ -427,7 +435,7 @@ class ClnClient public cancelHoldInvoice = async (preimageHash: Buffer): Promise => { const req = new holdrpc.CancelRequest(); - req.setPaymentHash(getHexString(preimageHash)); + req.setPaymentHash(preimageHash); await this.unaryHoldCall< holdrpc.CancelRequest, @@ -437,7 +445,7 @@ class ClnClient public settleHoldInvoice = async (preimage: Buffer): Promise => { const req = new holdrpc.SettleRequest(); - req.setPaymentPreimage(getHexString(preimage)); + req.setPaymentPreimage(preimage); await this.unaryHoldCall< holdrpc.SettleRequest, @@ -510,7 +518,7 @@ class ClnClient routingHints?: HopHint[][], ): Promise => { const prms: Promise[] = [ - this.queryRoute(destination, amt, cltvLimit, finalCltvDelta), + getRoute(this.unaryNodeCall, destination, amt, cltvLimit, finalCltvDelta), ]; if (routingHints) { @@ -520,7 +528,8 @@ class ClnClient 0, ); prms.push( - this.queryRoute( + getRoute( + this.unaryNodeCall, hint[0].nodeId, amt, cltvLimit, @@ -614,7 +623,7 @@ class ClnClient // eslint-disable-next-line @typescript-eslint/no-unused-vars public subscribeSingleInvoice = (_: Buffer): void => { // Just here for interface compatibility; - // with CLN we can subscribe to all hold invoice with one gRPC subscription + // with CLN we can subscribe to all hold invoices with one gRPC subscription return; }; @@ -625,8 +634,8 @@ class ClnClient const routeHint = new holdrpc.RoutingHint(); for (const hint of hints) { const hopHint = new holdrpc.Hop(); - hopHint.setPublicKey(hint.nodeId); - hopHint.setShortChannelId(scidLndToCln(hint.chanId)); + hopHint.setPublicKey(getHexBuffer(hint.nodeId)); + hopHint.setShortChannelId(Number(hint.chanId)); hopHint.setBaseFee(hint.feeBaseMsat); hopHint.setPpmFee(hint.feeProportionalMillionths); hopHint.setCltvExpiryDelta(hint.cltvExpiryDelta); @@ -638,49 +647,39 @@ class ClnClient }); }; - private static routingHintsFromGrpc = ( - routingHints: holdrpc.RoutingHint.AsObject[], - ): HopHint[][] => { - return routingHints.map((hint) => - hint.hopsList.map((hop) => ({ - nodeId: hop.publicKey, - chanId: hop.shortChannelId, - feeBaseMsat: hop.baseFee, - feeProportionalMillionths: hop.ppmFee, - cltvExpiryDelta: hop.cltvExpiryDelta, - })), - ); - }; - private static invoiceStateFromGrpc = ( state: holdrpc.InvoiceState, ): InvoiceState => { switch (state) { - case holdrpc.InvoiceState.INVOICE_UNPAID: + case holdrpc.InvoiceState.UNPAID: return InvoiceState.Open; - case holdrpc.InvoiceState.INVOICE_ACCEPTED: + case holdrpc.InvoiceState.ACCEPTED: return InvoiceState.Accepted; - case holdrpc.InvoiceState.INVOICE_CANCELLED: + case holdrpc.InvoiceState.CANCELLED: return InvoiceState.Cancelled; - case holdrpc.InvoiceState.INVOICE_PAID: + case holdrpc.InvoiceState.PAID: return InvoiceState.Settled; } }; private static htlcFromGrpc = (htlc: holdrpc.Htlc.AsObject): Htlc => { return { - state: ClnClient.htlcStateFromGrpc(htlc.state), valueMsat: htlc.msat, + state: ClnClient.htlcStateFromGrpc(htlc.state), }; }; - private static htlcStateFromGrpc = (state: holdrpc.HtlcState): HtlcState => { + private static htlcStateFromGrpc = ( + state: holdrpc.InvoiceState, + ): HtlcState => { switch (state) { - case holdrpc.HtlcState.HTLC_ACCEPTED: + case holdrpc.InvoiceState.UNPAID: + throw 'invalid HTLC state'; + case holdrpc.InvoiceState.ACCEPTED: return HtlcState.Accepted; - case holdrpc.HtlcState.HTLC_CANCELLED: + case holdrpc.InvoiceState.CANCELLED: return HtlcState.Cancelled; - case holdrpc.HtlcState.HTLC_SETTLED: + case holdrpc.InvoiceState.PAID: return HtlcState.Settled; } }; @@ -721,24 +720,7 @@ class ClnClient }; } - // ... has failed - // TODO: mpay incorrect payment details detection - for (const payStatus of (await this.payStatus(invoice)).statusList) { - for (const attempt of payStatus.attemptsList) { - if ( - attempt.state === - holdrpc.PayStatusResponse.PayStatus.Attempt.AttemptState - .ATTEMPT_PENDING || - attempt.failure === undefined - ) { - continue; - } - - if (ClnClient.errIsIncorrectPaymentDetails(attempt.failure.message)) { - throw attempt.failure.message; - } - } - } + // TODO: find a way to check "paystatus" // ... or is still pending const hasPendingPayments = pays.some( @@ -771,46 +753,6 @@ class ClnClient return undefined; }; - private payStatus = (invoice: string) => { - const req = new holdrpc.PayStatusRequest(); - req.setBolt11(invoice); - - return this.unaryHoldCall< - holdrpc.PayStatusRequest, - holdrpc.PayStatusResponse.AsObject - >('payStatus', req); - }; - - private queryRoute = async ( - destination: string, - amt: number, - cltvLimit?: number, - finalCltvDelta?: number, - ): Promise => { - const req = new holdrpc.GetRouteRequest(); - req.setDestination(destination); - req.setRiskFactor(0); - req.setAmountMsat(amt); - - if (cltvLimit) { - req.setMaxCltv(cltvLimit); - } - - if (finalCltvDelta) { - req.setFinalCltvDelta(finalCltvDelta); - } - - const res = await this.unaryHoldCall< - holdrpc.GetRouteRequest, - holdrpc.GetRouteResponse.AsObject - >('getRoute', req); - - return { - ctlv: res.hopsList[0].delay, - feesMsat: res.feesMsat, - }; - }; - private subscribeTrackHoldInvoices = () => { if (this.trackAllSubscription) { this.trackAllSubscription.cancel(); @@ -822,7 +764,7 @@ class ClnClient this.trackAllSubscription.on('data', (update: holdrpc.TrackAllResponse) => { switch (update.getState()) { - case holdrpc.InvoiceState.INVOICE_ACCEPTED: + case holdrpc.InvoiceState.ACCEPTED: this.logger.debug( `${ClnClient.serviceName} ${ this.symbol @@ -832,7 +774,7 @@ class ClnClient this.emit('htlc.accepted', update.getBolt11()); break; - case holdrpc.InvoiceState.INVOICE_PAID: + case holdrpc.InvoiceState.PAID: this.logger.debug( `${ClnClient.serviceName} ${ this.symbol diff --git a/lib/lightning/cln/Router.ts b/lib/lightning/cln/Router.ts new file mode 100644 index 00000000..aca7e3a1 --- /dev/null +++ b/lib/lightning/cln/Router.ts @@ -0,0 +1,82 @@ +import { getHexBuffer } from '../../Utils'; +import { NodeClient } from '../../proto/cln/node_grpc_pb'; +import * as noderpc from '../../proto/cln/node_pb'; +import * as primivites from '../../proto/cln/primitives_pb'; +import { satToMsat } from '../ChannelUtils'; +import Errors from '../Errors'; +import { Route } from '../LightningClient'; + +export const getRoute = async ( + nodeCaller: ( + methodName: keyof NodeClient, + params: T, + toObject?: boolean, + ) => Promise, + destination: string, + amount: number, + cltvLimit: number = Number.MAX_SAFE_INTEGER, + finalCltv: number = 9, + riskFactor: number = 0, + maxRetries: number = 10, +): Promise => { + const req = new noderpc.GetrouteRequest(); + req.setId(getHexBuffer(destination)); + + const amountMsat = new primivites.Amount(); + amountMsat.setMsat(satToMsat(amount)); + req.setAmountMsat(amountMsat); + + req.setCltv(finalCltv); + req.setRiskfactor(riskFactor); + + const excludes: string[] = []; + req.setExcludeList(excludes); + + for (let i = 0; i < maxRetries; i++) { + const res = await nodeCaller< + noderpc.GetrouteRequest, + noderpc.GetrouteResponse.AsObject + >('getRoute', req, true); + + if (res.routeList.length === 0) { + throw Errors.NO_ROUTE(); + } + + if (res.routeList[0].delay > cltvLimit) { + const highestDelta = findHighestDeltaHop(res.routeList); + excludes.push(`${highestDelta.channel}/${highestDelta.direction}`); + + req.setExcludeList(excludes); + continue; + } + + return { + ctlv: res.routeList[0].delay, + feesMsat: Number( + BigInt(res.routeList[0].amountMsat!.msat) - BigInt(satToMsat(amount)), + ), + }; + } + + throw Errors.NO_ROUTE(); +}; + +const findHighestDeltaHop = (route: noderpc.GetrouteRoute.AsObject[]) => { + if (route.length < 2) { + return route[0]; + } + + let highestDeltaHop = route[0]; + let maxDelta = route[0].delay - route[1].delay; + + for (let i = 1; i < route.length - 1; i++) { + const delta = route[i].delay - route[i + 1].delay; + + if (delta > maxDelta) { + maxDelta = delta; + highestDeltaHop = route[i]; + } + } + + return highestDeltaHop; +}; diff --git a/lib/lightning/paymentTrackers/ClnPendingPaymentTracker.ts b/lib/lightning/paymentTrackers/ClnPendingPaymentTracker.ts index fe9c75fa..76d91487 100644 --- a/lib/lightning/paymentTrackers/ClnPendingPaymentTracker.ts +++ b/lib/lightning/paymentTrackers/ClnPendingPaymentTracker.ts @@ -19,7 +19,7 @@ class ClnPendingPaymentTracker extends NodePendingPendingTracker { constructor(logger: Logger) { super(logger, NodeType.CLN); // CLN does not have streaming for existing pending payments - // We have to poll on interval + // We have to poll on an interval this.logger.debug( `Checking for updates on pending CLN payments every ${ClnPendingPaymentTracker.checkInterval} seconds`, ); diff --git a/lib/proto/hold/hold_grpc_pb.d.ts b/lib/proto/hold/hold_grpc_pb.d.ts index 47dc6d02..4f668dad 100644 --- a/lib/proto/hold/hold_grpc_pb.d.ts +++ b/lib/proto/hold/hold_grpc_pb.d.ts @@ -10,14 +10,11 @@ import * as hold_pb from "./hold_pb"; interface IHoldService extends grpc.ServiceDefinition { getInfo: IHoldService_IGetInfo; invoice: IHoldService_IInvoice; - routingHints: IHoldService_IRoutingHints; list: IHoldService_IList; settle: IHoldService_ISettle; cancel: IHoldService_ICancel; track: IHoldService_ITrack; trackAll: IHoldService_ITrackAll; - payStatus: IHoldService_IPayStatus; - getRoute: IHoldService_IGetRoute; } interface IHoldService_IGetInfo extends grpc.MethodDefinition { @@ -38,15 +35,6 @@ interface IHoldService_IInvoice extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } -interface IHoldService_IRoutingHints extends grpc.MethodDefinition { - path: "/hold.Hold/RoutingHints"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} interface IHoldService_IList extends grpc.MethodDefinition { path: "/hold.Hold/List"; requestStream: false; @@ -92,38 +80,17 @@ interface IHoldService_ITrackAll extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } -interface IHoldService_IPayStatus extends grpc.MethodDefinition { - path: "/hold.Hold/PayStatus"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IHoldService_IGetRoute extends grpc.MethodDefinition { - path: "/hold.Hold/GetRoute"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} export const HoldService: IHoldService; export interface IHoldServer extends grpc.UntypedServiceImplementation { getInfo: grpc.handleUnaryCall; invoice: grpc.handleUnaryCall; - routingHints: grpc.handleUnaryCall; list: grpc.handleUnaryCall; settle: grpc.handleUnaryCall; cancel: grpc.handleUnaryCall; track: grpc.handleServerStreamingCall; trackAll: grpc.handleServerStreamingCall; - payStatus: grpc.handleUnaryCall; - getRoute: grpc.handleUnaryCall; } export interface IHoldClient { @@ -133,9 +100,6 @@ export interface IHoldClient { invoice(request: hold_pb.InvoiceRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.InvoiceResponse) => void): grpc.ClientUnaryCall; invoice(request: hold_pb.InvoiceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.InvoiceResponse) => void): grpc.ClientUnaryCall; invoice(request: hold_pb.InvoiceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.InvoiceResponse) => void): grpc.ClientUnaryCall; - routingHints(request: hold_pb.RoutingHintsRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.RoutingHintsResponse) => void): grpc.ClientUnaryCall; - routingHints(request: hold_pb.RoutingHintsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.RoutingHintsResponse) => void): grpc.ClientUnaryCall; - routingHints(request: hold_pb.RoutingHintsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.RoutingHintsResponse) => void): grpc.ClientUnaryCall; list(request: hold_pb.ListRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.ListResponse) => void): grpc.ClientUnaryCall; list(request: hold_pb.ListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.ListResponse) => void): grpc.ClientUnaryCall; list(request: hold_pb.ListRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.ListResponse) => void): grpc.ClientUnaryCall; @@ -149,12 +113,6 @@ export interface IHoldClient { track(request: hold_pb.TrackRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; trackAll(request: hold_pb.TrackAllRequest, options?: Partial): grpc.ClientReadableStream; trackAll(request: hold_pb.TrackAllRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - payStatus(request: hold_pb.PayStatusRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.PayStatusResponse) => void): grpc.ClientUnaryCall; - payStatus(request: hold_pb.PayStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.PayStatusResponse) => void): grpc.ClientUnaryCall; - payStatus(request: hold_pb.PayStatusRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.PayStatusResponse) => void): grpc.ClientUnaryCall; - getRoute(request: hold_pb.GetRouteRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.GetRouteResponse) => void): grpc.ClientUnaryCall; - getRoute(request: hold_pb.GetRouteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.GetRouteResponse) => void): grpc.ClientUnaryCall; - getRoute(request: hold_pb.GetRouteRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.GetRouteResponse) => void): grpc.ClientUnaryCall; } export class HoldClient extends grpc.Client implements IHoldClient { @@ -165,9 +123,6 @@ export class HoldClient extends grpc.Client implements IHoldClient { public invoice(request: hold_pb.InvoiceRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.InvoiceResponse) => void): grpc.ClientUnaryCall; public invoice(request: hold_pb.InvoiceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.InvoiceResponse) => void): grpc.ClientUnaryCall; public invoice(request: hold_pb.InvoiceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.InvoiceResponse) => void): grpc.ClientUnaryCall; - public routingHints(request: hold_pb.RoutingHintsRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.RoutingHintsResponse) => void): grpc.ClientUnaryCall; - public routingHints(request: hold_pb.RoutingHintsRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.RoutingHintsResponse) => void): grpc.ClientUnaryCall; - public routingHints(request: hold_pb.RoutingHintsRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.RoutingHintsResponse) => void): grpc.ClientUnaryCall; public list(request: hold_pb.ListRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.ListResponse) => void): grpc.ClientUnaryCall; public list(request: hold_pb.ListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.ListResponse) => void): grpc.ClientUnaryCall; public list(request: hold_pb.ListRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.ListResponse) => void): grpc.ClientUnaryCall; @@ -181,10 +136,4 @@ export class HoldClient extends grpc.Client implements IHoldClient { public track(request: hold_pb.TrackRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; public trackAll(request: hold_pb.TrackAllRequest, options?: Partial): grpc.ClientReadableStream; public trackAll(request: hold_pb.TrackAllRequest, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public payStatus(request: hold_pb.PayStatusRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.PayStatusResponse) => void): grpc.ClientUnaryCall; - public payStatus(request: hold_pb.PayStatusRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.PayStatusResponse) => void): grpc.ClientUnaryCall; - public payStatus(request: hold_pb.PayStatusRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.PayStatusResponse) => void): grpc.ClientUnaryCall; - public getRoute(request: hold_pb.GetRouteRequest, callback: (error: grpc.ServiceError | null, response: hold_pb.GetRouteResponse) => void): grpc.ClientUnaryCall; - public getRoute(request: hold_pb.GetRouteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: hold_pb.GetRouteResponse) => void): grpc.ClientUnaryCall; - public getRoute(request: hold_pb.GetRouteRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: hold_pb.GetRouteResponse) => void): grpc.ClientUnaryCall; } diff --git a/lib/proto/hold/hold_grpc_pb.js b/lib/proto/hold/hold_grpc_pb.js index d892a51a..f4bce10b 100644 --- a/lib/proto/hold/hold_grpc_pb.js +++ b/lib/proto/hold/hold_grpc_pb.js @@ -48,28 +48,6 @@ function deserialize_hold_GetInfoResponse(buffer_arg) { return hold_pb.GetInfoResponse.deserializeBinary(new Uint8Array(buffer_arg)); } -function serialize_hold_GetRouteRequest(arg) { - if (!(arg instanceof hold_pb.GetRouteRequest)) { - throw new Error('Expected argument of type hold.GetRouteRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_hold_GetRouteRequest(buffer_arg) { - return hold_pb.GetRouteRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_hold_GetRouteResponse(arg) { - if (!(arg instanceof hold_pb.GetRouteResponse)) { - throw new Error('Expected argument of type hold.GetRouteResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_hold_GetRouteResponse(buffer_arg) { - return hold_pb.GetRouteResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - function serialize_hold_InvoiceRequest(arg) { if (!(arg instanceof hold_pb.InvoiceRequest)) { throw new Error('Expected argument of type hold.InvoiceRequest'); @@ -114,50 +92,6 @@ function deserialize_hold_ListResponse(buffer_arg) { return hold_pb.ListResponse.deserializeBinary(new Uint8Array(buffer_arg)); } -function serialize_hold_PayStatusRequest(arg) { - if (!(arg instanceof hold_pb.PayStatusRequest)) { - throw new Error('Expected argument of type hold.PayStatusRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_hold_PayStatusRequest(buffer_arg) { - return hold_pb.PayStatusRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_hold_PayStatusResponse(arg) { - if (!(arg instanceof hold_pb.PayStatusResponse)) { - throw new Error('Expected argument of type hold.PayStatusResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_hold_PayStatusResponse(buffer_arg) { - return hold_pb.PayStatusResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_hold_RoutingHintsRequest(arg) { - if (!(arg instanceof hold_pb.RoutingHintsRequest)) { - throw new Error('Expected argument of type hold.RoutingHintsRequest'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_hold_RoutingHintsRequest(buffer_arg) { - return hold_pb.RoutingHintsRequest.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_hold_RoutingHintsResponse(arg) { - if (!(arg instanceof hold_pb.RoutingHintsResponse)) { - throw new Error('Expected argument of type hold.RoutingHintsResponse'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_hold_RoutingHintsResponse(buffer_arg) { - return hold_pb.RoutingHintsResponse.deserializeBinary(new Uint8Array(buffer_arg)); -} - function serialize_hold_SettleRequest(arg) { if (!(arg instanceof hold_pb.SettleRequest)) { throw new Error('Expected argument of type hold.SettleRequest'); @@ -248,17 +182,6 @@ var HoldService = exports.HoldService = { responseSerialize: serialize_hold_InvoiceResponse, responseDeserialize: deserialize_hold_InvoiceResponse, }, - routingHints: { - path: '/hold.Hold/RoutingHints', - requestStream: false, - responseStream: false, - requestType: hold_pb.RoutingHintsRequest, - responseType: hold_pb.RoutingHintsResponse, - requestSerialize: serialize_hold_RoutingHintsRequest, - requestDeserialize: deserialize_hold_RoutingHintsRequest, - responseSerialize: serialize_hold_RoutingHintsResponse, - responseDeserialize: deserialize_hold_RoutingHintsResponse, - }, list: { path: '/hold.Hold/List', requestStream: false, @@ -314,30 +237,6 @@ var HoldService = exports.HoldService = { responseSerialize: serialize_hold_TrackAllResponse, responseDeserialize: deserialize_hold_TrackAllResponse, }, - // Workaround to expose the paystatus command via gRPC, since CLN doesn't -payStatus: { - path: '/hold.Hold/PayStatus', - requestStream: false, - responseStream: false, - requestType: hold_pb.PayStatusRequest, - responseType: hold_pb.PayStatusResponse, - requestSerialize: serialize_hold_PayStatusRequest, - requestDeserialize: deserialize_hold_PayStatusRequest, - responseSerialize: serialize_hold_PayStatusResponse, - responseDeserialize: deserialize_hold_PayStatusResponse, - }, - // Custom algorithm that allows specifying a max delay -getRoute: { - path: '/hold.Hold/GetRoute', - requestStream: false, - responseStream: false, - requestType: hold_pb.GetRouteRequest, - responseType: hold_pb.GetRouteResponse, - requestSerialize: serialize_hold_GetRouteRequest, - requestDeserialize: deserialize_hold_GetRouteRequest, - responseSerialize: serialize_hold_GetRouteResponse, - responseDeserialize: deserialize_hold_GetRouteResponse, - }, }; exports.HoldClient = grpc.makeGenericClientConstructor(HoldService); diff --git a/lib/proto/hold/hold_pb.d.ts b/lib/proto/hold/hold_pb.d.ts index 7fdd561e..f5f98316 100644 --- a/lib/proto/hold/hold_pb.d.ts +++ b/lib/proto/hold/hold_pb.d.ts @@ -43,21 +43,81 @@ export namespace GetInfoResponse { } } +export class Hop extends jspb.Message { + getPublicKey(): Uint8Array | string; + getPublicKey_asU8(): Uint8Array; + getPublicKey_asB64(): string; + setPublicKey(value: Uint8Array | string): Hop; + getShortChannelId(): number; + setShortChannelId(value: number): Hop; + getBaseFee(): number; + setBaseFee(value: number): Hop; + getPpmFee(): number; + setPpmFee(value: number): Hop; + getCltvExpiryDelta(): number; + setCltvExpiryDelta(value: number): Hop; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Hop.AsObject; + static toObject(includeInstance: boolean, msg: Hop): Hop.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Hop, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Hop; + static deserializeBinaryFromReader(message: Hop, reader: jspb.BinaryReader): Hop; +} + +export namespace Hop { + export type AsObject = { + publicKey: Uint8Array | string, + shortChannelId: number, + baseFee: number, + ppmFee: number, + cltvExpiryDelta: number, + } +} + +export class RoutingHint extends jspb.Message { + clearHopsList(): void; + getHopsList(): Array; + setHopsList(value: Array): RoutingHint; + addHops(value?: Hop, index?: number): Hop; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RoutingHint.AsObject; + static toObject(includeInstance: boolean, msg: RoutingHint): RoutingHint.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RoutingHint, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RoutingHint; + static deserializeBinaryFromReader(message: RoutingHint, reader: jspb.BinaryReader): RoutingHint; +} + +export namespace RoutingHint { + export type AsObject = { + hopsList: Array, + } +} + export class InvoiceRequest extends jspb.Message { - getPaymentHash(): string; - setPaymentHash(value: string): InvoiceRequest; + getPaymentHash(): Uint8Array | string; + getPaymentHash_asU8(): Uint8Array; + getPaymentHash_asB64(): string; + setPaymentHash(value: Uint8Array | string): InvoiceRequest; getAmountMsat(): number; setAmountMsat(value: number): InvoiceRequest; - hasDescription(): boolean; - clearDescription(): void; - getDescription(): string | undefined; - setDescription(value: string): InvoiceRequest; + hasMemo(): boolean; + clearMemo(): void; + getMemo(): string; + setMemo(value: string): InvoiceRequest; - hasDescriptionHash(): boolean; - clearDescriptionHash(): void; - getDescriptionHash(): string | undefined; - setDescriptionHash(value: string): InvoiceRequest; + hasHash(): boolean; + clearHash(): void; + getHash(): Uint8Array | string; + getHash_asU8(): Uint8Array; + getHash_asB64(): string; + setHash(value: Uint8Array | string): InvoiceRequest; hasExpiry(): boolean; clearExpiry(): void; @@ -73,6 +133,8 @@ export class InvoiceRequest extends jspb.Message { setRoutingHintsList(value: Array): InvoiceRequest; addRoutingHints(value?: RoutingHint, index?: number): RoutingHint; + getDescriptionCase(): InvoiceRequest.DescriptionCase; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): InvoiceRequest.AsObject; static toObject(includeInstance: boolean, msg: InvoiceRequest): InvoiceRequest.AsObject; @@ -85,14 +147,21 @@ export class InvoiceRequest extends jspb.Message { export namespace InvoiceRequest { export type AsObject = { - paymentHash: string, + paymentHash: Uint8Array | string, amountMsat: number, - description?: string, - descriptionHash?: string, + memo: string, + hash: Uint8Array | string, expiry?: number, minFinalCltvExpiry?: number, routingHintsList: Array, } + + export enum DescriptionCase { + DESCRIPTION_NOT_SET = 0, + MEMO = 3, + HASH = 4, + } + } export class InvoiceResponse extends jspb.Message { @@ -115,136 +184,84 @@ export namespace InvoiceResponse { } } -export class RoutingHintsRequest extends jspb.Message { - getNode(): string; - setNode(value: string): RoutingHintsRequest; +export class ListRequest extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RoutingHintsRequest.AsObject; - static toObject(includeInstance: boolean, msg: RoutingHintsRequest): RoutingHintsRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RoutingHintsRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RoutingHintsRequest; - static deserializeBinaryFromReader(message: RoutingHintsRequest, reader: jspb.BinaryReader): RoutingHintsRequest; -} + hasPaymentHash(): boolean; + clearPaymentHash(): void; + getPaymentHash(): Uint8Array | string; + getPaymentHash_asU8(): Uint8Array; + getPaymentHash_asB64(): string; + setPaymentHash(value: Uint8Array | string): ListRequest; -export namespace RoutingHintsRequest { - export type AsObject = { - node: string, - } -} + hasPagination(): boolean; + clearPagination(): void; + getPagination(): ListRequest.Pagination | undefined; + setPagination(value?: ListRequest.Pagination): ListRequest; -export class Hop extends jspb.Message { - getPublicKey(): string; - setPublicKey(value: string): Hop; - getShortChannelId(): string; - setShortChannelId(value: string): Hop; - getBaseFee(): number; - setBaseFee(value: number): Hop; - getPpmFee(): number; - setPpmFee(value: number): Hop; - getCltvExpiryDelta(): number; - setCltvExpiryDelta(value: number): Hop; + getConstraintCase(): ListRequest.ConstraintCase; serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Hop.AsObject; - static toObject(includeInstance: boolean, msg: Hop): Hop.AsObject; + toObject(includeInstance?: boolean): ListRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListRequest): ListRequest.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Hop, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Hop; - static deserializeBinaryFromReader(message: Hop, reader: jspb.BinaryReader): Hop; + static serializeBinaryToWriter(message: ListRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListRequest; + static deserializeBinaryFromReader(message: ListRequest, reader: jspb.BinaryReader): ListRequest; } -export namespace Hop { +export namespace ListRequest { export type AsObject = { - publicKey: string, - shortChannelId: string, - baseFee: number, - ppmFee: number, - cltvExpiryDelta: number, + paymentHash: Uint8Array | string, + pagination?: ListRequest.Pagination.AsObject, } -} -export class RoutingHint extends jspb.Message { - clearHopsList(): void; - getHopsList(): Array; - setHopsList(value: Array): RoutingHint; - addHops(value?: Hop, index?: number): Hop; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RoutingHint.AsObject; - static toObject(includeInstance: boolean, msg: RoutingHint): RoutingHint.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RoutingHint, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RoutingHint; - static deserializeBinaryFromReader(message: RoutingHint, reader: jspb.BinaryReader): RoutingHint; -} + export class Pagination extends jspb.Message { + getIndexStart(): number; + setIndexStart(value: number): Pagination; + getLimit(): number; + setLimit(value: number): Pagination; -export namespace RoutingHint { - export type AsObject = { - hopsList: Array, + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Pagination.AsObject; + static toObject(includeInstance: boolean, msg: Pagination): Pagination.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Pagination, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Pagination; + static deserializeBinaryFromReader(message: Pagination, reader: jspb.BinaryReader): Pagination; } -} - -export class RoutingHintsResponse extends jspb.Message { - clearHintsList(): void; - getHintsList(): Array; - setHintsList(value: Array): RoutingHintsResponse; - addHints(value?: RoutingHint, index?: number): RoutingHint; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): RoutingHintsResponse.AsObject; - static toObject(includeInstance: boolean, msg: RoutingHintsResponse): RoutingHintsResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: RoutingHintsResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): RoutingHintsResponse; - static deserializeBinaryFromReader(message: RoutingHintsResponse, reader: jspb.BinaryReader): RoutingHintsResponse; -} -export namespace RoutingHintsResponse { - export type AsObject = { - hintsList: Array, + export namespace Pagination { + export type AsObject = { + indexStart: number, + limit: number, + } } -} -export class ListRequest extends jspb.Message { - - hasPaymentHash(): boolean; - clearPaymentHash(): void; - getPaymentHash(): string | undefined; - setPaymentHash(value: string): ListRequest; - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ListRequest.AsObject; - static toObject(includeInstance: boolean, msg: ListRequest): ListRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ListRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ListRequest; - static deserializeBinaryFromReader(message: ListRequest, reader: jspb.BinaryReader): ListRequest; -} - -export namespace ListRequest { - export type AsObject = { - paymentHash?: string, + export enum ConstraintCase { + CONSTRAINT_NOT_SET = 0, + PAYMENT_HASH = 1, + PAGINATION = 2, } + } export class Htlc extends jspb.Message { - getState(): HtlcState; - setState(value: HtlcState): Htlc; + getId(): number; + setId(value: number): Htlc; + getState(): InvoiceState; + setState(value: InvoiceState): Htlc; + getScid(): string; + setScid(value: string): Htlc; + getChannelId(): number; + setChannelId(value: number): Htlc; getMsat(): number; setMsat(value: number): Htlc; getCreatedAt(): number; setCreatedAt(value: number): Htlc; - getShortChannelId(): string; - setShortChannelId(value: string): Htlc; - getId(): number; - setId(value: number): Htlc; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Htlc.AsObject; @@ -258,34 +275,39 @@ export class Htlc extends jspb.Message { export namespace Htlc { export type AsObject = { - state: HtlcState, + id: number, + state: InvoiceState, + scid: string, + channelId: number, msat: number, createdAt: number, - shortChannelId: string, - id: number, } } export class Invoice extends jspb.Message { - getPaymentHash(): string; - setPaymentHash(value: string): Invoice; - - hasPaymentPreimage(): boolean; - clearPaymentPreimage(): void; - getPaymentPreimage(): string | undefined; - setPaymentPreimage(value: string): Invoice; - getState(): InvoiceState; - setState(value: InvoiceState): Invoice; + getId(): number; + setId(value: number): Invoice; + getPaymentHash(): Uint8Array | string; + getPaymentHash_asU8(): Uint8Array; + getPaymentHash_asB64(): string; + setPaymentHash(value: Uint8Array | string): Invoice; + + hasPreimage(): boolean; + clearPreimage(): void; + getPreimage(): Uint8Array | string; + getPreimage_asU8(): Uint8Array; + getPreimage_asB64(): string; + setPreimage(value: Uint8Array | string): Invoice; getBolt11(): string; setBolt11(value: string): Invoice; + getState(): InvoiceState; + setState(value: InvoiceState): Invoice; getCreatedAt(): number; setCreatedAt(value: number): Invoice; clearHtlcsList(): void; getHtlcsList(): Array; setHtlcsList(value: Array): Invoice; addHtlcs(value?: Htlc, index?: number): Htlc; - getAmountMsat(): number; - setAmountMsat(value: number): Invoice; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Invoice.AsObject; @@ -299,13 +321,13 @@ export class Invoice extends jspb.Message { export namespace Invoice { export type AsObject = { - paymentHash: string, - paymentPreimage?: string, - state: InvoiceState, + id: number, + paymentHash: Uint8Array | string, + preimage: Uint8Array | string, bolt11: string, + state: InvoiceState, createdAt: number, htlcsList: Array, - amountMsat: number, } } @@ -332,8 +354,10 @@ export namespace ListResponse { } export class SettleRequest extends jspb.Message { - getPaymentPreimage(): string; - setPaymentPreimage(value: string): SettleRequest; + getPaymentPreimage(): Uint8Array | string; + getPaymentPreimage_asU8(): Uint8Array; + getPaymentPreimage_asB64(): string; + setPaymentPreimage(value: Uint8Array | string): SettleRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): SettleRequest.AsObject; @@ -347,7 +371,7 @@ export class SettleRequest extends jspb.Message { export namespace SettleRequest { export type AsObject = { - paymentPreimage: string, + paymentPreimage: Uint8Array | string, } } @@ -369,8 +393,10 @@ export namespace SettleResponse { } export class CancelRequest extends jspb.Message { - getPaymentHash(): string; - setPaymentHash(value: string): CancelRequest; + getPaymentHash(): Uint8Array | string; + getPaymentHash_asU8(): Uint8Array; + getPaymentHash_asB64(): string; + setPaymentHash(value: Uint8Array | string): CancelRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): CancelRequest.AsObject; @@ -384,7 +410,7 @@ export class CancelRequest extends jspb.Message { export namespace CancelRequest { export type AsObject = { - paymentHash: string, + paymentHash: Uint8Array | string, } } @@ -406,8 +432,10 @@ export namespace CancelResponse { } export class TrackRequest extends jspb.Message { - getPaymentHash(): string; - setPaymentHash(value: string): TrackRequest; + getPaymentHash(): Uint8Array | string; + getPaymentHash_asU8(): Uint8Array; + getPaymentHash_asB64(): string; + setPaymentHash(value: Uint8Array | string): TrackRequest; serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): TrackRequest.AsObject; @@ -421,7 +449,7 @@ export class TrackRequest extends jspb.Message { export namespace TrackRequest { export type AsObject = { - paymentHash: string, + paymentHash: Uint8Array | string, } } @@ -463,8 +491,10 @@ export namespace TrackAllRequest { } export class TrackAllResponse extends jspb.Message { - getPaymentHash(): string; - setPaymentHash(value: string): TrackAllResponse; + getPaymentHash(): Uint8Array | string; + getPaymentHash_asU8(): Uint8Array; + getPaymentHash_asB64(): string; + setPaymentHash(value: Uint8Array | string): TrackAllResponse; getBolt11(): string; setBolt11(value: string): TrackAllResponse; getState(): InvoiceState; @@ -482,351 +512,15 @@ export class TrackAllResponse extends jspb.Message { export namespace TrackAllResponse { export type AsObject = { - paymentHash: string, + paymentHash: Uint8Array | string, bolt11: string, state: InvoiceState, } } -export class PayStatusRequest extends jspb.Message { - - hasBolt11(): boolean; - clearBolt11(): void; - getBolt11(): string | undefined; - setBolt11(value: string): PayStatusRequest; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): PayStatusRequest.AsObject; - static toObject(includeInstance: boolean, msg: PayStatusRequest): PayStatusRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: PayStatusRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): PayStatusRequest; - static deserializeBinaryFromReader(message: PayStatusRequest, reader: jspb.BinaryReader): PayStatusRequest; -} - -export namespace PayStatusRequest { - export type AsObject = { - bolt11?: string, - } -} - -export class PayStatusResponse extends jspb.Message { - clearStatusList(): void; - getStatusList(): Array; - setStatusList(value: Array): PayStatusResponse; - addStatus(value?: PayStatusResponse.PayStatus, index?: number): PayStatusResponse.PayStatus; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): PayStatusResponse.AsObject; - static toObject(includeInstance: boolean, msg: PayStatusResponse): PayStatusResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: PayStatusResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): PayStatusResponse; - static deserializeBinaryFromReader(message: PayStatusResponse, reader: jspb.BinaryReader): PayStatusResponse; -} - -export namespace PayStatusResponse { - export type AsObject = { - statusList: Array, - } - - - export class PayStatus extends jspb.Message { - getBolt11(): string; - setBolt11(value: string): PayStatus; - getAmountMsat(): number; - setAmountMsat(value: number): PayStatus; - getDestination(): string; - setDestination(value: string): PayStatus; - clearAttemptsList(): void; - getAttemptsList(): Array; - setAttemptsList(value: Array): PayStatus; - addAttempts(value?: PayStatusResponse.PayStatus.Attempt, index?: number): PayStatusResponse.PayStatus.Attempt; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): PayStatus.AsObject; - static toObject(includeInstance: boolean, msg: PayStatus): PayStatus.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: PayStatus, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): PayStatus; - static deserializeBinaryFromReader(message: PayStatus, reader: jspb.BinaryReader): PayStatus; - } - - export namespace PayStatus { - export type AsObject = { - bolt11: string, - amountMsat: number, - destination: string, - attemptsList: Array, - } - - - export class Attempt extends jspb.Message { - getStrategy(): string; - setStrategy(value: string): Attempt; - getStartTime(): number; - setStartTime(value: number): Attempt; - getAgeInSeconds(): number; - setAgeInSeconds(value: number): Attempt; - - hasEndTime(): boolean; - clearEndTime(): void; - getEndTime(): number | undefined; - setEndTime(value: number): Attempt; - getState(): PayStatusResponse.PayStatus.Attempt.AttemptState; - setState(value: PayStatusResponse.PayStatus.Attempt.AttemptState): Attempt; - - hasSuccess(): boolean; - clearSuccess(): void; - getSuccess(): PayStatusResponse.PayStatus.Attempt.Success | undefined; - setSuccess(value?: PayStatusResponse.PayStatus.Attempt.Success): Attempt; - - hasFailure(): boolean; - clearFailure(): void; - getFailure(): PayStatusResponse.PayStatus.Attempt.Failure | undefined; - setFailure(value?: PayStatusResponse.PayStatus.Attempt.Failure): Attempt; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Attempt.AsObject; - static toObject(includeInstance: boolean, msg: Attempt): Attempt.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Attempt, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Attempt; - static deserializeBinaryFromReader(message: Attempt, reader: jspb.BinaryReader): Attempt; - } - - export namespace Attempt { - export type AsObject = { - strategy: string, - startTime: number, - ageInSeconds: number, - endTime?: number, - state: PayStatusResponse.PayStatus.Attempt.AttemptState, - success?: PayStatusResponse.PayStatus.Attempt.Success.AsObject, - failure?: PayStatusResponse.PayStatus.Attempt.Failure.AsObject, - } - - - export class Success extends jspb.Message { - getId(): number; - setId(value: number): Success; - getPaymentPreimage(): string; - setPaymentPreimage(value: string): Success; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Success.AsObject; - static toObject(includeInstance: boolean, msg: Success): Success.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Success, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Success; - static deserializeBinaryFromReader(message: Success, reader: jspb.BinaryReader): Success; - } - - export namespace Success { - export type AsObject = { - id: number, - paymentPreimage: string, - } - } - - export class Failure extends jspb.Message { - getMessage(): string; - setMessage(value: string): Failure; - getCode(): number; - setCode(value: number): Failure; - - hasData(): boolean; - clearData(): void; - getData(): PayStatusResponse.PayStatus.Attempt.Failure.Data | undefined; - setData(value?: PayStatusResponse.PayStatus.Attempt.Failure.Data): Failure; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Failure.AsObject; - static toObject(includeInstance: boolean, msg: Failure): Failure.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Failure, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Failure; - static deserializeBinaryFromReader(message: Failure, reader: jspb.BinaryReader): Failure; - } - - export namespace Failure { - export type AsObject = { - message: string, - code: number, - data?: PayStatusResponse.PayStatus.Attempt.Failure.Data.AsObject, - } - - - export class Data extends jspb.Message { - getId(): number; - setId(value: number): Data; - getRawMessage(): string; - setRawMessage(value: string): Data; - getFailCode(): number; - setFailCode(value: number): Data; - getFailCodename(): string; - setFailCodename(value: string): Data; - getErringIndex(): number; - setErringIndex(value: number): Data; - getErringNode(): string; - setErringNode(value: string): Data; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Data.AsObject; - static toObject(includeInstance: boolean, msg: Data): Data.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Data, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Data; - static deserializeBinaryFromReader(message: Data, reader: jspb.BinaryReader): Data; - } - - export namespace Data { - export type AsObject = { - id: number, - rawMessage: string, - failCode: number, - failCodename: string, - erringIndex: number, - erringNode: string, - } - } - - } - - - export enum AttemptState { - ATTEMPT_PENDING = 0, - ATTEMPT_COMPLETED = 1, - } - - } - - } - -} - -export class GetRouteRequest extends jspb.Message { - getDestination(): string; - setDestination(value: string): GetRouteRequest; - getAmountMsat(): number; - setAmountMsat(value: number): GetRouteRequest; - getMaxRetries(): number; - setMaxRetries(value: number): GetRouteRequest; - - hasRiskFactor(): boolean; - clearRiskFactor(): void; - getRiskFactor(): number | undefined; - setRiskFactor(value: number): GetRouteRequest; - - hasMaxCltv(): boolean; - clearMaxCltv(): void; - getMaxCltv(): number | undefined; - setMaxCltv(value: number): GetRouteRequest; - - hasFinalCltvDelta(): boolean; - clearFinalCltvDelta(): void; - getFinalCltvDelta(): number | undefined; - setFinalCltvDelta(value: number): GetRouteRequest; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetRouteRequest.AsObject; - static toObject(includeInstance: boolean, msg: GetRouteRequest): GetRouteRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetRouteRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetRouteRequest; - static deserializeBinaryFromReader(message: GetRouteRequest, reader: jspb.BinaryReader): GetRouteRequest; -} - -export namespace GetRouteRequest { - export type AsObject = { - destination: string, - amountMsat: number, - maxRetries: number, - riskFactor?: number, - maxCltv?: number, - finalCltvDelta?: number, - } -} - -export class GetRouteResponse extends jspb.Message { - clearHopsList(): void; - getHopsList(): Array; - setHopsList(value: Array): GetRouteResponse; - addHops(value?: GetRouteResponse.Hop, index?: number): GetRouteResponse.Hop; - getFeesMsat(): number; - setFeesMsat(value: number): GetRouteResponse; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GetRouteResponse.AsObject; - static toObject(includeInstance: boolean, msg: GetRouteResponse): GetRouteResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GetRouteResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GetRouteResponse; - static deserializeBinaryFromReader(message: GetRouteResponse, reader: jspb.BinaryReader): GetRouteResponse; -} - -export namespace GetRouteResponse { - export type AsObject = { - hopsList: Array, - feesMsat: number, - } - - - export class Hop extends jspb.Message { - getId(): string; - setId(value: string): Hop; - getChannel(): string; - setChannel(value: string): Hop; - getDirection(): number; - setDirection(value: number): Hop; - getAmountMsat(): number; - setAmountMsat(value: number): Hop; - getDelay(): number; - setDelay(value: number): Hop; - getStyle(): string; - setStyle(value: string): Hop; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): Hop.AsObject; - static toObject(includeInstance: boolean, msg: Hop): Hop.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: Hop, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): Hop; - static deserializeBinaryFromReader(message: Hop, reader: jspb.BinaryReader): Hop; - } - - export namespace Hop { - export type AsObject = { - id: string, - channel: string, - direction: number, - amountMsat: number, - delay: number, - style: string, - } - } - -} - export enum InvoiceState { - INVOICE_UNPAID = 0, - INVOICE_ACCEPTED = 1, - INVOICE_PAID = 2, - INVOICE_CANCELLED = 3, -} - -export enum HtlcState { - HTLC_ACCEPTED = 0, - HTLC_SETTLED = 1, - HTLC_CANCELLED = 2, + UNPAID = 0, + ACCEPTED = 1, + PAID = 2, + CANCELLED = 3, } diff --git a/lib/proto/hold/hold_pb.js b/lib/proto/hold/hold_pb.js index 828f1a03..e52abbd6 100644 --- a/lib/proto/hold/hold_pb.js +++ b/lib/proto/hold/hold_pb.js @@ -25,29 +25,18 @@ goog.exportSymbol('proto.hold.CancelRequest', null, global); goog.exportSymbol('proto.hold.CancelResponse', null, global); goog.exportSymbol('proto.hold.GetInfoRequest', null, global); goog.exportSymbol('proto.hold.GetInfoResponse', null, global); -goog.exportSymbol('proto.hold.GetRouteRequest', null, global); -goog.exportSymbol('proto.hold.GetRouteResponse', null, global); -goog.exportSymbol('proto.hold.GetRouteResponse.Hop', null, global); goog.exportSymbol('proto.hold.Hop', null, global); goog.exportSymbol('proto.hold.Htlc', null, global); -goog.exportSymbol('proto.hold.HtlcState', null, global); goog.exportSymbol('proto.hold.Invoice', null, global); goog.exportSymbol('proto.hold.InvoiceRequest', null, global); +goog.exportSymbol('proto.hold.InvoiceRequest.DescriptionCase', null, global); goog.exportSymbol('proto.hold.InvoiceResponse', null, global); goog.exportSymbol('proto.hold.InvoiceState', null, global); goog.exportSymbol('proto.hold.ListRequest', null, global); +goog.exportSymbol('proto.hold.ListRequest.ConstraintCase', null, global); +goog.exportSymbol('proto.hold.ListRequest.Pagination', null, global); goog.exportSymbol('proto.hold.ListResponse', null, global); -goog.exportSymbol('proto.hold.PayStatusRequest', null, global); -goog.exportSymbol('proto.hold.PayStatusResponse', null, global); -goog.exportSymbol('proto.hold.PayStatusResponse.PayStatus', null, global); -goog.exportSymbol('proto.hold.PayStatusResponse.PayStatus.Attempt', null, global); -goog.exportSymbol('proto.hold.PayStatusResponse.PayStatus.Attempt.AttemptState', null, global); -goog.exportSymbol('proto.hold.PayStatusResponse.PayStatus.Attempt.Failure', null, global); -goog.exportSymbol('proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data', null, global); -goog.exportSymbol('proto.hold.PayStatusResponse.PayStatus.Attempt.Success', null, global); goog.exportSymbol('proto.hold.RoutingHint', null, global); -goog.exportSymbol('proto.hold.RoutingHintsRequest', null, global); -goog.exportSymbol('proto.hold.RoutingHintsResponse', null, global); goog.exportSymbol('proto.hold.SettleRequest', null, global); goog.exportSymbol('proto.hold.SettleResponse', null, global); goog.exportSymbol('proto.hold.TrackAllRequest', null, global); @@ -106,37 +95,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.hold.InvoiceRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.InvoiceRequest.repeatedFields_, null); -}; -goog.inherits(proto.hold.InvoiceRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.InvoiceRequest.displayName = 'proto.hold.InvoiceRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.InvoiceResponse = function(opt_data) { +proto.hold.Hop = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.hold.InvoiceResponse, jspb.Message); +goog.inherits(proto.hold.Hop, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.hold.InvoiceResponse.displayName = 'proto.hold.InvoiceResponse'; + proto.hold.Hop.displayName = 'proto.hold.Hop'; } /** * Generated by JsPbCodeGenerator. @@ -148,16 +116,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.hold.RoutingHintsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.hold.RoutingHint = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.RoutingHint.repeatedFields_, null); }; -goog.inherits(proto.hold.RoutingHintsRequest, jspb.Message); +goog.inherits(proto.hold.RoutingHint, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.hold.RoutingHintsRequest.displayName = 'proto.hold.RoutingHintsRequest'; + proto.hold.RoutingHint.displayName = 'proto.hold.RoutingHint'; } /** * Generated by JsPbCodeGenerator. @@ -169,16 +137,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.hold.Hop = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.hold.InvoiceRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.InvoiceRequest.repeatedFields_, proto.hold.InvoiceRequest.oneofGroups_); }; -goog.inherits(proto.hold.Hop, jspb.Message); +goog.inherits(proto.hold.InvoiceRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.hold.Hop.displayName = 'proto.hold.Hop'; + proto.hold.InvoiceRequest.displayName = 'proto.hold.InvoiceRequest'; } /** * Generated by JsPbCodeGenerator. @@ -190,16 +158,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.hold.RoutingHint = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.RoutingHint.repeatedFields_, null); +proto.hold.InvoiceResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.hold.RoutingHint, jspb.Message); +goog.inherits(proto.hold.InvoiceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.hold.RoutingHint.displayName = 'proto.hold.RoutingHint'; + proto.hold.InvoiceResponse.displayName = 'proto.hold.InvoiceResponse'; } /** * Generated by JsPbCodeGenerator. @@ -211,16 +179,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.hold.RoutingHintsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.RoutingHintsResponse.repeatedFields_, null); +proto.hold.ListRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.hold.ListRequest.oneofGroups_); }; -goog.inherits(proto.hold.RoutingHintsResponse, jspb.Message); +goog.inherits(proto.hold.ListRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.hold.RoutingHintsResponse.displayName = 'proto.hold.RoutingHintsResponse'; + proto.hold.ListRequest.displayName = 'proto.hold.ListRequest'; } /** * Generated by JsPbCodeGenerator. @@ -232,16 +200,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.hold.ListRequest = function(opt_data) { +proto.hold.ListRequest.Pagination = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.hold.ListRequest, jspb.Message); +goog.inherits(proto.hold.ListRequest.Pagination, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.hold.ListRequest.displayName = 'proto.hold.ListRequest'; + proto.hold.ListRequest.Pagination.displayName = 'proto.hold.ListRequest.Pagination'; } /** * Generated by JsPbCodeGenerator. @@ -474,216 +442,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.hold.TrackAllResponse.displayName = 'proto.hold.TrackAllResponse'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.PayStatusRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hold.PayStatusRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.PayStatusRequest.displayName = 'proto.hold.PayStatusRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.PayStatusResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.PayStatusResponse.repeatedFields_, null); -}; -goog.inherits(proto.hold.PayStatusResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.PayStatusResponse.displayName = 'proto.hold.PayStatusResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.PayStatusResponse.PayStatus = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.PayStatusResponse.PayStatus.repeatedFields_, null); -}; -goog.inherits(proto.hold.PayStatusResponse.PayStatus, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.PayStatusResponse.PayStatus.displayName = 'proto.hold.PayStatusResponse.PayStatus'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.PayStatusResponse.PayStatus.Attempt = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hold.PayStatusResponse.PayStatus.Attempt, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.PayStatusResponse.PayStatus.Attempt.displayName = 'proto.hold.PayStatusResponse.PayStatus.Attempt'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hold.PayStatusResponse.PayStatus.Attempt.Success, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.PayStatusResponse.PayStatus.Attempt.Success.displayName = 'proto.hold.PayStatusResponse.PayStatus.Attempt.Success'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hold.PayStatusResponse.PayStatus.Attempt.Failure, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.displayName = 'proto.hold.PayStatusResponse.PayStatus.Attempt.Failure'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.displayName = 'proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.GetRouteRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hold.GetRouteRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.GetRouteRequest.displayName = 'proto.hold.GetRouteRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.GetRouteResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.hold.GetRouteResponse.repeatedFields_, null); -}; -goog.inherits(proto.hold.GetRouteResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.GetRouteResponse.displayName = 'proto.hold.GetRouteResponse'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.hold.GetRouteResponse.Hop = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.hold.GetRouteResponse.Hop, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.hold.GetRouteResponse.Hop.displayName = 'proto.hold.GetRouteResponse.Hop'; -} @@ -916,13 +674,6 @@ proto.hold.GetInfoResponse.prototype.setVersion = function(value) { -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.hold.InvoiceRequest.repeatedFields_ = [6]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -938,8 +689,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.InvoiceRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hold.InvoiceRequest.toObject(opt_includeInstance, this); +proto.hold.Hop.prototype.toObject = function(opt_includeInstance) { + return proto.hold.Hop.toObject(opt_includeInstance, this); }; @@ -948,20 +699,17 @@ proto.hold.InvoiceRequest.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.InvoiceRequest} msg The msg instance to transform. + * @param {!proto.hold.Hop} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.InvoiceRequest.toObject = function(includeInstance, msg) { +proto.hold.Hop.toObject = function(includeInstance, msg) { var f, obj = { - paymentHash: jspb.Message.getFieldWithDefault(msg, 1, ""), - amountMsat: jspb.Message.getFieldWithDefault(msg, 2, 0), - description: jspb.Message.getFieldWithDefault(msg, 3, ""), - descriptionHash: jspb.Message.getFieldWithDefault(msg, 7, ""), - expiry: jspb.Message.getFieldWithDefault(msg, 4, 0), - minFinalCltvExpiry: jspb.Message.getFieldWithDefault(msg, 5, 0), - routingHintsList: jspb.Message.toObjectList(msg.getRoutingHintsList(), - proto.hold.RoutingHint.toObject, includeInstance) + publicKey: msg.getPublicKey_asB64(), + shortChannelId: jspb.Message.getFieldWithDefault(msg, 2, 0), + baseFee: jspb.Message.getFieldWithDefault(msg, 3, 0), + ppmFee: jspb.Message.getFieldWithDefault(msg, 4, 0), + cltvExpiryDelta: jspb.Message.getFieldWithDefault(msg, 5, 0) }; if (includeInstance) { @@ -975,23 +723,23 @@ proto.hold.InvoiceRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.InvoiceRequest} + * @return {!proto.hold.Hop} */ -proto.hold.InvoiceRequest.deserializeBinary = function(bytes) { +proto.hold.Hop.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.InvoiceRequest; - return proto.hold.InvoiceRequest.deserializeBinaryFromReader(msg, reader); -}; + var msg = new proto.hold.Hop; + return proto.hold.Hop.deserializeBinaryFromReader(msg, reader); +}; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.InvoiceRequest} msg The message object to deserialize into. + * @param {!proto.hold.Hop} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.InvoiceRequest} + * @return {!proto.hold.Hop} */ -proto.hold.InvoiceRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.Hop.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -999,33 +747,24 @@ proto.hold.InvoiceRequest.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPaymentHash(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPublicKey(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); - msg.setAmountMsat(value); + msg.setShortChannelId(value); break; case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setDescription(value); - break; - case 7: - var value = /** @type {string} */ (reader.readString()); - msg.setDescriptionHash(value); + var value = /** @type {number} */ (reader.readUint64()); + msg.setBaseFee(value); break; case 4: var value = /** @type {number} */ (reader.readUint64()); - msg.setExpiry(value); + msg.setPpmFee(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); - msg.setMinFinalCltvExpiry(value); - break; - case 6: - var value = new proto.hold.RoutingHint; - reader.readMessage(value,proto.hold.RoutingHint.deserializeBinaryFromReader); - msg.addRoutingHints(value); + msg.setCltvExpiryDelta(value); break; default: reader.skipField(); @@ -1040,9 +779,9 @@ proto.hold.InvoiceRequest.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.InvoiceRequest.prototype.serializeBinary = function() { +proto.hold.Hop.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.InvoiceRequest.serializeBinaryToWriter(this, writer); + proto.hold.Hop.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1050,283 +789,171 @@ proto.hold.InvoiceRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.InvoiceRequest} message + * @param {!proto.hold.Hop} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.InvoiceRequest.serializeBinaryToWriter = function(message, writer) { +proto.hold.Hop.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPaymentHash(); + f = message.getPublicKey_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 1, f ); } - f = message.getAmountMsat(); + f = message.getShortChannelId(); if (f !== 0) { writer.writeUint64( 2, f ); } - f = /** @type {string} */ (jspb.Message.getField(message, 3)); - if (f != null) { - writer.writeString( + f = message.getBaseFee(); + if (f !== 0) { + writer.writeUint64( 3, f ); } - f = /** @type {string} */ (jspb.Message.getField(message, 7)); - if (f != null) { - writer.writeString( - 7, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { + f = message.getPpmFee(); + if (f !== 0) { writer.writeUint64( 4, f ); } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { + f = message.getCltvExpiryDelta(); + if (f !== 0) { writer.writeUint64( 5, f ); } - f = message.getRoutingHintsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 6, - f, - proto.hold.RoutingHint.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string payment_hash = 1; - * @return {string} - */ -proto.hold.InvoiceRequest.prototype.getPaymentHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.InvoiceRequest} returns this - */ -proto.hold.InvoiceRequest.prototype.setPaymentHash = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional uint64 amount_msat = 2; - * @return {number} - */ -proto.hold.InvoiceRequest.prototype.getAmountMsat = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * @param {number} value - * @return {!proto.hold.InvoiceRequest} returns this + * optional bytes public_key = 1; + * @return {!(string|Uint8Array)} */ -proto.hold.InvoiceRequest.prototype.setAmountMsat = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.hold.Hop.prototype.getPublicKey = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional string description = 3; + * optional bytes public_key = 1; + * This is a type-conversion wrapper around `getPublicKey()` * @return {string} */ -proto.hold.InvoiceRequest.prototype.getDescription = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.InvoiceRequest} returns this - */ -proto.hold.InvoiceRequest.prototype.setDescription = function(value) { - return jspb.Message.setField(this, 3, value); +proto.hold.Hop.prototype.getPublicKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPublicKey())); }; /** - * Clears the field making it undefined. - * @return {!proto.hold.InvoiceRequest} returns this + * optional bytes public_key = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPublicKey()` + * @return {!Uint8Array} */ -proto.hold.InvoiceRequest.prototype.clearDescription = function() { - return jspb.Message.setField(this, 3, undefined); +proto.hold.Hop.prototype.getPublicKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPublicKey())); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {!(string|Uint8Array)} value + * @return {!proto.hold.Hop} returns this */ -proto.hold.InvoiceRequest.prototype.hasDescription = function() { - return jspb.Message.getField(this, 3) != null; +proto.hold.Hop.prototype.setPublicKey = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional string description_hash = 7; - * @return {string} + * optional uint64 short_channel_id = 2; + * @return {number} */ -proto.hold.InvoiceRequest.prototype.getDescriptionHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +proto.hold.Hop.prototype.getShortChannelId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * @param {string} value - * @return {!proto.hold.InvoiceRequest} returns this + * @param {number} value + * @return {!proto.hold.Hop} returns this */ -proto.hold.InvoiceRequest.prototype.setDescriptionHash = function(value) { - return jspb.Message.setField(this, 7, value); +proto.hold.Hop.prototype.setShortChannelId = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); }; /** - * Clears the field making it undefined. - * @return {!proto.hold.InvoiceRequest} returns this + * optional uint64 base_fee = 3; + * @return {number} */ -proto.hold.InvoiceRequest.prototype.clearDescriptionHash = function() { - return jspb.Message.setField(this, 7, undefined); +proto.hold.Hop.prototype.getBaseFee = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {number} value + * @return {!proto.hold.Hop} returns this */ -proto.hold.InvoiceRequest.prototype.hasDescriptionHash = function() { - return jspb.Message.getField(this, 7) != null; +proto.hold.Hop.prototype.setBaseFee = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); }; /** - * optional uint64 expiry = 4; + * optional uint64 ppm_fee = 4; * @return {number} */ -proto.hold.InvoiceRequest.prototype.getExpiry = function() { +proto.hold.Hop.prototype.getPpmFee = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value - * @return {!proto.hold.InvoiceRequest} returns this - */ -proto.hold.InvoiceRequest.prototype.setExpiry = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.hold.InvoiceRequest} returns this - */ -proto.hold.InvoiceRequest.prototype.clearExpiry = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} + * @return {!proto.hold.Hop} returns this */ -proto.hold.InvoiceRequest.prototype.hasExpiry = function() { - return jspb.Message.getField(this, 4) != null; +proto.hold.Hop.prototype.setPpmFee = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); }; /** - * optional uint64 min_final_cltv_expiry = 5; + * optional uint64 cltv_expiry_delta = 5; * @return {number} */ -proto.hold.InvoiceRequest.prototype.getMinFinalCltvExpiry = function() { +proto.hold.Hop.prototype.getCltvExpiryDelta = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value - * @return {!proto.hold.InvoiceRequest} returns this - */ -proto.hold.InvoiceRequest.prototype.setMinFinalCltvExpiry = function(value) { - return jspb.Message.setField(this, 5, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.hold.InvoiceRequest} returns this - */ -proto.hold.InvoiceRequest.prototype.clearMinFinalCltvExpiry = function() { - return jspb.Message.setField(this, 5, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hold.InvoiceRequest.prototype.hasMinFinalCltvExpiry = function() { - return jspb.Message.getField(this, 5) != null; -}; - - -/** - * repeated RoutingHint routing_hints = 6; - * @return {!Array} + * @return {!proto.hold.Hop} returns this */ -proto.hold.InvoiceRequest.prototype.getRoutingHintsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hold.RoutingHint, 6)); -}; - - -/** - * @param {!Array} value - * @return {!proto.hold.InvoiceRequest} returns this -*/ -proto.hold.InvoiceRequest.prototype.setRoutingHintsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 6, value); +proto.hold.Hop.prototype.setCltvExpiryDelta = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); }; -/** - * @param {!proto.hold.RoutingHint=} opt_value - * @param {number=} opt_index - * @return {!proto.hold.RoutingHint} - */ -proto.hold.InvoiceRequest.prototype.addRoutingHints = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.hold.RoutingHint, opt_index); -}; - /** - * Clears the list making it empty but non-null. - * @return {!proto.hold.InvoiceRequest} returns this + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.hold.InvoiceRequest.prototype.clearRoutingHintsList = function() { - return this.setRoutingHintsList([]); -}; - - +proto.hold.RoutingHint.repeatedFields_ = [1]; @@ -1343,8 +970,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.InvoiceResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hold.InvoiceResponse.toObject(opt_includeInstance, this); +proto.hold.RoutingHint.prototype.toObject = function(opt_includeInstance) { + return proto.hold.RoutingHint.toObject(opt_includeInstance, this); }; @@ -1353,13 +980,14 @@ proto.hold.InvoiceResponse.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.InvoiceResponse} msg The msg instance to transform. + * @param {!proto.hold.RoutingHint} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.InvoiceResponse.toObject = function(includeInstance, msg) { +proto.hold.RoutingHint.toObject = function(includeInstance, msg) { var f, obj = { - bolt11: jspb.Message.getFieldWithDefault(msg, 1, "") + hopsList: jspb.Message.toObjectList(msg.getHopsList(), + proto.hold.Hop.toObject, includeInstance) }; if (includeInstance) { @@ -1373,23 +1001,23 @@ proto.hold.InvoiceResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.InvoiceResponse} + * @return {!proto.hold.RoutingHint} */ -proto.hold.InvoiceResponse.deserializeBinary = function(bytes) { +proto.hold.RoutingHint.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.InvoiceResponse; - return proto.hold.InvoiceResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.RoutingHint; + return proto.hold.RoutingHint.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.InvoiceResponse} msg The message object to deserialize into. + * @param {!proto.hold.RoutingHint} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.InvoiceResponse} + * @return {!proto.hold.RoutingHint} */ -proto.hold.InvoiceResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.RoutingHint.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1397,8 +1025,9 @@ proto.hold.InvoiceResponse.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setBolt11(value); + var value = new proto.hold.Hop; + reader.readMessage(value,proto.hold.Hop.deserializeBinaryFromReader); + msg.addHops(value); break; default: reader.skipField(); @@ -1413,9 +1042,9 @@ proto.hold.InvoiceResponse.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.InvoiceResponse.prototype.serializeBinary = function() { +proto.hold.RoutingHint.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.InvoiceResponse.serializeBinaryToWriter(this, writer); + proto.hold.RoutingHint.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1423,173 +1052,97 @@ proto.hold.InvoiceResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.InvoiceResponse} message + * @param {!proto.hold.RoutingHint} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.InvoiceResponse.serializeBinaryToWriter = function(message, writer) { +proto.hold.RoutingHint.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getBolt11(); + f = message.getHopsList(); if (f.length > 0) { - writer.writeString( + writer.writeRepeatedMessage( 1, - f + f, + proto.hold.Hop.serializeBinaryToWriter ); } }; /** - * optional string bolt11 = 1; - * @return {string} - */ -proto.hold.InvoiceResponse.prototype.getBolt11 = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.InvoiceResponse} returns this + * repeated Hop hops = 1; + * @return {!Array} */ -proto.hold.InvoiceResponse.prototype.setBolt11 = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.hold.RoutingHint.prototype.getHopsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.hold.Hop, 1)); }; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.RoutingHintsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hold.RoutingHintsRequest.toObject(opt_includeInstance, this); + * @param {!Array} value + * @return {!proto.hold.RoutingHint} returns this +*/ +proto.hold.RoutingHint.prototype.setHopsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.RoutingHintsRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {!proto.hold.Hop=} opt_value + * @param {number=} opt_index + * @return {!proto.hold.Hop} */ -proto.hold.RoutingHintsRequest.toObject = function(includeInstance, msg) { - var f, obj = { - node: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; +proto.hold.RoutingHint.prototype.addHops = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.hold.Hop, opt_index); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.RoutingHintsRequest} + * Clears the list making it empty but non-null. + * @return {!proto.hold.RoutingHint} returns this */ -proto.hold.RoutingHintsRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.RoutingHintsRequest; - return proto.hold.RoutingHintsRequest.deserializeBinaryFromReader(msg, reader); +proto.hold.RoutingHint.prototype.clearHopsList = function() { + return this.setHopsList([]); }; -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.RoutingHintsRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.RoutingHintsRequest} - */ -proto.hold.RoutingHintsRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setNode(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.hold.RoutingHintsRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.RoutingHintsRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - +proto.hold.InvoiceRequest.repeatedFields_ = [7]; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.RoutingHintsRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const */ -proto.hold.RoutingHintsRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getNode(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - +proto.hold.InvoiceRequest.oneofGroups_ = [[3,4]]; /** - * optional string node = 1; - * @return {string} + * @enum {number} */ -proto.hold.RoutingHintsRequest.prototype.getNode = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.hold.InvoiceRequest.DescriptionCase = { + DESCRIPTION_NOT_SET: 0, + MEMO: 3, + HASH: 4 }; - /** - * @param {string} value - * @return {!proto.hold.RoutingHintsRequest} returns this + * @return {proto.hold.InvoiceRequest.DescriptionCase} */ -proto.hold.RoutingHintsRequest.prototype.setNode = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.hold.InvoiceRequest.prototype.getDescriptionCase = function() { + return /** @type {proto.hold.InvoiceRequest.DescriptionCase} */(jspb.Message.computeOneofCase(this, proto.hold.InvoiceRequest.oneofGroups_[0])); }; - - if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. @@ -1603,8 +1156,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.Hop.prototype.toObject = function(opt_includeInstance) { - return proto.hold.Hop.toObject(opt_includeInstance, this); +proto.hold.InvoiceRequest.prototype.toObject = function(opt_includeInstance) { + return proto.hold.InvoiceRequest.toObject(opt_includeInstance, this); }; @@ -1613,17 +1166,20 @@ proto.hold.Hop.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.Hop} msg The msg instance to transform. + * @param {!proto.hold.InvoiceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.Hop.toObject = function(includeInstance, msg) { +proto.hold.InvoiceRequest.toObject = function(includeInstance, msg) { var f, obj = { - publicKey: jspb.Message.getFieldWithDefault(msg, 1, ""), - shortChannelId: jspb.Message.getFieldWithDefault(msg, 2, ""), - baseFee: jspb.Message.getFieldWithDefault(msg, 3, 0), - ppmFee: jspb.Message.getFieldWithDefault(msg, 4, 0), - cltvExpiryDelta: jspb.Message.getFieldWithDefault(msg, 5, 0) + paymentHash: msg.getPaymentHash_asB64(), + amountMsat: jspb.Message.getFieldWithDefault(msg, 2, 0), + memo: jspb.Message.getFieldWithDefault(msg, 3, ""), + hash: msg.getHash_asB64(), + expiry: jspb.Message.getFieldWithDefault(msg, 5, 0), + minFinalCltvExpiry: jspb.Message.getFieldWithDefault(msg, 6, 0), + routingHintsList: jspb.Message.toObjectList(msg.getRoutingHintsList(), + proto.hold.RoutingHint.toObject, includeInstance) }; if (includeInstance) { @@ -1637,23 +1193,23 @@ proto.hold.Hop.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.Hop} + * @return {!proto.hold.InvoiceRequest} */ -proto.hold.Hop.deserializeBinary = function(bytes) { +proto.hold.InvoiceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.Hop; - return proto.hold.Hop.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.InvoiceRequest; + return proto.hold.InvoiceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.Hop} msg The message object to deserialize into. + * @param {!proto.hold.InvoiceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.Hop} + * @return {!proto.hold.InvoiceRequest} */ -proto.hold.Hop.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.InvoiceRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1661,24 +1217,33 @@ proto.hold.Hop.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPublicKey(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPaymentHash(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setShortChannelId(value); + var value = /** @type {number} */ (reader.readUint64()); + msg.setAmountMsat(value); break; case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setBaseFee(value); + var value = /** @type {string} */ (reader.readString()); + msg.setMemo(value); break; case 4: - var value = /** @type {number} */ (reader.readUint64()); - msg.setPpmFee(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setHash(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); - msg.setCltvExpiryDelta(value); + msg.setExpiry(value); + break; + case 6: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMinFinalCltvExpiry(value); + break; + case 7: + var value = new proto.hold.RoutingHint; + reader.readMessage(value,proto.hold.RoutingHint.deserializeBinaryFromReader); + msg.addRoutingHints(value); break; default: reader.skipField(); @@ -1693,9 +1258,9 @@ proto.hold.Hop.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.Hop.prototype.serializeBinary = function() { +proto.hold.InvoiceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.Hop.serializeBinaryToWriter(this, writer); + proto.hold.InvoiceRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1703,147 +1268,331 @@ proto.hold.Hop.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.Hop} message + * @param {!proto.hold.InvoiceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.Hop.serializeBinaryToWriter = function(message, writer) { +proto.hold.InvoiceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPublicKey(); + f = message.getPaymentHash_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 1, f ); } - f = message.getShortChannelId(); - if (f.length > 0) { - writer.writeString( + f = message.getAmountMsat(); + if (f !== 0) { + writer.writeUint64( 2, f ); } - f = message.getBaseFee(); - if (f !== 0) { - writer.writeUint64( + f = /** @type {string} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeString( 3, f ); } - f = message.getPpmFee(); - if (f !== 0) { - writer.writeUint64( + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeBytes( 4, f ); } - f = message.getCltvExpiryDelta(); - if (f !== 0) { + f = /** @type {number} */ (jspb.Message.getField(message, 5)); + if (f != null) { writer.writeUint64( 5, f ); } + f = /** @type {number} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeUint64( + 6, + f + ); + } + f = message.getRoutingHintsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.hold.RoutingHint.serializeBinaryToWriter + ); + } }; /** - * optional string public_key = 1; - * @return {string} + * optional bytes payment_hash = 1; + * @return {!(string|Uint8Array)} */ -proto.hold.Hop.prototype.getPublicKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.hold.InvoiceRequest.prototype.getPaymentHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.hold.Hop} returns this + * optional bytes payment_hash = 1; + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {string} */ -proto.hold.Hop.prototype.setPublicKey = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.hold.InvoiceRequest.prototype.getPaymentHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPaymentHash())); }; /** - * optional string short_channel_id = 2; - * @return {string} + * optional bytes payment_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {!Uint8Array} */ -proto.hold.Hop.prototype.getShortChannelId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.hold.InvoiceRequest.prototype.getPaymentHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPaymentHash())); }; /** - * @param {string} value - * @return {!proto.hold.Hop} returns this + * @param {!(string|Uint8Array)} value + * @return {!proto.hold.InvoiceRequest} returns this */ -proto.hold.Hop.prototype.setShortChannelId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.hold.InvoiceRequest.prototype.setPaymentHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional uint64 base_fee = 3; + * optional uint64 amount_msat = 2; * @return {number} */ -proto.hold.Hop.prototype.getBaseFee = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.hold.InvoiceRequest.prototype.getAmountMsat = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value - * @return {!proto.hold.Hop} returns this + * @return {!proto.hold.InvoiceRequest} returns this */ -proto.hold.Hop.prototype.setBaseFee = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; +proto.hold.InvoiceRequest.prototype.setAmountMsat = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; /** - * optional uint64 ppm_fee = 4; + * optional string memo = 3; + * @return {string} + */ +proto.hold.InvoiceRequest.prototype.getMemo = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.hold.InvoiceRequest} returns this + */ +proto.hold.InvoiceRequest.prototype.setMemo = function(value) { + return jspb.Message.setOneofField(this, 3, proto.hold.InvoiceRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.hold.InvoiceRequest} returns this + */ +proto.hold.InvoiceRequest.prototype.clearMemo = function() { + return jspb.Message.setOneofField(this, 3, proto.hold.InvoiceRequest.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.hold.InvoiceRequest.prototype.hasMemo = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional bytes hash = 4; + * @return {!(string|Uint8Array)} + */ +proto.hold.InvoiceRequest.prototype.getHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes hash = 4; + * This is a type-conversion wrapper around `getHash()` + * @return {string} + */ +proto.hold.InvoiceRequest.prototype.getHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getHash())); +}; + + +/** + * optional bytes hash = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getHash()` + * @return {!Uint8Array} + */ +proto.hold.InvoiceRequest.prototype.getHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.hold.InvoiceRequest} returns this + */ +proto.hold.InvoiceRequest.prototype.setHash = function(value) { + return jspb.Message.setOneofField(this, 4, proto.hold.InvoiceRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.hold.InvoiceRequest} returns this + */ +proto.hold.InvoiceRequest.prototype.clearHash = function() { + return jspb.Message.setOneofField(this, 4, proto.hold.InvoiceRequest.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.hold.InvoiceRequest.prototype.hasHash = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional uint64 expiry = 5; * @return {number} */ -proto.hold.Hop.prototype.getPpmFee = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.hold.InvoiceRequest.prototype.getExpiry = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value - * @return {!proto.hold.Hop} returns this + * @return {!proto.hold.InvoiceRequest} returns this */ -proto.hold.Hop.prototype.setPpmFee = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.hold.InvoiceRequest.prototype.setExpiry = function(value) { + return jspb.Message.setField(this, 5, value); }; /** - * optional uint64 cltv_expiry_delta = 5; + * Clears the field making it undefined. + * @return {!proto.hold.InvoiceRequest} returns this + */ +proto.hold.InvoiceRequest.prototype.clearExpiry = function() { + return jspb.Message.setField(this, 5, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.hold.InvoiceRequest.prototype.hasExpiry = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional uint64 min_final_cltv_expiry = 6; * @return {number} */ -proto.hold.Hop.prototype.getCltvExpiryDelta = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +proto.hold.InvoiceRequest.prototype.getMinFinalCltvExpiry = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; /** * @param {number} value - * @return {!proto.hold.Hop} returns this + * @return {!proto.hold.InvoiceRequest} returns this */ -proto.hold.Hop.prototype.setCltvExpiryDelta = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); +proto.hold.InvoiceRequest.prototype.setMinFinalCltvExpiry = function(value) { + return jspb.Message.setField(this, 6, value); }; +/** + * Clears the field making it undefined. + * @return {!proto.hold.InvoiceRequest} returns this + */ +proto.hold.InvoiceRequest.prototype.clearMinFinalCltvExpiry = function() { + return jspb.Message.setField(this, 6, undefined); +}; + /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * Returns whether this field is set. + * @return {boolean} */ -proto.hold.RoutingHint.repeatedFields_ = [1]; +proto.hold.InvoiceRequest.prototype.hasMinFinalCltvExpiry = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * repeated RoutingHint routing_hints = 7; + * @return {!Array} + */ +proto.hold.InvoiceRequest.prototype.getRoutingHintsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.hold.RoutingHint, 7)); +}; + + +/** + * @param {!Array} value + * @return {!proto.hold.InvoiceRequest} returns this +*/ +proto.hold.InvoiceRequest.prototype.setRoutingHintsList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.hold.RoutingHint=} opt_value + * @param {number=} opt_index + * @return {!proto.hold.RoutingHint} + */ +proto.hold.InvoiceRequest.prototype.addRoutingHints = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.hold.RoutingHint, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.hold.InvoiceRequest} returns this + */ +proto.hold.InvoiceRequest.prototype.clearRoutingHintsList = function() { + return this.setRoutingHintsList([]); +}; + + @@ -1860,8 +1609,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.RoutingHint.prototype.toObject = function(opt_includeInstance) { - return proto.hold.RoutingHint.toObject(opt_includeInstance, this); +proto.hold.InvoiceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.hold.InvoiceResponse.toObject(opt_includeInstance, this); }; @@ -1870,14 +1619,13 @@ proto.hold.RoutingHint.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.RoutingHint} msg The msg instance to transform. + * @param {!proto.hold.InvoiceResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.RoutingHint.toObject = function(includeInstance, msg) { +proto.hold.InvoiceResponse.toObject = function(includeInstance, msg) { var f, obj = { - hopsList: jspb.Message.toObjectList(msg.getHopsList(), - proto.hold.Hop.toObject, includeInstance) + bolt11: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { @@ -1891,23 +1639,23 @@ proto.hold.RoutingHint.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.RoutingHint} + * @return {!proto.hold.InvoiceResponse} */ -proto.hold.RoutingHint.deserializeBinary = function(bytes) { +proto.hold.InvoiceResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.RoutingHint; - return proto.hold.RoutingHint.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.InvoiceResponse; + return proto.hold.InvoiceResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.RoutingHint} msg The message object to deserialize into. + * @param {!proto.hold.InvoiceResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.RoutingHint} + * @return {!proto.hold.InvoiceResponse} */ -proto.hold.RoutingHint.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.InvoiceResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1915,9 +1663,8 @@ proto.hold.RoutingHint.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.hold.Hop; - reader.readMessage(value,proto.hold.Hop.deserializeBinaryFromReader); - msg.addHops(value); + var value = /** @type {string} */ (reader.readString()); + msg.setBolt11(value); break; default: reader.skipField(); @@ -1932,9 +1679,9 @@ proto.hold.RoutingHint.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.RoutingHint.prototype.serializeBinary = function() { +proto.hold.InvoiceResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.RoutingHint.serializeBinaryToWriter(this, writer); + proto.hold.InvoiceResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1942,68 +1689,66 @@ proto.hold.RoutingHint.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.RoutingHint} message + * @param {!proto.hold.InvoiceResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.RoutingHint.serializeBinaryToWriter = function(message, writer) { +proto.hold.InvoiceResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getHopsList(); + f = message.getBolt11(); if (f.length > 0) { - writer.writeRepeatedMessage( + writer.writeString( 1, - f, - proto.hold.Hop.serializeBinaryToWriter + f ); } }; /** - * repeated Hop hops = 1; - * @return {!Array} + * optional string bolt11 = 1; + * @return {string} */ -proto.hold.RoutingHint.prototype.getHopsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hold.Hop, 1)); +proto.hold.InvoiceResponse.prototype.getBolt11 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {!Array} value - * @return {!proto.hold.RoutingHint} returns this -*/ -proto.hold.RoutingHint.prototype.setHopsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); + * @param {string} value + * @return {!proto.hold.InvoiceResponse} returns this + */ +proto.hold.InvoiceResponse.prototype.setBolt11 = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); }; + /** - * @param {!proto.hold.Hop=} opt_value - * @param {number=} opt_index - * @return {!proto.hold.Hop} + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const */ -proto.hold.RoutingHint.prototype.addHops = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.hold.Hop, opt_index); -}; - +proto.hold.ListRequest.oneofGroups_ = [[1,2]]; /** - * Clears the list making it empty but non-null. - * @return {!proto.hold.RoutingHint} returns this + * @enum {number} */ -proto.hold.RoutingHint.prototype.clearHopsList = function() { - return this.setHopsList([]); +proto.hold.ListRequest.ConstraintCase = { + CONSTRAINT_NOT_SET: 0, + PAYMENT_HASH: 1, + PAGINATION: 2 }; - - /** - * List of repeated fields within this message type. - * @private {!Array} - * @const + * @return {proto.hold.ListRequest.ConstraintCase} */ -proto.hold.RoutingHintsResponse.repeatedFields_ = [1]; +proto.hold.ListRequest.prototype.getConstraintCase = function() { + return /** @type {proto.hold.ListRequest.ConstraintCase} */(jspb.Message.computeOneofCase(this, proto.hold.ListRequest.oneofGroups_[0])); +}; @@ -2020,8 +1765,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.RoutingHintsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hold.RoutingHintsResponse.toObject(opt_includeInstance, this); +proto.hold.ListRequest.prototype.toObject = function(opt_includeInstance) { + return proto.hold.ListRequest.toObject(opt_includeInstance, this); }; @@ -2030,14 +1775,14 @@ proto.hold.RoutingHintsResponse.prototype.toObject = function(opt_includeInstanc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.RoutingHintsResponse} msg The msg instance to transform. + * @param {!proto.hold.ListRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.RoutingHintsResponse.toObject = function(includeInstance, msg) { +proto.hold.ListRequest.toObject = function(includeInstance, msg) { var f, obj = { - hintsList: jspb.Message.toObjectList(msg.getHintsList(), - proto.hold.RoutingHint.toObject, includeInstance) + paymentHash: msg.getPaymentHash_asB64(), + pagination: (f = msg.getPagination()) && proto.hold.ListRequest.Pagination.toObject(includeInstance, f) }; if (includeInstance) { @@ -2051,23 +1796,23 @@ proto.hold.RoutingHintsResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.RoutingHintsResponse} + * @return {!proto.hold.ListRequest} */ -proto.hold.RoutingHintsResponse.deserializeBinary = function(bytes) { +proto.hold.ListRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.RoutingHintsResponse; - return proto.hold.RoutingHintsResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.ListRequest; + return proto.hold.ListRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.RoutingHintsResponse} msg The message object to deserialize into. + * @param {!proto.hold.ListRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.RoutingHintsResponse} + * @return {!proto.hold.ListRequest} */ -proto.hold.RoutingHintsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.ListRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2075,9 +1820,13 @@ proto.hold.RoutingHintsResponse.deserializeBinaryFromReader = function(msg, read var field = reader.getFieldNumber(); switch (field) { case 1: - var value = new proto.hold.RoutingHint; - reader.readMessage(value,proto.hold.RoutingHint.deserializeBinaryFromReader); - msg.addHints(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPaymentHash(value); + break; + case 2: + var value = new proto.hold.ListRequest.Pagination; + reader.readMessage(value,proto.hold.ListRequest.Pagination.deserializeBinaryFromReader); + msg.setPagination(value); break; default: reader.skipField(); @@ -2092,9 +1841,9 @@ proto.hold.RoutingHintsResponse.deserializeBinaryFromReader = function(msg, read * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.RoutingHintsResponse.prototype.serializeBinary = function() { +proto.hold.ListRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.RoutingHintsResponse.serializeBinaryToWriter(this, writer); + proto.hold.ListRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2102,61 +1851,30 @@ proto.hold.RoutingHintsResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.RoutingHintsResponse} message + * @param {!proto.hold.ListRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.RoutingHintsResponse.serializeBinaryToWriter = function(message, writer) { +proto.hold.ListRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getHintsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBytes( 1, + f + ); + } + f = message.getPagination(); + if (f != null) { + writer.writeMessage( + 2, f, - proto.hold.RoutingHint.serializeBinaryToWriter + proto.hold.ListRequest.Pagination.serializeBinaryToWriter ); } }; -/** - * repeated RoutingHint hints = 1; - * @return {!Array} - */ -proto.hold.RoutingHintsResponse.prototype.getHintsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hold.RoutingHint, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.hold.RoutingHintsResponse} returns this -*/ -proto.hold.RoutingHintsResponse.prototype.setHintsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.hold.RoutingHint=} opt_value - * @param {number=} opt_index - * @return {!proto.hold.RoutingHint} - */ -proto.hold.RoutingHintsResponse.prototype.addHints = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.hold.RoutingHint, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.hold.RoutingHintsResponse} returns this - */ -proto.hold.RoutingHintsResponse.prototype.clearHintsList = function() { - return this.setHintsList([]); -}; - - @@ -2173,8 +1891,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.ListRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hold.ListRequest.toObject(opt_includeInstance, this); +proto.hold.ListRequest.Pagination.prototype.toObject = function(opt_includeInstance) { + return proto.hold.ListRequest.Pagination.toObject(opt_includeInstance, this); }; @@ -2183,13 +1901,14 @@ proto.hold.ListRequest.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.ListRequest} msg The msg instance to transform. + * @param {!proto.hold.ListRequest.Pagination} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.ListRequest.toObject = function(includeInstance, msg) { +proto.hold.ListRequest.Pagination.toObject = function(includeInstance, msg) { var f, obj = { - paymentHash: jspb.Message.getFieldWithDefault(msg, 1, "") + indexStart: jspb.Message.getFieldWithDefault(msg, 1, 0), + limit: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { @@ -2203,23 +1922,23 @@ proto.hold.ListRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.ListRequest} + * @return {!proto.hold.ListRequest.Pagination} */ -proto.hold.ListRequest.deserializeBinary = function(bytes) { +proto.hold.ListRequest.Pagination.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.ListRequest; - return proto.hold.ListRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.ListRequest.Pagination; + return proto.hold.ListRequest.Pagination.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.ListRequest} msg The message object to deserialize into. + * @param {!proto.hold.ListRequest.Pagination} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.ListRequest} + * @return {!proto.hold.ListRequest.Pagination} */ -proto.hold.ListRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.ListRequest.Pagination.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2227,8 +1946,12 @@ proto.hold.ListRequest.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPaymentHash(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setIndexStart(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setLimit(value); break; default: reader.skipField(); @@ -2243,9 +1966,9 @@ proto.hold.ListRequest.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.ListRequest.prototype.serializeBinary = function() { +proto.hold.ListRequest.Pagination.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.ListRequest.serializeBinaryToWriter(this, writer); + proto.hold.ListRequest.Pagination.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2253,37 +1976,104 @@ proto.hold.ListRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.ListRequest} message + * @param {!proto.hold.ListRequest.Pagination} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.ListRequest.serializeBinaryToWriter = function(message, writer) { +proto.hold.ListRequest.Pagination.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( + f = message.getIndexStart(); + if (f !== 0) { + writer.writeInt64( 1, f ); } + f = message.getLimit(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } }; /** - * optional string payment_hash = 1; - * @return {string} + * optional int64 index_start = 1; + * @return {number} + */ +proto.hold.ListRequest.Pagination.prototype.getIndexStart = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.hold.ListRequest.Pagination} returns this + */ +proto.hold.ListRequest.Pagination.prototype.setIndexStart = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint64 limit = 2; + * @return {number} + */ +proto.hold.ListRequest.Pagination.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.hold.ListRequest.Pagination} returns this + */ +proto.hold.ListRequest.Pagination.prototype.setLimit = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bytes payment_hash = 1; + * @return {!(string|Uint8Array)} */ proto.hold.ListRequest.prototype.getPaymentHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value + * optional bytes payment_hash = 1; + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {string} + */ +proto.hold.ListRequest.prototype.getPaymentHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPaymentHash())); +}; + + +/** + * optional bytes payment_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {!Uint8Array} + */ +proto.hold.ListRequest.prototype.getPaymentHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPaymentHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value * @return {!proto.hold.ListRequest} returns this */ proto.hold.ListRequest.prototype.setPaymentHash = function(value) { - return jspb.Message.setField(this, 1, value); + return jspb.Message.setOneofField(this, 1, proto.hold.ListRequest.oneofGroups_[0], value); }; @@ -2292,7 +2082,7 @@ proto.hold.ListRequest.prototype.setPaymentHash = function(value) { * @return {!proto.hold.ListRequest} returns this */ proto.hold.ListRequest.prototype.clearPaymentHash = function() { - return jspb.Message.setField(this, 1, undefined); + return jspb.Message.setOneofField(this, 1, proto.hold.ListRequest.oneofGroups_[0], undefined); }; @@ -2305,6 +2095,43 @@ proto.hold.ListRequest.prototype.hasPaymentHash = function() { }; +/** + * optional Pagination pagination = 2; + * @return {?proto.hold.ListRequest.Pagination} + */ +proto.hold.ListRequest.prototype.getPagination = function() { + return /** @type{?proto.hold.ListRequest.Pagination} */ ( + jspb.Message.getWrapperField(this, proto.hold.ListRequest.Pagination, 2)); +}; + + +/** + * @param {?proto.hold.ListRequest.Pagination|undefined} value + * @return {!proto.hold.ListRequest} returns this +*/ +proto.hold.ListRequest.prototype.setPagination = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.hold.ListRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.hold.ListRequest} returns this + */ +proto.hold.ListRequest.prototype.clearPagination = function() { + return this.setPagination(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.hold.ListRequest.prototype.hasPagination = function() { + return jspb.Message.getField(this, 2) != null; +}; + + @@ -2337,11 +2164,12 @@ proto.hold.Htlc.prototype.toObject = function(opt_includeInstance) { */ proto.hold.Htlc.toObject = function(includeInstance, msg) { var f, obj = { - state: jspb.Message.getFieldWithDefault(msg, 1, 0), - msat: jspb.Message.getFieldWithDefault(msg, 2, 0), - createdAt: jspb.Message.getFieldWithDefault(msg, 3, 0), - shortChannelId: jspb.Message.getFieldWithDefault(msg, 4, ""), - id: jspb.Message.getFieldWithDefault(msg, 5, 0) + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + state: jspb.Message.getFieldWithDefault(msg, 2, 0), + scid: jspb.Message.getFieldWithDefault(msg, 3, ""), + channelId: jspb.Message.getFieldWithDefault(msg, 4, 0), + msat: jspb.Message.getFieldWithDefault(msg, 5, 0), + createdAt: jspb.Message.getFieldWithDefault(msg, 6, 0) }; if (includeInstance) { @@ -2379,24 +2207,28 @@ proto.hold.Htlc.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!proto.hold.HtlcState} */ (reader.readEnum()); - msg.setState(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setId(value); break; case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMsat(value); + var value = /** @type {!proto.hold.InvoiceState} */ (reader.readEnum()); + msg.setState(value); break; case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setCreatedAt(value); + var value = /** @type {string} */ (reader.readString()); + msg.setScid(value); break; case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setShortChannelId(value); + var value = /** @type {number} */ (reader.readUint64()); + msg.setChannelId(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); + msg.setMsat(value); + break; + case 6: + var value = /** @type {number} */ (reader.readUint64()); + msg.setCreatedAt(value); break; default: reader.skipField(); @@ -2427,86 +2259,111 @@ proto.hold.Htlc.prototype.serializeBinary = function() { */ proto.hold.Htlc.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getState(); - if (f !== 0.0) { - writer.writeEnum( + f = message.getId(); + if (f !== 0) { + writer.writeInt64( 1, f ); } - f = message.getMsat(); - if (f !== 0) { - writer.writeUint64( + f = message.getState(); + if (f !== 0.0) { + writer.writeEnum( 2, f ); } - f = message.getCreatedAt(); - if (f !== 0) { - writer.writeUint64( + f = message.getScid(); + if (f.length > 0) { + writer.writeString( 3, f ); } - f = message.getShortChannelId(); - if (f.length > 0) { - writer.writeString( + f = message.getChannelId(); + if (f !== 0) { + writer.writeUint64( 4, f ); } - f = message.getId(); + f = message.getMsat(); if (f !== 0) { writer.writeUint64( 5, f ); } + f = message.getCreatedAt(); + if (f !== 0) { + writer.writeUint64( + 6, + f + ); + } +}; + + +/** + * optional int64 id = 1; + * @return {number} + */ +proto.hold.Htlc.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.hold.Htlc} returns this + */ +proto.hold.Htlc.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); }; /** - * optional HtlcState state = 1; - * @return {!proto.hold.HtlcState} + * optional InvoiceState state = 2; + * @return {!proto.hold.InvoiceState} */ proto.hold.Htlc.prototype.getState = function() { - return /** @type {!proto.hold.HtlcState} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); + return /** @type {!proto.hold.InvoiceState} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * @param {!proto.hold.HtlcState} value + * @param {!proto.hold.InvoiceState} value * @return {!proto.hold.Htlc} returns this */ proto.hold.Htlc.prototype.setState = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); + return jspb.Message.setProto3EnumField(this, 2, value); }; /** - * optional uint64 msat = 2; - * @return {number} + * optional string scid = 3; + * @return {string} */ -proto.hold.Htlc.prototype.getMsat = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.hold.Htlc.prototype.getScid = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * @param {number} value + * @param {string} value * @return {!proto.hold.Htlc} returns this */ -proto.hold.Htlc.prototype.setMsat = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.hold.Htlc.prototype.setScid = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); }; /** - * optional uint64 created_at = 3; + * optional uint64 channel_id = 4; * @return {number} */ -proto.hold.Htlc.prototype.getCreatedAt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.hold.Htlc.prototype.getChannelId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; @@ -2514,35 +2371,35 @@ proto.hold.Htlc.prototype.getCreatedAt = function() { * @param {number} value * @return {!proto.hold.Htlc} returns this */ -proto.hold.Htlc.prototype.setCreatedAt = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); +proto.hold.Htlc.prototype.setChannelId = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); }; /** - * optional string short_channel_id = 4; - * @return {string} + * optional uint64 msat = 5; + * @return {number} */ -proto.hold.Htlc.prototype.getShortChannelId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.hold.Htlc.prototype.getMsat = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** - * @param {string} value + * @param {number} value * @return {!proto.hold.Htlc} returns this */ -proto.hold.Htlc.prototype.setShortChannelId = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); +proto.hold.Htlc.prototype.setMsat = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); }; /** - * optional uint64 id = 5; + * optional uint64 created_at = 6; * @return {number} */ -proto.hold.Htlc.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +proto.hold.Htlc.prototype.getCreatedAt = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; @@ -2550,8 +2407,8 @@ proto.hold.Htlc.prototype.getId = function() { * @param {number} value * @return {!proto.hold.Htlc} returns this */ -proto.hold.Htlc.prototype.setId = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); +proto.hold.Htlc.prototype.setCreatedAt = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); }; @@ -2561,7 +2418,7 @@ proto.hold.Htlc.prototype.setId = function(value) { * @private {!Array} * @const */ -proto.hold.Invoice.repeatedFields_ = [6]; +proto.hold.Invoice.repeatedFields_ = [7]; @@ -2594,14 +2451,14 @@ proto.hold.Invoice.prototype.toObject = function(opt_includeInstance) { */ proto.hold.Invoice.toObject = function(includeInstance, msg) { var f, obj = { - paymentHash: jspb.Message.getFieldWithDefault(msg, 1, ""), - paymentPreimage: jspb.Message.getFieldWithDefault(msg, 2, ""), - state: jspb.Message.getFieldWithDefault(msg, 3, 0), + id: jspb.Message.getFieldWithDefault(msg, 1, 0), + paymentHash: msg.getPaymentHash_asB64(), + preimage: msg.getPreimage_asB64(), bolt11: jspb.Message.getFieldWithDefault(msg, 4, ""), - createdAt: jspb.Message.getFieldWithDefault(msg, 5, 0), + state: jspb.Message.getFieldWithDefault(msg, 5, 0), + createdAt: jspb.Message.getFieldWithDefault(msg, 6, 0), htlcsList: jspb.Message.toObjectList(msg.getHtlcsList(), - proto.hold.Htlc.toObject, includeInstance), - amountMsat: jspb.Message.getFieldWithDefault(msg, 7, 0) + proto.hold.Htlc.toObject, includeInstance) }; if (includeInstance) { @@ -2639,34 +2496,34 @@ proto.hold.Invoice.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPaymentHash(value); + var value = /** @type {number} */ (reader.readInt64()); + msg.setId(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPaymentPreimage(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPaymentHash(value); break; case 3: - var value = /** @type {!proto.hold.InvoiceState} */ (reader.readEnum()); - msg.setState(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPreimage(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setBolt11(value); break; case 5: + var value = /** @type {!proto.hold.InvoiceState} */ (reader.readEnum()); + msg.setState(value); + break; + case 6: var value = /** @type {number} */ (reader.readUint64()); msg.setCreatedAt(value); break; - case 6: + case 7: var value = new proto.hold.Htlc; reader.readMessage(value,proto.hold.Htlc.deserializeBinaryFromReader); msg.addHtlcs(value); break; - case 7: - var value = /** @type {number} */ (reader.readUint64()); - msg.setAmountMsat(value); - break; default: reader.skipField(); break; @@ -2696,23 +2553,23 @@ proto.hold.Invoice.prototype.serializeBinary = function() { */ proto.hold.Invoice.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPaymentHash(); - if (f.length > 0) { - writer.writeString( + f = message.getId(); + if (f !== 0) { + writer.writeInt64( 1, f ); } - f = /** @type {string} */ (jspb.Message.getField(message, 2)); - if (f != null) { - writer.writeString( + f = message.getPaymentHash_asU8(); + if (f.length > 0) { + writer.writeBytes( 2, f ); } - f = message.getState(); - if (f !== 0.0) { - writer.writeEnum( + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeBytes( 3, f ); @@ -2724,100 +2581,148 @@ proto.hold.Invoice.serializeBinaryToWriter = function(message, writer) { f ); } + f = message.getState(); + if (f !== 0.0) { + writer.writeEnum( + 5, + f + ); + } f = message.getCreatedAt(); if (f !== 0) { writer.writeUint64( - 5, + 6, f ); } f = message.getHtlcsList(); if (f.length > 0) { writer.writeRepeatedMessage( - 6, + 7, f, proto.hold.Htlc.serializeBinaryToWriter ); } - f = message.getAmountMsat(); - if (f !== 0) { - writer.writeUint64( - 7, - f - ); - } }; /** - * optional string payment_hash = 1; - * @return {string} + * optional int64 id = 1; + * @return {number} */ -proto.hold.Invoice.prototype.getPaymentHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.hold.Invoice.prototype.getId = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** - * @param {string} value + * @param {number} value * @return {!proto.hold.Invoice} returns this */ -proto.hold.Invoice.prototype.setPaymentHash = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.hold.Invoice.prototype.setId = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional bytes payment_hash = 2; + * @return {!(string|Uint8Array)} + */ +proto.hold.Invoice.prototype.getPaymentHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * optional string payment_preimage = 2; + * optional bytes payment_hash = 2; + * This is a type-conversion wrapper around `getPaymentHash()` * @return {string} */ -proto.hold.Invoice.prototype.getPaymentPreimage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.hold.Invoice.prototype.getPaymentHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPaymentHash())); }; /** - * @param {string} value - * @return {!proto.hold.Invoice} returns this + * optional bytes payment_hash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {!Uint8Array} */ -proto.hold.Invoice.prototype.setPaymentPreimage = function(value) { - return jspb.Message.setField(this, 2, value); +proto.hold.Invoice.prototype.getPaymentHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPaymentHash())); }; /** - * Clears the field making it undefined. + * @param {!(string|Uint8Array)} value * @return {!proto.hold.Invoice} returns this */ -proto.hold.Invoice.prototype.clearPaymentPreimage = function() { - return jspb.Message.setField(this, 2, undefined); +proto.hold.Invoice.prototype.setPaymentHash = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); }; /** - * Returns whether this field is set. - * @return {boolean} + * optional bytes preimage = 3; + * @return {!(string|Uint8Array)} */ -proto.hold.Invoice.prototype.hasPaymentPreimage = function() { - return jspb.Message.getField(this, 2) != null; +proto.hold.Invoice.prototype.getPreimage = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** - * optional InvoiceState state = 3; - * @return {!proto.hold.InvoiceState} + * optional bytes preimage = 3; + * This is a type-conversion wrapper around `getPreimage()` + * @return {string} */ -proto.hold.Invoice.prototype.getState = function() { - return /** @type {!proto.hold.InvoiceState} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.hold.Invoice.prototype.getPreimage_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPreimage())); }; /** - * @param {!proto.hold.InvoiceState} value + * optional bytes preimage = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPreimage()` + * @return {!Uint8Array} + */ +proto.hold.Invoice.prototype.getPreimage_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPreimage())); +}; + + +/** + * @param {!(string|Uint8Array)} value * @return {!proto.hold.Invoice} returns this */ -proto.hold.Invoice.prototype.setState = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); +proto.hold.Invoice.prototype.setPreimage = function(value) { + return jspb.Message.setField(this, 3, value); +}; + + +/** + * Clears the field making it undefined. + * @return {!proto.hold.Invoice} returns this + */ +proto.hold.Invoice.prototype.clearPreimage = function() { + return jspb.Message.setField(this, 3, undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.hold.Invoice.prototype.hasPreimage = function() { + return jspb.Message.getField(this, 3) != null; }; @@ -2840,11 +2745,29 @@ proto.hold.Invoice.prototype.setBolt11 = function(value) { /** - * optional uint64 created_at = 5; + * optional InvoiceState state = 5; + * @return {!proto.hold.InvoiceState} + */ +proto.hold.Invoice.prototype.getState = function() { + return /** @type {!proto.hold.InvoiceState} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {!proto.hold.InvoiceState} value + * @return {!proto.hold.Invoice} returns this + */ +proto.hold.Invoice.prototype.setState = function(value) { + return jspb.Message.setProto3EnumField(this, 5, value); +}; + + +/** + * optional uint64 created_at = 6; * @return {number} */ proto.hold.Invoice.prototype.getCreatedAt = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; @@ -2853,17 +2776,17 @@ proto.hold.Invoice.prototype.getCreatedAt = function() { * @return {!proto.hold.Invoice} returns this */ proto.hold.Invoice.prototype.setCreatedAt = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); + return jspb.Message.setProto3IntField(this, 6, value); }; /** - * repeated Htlc htlcs = 6; + * repeated Htlc htlcs = 7; * @return {!Array} */ proto.hold.Invoice.prototype.getHtlcsList = function() { return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hold.Htlc, 6)); + jspb.Message.getRepeatedWrapperField(this, proto.hold.Htlc, 7)); }; @@ -2872,7 +2795,7 @@ proto.hold.Invoice.prototype.getHtlcsList = function() { * @return {!proto.hold.Invoice} returns this */ proto.hold.Invoice.prototype.setHtlcsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 6, value); + return jspb.Message.setRepeatedWrapperField(this, 7, value); }; @@ -2882,7 +2805,7 @@ proto.hold.Invoice.prototype.setHtlcsList = function(value) { * @return {!proto.hold.Htlc} */ proto.hold.Invoice.prototype.addHtlcs = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.hold.Htlc, opt_index); + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.hold.Htlc, opt_index); }; @@ -2895,24 +2818,6 @@ proto.hold.Invoice.prototype.clearHtlcsList = function() { }; -/** - * optional uint64 amount_msat = 7; - * @return {number} - */ -proto.hold.Invoice.prototype.getAmountMsat = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.Invoice} returns this - */ -proto.hold.Invoice.prototype.setAmountMsat = function(value) { - return jspb.Message.setProto3IntField(this, 7, value); -}; - - /** * List of repeated fields within this message type. @@ -3105,7 +3010,7 @@ proto.hold.SettleRequest.prototype.toObject = function(opt_includeInstance) { */ proto.hold.SettleRequest.toObject = function(includeInstance, msg) { var f, obj = { - paymentPreimage: jspb.Message.getFieldWithDefault(msg, 1, "") + paymentPreimage: msg.getPaymentPreimage_asB64() }; if (includeInstance) { @@ -3143,7 +3048,7 @@ proto.hold.SettleRequest.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setPaymentPreimage(value); break; default: @@ -3175,9 +3080,9 @@ proto.hold.SettleRequest.prototype.serializeBinary = function() { */ proto.hold.SettleRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPaymentPreimage(); + f = message.getPaymentPreimage_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 1, f ); @@ -3186,20 +3091,44 @@ proto.hold.SettleRequest.serializeBinaryToWriter = function(message, writer) { /** - * optional string payment_preimage = 1; - * @return {string} + * optional bytes payment_preimage = 1; + * @return {!(string|Uint8Array)} */ proto.hold.SettleRequest.prototype.getPaymentPreimage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value + * optional bytes payment_preimage = 1; + * This is a type-conversion wrapper around `getPaymentPreimage()` + * @return {string} + */ +proto.hold.SettleRequest.prototype.getPaymentPreimage_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPaymentPreimage())); +}; + + +/** + * optional bytes payment_preimage = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPaymentPreimage()` + * @return {!Uint8Array} + */ +proto.hold.SettleRequest.prototype.getPaymentPreimage_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPaymentPreimage())); +}; + + +/** + * @param {!(string|Uint8Array)} value * @return {!proto.hold.SettleRequest} returns this */ proto.hold.SettleRequest.prototype.setPaymentPreimage = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); + return jspb.Message.setProto3BytesField(this, 1, value); }; @@ -3336,7 +3265,7 @@ proto.hold.CancelRequest.prototype.toObject = function(opt_includeInstance) { */ proto.hold.CancelRequest.toObject = function(includeInstance, msg) { var f, obj = { - paymentHash: jspb.Message.getFieldWithDefault(msg, 1, "") + paymentHash: msg.getPaymentHash_asB64() }; if (includeInstance) { @@ -3374,7 +3303,7 @@ proto.hold.CancelRequest.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setPaymentHash(value); break; default: @@ -3406,2270 +3335,156 @@ proto.hold.CancelRequest.prototype.serializeBinary = function() { */ proto.hold.CancelRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPaymentHash(); + f = message.getPaymentHash_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 1, - f - ); - } -}; - - -/** - * optional string payment_hash = 1; - * @return {string} - */ -proto.hold.CancelRequest.prototype.getPaymentHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.CancelRequest} returns this - */ -proto.hold.CancelRequest.prototype.setPaymentHash = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.CancelResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hold.CancelResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.CancelResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.CancelResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.CancelResponse} - */ -proto.hold.CancelResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.CancelResponse; - return proto.hold.CancelResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.CancelResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.CancelResponse} - */ -proto.hold.CancelResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.CancelResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.CancelResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.CancelResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.CancelResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.TrackRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hold.TrackRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.TrackRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackRequest.toObject = function(includeInstance, msg) { - var f, obj = { - paymentHash: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.TrackRequest} - */ -proto.hold.TrackRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.TrackRequest; - return proto.hold.TrackRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.TrackRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.TrackRequest} - */ -proto.hold.TrackRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPaymentHash(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.TrackRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.TrackRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.TrackRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPaymentHash(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string payment_hash = 1; - * @return {string} - */ -proto.hold.TrackRequest.prototype.getPaymentHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.TrackRequest} returns this - */ -proto.hold.TrackRequest.prototype.setPaymentHash = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.TrackResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hold.TrackResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.TrackResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackResponse.toObject = function(includeInstance, msg) { - var f, obj = { - state: jspb.Message.getFieldWithDefault(msg, 1, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.TrackResponse} - */ -proto.hold.TrackResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.TrackResponse; - return proto.hold.TrackResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.TrackResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.TrackResponse} - */ -proto.hold.TrackResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!proto.hold.InvoiceState} */ (reader.readEnum()); - msg.setState(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.TrackResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.TrackResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.TrackResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getState(); - if (f !== 0.0) { - writer.writeEnum( - 1, - f - ); - } -}; - - -/** - * optional InvoiceState state = 1; - * @return {!proto.hold.InvoiceState} - */ -proto.hold.TrackResponse.prototype.getState = function() { - return /** @type {!proto.hold.InvoiceState} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {!proto.hold.InvoiceState} value - * @return {!proto.hold.TrackResponse} returns this - */ -proto.hold.TrackResponse.prototype.setState = function(value) { - return jspb.Message.setProto3EnumField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.TrackAllRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hold.TrackAllRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.TrackAllRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackAllRequest.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.TrackAllRequest} - */ -proto.hold.TrackAllRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.TrackAllRequest; - return proto.hold.TrackAllRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.TrackAllRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.TrackAllRequest} - */ -proto.hold.TrackAllRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.TrackAllRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.TrackAllRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.TrackAllRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackAllRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.TrackAllResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hold.TrackAllResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.TrackAllResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackAllResponse.toObject = function(includeInstance, msg) { - var f, obj = { - paymentHash: jspb.Message.getFieldWithDefault(msg, 1, ""), - bolt11: jspb.Message.getFieldWithDefault(msg, 2, ""), - state: jspb.Message.getFieldWithDefault(msg, 3, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.TrackAllResponse} - */ -proto.hold.TrackAllResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.TrackAllResponse; - return proto.hold.TrackAllResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.TrackAllResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.TrackAllResponse} - */ -proto.hold.TrackAllResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPaymentHash(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setBolt11(value); - break; - case 3: - var value = /** @type {!proto.hold.InvoiceState} */ (reader.readEnum()); - msg.setState(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.TrackAllResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.TrackAllResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.TrackAllResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.TrackAllResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPaymentHash(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getBolt11(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getState(); - if (f !== 0.0) { - writer.writeEnum( - 3, - f - ); - } -}; - - -/** - * optional string payment_hash = 1; - * @return {string} - */ -proto.hold.TrackAllResponse.prototype.getPaymentHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.TrackAllResponse} returns this - */ -proto.hold.TrackAllResponse.prototype.setPaymentHash = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string bolt11 = 2; - * @return {string} - */ -proto.hold.TrackAllResponse.prototype.getBolt11 = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.TrackAllResponse} returns this - */ -proto.hold.TrackAllResponse.prototype.setBolt11 = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional InvoiceState state = 3; - * @return {!proto.hold.InvoiceState} - */ -proto.hold.TrackAllResponse.prototype.getState = function() { - return /** @type {!proto.hold.InvoiceState} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {!proto.hold.InvoiceState} value - * @return {!proto.hold.TrackAllResponse} returns this - */ -proto.hold.TrackAllResponse.prototype.setState = function(value) { - return jspb.Message.setProto3EnumField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.PayStatusRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hold.PayStatusRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.PayStatusRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusRequest.toObject = function(includeInstance, msg) { - var f, obj = { - bolt11: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.PayStatusRequest} - */ -proto.hold.PayStatusRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.PayStatusRequest; - return proto.hold.PayStatusRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.PayStatusRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.PayStatusRequest} - */ -proto.hold.PayStatusRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setBolt11(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.PayStatusRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.PayStatusRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.PayStatusRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = /** @type {string} */ (jspb.Message.getField(message, 1)); - if (f != null) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string bolt11 = 1; - * @return {string} - */ -proto.hold.PayStatusRequest.prototype.getBolt11 = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusRequest} returns this - */ -proto.hold.PayStatusRequest.prototype.setBolt11 = function(value) { - return jspb.Message.setField(this, 1, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.hold.PayStatusRequest} returns this - */ -proto.hold.PayStatusRequest.prototype.clearBolt11 = function() { - return jspb.Message.setField(this, 1, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hold.PayStatusRequest.prototype.hasBolt11 = function() { - return jspb.Message.getField(this, 1) != null; -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.hold.PayStatusResponse.repeatedFields_ = [1]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.PayStatusResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hold.PayStatusResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.PayStatusResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.toObject = function(includeInstance, msg) { - var f, obj = { - statusList: jspb.Message.toObjectList(msg.getStatusList(), - proto.hold.PayStatusResponse.PayStatus.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.PayStatusResponse} - */ -proto.hold.PayStatusResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.PayStatusResponse; - return proto.hold.PayStatusResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.PayStatusResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.PayStatusResponse} - */ -proto.hold.PayStatusResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.hold.PayStatusResponse.PayStatus; - reader.readMessage(value,proto.hold.PayStatusResponse.PayStatus.deserializeBinaryFromReader); - msg.addStatus(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.PayStatusResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.PayStatusResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.PayStatusResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStatusList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.hold.PayStatusResponse.PayStatus.serializeBinaryToWriter - ); - } -}; - - - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.hold.PayStatusResponse.PayStatus.repeatedFields_ = [4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.PayStatusResponse.PayStatus.prototype.toObject = function(opt_includeInstance) { - return proto.hold.PayStatusResponse.PayStatus.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.PayStatusResponse.PayStatus} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.toObject = function(includeInstance, msg) { - var f, obj = { - bolt11: jspb.Message.getFieldWithDefault(msg, 1, ""), - amountMsat: jspb.Message.getFieldWithDefault(msg, 2, 0), - destination: jspb.Message.getFieldWithDefault(msg, 3, ""), - attemptsList: jspb.Message.toObjectList(msg.getAttemptsList(), - proto.hold.PayStatusResponse.PayStatus.Attempt.toObject, includeInstance) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.PayStatusResponse.PayStatus} - */ -proto.hold.PayStatusResponse.PayStatus.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.PayStatusResponse.PayStatus; - return proto.hold.PayStatusResponse.PayStatus.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.PayStatusResponse.PayStatus} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.PayStatusResponse.PayStatus} - */ -proto.hold.PayStatusResponse.PayStatus.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setBolt11(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setAmountMsat(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setDestination(value); - break; - case 4: - var value = new proto.hold.PayStatusResponse.PayStatus.Attempt; - reader.readMessage(value,proto.hold.PayStatusResponse.PayStatus.Attempt.deserializeBinaryFromReader); - msg.addAttempts(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.PayStatusResponse.PayStatus.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.PayStatusResponse.PayStatus.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.PayStatusResponse.PayStatus} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getBolt11(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getAmountMsat(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getDestination(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } - f = message.getAttemptsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 4, - f, - proto.hold.PayStatusResponse.PayStatus.Attempt.serializeBinaryToWriter - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.toObject = function(opt_includeInstance) { - return proto.hold.PayStatusResponse.PayStatus.Attempt.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.toObject = function(includeInstance, msg) { - var f, obj = { - strategy: jspb.Message.getFieldWithDefault(msg, 1, ""), - startTime: jspb.Message.getFieldWithDefault(msg, 2, 0), - ageInSeconds: jspb.Message.getFieldWithDefault(msg, 3, 0), - endTime: jspb.Message.getFieldWithDefault(msg, 4, 0), - state: jspb.Message.getFieldWithDefault(msg, 5, 0), - success: (f = msg.getSuccess()) && proto.hold.PayStatusResponse.PayStatus.Attempt.Success.toObject(includeInstance, f), - failure: (f = msg.getFailure()) && proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.PayStatusResponse.PayStatus.Attempt; - return proto.hold.PayStatusResponse.PayStatus.Attempt.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setStrategy(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setStartTime(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setAgeInSeconds(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint64()); - msg.setEndTime(value); - break; - case 5: - var value = /** @type {!proto.hold.PayStatusResponse.PayStatus.Attempt.AttemptState} */ (reader.readEnum()); - msg.setState(value); - break; - case 6: - var value = new proto.hold.PayStatusResponse.PayStatus.Attempt.Success; - reader.readMessage(value,proto.hold.PayStatusResponse.PayStatus.Attempt.Success.deserializeBinaryFromReader); - msg.setSuccess(value); - break; - case 7: - var value = new proto.hold.PayStatusResponse.PayStatus.Attempt.Failure; - reader.readMessage(value,proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.deserializeBinaryFromReader); - msg.setFailure(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.PayStatusResponse.PayStatus.Attempt.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStrategy(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getStartTime(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getAgeInSeconds(); - if (f !== 0) { - writer.writeUint64( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeUint64( - 4, - f - ); - } - f = message.getState(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } - f = message.getSuccess(); - if (f != null) { - writer.writeMessage( - 6, - f, - proto.hold.PayStatusResponse.PayStatus.Attempt.Success.serializeBinaryToWriter - ); - } - f = message.getFailure(); - if (f != null) { - writer.writeMessage( - 7, - f, - proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.serializeBinaryToWriter - ); - } -}; - - -/** - * @enum {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.AttemptState = { - ATTEMPT_PENDING: 0, - ATTEMPT_COMPLETED: 1 -}; - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.prototype.toObject = function(opt_includeInstance) { - return proto.hold.PayStatusResponse.PayStatus.Attempt.Success.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Success} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0), - paymentPreimage: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Success} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.PayStatusResponse.PayStatus.Attempt.Success; - return proto.hold.PayStatusResponse.PayStatus.Attempt.Success.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Success} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Success} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPaymentPreimage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.PayStatusResponse.PayStatus.Attempt.Success.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Success} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getPaymentPreimage(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Success} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.prototype.setId = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string payment_preimage = 2; - * @return {string} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.prototype.getPaymentPreimage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Success} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Success.prototype.setPaymentPreimage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.toObject = function(opt_includeInstance) { - return proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.toObject = function(includeInstance, msg) { - var f, obj = { - message: jspb.Message.getFieldWithDefault(msg, 1, ""), - code: jspb.Message.getFieldWithDefault(msg, 2, 0), - data: (f = msg.getData()) && proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.PayStatusResponse.PayStatus.Attempt.Failure; - return proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setCode(value); - break; - case 3: - var value = new proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data; - reader.readMessage(value,proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.deserializeBinaryFromReader); - msg.setData(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getCode(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getData(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.serializeBinaryToWriter - ); - } -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.toObject = function(opt_includeInstance) { - return proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, 0), - rawMessage: jspb.Message.getFieldWithDefault(msg, 2, ""), - failCode: jspb.Message.getFieldWithDefault(msg, 3, 0), - failCodename: jspb.Message.getFieldWithDefault(msg, 4, ""), - erringIndex: jspb.Message.getFieldWithDefault(msg, 5, 0), - erringNode: jspb.Message.getFieldWithDefault(msg, 6, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data; - return proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {number} */ (reader.readUint64()); - msg.setId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setRawMessage(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setFailCode(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.setFailCodename(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint64()); - msg.setErringIndex(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setErringNode(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f !== 0) { - writer.writeUint64( - 1, - f - ); - } - f = message.getRawMessage(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getFailCode(); - if (f !== 0) { - writer.writeUint64( - 3, - f - ); - } - f = message.getFailCodename(); - if (f.length > 0) { - writer.writeString( - 4, - f - ); - } - f = message.getErringIndex(); - if (f !== 0) { - writer.writeUint64( - 5, - f - ); - } - f = message.getErringNode(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } -}; - - -/** - * optional uint64 id = 1; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.getId = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.setId = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); -}; - - -/** - * optional string raw_message = 2; - * @return {string} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.getRawMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.setRawMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional uint64 fail_code = 3; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.getFailCode = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.setFailCode = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; - - -/** - * optional string fail_codename = 4; - * @return {string} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.getFailCodename = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.setFailCodename = function(value) { - return jspb.Message.setProto3StringField(this, 4, value); -}; - - -/** - * optional uint64 erring_index = 5; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.getErringIndex = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.setErringIndex = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); -}; - - -/** - * optional string erring_node = 6; - * @return {string} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.getErringNode = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data.prototype.setErringNode = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * optional string message = 1; - * @return {string} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional uint64 code = 2; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.getCode = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.setCode = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional Data data = 3; - * @return {?proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.getData = function() { - return /** @type{?proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data} */ ( - jspb.Message.getWrapperField(this, proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data, 3)); -}; - - -/** - * @param {?proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.Data|undefined} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} returns this -*/ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.setData = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.clearData = function() { - return this.setData(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.Failure.prototype.hasData = function() { - return jspb.Message.getField(this, 3) != null; -}; - - -/** - * optional string strategy = 1; - * @return {string} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.getStrategy = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.setStrategy = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional uint64 start_time = 2; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.getStartTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.setStartTime = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); -}; - - -/** - * optional uint64 age_in_seconds = 3; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.getAgeInSeconds = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.setAgeInSeconds = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; - - -/** - * optional uint64 end_time = 4; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.getEndTime = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.setEndTime = function(value) { - return jspb.Message.setField(this, 4, value); -}; - - -/** - * Clears the field making it undefined. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.clearEndTime = function() { - return jspb.Message.setField(this, 4, undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.hasEndTime = function() { - return jspb.Message.getField(this, 4) != null; -}; - - -/** - * optional AttemptState state = 5; - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt.AttemptState} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.getState = function() { - return /** @type {!proto.hold.PayStatusResponse.PayStatus.Attempt.AttemptState} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt.AttemptState} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.setState = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - -/** - * optional Success success = 6; - * @return {?proto.hold.PayStatusResponse.PayStatus.Attempt.Success} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.getSuccess = function() { - return /** @type{?proto.hold.PayStatusResponse.PayStatus.Attempt.Success} */ ( - jspb.Message.getWrapperField(this, proto.hold.PayStatusResponse.PayStatus.Attempt.Success, 6)); -}; - - -/** - * @param {?proto.hold.PayStatusResponse.PayStatus.Attempt.Success|undefined} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this -*/ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.setSuccess = function(value) { - return jspb.Message.setWrapperField(this, 6, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.clearSuccess = function() { - return this.setSuccess(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.hasSuccess = function() { - return jspb.Message.getField(this, 6) != null; -}; - - -/** - * optional Failure failure = 7; - * @return {?proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.getFailure = function() { - return /** @type{?proto.hold.PayStatusResponse.PayStatus.Attempt.Failure} */ ( - jspb.Message.getWrapperField(this, proto.hold.PayStatusResponse.PayStatus.Attempt.Failure, 7)); -}; - - -/** - * @param {?proto.hold.PayStatusResponse.PayStatus.Attempt.Failure|undefined} value - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this -*/ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.setFailure = function(value) { - return jspb.Message.setWrapperField(this, 7, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} returns this - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.clearFailure = function() { - return this.setFailure(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.hold.PayStatusResponse.PayStatus.Attempt.prototype.hasFailure = function() { - return jspb.Message.getField(this, 7) != null; -}; - - -/** - * optional string bolt11 = 1; - * @return {string} - */ -proto.hold.PayStatusResponse.PayStatus.prototype.getBolt11 = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus} returns this - */ -proto.hold.PayStatusResponse.PayStatus.prototype.setBolt11 = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional uint64 amount_msat = 2; - * @return {number} - */ -proto.hold.PayStatusResponse.PayStatus.prototype.getAmountMsat = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); + f + ); + } }; /** - * @param {number} value - * @return {!proto.hold.PayStatusResponse.PayStatus} returns this + * optional bytes payment_hash = 1; + * @return {!(string|Uint8Array)} */ -proto.hold.PayStatusResponse.PayStatus.prototype.setAmountMsat = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.hold.CancelRequest.prototype.getPaymentHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional string destination = 3; + * optional bytes payment_hash = 1; + * This is a type-conversion wrapper around `getPaymentHash()` * @return {string} */ -proto.hold.PayStatusResponse.PayStatus.prototype.getDestination = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.hold.CancelRequest.prototype.getPaymentHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPaymentHash())); }; /** - * @param {string} value - * @return {!proto.hold.PayStatusResponse.PayStatus} returns this + * optional bytes payment_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {!Uint8Array} */ -proto.hold.PayStatusResponse.PayStatus.prototype.setDestination = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); +proto.hold.CancelRequest.prototype.getPaymentHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPaymentHash())); }; /** - * repeated Attempt attempts = 4; - * @return {!Array} + * @param {!(string|Uint8Array)} value + * @return {!proto.hold.CancelRequest} returns this */ -proto.hold.PayStatusResponse.PayStatus.prototype.getAttemptsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hold.PayStatusResponse.PayStatus.Attempt, 4)); +proto.hold.CancelRequest.prototype.setPaymentHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; -/** - * @param {!Array} value - * @return {!proto.hold.PayStatusResponse.PayStatus} returns this -*/ -proto.hold.PayStatusResponse.PayStatus.prototype.setAttemptsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 4, value); -}; + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * @param {!proto.hold.PayStatusResponse.PayStatus.Attempt=} opt_value - * @param {number=} opt_index - * @return {!proto.hold.PayStatusResponse.PayStatus.Attempt} + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.hold.PayStatusResponse.PayStatus.prototype.addAttempts = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.hold.PayStatusResponse.PayStatus.Attempt, opt_index); +proto.hold.CancelResponse.prototype.toObject = function(opt_includeInstance) { + return proto.hold.CancelResponse.toObject(opt_includeInstance, this); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.hold.PayStatusResponse.PayStatus} returns this + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.hold.CancelResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.PayStatusResponse.PayStatus.prototype.clearAttemptsList = function() { - return this.setAttemptsList([]); +proto.hold.CancelResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * repeated PayStatus status = 1; - * @return {!Array} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.hold.CancelResponse} */ -proto.hold.PayStatusResponse.prototype.getStatusList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hold.PayStatusResponse.PayStatus, 1)); +proto.hold.CancelResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.hold.CancelResponse; + return proto.hold.CancelResponse.deserializeBinaryFromReader(msg, reader); }; /** - * @param {!Array} value - * @return {!proto.hold.PayStatusResponse} returns this -*/ -proto.hold.PayStatusResponse.prototype.setStatusList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.hold.CancelResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.hold.CancelResponse} + */ +proto.hold.CancelResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * @param {!proto.hold.PayStatusResponse.PayStatus=} opt_value - * @param {number=} opt_index - * @return {!proto.hold.PayStatusResponse.PayStatus} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.hold.PayStatusResponse.prototype.addStatus = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.hold.PayStatusResponse.PayStatus, opt_index); +proto.hold.CancelResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.hold.CancelResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.hold.PayStatusResponse} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.hold.CancelResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.PayStatusResponse.prototype.clearStatusList = function() { - return this.setStatusList([]); +proto.hold.CancelResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; }; @@ -5689,8 +3504,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.GetRouteRequest.prototype.toObject = function(opt_includeInstance) { - return proto.hold.GetRouteRequest.toObject(opt_includeInstance, this); +proto.hold.TrackRequest.prototype.toObject = function(opt_includeInstance) { + return proto.hold.TrackRequest.toObject(opt_includeInstance, this); }; @@ -5699,18 +3514,13 @@ proto.hold.GetRouteRequest.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.GetRouteRequest} msg The msg instance to transform. + * @param {!proto.hold.TrackRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteRequest.toObject = function(includeInstance, msg) { +proto.hold.TrackRequest.toObject = function(includeInstance, msg) { var f, obj = { - destination: jspb.Message.getFieldWithDefault(msg, 1, ""), - amountMsat: jspb.Message.getFieldWithDefault(msg, 2, 0), - maxRetries: jspb.Message.getFieldWithDefault(msg, 3, 0), - riskFactor: jspb.Message.getFieldWithDefault(msg, 4, 0), - maxCltv: jspb.Message.getFieldWithDefault(msg, 5, 0), - finalCltvDelta: jspb.Message.getFieldWithDefault(msg, 6, 0) + paymentHash: msg.getPaymentHash_asB64() }; if (includeInstance) { @@ -5724,23 +3534,23 @@ proto.hold.GetRouteRequest.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.GetRouteRequest} + * @return {!proto.hold.TrackRequest} */ -proto.hold.GetRouteRequest.deserializeBinary = function(bytes) { +proto.hold.TrackRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.GetRouteRequest; - return proto.hold.GetRouteRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.TrackRequest; + return proto.hold.TrackRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.GetRouteRequest} msg The message object to deserialize into. + * @param {!proto.hold.TrackRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.GetRouteRequest} + * @return {!proto.hold.TrackRequest} */ -proto.hold.GetRouteRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.TrackRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -5748,28 +3558,8 @@ proto.hold.GetRouteRequest.deserializeBinaryFromReader = function(msg, reader) { var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDestination(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setAmountMsat(value); - break; - case 3: - var value = /** @type {number} */ (reader.readUint32()); - msg.setMaxRetries(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setRiskFactor(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint64()); - msg.setMaxCltv(value); - break; - case 6: - var value = /** @type {number} */ (reader.readUint64()); - msg.setFinalCltvDelta(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPaymentHash(value); break; default: reader.skipField(); @@ -5784,9 +3574,9 @@ proto.hold.GetRouteRequest.deserializeBinaryFromReader = function(msg, reader) { * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.GetRouteRequest.prototype.serializeBinary = function() { +proto.hold.TrackRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.GetRouteRequest.serializeBinaryToWriter(this, writer); + proto.hold.TrackRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -5794,227 +3584,195 @@ proto.hold.GetRouteRequest.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.GetRouteRequest} message + * @param {!proto.hold.TrackRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteRequest.serializeBinaryToWriter = function(message, writer) { +proto.hold.TrackRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDestination(); + f = message.getPaymentHash_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 1, f ); } - f = message.getAmountMsat(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } - f = message.getMaxRetries(); - if (f !== 0) { - writer.writeUint32( - 3, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 4)); - if (f != null) { - writer.writeUint32( - 4, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 5)); - if (f != null) { - writer.writeUint64( - 5, - f - ); - } - f = /** @type {number} */ (jspb.Message.getField(message, 6)); - if (f != null) { - writer.writeUint64( - 6, - f - ); - } -}; - - -/** - * optional string destination = 1; - * @return {string} - */ -proto.hold.GetRouteRequest.prototype.getDestination = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.GetRouteRequest} returns this - */ -proto.hold.GetRouteRequest.prototype.setDestination = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional uint64 amount_msat = 2; - * @return {number} - */ -proto.hold.GetRouteRequest.prototype.getAmountMsat = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** - * @param {number} value - * @return {!proto.hold.GetRouteRequest} returns this + * optional bytes payment_hash = 1; + * @return {!(string|Uint8Array)} */ -proto.hold.GetRouteRequest.prototype.setAmountMsat = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.hold.TrackRequest.prototype.getPaymentHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional uint32 max_retries = 3; - * @return {number} + * optional bytes payment_hash = 1; + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {string} */ -proto.hold.GetRouteRequest.prototype.getMaxRetries = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.hold.TrackRequest.prototype.getPaymentHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPaymentHash())); }; /** - * @param {number} value - * @return {!proto.hold.GetRouteRequest} returns this + * optional bytes payment_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {!Uint8Array} */ -proto.hold.GetRouteRequest.prototype.setMaxRetries = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); +proto.hold.TrackRequest.prototype.getPaymentHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPaymentHash())); }; /** - * optional uint32 risk_factor = 4; - * @return {number} + * @param {!(string|Uint8Array)} value + * @return {!proto.hold.TrackRequest} returns this */ -proto.hold.GetRouteRequest.prototype.getRiskFactor = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.hold.TrackRequest.prototype.setPaymentHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; -/** - * @param {number} value - * @return {!proto.hold.GetRouteRequest} returns this - */ -proto.hold.GetRouteRequest.prototype.setRiskFactor = function(value) { - return jspb.Message.setField(this, 4, value); -}; - -/** - * Clears the field making it undefined. - * @return {!proto.hold.GetRouteRequest} returns this - */ -proto.hold.GetRouteRequest.prototype.clearRiskFactor = function() { - return jspb.Message.setField(this, 4, undefined); -}; +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Returns whether this field is set. - * @return {boolean} + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.hold.GetRouteRequest.prototype.hasRiskFactor = function() { - return jspb.Message.getField(this, 4) != null; +proto.hold.TrackResponse.prototype.toObject = function(opt_includeInstance) { + return proto.hold.TrackResponse.toObject(opt_includeInstance, this); }; /** - * optional uint64 max_cltv = 5; - * @return {number} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.hold.TrackResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteRequest.prototype.getMaxCltv = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - +proto.hold.TrackResponse.toObject = function(includeInstance, msg) { + var f, obj = { + state: jspb.Message.getFieldWithDefault(msg, 1, 0) + }; -/** - * @param {number} value - * @return {!proto.hold.GetRouteRequest} returns this - */ -proto.hold.GetRouteRequest.prototype.setMaxCltv = function(value) { - return jspb.Message.setField(this, 5, value); + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * Clears the field making it undefined. - * @return {!proto.hold.GetRouteRequest} returns this + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.hold.TrackResponse} */ -proto.hold.GetRouteRequest.prototype.clearMaxCltv = function() { - return jspb.Message.setField(this, 5, undefined); +proto.hold.TrackResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.hold.TrackResponse; + return proto.hold.TrackResponse.deserializeBinaryFromReader(msg, reader); }; /** - * Returns whether this field is set. - * @return {boolean} + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.hold.TrackResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.hold.TrackResponse} */ -proto.hold.GetRouteRequest.prototype.hasMaxCltv = function() { - return jspb.Message.getField(this, 5) != null; +proto.hold.TrackResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.hold.InvoiceState} */ (reader.readEnum()); + msg.setState(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional uint64 final_cltv_delta = 6; - * @return {number} + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.hold.GetRouteRequest.prototype.getFinalCltvDelta = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +proto.hold.TrackResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.hold.TrackResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {number} value - * @return {!proto.hold.GetRouteRequest} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.hold.TrackResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteRequest.prototype.setFinalCltvDelta = function(value) { - return jspb.Message.setField(this, 6, value); +proto.hold.TrackResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getState(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } }; /** - * Clears the field making it undefined. - * @return {!proto.hold.GetRouteRequest} returns this + * optional InvoiceState state = 1; + * @return {!proto.hold.InvoiceState} */ -proto.hold.GetRouteRequest.prototype.clearFinalCltvDelta = function() { - return jspb.Message.setField(this, 6, undefined); +proto.hold.TrackResponse.prototype.getState = function() { + return /** @type {!proto.hold.InvoiceState} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** - * Returns whether this field is set. - * @return {boolean} + * @param {!proto.hold.InvoiceState} value + * @return {!proto.hold.TrackResponse} returns this */ -proto.hold.GetRouteRequest.prototype.hasFinalCltvDelta = function() { - return jspb.Message.getField(this, 6) != null; +proto.hold.TrackResponse.prototype.setState = function(value) { + return jspb.Message.setProto3EnumField(this, 1, value); }; -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.hold.GetRouteResponse.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -6030,8 +3788,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.GetRouteResponse.prototype.toObject = function(opt_includeInstance) { - return proto.hold.GetRouteResponse.toObject(opt_includeInstance, this); +proto.hold.TrackAllRequest.prototype.toObject = function(opt_includeInstance) { + return proto.hold.TrackAllRequest.toObject(opt_includeInstance, this); }; @@ -6040,15 +3798,13 @@ proto.hold.GetRouteResponse.prototype.toObject = function(opt_includeInstance) { * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.GetRouteResponse} msg The msg instance to transform. + * @param {!proto.hold.TrackAllRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteResponse.toObject = function(includeInstance, msg) { +proto.hold.TrackAllRequest.toObject = function(includeInstance, msg) { var f, obj = { - hopsList: jspb.Message.toObjectList(msg.getHopsList(), - proto.hold.GetRouteResponse.Hop.toObject, includeInstance), - feesMsat: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; if (includeInstance) { @@ -6062,38 +3818,29 @@ proto.hold.GetRouteResponse.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.GetRouteResponse} + * @return {!proto.hold.TrackAllRequest} */ -proto.hold.GetRouteResponse.deserializeBinary = function(bytes) { +proto.hold.TrackAllRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.GetRouteResponse; - return proto.hold.GetRouteResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.TrackAllRequest; + return proto.hold.TrackAllRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.GetRouteResponse} msg The message object to deserialize into. + * @param {!proto.hold.TrackAllRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.GetRouteResponse} + * @return {!proto.hold.TrackAllRequest} */ -proto.hold.GetRouteResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.TrackAllRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { - case 1: - var value = new proto.hold.GetRouteResponse.Hop; - reader.readMessage(value,proto.hold.GetRouteResponse.Hop.deserializeBinaryFromReader); - msg.addHops(value); - break; - case 2: - var value = /** @type {number} */ (reader.readUint64()); - msg.setFeesMsat(value); - break; default: reader.skipField(); break; @@ -6107,9 +3854,9 @@ proto.hold.GetRouteResponse.deserializeBinaryFromReader = function(msg, reader) * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.GetRouteResponse.prototype.serializeBinary = function() { +proto.hold.TrackAllRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.GetRouteResponse.serializeBinaryToWriter(this, writer); + proto.hold.TrackAllRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6117,27 +3864,12 @@ proto.hold.GetRouteResponse.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.GetRouteResponse} message + * @param {!proto.hold.TrackAllRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteResponse.serializeBinaryToWriter = function(message, writer) { +proto.hold.TrackAllRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getHopsList(); - if (f.length > 0) { - writer.writeRepeatedMessage( - 1, - f, - proto.hold.GetRouteResponse.Hop.serializeBinaryToWriter - ); - } - f = message.getFeesMsat(); - if (f !== 0) { - writer.writeUint64( - 2, - f - ); - } }; @@ -6157,8 +3889,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.hold.GetRouteResponse.Hop.prototype.toObject = function(opt_includeInstance) { - return proto.hold.GetRouteResponse.Hop.toObject(opt_includeInstance, this); +proto.hold.TrackAllResponse.prototype.toObject = function(opt_includeInstance) { + return proto.hold.TrackAllResponse.toObject(opt_includeInstance, this); }; @@ -6167,18 +3899,15 @@ proto.hold.GetRouteResponse.Hop.prototype.toObject = function(opt_includeInstanc * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.hold.GetRouteResponse.Hop} msg The msg instance to transform. + * @param {!proto.hold.TrackAllResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteResponse.Hop.toObject = function(includeInstance, msg) { +proto.hold.TrackAllResponse.toObject = function(includeInstance, msg) { var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - channel: jspb.Message.getFieldWithDefault(msg, 2, ""), - direction: jspb.Message.getFieldWithDefault(msg, 3, 0), - amountMsat: jspb.Message.getFieldWithDefault(msg, 4, 0), - delay: jspb.Message.getFieldWithDefault(msg, 5, 0), - style: jspb.Message.getFieldWithDefault(msg, 6, "") + paymentHash: msg.getPaymentHash_asB64(), + bolt11: jspb.Message.getFieldWithDefault(msg, 2, ""), + state: jspb.Message.getFieldWithDefault(msg, 3, 0) }; if (includeInstance) { @@ -6192,23 +3921,23 @@ proto.hold.GetRouteResponse.Hop.toObject = function(includeInstance, msg) { /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.hold.GetRouteResponse.Hop} + * @return {!proto.hold.TrackAllResponse} */ -proto.hold.GetRouteResponse.Hop.deserializeBinary = function(bytes) { +proto.hold.TrackAllResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.hold.GetRouteResponse.Hop; - return proto.hold.GetRouteResponse.Hop.deserializeBinaryFromReader(msg, reader); + var msg = new proto.hold.TrackAllResponse; + return proto.hold.TrackAllResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.hold.GetRouteResponse.Hop} msg The message object to deserialize into. + * @param {!proto.hold.TrackAllResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.hold.GetRouteResponse.Hop} + * @return {!proto.hold.TrackAllResponse} */ -proto.hold.GetRouteResponse.Hop.deserializeBinaryFromReader = function(msg, reader) { +proto.hold.TrackAllResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -6216,28 +3945,16 @@ proto.hold.GetRouteResponse.Hop.deserializeBinaryFromReader = function(msg, read var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setPaymentHash(value); break; case 2: var value = /** @type {string} */ (reader.readString()); - msg.setChannel(value); + msg.setBolt11(value); break; case 3: - var value = /** @type {number} */ (reader.readUint32()); - msg.setDirection(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint64()); - msg.setAmountMsat(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint64()); - msg.setDelay(value); - break; - case 6: - var value = /** @type {string} */ (reader.readString()); - msg.setStyle(value); + var value = /** @type {!proto.hold.InvoiceState} */ (reader.readEnum()); + msg.setState(value); break; default: reader.skipField(); @@ -6252,9 +3969,9 @@ proto.hold.GetRouteResponse.Hop.deserializeBinaryFromReader = function(msg, read * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.hold.GetRouteResponse.Hop.prototype.serializeBinary = function() { +proto.hold.TrackAllResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.hold.GetRouteResponse.Hop.serializeBinaryToWriter(this, writer); + proto.hold.TrackAllResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -6262,218 +3979,111 @@ proto.hold.GetRouteResponse.Hop.prototype.serializeBinary = function() { /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.hold.GetRouteResponse.Hop} message + * @param {!proto.hold.TrackAllResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.hold.GetRouteResponse.Hop.serializeBinaryToWriter = function(message, writer) { +proto.hold.TrackAllResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getId(); + f = message.getPaymentHash_asU8(); if (f.length > 0) { - writer.writeString( + writer.writeBytes( 1, f ); } - f = message.getChannel(); + f = message.getBolt11(); if (f.length > 0) { writer.writeString( 2, f ); } - f = message.getDirection(); - if (f !== 0) { - writer.writeUint32( + f = message.getState(); + if (f !== 0.0) { + writer.writeEnum( 3, f ); } - f = message.getAmountMsat(); - if (f !== 0) { - writer.writeUint64( - 4, - f - ); - } - f = message.getDelay(); - if (f !== 0) { - writer.writeUint64( - 5, - f - ); - } - f = message.getStyle(); - if (f.length > 0) { - writer.writeString( - 6, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.hold.GetRouteResponse.Hop.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.hold.GetRouteResponse.Hop} returns this + * optional bytes payment_hash = 1; + * @return {!(string|Uint8Array)} */ -proto.hold.GetRouteResponse.Hop.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); +proto.hold.TrackAllResponse.prototype.getPaymentHash = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional string channel = 2; + * optional bytes payment_hash = 1; + * This is a type-conversion wrapper around `getPaymentHash()` * @return {string} */ -proto.hold.GetRouteResponse.Hop.prototype.getChannel = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.hold.GetRouteResponse.Hop} returns this - */ -proto.hold.GetRouteResponse.Hop.prototype.setChannel = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional uint32 direction = 3; - * @return {number} - */ -proto.hold.GetRouteResponse.Hop.prototype.getDirection = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.GetRouteResponse.Hop} returns this - */ -proto.hold.GetRouteResponse.Hop.prototype.setDirection = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); -}; - - -/** - * optional uint64 amount_msat = 4; - * @return {number} - */ -proto.hold.GetRouteResponse.Hop.prototype.getAmountMsat = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); -}; - - -/** - * @param {number} value - * @return {!proto.hold.GetRouteResponse.Hop} returns this - */ -proto.hold.GetRouteResponse.Hop.prototype.setAmountMsat = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.hold.TrackAllResponse.prototype.getPaymentHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPaymentHash())); }; /** - * optional uint64 delay = 5; - * @return {number} + * optional bytes payment_hash = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getPaymentHash()` + * @return {!Uint8Array} */ -proto.hold.GetRouteResponse.Hop.prototype.getDelay = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +proto.hold.TrackAllResponse.prototype.getPaymentHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPaymentHash())); }; /** - * @param {number} value - * @return {!proto.hold.GetRouteResponse.Hop} returns this + * @param {!(string|Uint8Array)} value + * @return {!proto.hold.TrackAllResponse} returns this */ -proto.hold.GetRouteResponse.Hop.prototype.setDelay = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); +proto.hold.TrackAllResponse.prototype.setPaymentHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional string style = 6; + * optional string bolt11 = 2; * @return {string} */ -proto.hold.GetRouteResponse.Hop.prototype.getStyle = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +proto.hold.TrackAllResponse.prototype.getBolt11 = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value - * @return {!proto.hold.GetRouteResponse.Hop} returns this - */ -proto.hold.GetRouteResponse.Hop.prototype.setStyle = function(value) { - return jspb.Message.setProto3StringField(this, 6, value); -}; - - -/** - * repeated Hop hops = 1; - * @return {!Array} - */ -proto.hold.GetRouteResponse.prototype.getHopsList = function() { - return /** @type{!Array} */ ( - jspb.Message.getRepeatedWrapperField(this, proto.hold.GetRouteResponse.Hop, 1)); -}; - - -/** - * @param {!Array} value - * @return {!proto.hold.GetRouteResponse} returns this -*/ -proto.hold.GetRouteResponse.prototype.setHopsList = function(value) { - return jspb.Message.setRepeatedWrapperField(this, 1, value); -}; - - -/** - * @param {!proto.hold.GetRouteResponse.Hop=} opt_value - * @param {number=} opt_index - * @return {!proto.hold.GetRouteResponse.Hop} - */ -proto.hold.GetRouteResponse.prototype.addHops = function(opt_value, opt_index) { - return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.hold.GetRouteResponse.Hop, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.hold.GetRouteResponse} returns this + * @return {!proto.hold.TrackAllResponse} returns this */ -proto.hold.GetRouteResponse.prototype.clearHopsList = function() { - return this.setHopsList([]); +proto.hold.TrackAllResponse.prototype.setBolt11 = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; /** - * optional uint64 fees_msat = 2; - * @return {number} + * optional InvoiceState state = 3; + * @return {!proto.hold.InvoiceState} */ -proto.hold.GetRouteResponse.prototype.getFeesMsat = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.hold.TrackAllResponse.prototype.getState = function() { + return /** @type {!proto.hold.InvoiceState} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** - * @param {number} value - * @return {!proto.hold.GetRouteResponse} returns this + * @param {!proto.hold.InvoiceState} value + * @return {!proto.hold.TrackAllResponse} returns this */ -proto.hold.GetRouteResponse.prototype.setFeesMsat = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.hold.TrackAllResponse.prototype.setState = function(value) { + return jspb.Message.setProto3EnumField(this, 3, value); }; @@ -6481,19 +4091,10 @@ proto.hold.GetRouteResponse.prototype.setFeesMsat = function(value) { * @enum {number} */ proto.hold.InvoiceState = { - INVOICE_UNPAID: 0, - INVOICE_ACCEPTED: 1, - INVOICE_PAID: 2, - INVOICE_CANCELLED: 3 -}; - -/** - * @enum {number} - */ -proto.hold.HtlcState = { - HTLC_ACCEPTED: 0, - HTLC_SETTLED: 1, - HTLC_CANCELLED: 2 + UNPAID: 0, + ACCEPTED: 1, + PAID: 2, + CANCELLED: 3 }; goog.object.extend(exports, proto.hold); diff --git a/lib/proto/mpay/mpay_pb.d.ts b/lib/proto/mpay/mpay_pb.d.ts index 2c258fd9..baa3dea4 100644 --- a/lib/proto/mpay/mpay_pb.d.ts +++ b/lib/proto/mpay/mpay_pb.d.ts @@ -166,6 +166,11 @@ export class ListPaymentsRequest extends jspb.Message { getPaymentHash(): string; setPaymentHash(value: string): ListPaymentsRequest; + hasPagination(): boolean; + clearPagination(): void; + getPagination(): PaginationParams | undefined; + setPagination(value?: PaginationParams): ListPaymentsRequest; + getIdentifierCase(): ListPaymentsRequest.IdentifierCase; serializeBinary(): Uint8Array; @@ -182,16 +187,41 @@ export namespace ListPaymentsRequest { export type AsObject = { bolt11: string, paymentHash: string, + pagination?: PaginationParams.AsObject, } export enum IdentifierCase { IDENTIFIER_NOT_SET = 0, BOLT11 = 1, PAYMENT_HASH = 2, + PAGINATION = 3, } } +export class PaginationParams extends jspb.Message { + getOffset(): number; + setOffset(value: number): PaginationParams; + getLimit(): number; + setLimit(value: number): PaginationParams; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PaginationParams.AsObject; + static toObject(includeInstance: boolean, msg: PaginationParams): PaginationParams.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PaginationParams, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PaginationParams; + static deserializeBinaryFromReader(message: PaginationParams, reader: jspb.BinaryReader): PaginationParams; +} + +export namespace PaginationParams { + export type AsObject = { + offset: number, + limit: number, + } +} + export class ListPaymentsResponse extends jspb.Message { clearPaymentsList(): void; getPaymentsList(): Array; diff --git a/lib/proto/mpay/mpay_pb.js b/lib/proto/mpay/mpay_pb.js index d8fcd9a4..14df0570 100644 --- a/lib/proto/mpay/mpay_pb.js +++ b/lib/proto/mpay/mpay_pb.js @@ -33,6 +33,7 @@ goog.exportSymbol('proto.mpay.ListPaymentsResponse', null, global); goog.exportSymbol('proto.mpay.ListPaymentsResponse.Payment', null, global); goog.exportSymbol('proto.mpay.ListPaymentsResponse.Payment.Attempt', null, global); goog.exportSymbol('proto.mpay.ListPaymentsResponse.Payment.Attempt.Hop', null, global); +goog.exportSymbol('proto.mpay.PaginationParams', null, global); goog.exportSymbol('proto.mpay.PayRequest', null, global); goog.exportSymbol('proto.mpay.PayResponse', null, global); goog.exportSymbol('proto.mpay.ResetPathMemoryRequest', null, global); @@ -184,6 +185,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.mpay.ListPaymentsRequest.displayName = 'proto.mpay.ListPaymentsRequest'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.mpay.PaginationParams = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mpay.PaginationParams, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mpay.PaginationParams.displayName = 'proto.mpay.PaginationParams'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -1345,7 +1367,7 @@ proto.mpay.GetRoutesResponse.prototype.clearRoutesMap = function() { * @private {!Array>} * @const */ -proto.mpay.ListPaymentsRequest.oneofGroups_ = [[1,2]]; +proto.mpay.ListPaymentsRequest.oneofGroups_ = [[1,2,3]]; /** * @enum {number} @@ -1353,7 +1375,8 @@ proto.mpay.ListPaymentsRequest.oneofGroups_ = [[1,2]]; proto.mpay.ListPaymentsRequest.IdentifierCase = { IDENTIFIER_NOT_SET: 0, BOLT11: 1, - PAYMENT_HASH: 2 + PAYMENT_HASH: 2, + PAGINATION: 3 }; /** @@ -1395,7 +1418,8 @@ proto.mpay.ListPaymentsRequest.prototype.toObject = function(opt_includeInstance proto.mpay.ListPaymentsRequest.toObject = function(includeInstance, msg) { var f, obj = { bolt11: jspb.Message.getFieldWithDefault(msg, 1, ""), - paymentHash: jspb.Message.getFieldWithDefault(msg, 2, "") + paymentHash: jspb.Message.getFieldWithDefault(msg, 2, ""), + pagination: (f = msg.getPagination()) && proto.mpay.PaginationParams.toObject(includeInstance, f) }; if (includeInstance) { @@ -1440,6 +1464,11 @@ proto.mpay.ListPaymentsRequest.deserializeBinaryFromReader = function(msg, reade var value = /** @type {string} */ (reader.readString()); msg.setPaymentHash(value); break; + case 3: + var value = new proto.mpay.PaginationParams; + reader.readMessage(value,proto.mpay.PaginationParams.deserializeBinaryFromReader); + msg.setPagination(value); + break; default: reader.skipField(); break; @@ -1483,6 +1512,14 @@ proto.mpay.ListPaymentsRequest.serializeBinaryToWriter = function(message, write f ); } + f = message.getPagination(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.mpay.PaginationParams.serializeBinaryToWriter + ); + } }; @@ -1558,6 +1595,203 @@ proto.mpay.ListPaymentsRequest.prototype.hasPaymentHash = function() { }; +/** + * optional PaginationParams pagination = 3; + * @return {?proto.mpay.PaginationParams} + */ +proto.mpay.ListPaymentsRequest.prototype.getPagination = function() { + return /** @type{?proto.mpay.PaginationParams} */ ( + jspb.Message.getWrapperField(this, proto.mpay.PaginationParams, 3)); +}; + + +/** + * @param {?proto.mpay.PaginationParams|undefined} value + * @return {!proto.mpay.ListPaymentsRequest} returns this +*/ +proto.mpay.ListPaymentsRequest.prototype.setPagination = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.mpay.ListPaymentsRequest.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.mpay.ListPaymentsRequest} returns this + */ +proto.mpay.ListPaymentsRequest.prototype.clearPagination = function() { + return this.setPagination(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.mpay.ListPaymentsRequest.prototype.hasPagination = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.mpay.PaginationParams.prototype.toObject = function(opt_includeInstance) { + return proto.mpay.PaginationParams.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mpay.PaginationParams} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mpay.PaginationParams.toObject = function(includeInstance, msg) { + var f, obj = { + offset: jspb.Message.getFieldWithDefault(msg, 1, 0), + limit: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.mpay.PaginationParams} + */ +proto.mpay.PaginationParams.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mpay.PaginationParams; + return proto.mpay.PaginationParams.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mpay.PaginationParams} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mpay.PaginationParams} + */ +proto.mpay.PaginationParams.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setOffset(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mpay.PaginationParams.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mpay.PaginationParams.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mpay.PaginationParams} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mpay.PaginationParams.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOffset(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getLimit(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } +}; + + +/** + * optional uint64 offset = 1; + * @return {number} + */ +proto.mpay.PaginationParams.prototype.getOffset = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.mpay.PaginationParams} returns this + */ +proto.mpay.PaginationParams.prototype.setOffset = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 limit = 2; + * @return {number} + */ +proto.mpay.PaginationParams.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.mpay.PaginationParams} returns this + */ +proto.mpay.PaginationParams.prototype.setLimit = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + /** * List of repeated fields within this message type. diff --git a/package-lock.json b/package-lock.json index 44d611a5..708b7379 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5954,6 +5954,21 @@ "dev": true, "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "license": "MIT", @@ -9105,11 +9120,13 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { diff --git a/package.json b/package.json index 4e55f644..b9d567ec 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,11 @@ "description": "Backend of Boltz", "main": "dist/lib/Boltz.js", "scripts": { - "postinstall": "npm run precompile", + "postinstall": "node parseGitCommit.js", "proto": "node protos.js", - "precompile": "node parseGitCommit.js", "compile": "npm run compile:rust && npm run compile:typescript", "compile:release": "npm run compile:rust:release && npm run compile:typescript", - "compile:typescript": "npm run swagger && tsc && cross-os postcompile", + "compile:typescript": "node parseGitCommit.js && npm run swagger && tsc && cross-os postcompile", "compile:rust": "cd boltzr && cargo build", "compile:rust:release": "cd boltzr && cargo build --release", "swagger": "node swagger.js", @@ -31,7 +30,7 @@ "docker:solidity:fund": "./bin/boltz-ethereum send 100000000000 && ./bin/boltz-ethereum send 1000000000 --token", "docker:start": "npm run docker:regtest && npm run docker:solidity && npm run docker:solidity:deploy && npm run docker:solidity:fund", "docker:python:install": "docker exec regtest bash /root/poetry-install.sh", - "docker:cln:hold": "docker exec regtest lightning-cli plugin start /root/hold.sh", + "docker:cln:hold": "cd hold && cargo build && cp target/debug/hold ../docker/regtest/data/cln/plugins && docker exec regtest lightning-cli plugin start /root/.lightning/plugins/hold && docker exec regtest chmod -R 777 /root/.lightning/regtest/hold", "docker:cln:mpay": "docker exec regtest lightning-cli plugin start /root/mpay.sh", "docker:cln:plugins": "npm run docker:cln:hold && npm run docker:cln:mpay", "docker:stop": "docker kill regtest && docker rm regtest && docker kill anvil && docker rm anvil", @@ -43,7 +42,7 @@ "changelog": "git-cliff -o CHANGELOG.md", "prepublishOnly": "npm run compile && rm -f dist/package.json", "python:install": "cd tools && poetry install", - "python:proto": "cd tools && poetry run python -m grpc_tools.protoc -I plugins/hold/protos --python_out=plugins/hold/protos --pyi_out=plugins/hold/protos --grpc_python_out=plugins/hold/protos plugins/hold/protos/hold.proto && poetry run python -m grpc_tools.protoc -I plugins/mpay/protos --python_out=plugins/mpay/protos --pyi_out=plugins/mpay/protos --grpc_python_out=plugins/mpay/protos plugins/mpay/protos/mpay.proto", + "python:proto": "cd tools && poetry run python -m grpc_tools.protoc -I plugins/mpay/protos --python_out=plugins/mpay/protos --pyi_out=plugins/mpay/protos --grpc_python_out=plugins/mpay/protos plugins/mpay/protos/mpay.proto", "python:lint": "cd tools && poetry run ruff check . ../docker", "python:format": "cd tools && poetry run ruff format . ../docker", "python:test": "cd tools && poetry run pytest" diff --git a/protos.js b/protos.js index b8717ee7..ea0b9570 100644 --- a/protos.js +++ b/protos.js @@ -2,7 +2,7 @@ const path = require('path'); const childProcess = require('child_process'); const protoDir = path.join(__dirname, 'proto'); -const protoDirHold = path.join(__dirname, 'tools/plugins/hold/protos'); +const protoDirHold = path.join(__dirname, 'hold/protos'); const protoDirMpay = path.join(__dirname, 'tools/plugins/mpay/protos'); const protoDirSidecar = path.join(__dirname, 'boltzr/protos'); diff --git a/test/integration/lightning/cln/Router.spec.ts b/test/integration/lightning/cln/Router.spec.ts new file mode 100644 index 00000000..a72a6657 --- /dev/null +++ b/test/integration/lightning/cln/Router.spec.ts @@ -0,0 +1,47 @@ +import { getRoute } from '../../../../lib/lightning/cln/Router'; +import { bitcoinClient, bitcoinLndClient, clnClient } from '../../Nodes'; + +describe('Router', () => { + beforeAll(async () => { + await bitcoinClient.generate(1); + await Promise.all([ + clnClient.connect(false), + bitcoinLndClient.connect(false), + ]); + }); + + afterAll(() => { + clnClient.removeAllListeners(); + clnClient.disconnect(); + bitcoinLndClient.disconnect(); + }); + + describe('getRoute', () => { + test.each` + cltv + ${9} + ${21} + ${160} + `('should handle final CLTV $cltv', async ({ cltv }) => { + const { pubkey } = await bitcoinLndClient.getInfo(); + + const route = await getRoute( + clnClient['unaryNodeCall'], + pubkey, + 10_000, + undefined, + cltv, + ); + expect(route.ctlv).toEqual(cltv); + expect(route.feesMsat).toEqual(0); + }); + + test('should throw error when there is no route', async () => { + const { pubkey } = await bitcoinLndClient.getInfo(); + + await expect( + getRoute(clnClient['unaryNodeCall'], pubkey, 1, 0), + ).rejects.toEqual(expect.anything()); + }); + }); +}); diff --git a/tools/plugins/hold/__init__.py b/tools/plugins/hold/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/plugins/hold/config.py b/tools/plugins/hold/config.py deleted file mode 100644 index aa98d8df..00000000 --- a/tools/plugins/hold/config.py +++ /dev/null @@ -1,34 +0,0 @@ -from typing import Any - -from pyln.client import Plugin -from strenum import StrEnum - -from plugins.hold.consts import GRPC_HOST_REGTEST, PLUGIN_NAME, Network - - -class OptionKeys(StrEnum): - GrpcHost = f"{PLUGIN_NAME}-grpc-host" - GrpcPort = f"{PLUGIN_NAME}-grpc-port" - - -class OptionDefaults(StrEnum): - GrpcHost = "127.0.0.1" - GrpcPort = "9292" - - -def register_options(pl: Plugin) -> None: - pl.add_option(OptionKeys.GrpcHost, OptionDefaults.GrpcHost, "hold gRPC host") - pl.add_option(OptionKeys.GrpcPort, OptionDefaults.GrpcPort, "hold gRPC port") - - -class Config: - grpc_host: str - grpc_port: int - - def __init__(self, pl: Plugin, configuration: dict[str, Any]) -> None: - self.grpc_host = ( - configuration[OptionKeys.GrpcHost] - if pl.rpc.getinfo()["network"] != Network.Regtest - else GRPC_HOST_REGTEST - ) - self.grpc_port = int(configuration[OptionKeys.GrpcPort]) diff --git a/tools/plugins/hold/consts.py b/tools/plugins/hold/consts.py deleted file mode 100644 index 80587970..00000000 --- a/tools/plugins/hold/consts.py +++ /dev/null @@ -1,21 +0,0 @@ -from strenum import StrEnum - - -class Network(StrEnum): - Mainnet = "bitcoin" - Testnet = "testnet" - Signet = "signet" - Regtest = "regtest" - - -PLUGIN_NAME = "hold" -VERSION = "0.0.5" - -TIMEOUT_CANCEL = 60 -TIMEOUT_CANCEL_REGTEST = 5 - -TIMEOUT_CHECK_INTERVAL = 10 - -GRPC_HOST_REGTEST = "0.0.0.0" # noqa: S104 - -OVERPAYMENT_FACTOR = 2 diff --git a/tools/plugins/hold/datastore.py b/tools/plugins/hold/datastore.py deleted file mode 100644 index e5f11689..00000000 --- a/tools/plugins/hold/datastore.py +++ /dev/null @@ -1,85 +0,0 @@ -from enum import Enum -from typing import Any - -from pyln.client import Plugin, RpcError - -from plugins.hold.consts import PLUGIN_NAME -from plugins.hold.invoice import HoldInvoice -from plugins.hold.settler import Settler - - -class DataErrorCodes(int, Enum): - KeyDoesNotExist = 1200 - KeyExists = 1202 - - -class DataStore: - _plugin: Plugin - _settler: Settler - _invoices_key = "invoices" - - def __init__(self, plugin: Plugin, settler: Settler) -> None: - self._plugin = plugin - self._settler = settler - - def save_invoice(self, invoice: HoldInvoice, mode: str = "must-create") -> None: - self._plugin.rpc.datastore( - key=[PLUGIN_NAME, DataStore._invoices_key, invoice.payment_hash], - string=invoice.to_json(), - mode=mode, - ) - - def list_invoices(self, payment_hash: str | None) -> list[HoldInvoice]: - key = [PLUGIN_NAME, DataStore._invoices_key] - if payment_hash is not None: - key.append(payment_hash) - - return self._parse_invoices( - self._plugin.rpc.listdatastore( - key=key, - ) - ) - - def get_invoice(self, payment_hash: str) -> HoldInvoice | None: - invoices = self.list_invoices(payment_hash) - if len(invoices) == 0: - return None - - return invoices[0] - - def delete_invoice(self, payment_hash: str) -> bool: - try: - self._plugin.rpc.deldatastore( - [PLUGIN_NAME, DataStore._invoices_key, payment_hash], - ) - except RpcError as e: - # noinspection PyTypeChecker - if e.error["code"] == DataErrorCodes.KeyDoesNotExist: - return False - - raise - - return True - - def settle_invoice(self, invoice: HoldInvoice, preimage: str) -> None: - # TODO: save in the normal invoice table of CLN - invoice.payment_preimage = preimage - self._settler.settle(invoice) - self.save_invoice(invoice, mode="must-replace") - - def cancel_invoice(self, invoice: HoldInvoice) -> None: - self._settler.cancel(invoice) - self.save_invoice(invoice, mode="must-replace") - - def delete_invoices(self) -> int: - key = [PLUGIN_NAME, DataStore._invoices_key] - invoices = self._plugin.rpc.listdatastore(key=key)["datastore"] - for invoice in invoices: - # TODO: also cancel? - self._plugin.rpc.deldatastore(invoice["key"]) - - return len(invoices) - - @staticmethod - def _parse_invoices(data: dict[str, Any]) -> list[HoldInvoice]: - return [HoldInvoice.from_json(i["string"]) for i in data["datastore"]] diff --git a/tools/plugins/hold/encoder.py b/tools/plugins/hold/encoder.py deleted file mode 100644 index 61726c9c..00000000 --- a/tools/plugins/hold/encoder.py +++ /dev/null @@ -1,108 +0,0 @@ -import random -from enum import Enum - -from bolt11 import Bolt11, Feature, Features, FeatureState, encode -from bolt11.models.tags import Tag -from bolt11.types import MilliSatoshi, RouteHint, TagChar, Tags -from pyln.client import Plugin -from secp256k1 import PrivateKey - -from plugins.hold.consts import Network -from plugins.hold.utils import time_now - -NETWORK_PREFIXES = { - Network.Mainnet: "bc", - Network.Testnet: "tb", - Network.Signet: "tbs", - Network.Regtest: "bcrt", -} - - -class Defaults(int, Enum): - Expiry = 3600 - MinFinalCltvExpiry = 80 - - -def get_network_prefix(network: str) -> str: - # noinspection PyTypeChecker - return ( - NETWORK_PREFIXES[network] - if network in NETWORK_PREFIXES - else NETWORK_PREFIXES[Network.Mainnet] - ) - - -def get_payment_secret(val: str | None) -> str: - return val if val is not None else random.randbytes(32).hex() - - -class Encoder: - _pl: Plugin - _prefix: str - _features: Features - - # Random key to make the bolt11 library work; - # the node signs the invoice again with its key - _key = PrivateKey().serialize() - - def __init__(self, pl: Plugin) -> None: - self._pl = pl - - def init(self) -> None: - info = self._pl.rpc.getinfo() - self._prefix = get_network_prefix(info["network"]) - - # TODO: parse from CLN - self._features = Features.from_feature_list( - { - Feature.var_onion_optin: FeatureState.required, - Feature.payment_secret: FeatureState.required, - Feature.basic_mpp: FeatureState.supported, - Feature.option_route_blinding: FeatureState.supported, - } - ) - - def encode( - self, - payment_hash: str, - amount_msat: int, - description: str | None = None, - description_hash: str | None = None, - expiry: int = Defaults.Expiry, - min_final_cltv_expiry: int = Defaults.MinFinalCltvExpiry, - payment_secret: str | None = None, - route_hints: list[RouteHint] | None = None, - ) -> str: - tags = Tags( - [ - Tag(TagChar.payment_hash, payment_hash), - Tag(TagChar.expire_time, expiry), - Tag(TagChar.min_final_cltv_expiry, min_final_cltv_expiry), - Tag(TagChar.payment_secret, get_payment_secret(payment_secret)), - Tag(TagChar.features, self._features), - ] - ) - - if route_hints is not None: - tags.tags.extend([Tag(TagChar.route_hint, route) for route in route_hints]) - - if description_hash is not None and description_hash != "": - if len(description_hash) != 64: - msg = "description_hash must be 64 bytes" - raise ValueError(msg) - - tags.tags.extend([Tag(TagChar.description_hash, description_hash)]) - else: - tags.tags.extend( - [Tag(TagChar.description, description if description is not None else "")] - ) - - return encode( - Bolt11( - self._prefix, - int(time_now().timestamp()), - tags, - MilliSatoshi(amount_msat), - ), - self._key, - ) diff --git a/tools/plugins/hold/enums.py b/tools/plugins/hold/enums.py deleted file mode 100644 index 966b5025..00000000 --- a/tools/plugins/hold/enums.py +++ /dev/null @@ -1,35 +0,0 @@ -from strenum import StrEnum - - -class HtlcFailureMessage(StrEnum): - MppTimeout = "0017" - IncorrectPaymentDetails = "400F" - - -class HtlcState(StrEnum): - Paid = "paid" - Accepted = "accepted" - Cancelled = "cancelled" - - -class InvoiceState(StrEnum): - Paid = "paid" - Unpaid = "unpaid" - Accepted = "accepted" - Cancelled = "cancelled" - - -POSSIBLE_STATE_TRANSITIONS = { - InvoiceState.Paid: [], - InvoiceState.Cancelled: [], - InvoiceState.Accepted: [ - InvoiceState.Cancelled, - InvoiceState.Paid, - InvoiceState.Accepted, - ], - InvoiceState.Unpaid: [InvoiceState.Accepted, InvoiceState.Cancelled], -} - - -def invoice_state_final(state: InvoiceState) -> bool: - return len(POSSIBLE_STATE_TRANSITIONS[state]) == 0 diff --git a/tools/plugins/hold/errors.py b/tools/plugins/hold/errors.py deleted file mode 100644 index e34a2f74..00000000 --- a/tools/plugins/hold/errors.py +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Any, ClassVar - - -class Errors: - invoice_exists: ClassVar[dict[str, Any]] = { - "code": 2101, - "message": "hold invoice with that payment hash exists already", - } - invoice_not_exists: ClassVar[dict[str, Any]] = { - "code": 2102, - "message": "hold invoice with that payment hash does not exist", - } - not_route: ClassVar[dict[str, Any]] = { - "code": 2103, - "message": "no route found", - } - invalid_payment_hash_length: ClassVar[dict[str, Any]] = { - "code": 2104, - "message": "invalid payment hash length", - } diff --git a/tools/plugins/hold/hold.py b/tools/plugins/hold/hold.py deleted file mode 100644 index 2ed46b2d..00000000 --- a/tools/plugins/hold/hold.py +++ /dev/null @@ -1,131 +0,0 @@ -import hashlib - -from bolt11.types import RouteHint -from pyln.client import Plugin, RpcError - -from plugins.hold.datastore import DataErrorCodes, DataStore -from plugins.hold.encoder import Encoder -from plugins.hold.htlc_handler import HtlcHandler -from plugins.hold.invoice import HoldInvoice, Htlcs, InvoiceState -from plugins.hold.route_hints import RouteHints -from plugins.hold.router import Router -from plugins.hold.settler import Settler -from plugins.hold.tracker import Tracker -from plugins.hold.utils import time_now - - -class InvoiceExistsError(Exception): - pass - - -class NoSuchInvoiceError(Exception): - pass - - -class InvalidPaymentHashLengthError(Exception): - pass - - -class Hold: - def __init__(self, plugin: Plugin) -> None: - self._plugin = plugin - self.tracker = Tracker() - self._settler = Settler(self.tracker) - self._encoder = Encoder(plugin) - self._route_hints = RouteHints(plugin) - - self.router = Router(plugin) - self.ds = DataStore(plugin, self._settler) - self.handler = HtlcHandler(plugin, self.ds, self._settler, self.tracker) - - def init(self) -> None: - self.handler.init() - self._encoder.init() - - def invoice( - self, - payment_hash: str, - amount_msat: int, - description: str | None, - description_hash: str | None, - expiry: int | None, - min_final_cltv_expiry: int | None, - route_hints: list[RouteHint] | None = None, - ) -> str: - if len(payment_hash) != 64: - raise InvalidPaymentHashLengthError - - if len(self._plugin.rpc.listinvoices(payment_hash=payment_hash)["invoices"]) > 0: - raise InvoiceExistsError - - bolt11 = self._encoder.encode( - payment_hash, - amount_msat, - description, - description_hash, - expiry, - min_final_cltv_expiry, - route_hints=route_hints, - ) - signed = self._plugin.rpc.call( - "signinvoice", - { - "invstring": bolt11, - }, - )["bolt11"] - - try: - hi = HoldInvoice( - state=InvoiceState.Unpaid, - bolt11=signed, - amount_msat=amount_msat, - payment_hash=payment_hash, - payment_preimage=None, - htlcs=Htlcs(), - created_at=time_now(), - ) - self.ds.save_invoice(hi) - self.tracker.send_update(hi.payment_hash, hi.bolt11, hi.state) - self._plugin.log(f"Added hold invoice {payment_hash} for {amount_msat}") - except RpcError as e: - # noinspection PyTypeChecker - if e.error["code"] == DataErrorCodes.KeyExists: - raise InvoiceExistsError from None - - raise - - return signed - - def settle(self, payment_preimage: str) -> None: - payment_hash = hashlib.sha256(bytes.fromhex(payment_preimage)).hexdigest() - invoice = self.ds.get_invoice(payment_hash) - if invoice is None: - raise NoSuchInvoiceError - - self.ds.settle_invoice(invoice, payment_preimage) - self._plugin.log(f"Settled hold invoice {payment_hash}") - - def cancel(self, payment_hash: str) -> None: - invoice = self.ds.get_invoice(payment_hash) - if invoice is None: - raise NoSuchInvoiceError - - self.ds.cancel_invoice(invoice) - self._plugin.log(f"Cancelled hold invoice {payment_hash}") - - def list_invoices(self, payment_hash: str | None) -> list[HoldInvoice]: - return self.ds.list_invoices(None if payment_hash == "" else payment_hash) - - def wipe(self, payment_hash: str | None) -> int: - if payment_hash is None or payment_hash == "": - self._plugin.log("Deleting all hold invoices", level="warn") - return self.ds.delete_invoices() - - if self.ds.delete_invoice(payment_hash): - self._plugin.log(f"Deleted hold invoice {payment_hash}", level="warn") - return 1 - - raise NoSuchInvoiceError - - def get_private_channels(self, node: str) -> list[RouteHint]: - return self._route_hints.get_private_channels(node) diff --git a/tools/plugins/hold/htlc_handler.py b/tools/plugins/hold/htlc_handler.py deleted file mode 100644 index 3f3b2521..00000000 --- a/tools/plugins/hold/htlc_handler.py +++ /dev/null @@ -1,181 +0,0 @@ -import threading -from typing import Any, Callable -from urllib.request import Request - -from pyln.client import Plugin - -from plugins.hold.consts import ( - OVERPAYMENT_FACTOR, - TIMEOUT_CANCEL, - TIMEOUT_CANCEL_REGTEST, - TIMEOUT_CHECK_INTERVAL, - Network, -) -from plugins.hold.datastore import DataStore -from plugins.hold.enums import HtlcState -from plugins.hold.invoice import HoldInvoice, Htlc, InvoiceState -from plugins.hold.settler import HtlcFailureMessage, Settler -from plugins.hold.tracker import Tracker - - -class HtlcHandler: - lock = threading.Lock() - - _interval_thread: threading.Thread - _stop_timeout_interval: threading.Event - - _plugin: Plugin - _ds: DataStore - _settler: Settler - - def __init__(self, plugin: Plugin, ds: DataStore, settler: Settler, tracker: Tracker) -> None: - self._plugin = plugin - self._ds = ds - self._settler = settler - self._tracker = tracker - self._timeout = TIMEOUT_CANCEL - - self._start_timeout_interval() - - def init(self) -> None: - if self._plugin.rpc.getinfo()["network"] == Network.Regtest: - self._timeout = TIMEOUT_CANCEL_REGTEST - self._plugin.log( - f"Using regtest MPP timeout of {self._timeout} seconds", - level="warn", - ) - - def stop(self) -> None: - self._stop_timeout_interval.set() - self._interval_thread.join() - - def handle_htlc( - self, - invoice: HoldInvoice, - htlc_dict: dict[str, str | int], - onion: dict[str, Any], - request: Request, - ) -> None: - # TODO: test restart handling accept/settle already accepted/settled invoices - - dec = self._plugin.rpc.decodepay(invoice.bolt11) - - htlc = Htlc.from_dict(htlc_dict) - - if invoice.htlcs.is_known(htlc): - self.handle_known_htlc( - invoice, - invoice.htlcs.find_htlc(htlc.short_channel_id, htlc.channel_id), - request, - ) - return - - invoice.htlcs.add_htlc(htlc) - - if htlc_dict["cltv_expiry_relative"] < dec["min_final_cltv_expiry"]: - self._log_htlc_rejected( - invoice, - htlc, - f"CLTV too little ({htlc_dict['cltv_expiry_relative']} < " - f"{dec['min_final_cltv_expiry']})", - ) - # TODO: use incorrect_cltv_expiry or expiry_too_soon error? - self._fail_and_save_htlc(request, invoice, htlc) - return - - if "payment_secret" not in onion or onion["payment_secret"] != dec["payment_secret"]: - self._log_htlc_rejected( - invoice, - htlc, - "incorrect payment secret", - ) - self._fail_and_save_htlc(request, invoice, htlc) - return - - if invoice.state != InvoiceState.Unpaid: - self._log_htlc_rejected(invoice, htlc, f"invoice is in state {invoice.state}") - self._fail_and_save_htlc(request, invoice, htlc) - return - - if invoice.amount_msat * OVERPAYMENT_FACTOR < invoice.sum_paid(): - self._log_htlc_rejected( - invoice, - htlc, - f"overpayment protection; " - f"{invoice.sum_paid()} > {invoice.amount_msat * OVERPAYMENT_FACTOR}", - ) - self._fail_and_save_htlc(request, invoice, htlc) - return - - self._settler.add_htlc(invoice.payment_hash, request, htlc) - - if not invoice.is_fully_paid(): - self._ds.save_invoice(invoice, mode="must-replace") - return - - invoice.set_state(self._tracker, InvoiceState.Accepted) - self._ds.save_invoice(invoice, mode="must-replace") - self._plugin.log( - f"Accepted hold invoice {invoice.payment_hash} " f"with {len(invoice.htlcs)} HTLCs", - ) - - def handle_known_htlc(self, invoice: HoldInvoice, htlc: Htlc, request: Request) -> None: - if htlc.state == HtlcState.Accepted: - # Pass the request to the settler to handle in the future - self._settler.add_htlc(invoice.payment_hash, request, htlc) - - elif htlc.state == HtlcState.Paid: - Settler.settle_callback(request, invoice.payment_preimage) - - elif htlc.state == HtlcState.Cancelled: - Settler.fail_callback(request, HtlcFailureMessage.IncorrectPaymentDetails) - - def _start_timeout_interval(self) -> None: - self._stop_timeout_interval = threading.Event() - - def loop() -> None: - while not self._stop_timeout_interval.wait(TIMEOUT_CHECK_INTERVAL): - self._timeout_handler() - - self._interval_thread = threading.Thread(target=loop) - self._interval_thread.start() - - def _timeout_handler(self) -> None: - with self.lock: - for payment_hash in self._settler.pending_payment_hashes(): - invoice = self._ds.get_invoice(payment_hash) - - if invoice is not None and not invoice.is_fully_paid(): - invoice.htlcs.cancel_expired( - self._timeout, self._fail_expired_callback(invoice) - ) - self._ds.save_invoice(invoice, mode="must-replace") - - def _fail_expired_callback( - self, invoice: HoldInvoice - ) -> Callable[[Htlc, HtlcFailureMessage], None]: - def callback(htlc: Htlc, message: HtlcFailureMessage) -> None: - request = self._settler.find_htlc_request(invoice.payment_hash, htlc) - if request is not None: - Settler.fail_callback(request, message) - self._settler.remove_htlc(invoice.payment_hash, htlc) - - return callback - - def _fail_and_save_htlc( - self, - request: Request, - invoice: HoldInvoice, - htlc: Htlc, - message: HtlcFailureMessage = HtlcFailureMessage.IncorrectPaymentDetails, - ) -> None: - Settler.fail_callback(request, message) - - htlc.state = HtlcState.Cancelled - self._ds.save_invoice(invoice, mode="must-replace") - - def _log_htlc_rejected(self, invoice: HoldInvoice, htlc: Htlc, msg: str) -> None: - self._plugin.log( - f"Rejected HTLC {htlc.identifier} for hold invoice {invoice.payment_hash}: {msg}", - level="warn", - ) diff --git a/tools/plugins/hold/invoice.py b/tools/plugins/hold/invoice.py deleted file mode 100644 index 70b3a8e4..00000000 --- a/tools/plugins/hold/invoice.py +++ /dev/null @@ -1,194 +0,0 @@ -import json -from dataclasses import dataclass -from datetime import date, datetime, timezone -from enum import Enum -from json import JSONEncoder -from typing import Any, Callable, TypeVar - -import bolt11 - -from plugins.hold.enums import ( - POSSIBLE_STATE_TRANSITIONS, - HtlcFailureMessage, - HtlcState, - InvoiceState, -) -from plugins.hold.tracker import Tracker -from plugins.hold.utils import time_now - -HtlcType = TypeVar("HtlcType", bound="Htlc") - - -@dataclass -class Htlc: - state: HtlcState - short_channel_id: str - channel_id: int - msat: int - created_at: datetime - - @property - def identifier(self) -> str: - return f"{self.short_channel_id}/{self.channel_id}" - - def to_dict(self) -> dict[str, Any]: - return { - k: int(v.timestamp()) if isinstance(v, datetime) else v - for k, v in self.__dict__.items() - } - - @classmethod - def from_dict(cls: type[HtlcType], htlc_dict: dict[str, Any]) -> HtlcType: - return Htlc( - state=HtlcState.Accepted, - short_channel_id=htlc_dict["short_channel_id"], - channel_id=htlc_dict["id"], - msat=htlc_dict["amount_msat"], - created_at=time_now(), - ) - - @classmethod - def from_json_dict(cls: type[HtlcType], json_dict: dict[str, Any]) -> HtlcType: - json_dict["created_at"] = datetime.fromtimestamp(json_dict["created_at"], tz=timezone.utc) - - return cls(**json_dict) - - -HtlcsType = TypeVar("HtlcsType", bound="Htlcs") - - -class Htlcs: - htlcs: list[Htlc] - - def __init__(self) -> None: - self.htlcs = [] - - def __len__(self) -> int: - """Return the number of accepted HTLCs.""" - return len([h.msat for h in self.htlcs if h.state in HtlcState.Accepted]) - - def add_htlc(self, htlc: Htlc) -> None: - self.htlcs.append(htlc) - - def is_known(self, htlc: Htlc) -> bool: - return self.find_htlc(htlc.short_channel_id, htlc.channel_id) is not None - - def find_htlc(self, short_channel_id: str, channel_id: int) -> Htlc | None: - return next( - ( - htlc - for htlc in self.htlcs - if htlc.short_channel_id == short_channel_id and htlc.channel_id == channel_id - ), - None, - ) - - def cancel_expired( - self, - expiry: int, - fail_callback: Callable[[Htlc, HtlcFailureMessage], None], - ) -> None: - for htlc in self.htlcs: - if not (time_now() - htlc.created_at).total_seconds() > expiry: - continue - - htlc.state = HtlcState.Cancelled - fail_callback(htlc, HtlcFailureMessage.MppTimeout) - - @classmethod - def from_json_arr(cls: type[HtlcsType], json_arr: list[Any]) -> HtlcsType: - htlcs = cls() - htlcs.htlcs = [Htlc.from_json_dict(entry) for entry in json_arr] - - return htlcs - - -class HoldInvoiceStateError(ValueError): - def __init__(self, old_state: InvoiceState, new_state: InvoiceState) -> None: - msg = f"illegal hold invoice state transition ({old_state} -> {new_state})" - super(ValueError, self).__init__(msg) - - self.error = { - "code": 2103, - "message": msg, - } - - -class HoldInvoiceEncoder(JSONEncoder): - def default(self, obj: object) -> str | int | list | None: - if isinstance(obj, (date, datetime)): - return int(obj.timestamp()) - - if isinstance(obj, Enum): - return obj.value - - if isinstance(obj, Htlcs): - return [htlc.to_dict() for htlc in obj.htlcs] - - return None - - -HoldInvoiceType = TypeVar("HoldInvoiceType", bound="HoldInvoice") - - -@dataclass -class HoldInvoice: - state: InvoiceState - bolt11: str - amount_msat: int - payment_hash: str - payment_preimage: str | None - created_at: datetime - htlcs: Htlcs - - def set_state(self, tracker: Tracker, new_state: InvoiceState) -> None: - if self.state == new_state: - return - - if new_state not in POSSIBLE_STATE_TRANSITIONS[self.state]: - raise HoldInvoiceStateError(self.state, new_state) - - self.state = new_state - tracker.send_update(self.payment_hash, self.bolt11, self.state) - - def is_fully_paid(self) -> bool: - return self.amount_msat <= self.sum_paid() - - def sum_paid(self) -> int: - return sum( - h.msat for h in self.htlcs.htlcs if h.state in [HtlcState.Paid, HtlcState.Accepted] - ) - - def to_json(self) -> str: - return json.dumps( - self.__dict__, - cls=HoldInvoiceEncoder, - ) - - def to_dict(self) -> dict[str, Any]: - self_with_htlcs = { - k: v if not isinstance(v, Htlcs) else [htlc.to_dict() for htlc in v.htlcs] - for k, v in self.__dict__.items() - } - - return { - k: int(v.timestamp()) if isinstance(v, datetime) else v - for k, v in self_with_htlcs.items() - } - - @classmethod - def from_json(cls: type[HoldInvoiceType], json_str: str) -> HoldInvoiceType: - json_str = json_str.removeprefix("\\") - - if json_str.endswith("\\}"): - json_str = json_str.removesuffix("\\}") + "}" - - json_dict = json.loads(json_str) - json_dict["created_at"] = datetime.fromtimestamp(json_dict["created_at"], tz=timezone.utc) - - if "amount_msat" not in json_dict: - json_dict["amount_msat"] = bolt11.decode(json_dict["bolt11"]).amount_msat - - json_dict["htlcs"] = Htlcs.from_json_arr(json_dict["htlcs"]) if "htlcs" in json_dict else [] - - return cls(**json_dict) diff --git a/tools/plugins/hold/plugin.py b/tools/plugins/hold/plugin.py deleted file mode 100755 index a3004d95..00000000 --- a/tools/plugins/hold/plugin.py +++ /dev/null @@ -1,240 +0,0 @@ -#!/usr/bin/env python3 -import contextlib -import sys -from typing import Any - -import bolt11 -from bolt11.exceptions import Bolt11Bech32InvalidException -from consts import ( - PLUGIN_NAME, - VERSION, -) -from pyln.client import Plugin -from pyln.client.plugin import Request - -from plugins.hold.config import Config, register_options -from plugins.hold.encoder import Defaults -from plugins.hold.errors import Errors -from plugins.hold.hold import ( - Hold, - InvalidPaymentHashLengthError, - InvoiceExistsError, - NoSuchInvoiceError, -) -from plugins.hold.invoice import HoldInvoiceStateError -from plugins.hold.router import NoRouteError -from plugins.hold.server import Server -from plugins.hold.settler import Settler -from plugins.hold.transformers import Transformers - -empty_value = ["", "none", "null", None] - -pl = Plugin() -hold = Hold(pl) -server = Server(pl, hold) - -register_options(pl) - - -@pl.init() -def init( - options: dict[str, Any], - configuration: dict[str, Any], - plugin: Plugin, - **kwargs: dict[str, Any], -) -> None: - cfg = Config(plugin, options) - hold.init() - - if cfg.grpc_port != -1: - server.start(cfg.grpc_host, cfg.grpc_port, configuration["lightning-dir"]) - else: - plugin.log("Not starting gRPC server") - - pl.log(f"Plugin {PLUGIN_NAME} v{VERSION} initialized") - - -@pl.method( - method_name="holdinvoice", - category=PLUGIN_NAME, -) -def hold_invoice( - plugin: Plugin, - payment_hash: str, - amount_msat: int, - description: str = "", - description_hash: str = "", - expiry: int = Defaults.Expiry, - min_final_cltv_expiry: int = Defaults.MinFinalCltvExpiry, - routing_hints: list[Any] | None = None, -) -> dict[str, Any]: - """Create a new hold invoice.""" - try: - return { - "bolt11": hold.invoice( - payment_hash, - amount_msat, - description, - description_hash, - expiry, - min_final_cltv_expiry, - Transformers.routing_hints_from_json(routing_hints) - if routing_hints is not None - else None, - ), - } - except InvoiceExistsError: - return Errors.invoice_exists - except InvalidPaymentHashLengthError: - return Errors.invalid_payment_hash_length - - -@pl.method( - method_name="listholdinvoices", - category=PLUGIN_NAME, -) -def list_hold_invoices(plugin: Plugin, payment_hash: str = "", invoice: str = "") -> dict[str, Any]: - """List one or more hold invoices.""" - if payment_hash in empty_value and invoice not in empty_value: - payment_hash = bolt11.decode(invoice).payment_hash - elif ( - payment_hash is not None - and len(payment_hash) > 64 - and payment_hash.lower().startswith("ln") - ): - # To allow the first parameter to be the invoice - with contextlib.suppress(Bolt11Bech32InvalidException): - payment_hash = bolt11.decode(payment_hash).payment_hash - - return { - "holdinvoices": [invoice.to_dict() for invoice in hold.list_invoices(payment_hash)], - } - - -@pl.method( - method_name="settleholdinvoice", - category=PLUGIN_NAME, -) -def settle_hold_invoice(plugin: Plugin, payment_preimage: str) -> dict[str, Any]: - """Settle a hold invoice.""" - try: - hold.settle(payment_preimage) - except NoSuchInvoiceError: - return Errors.invoice_not_exists - except HoldInvoiceStateError as e: - return e.error - - return {} - - -@pl.method( - method_name="cancelholdinvoice", - category=PLUGIN_NAME, -) -def cancel_hold_invoice(plugin: Plugin, payment_hash: str) -> dict[str, Any]: - """Cancel a hold invoice.""" - try: - hold.cancel(payment_hash) - except NoSuchInvoiceError: - return Errors.invoice_not_exists - except HoldInvoiceStateError as e: - return e.error - - return {} - - -@pl.method( - method_name="hold-getroute", - category=PLUGIN_NAME, -) -def get_route( - plugin: Plugin, - destination: str, - amount_msat: int, - risk: int = 0, - max_ctlv: int | None = None, - final_cltv_delta: int | None = None, - max_retries: int | None = None, -) -> dict[str, Any]: - """Get a route with less than a specified CLTV.""" - try: - return { - "routes": [ - hop.to_dict() - for hop in hold.router.get_route( - destination, - amount_msat, - risk, - max_ctlv, - final_cltv_delta, - max_retries, - ) - ] - } - except NoRouteError: - return Errors.not_route - - -@pl.method( - method_name="routinghints", - category=PLUGIN_NAME, -) -def get_routing_hints(plugin: Plugin, node: str) -> dict[str, Any]: - """Get routing hints for the unannounced channels of a node.""" - return { - "hints": Transformers.named_tuples_to_dict(hold.get_private_channels(node)), - } - - -@pl.method( - method_name="dev-wipeholdinvoices", - category=PLUGIN_NAME, -) -def wipe_hold_invoices(plugin: Plugin, payment_hash: str = "") -> dict[str, Any]: - """Delete one or more hold invoices from the datastore.""" - try: - return { - "deleted_count": hold.wipe(payment_hash), - } - except NoSuchInvoiceError: - return Errors.invoice_not_exists - - -@pl.async_hook("htlc_accepted") -def on_htlc_accepted( - onion: dict[str, Any], - htlc: dict[str, Any], - request: Request, - plugin: Plugin, - **kwargs: dict[str, Any], -) -> None: - # Ignore forwards - if "forward_to" in kwargs: - Settler.continue_callback(request) - return - - with hold.handler.lock: - invoice = hold.ds.get_invoice(htlc["payment_hash"]) - - # Ignore invoices that aren't hold invoices - if invoice is None: - Settler.continue_callback(request) - return - - hold.handler.handle_htlc(invoice, htlc, onion, request) - - -@pl.subscribe("shutdown") -def shutdown(**kwargs: dict[str, Any]) -> None: - pl.log(f"Plugin {PLUGIN_NAME} stopping") - - if server.is_running(): - server.stop() - - hold.handler.stop() - - pl.log(f"Plugin {PLUGIN_NAME} stopped") - sys.exit(0) - - -pl.run() diff --git a/tools/plugins/hold/protos/__init__.py b/tools/plugins/hold/protos/__init__.py deleted file mode 100644 index 1da1dcf0..00000000 --- a/tools/plugins/hold/protos/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -import sys -from pathlib import Path - -sys.path.insert(0, str(Path(__file__).parent)) diff --git a/tools/plugins/hold/protos/hold.proto b/tools/plugins/hold/protos/hold.proto deleted file mode 100644 index 350e854b..00000000 --- a/tools/plugins/hold/protos/hold.proto +++ /dev/null @@ -1,198 +0,0 @@ -syntax = "proto3"; - -package hold; - -service Hold { - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) {} - - rpc Invoice (InvoiceRequest) returns (InvoiceResponse) {} - rpc RoutingHints (RoutingHintsRequest) returns (RoutingHintsResponse) {} - rpc List (ListRequest) returns (ListResponse) {} - - rpc Settle (SettleRequest) returns (SettleResponse) {} - rpc Cancel (CancelRequest) returns (CancelResponse) {} - - rpc Track (TrackRequest) returns (stream TrackResponse) {} - rpc TrackAll (TrackAllRequest) returns (stream TrackAllResponse) {} - - // Workaround to expose the paystatus command via gRPC, since CLN doesn't - rpc PayStatus (PayStatusRequest) returns (PayStatusResponse) {} - - // Custom algorithm that allows specifying a max delay - rpc GetRoute (GetRouteRequest) returns (GetRouteResponse); -} - -message GetInfoRequest {} -message GetInfoResponse { - string version = 1; -} - -message InvoiceRequest { - string payment_hash = 1; - uint64 amount_msat = 2; - optional string description = 3; - // Takes precedence over description in case both are set - optional string description_hash = 7; - optional uint64 expiry = 4; - optional uint64 min_final_cltv_expiry = 5; - repeated RoutingHint routing_hints = 6; -} -message InvoiceResponse { - string bolt11 = 1; -} - -message RoutingHintsRequest { - string node = 1; -} - -message Hop { - string public_key = 1; - string short_channel_id = 2; - uint64 base_fee = 3; - uint64 ppm_fee = 4; - uint64 cltv_expiry_delta = 5; -} - -message RoutingHint { - repeated Hop hops = 1; -} - -message RoutingHintsResponse { - repeated RoutingHint hints = 1; -} - -message ListRequest { - optional string payment_hash = 1; -} - -enum InvoiceState { - INVOICE_UNPAID = 0; - INVOICE_ACCEPTED = 1; - INVOICE_PAID = 2; - INVOICE_CANCELLED = 3; -} - -enum HtlcState { - HTLC_ACCEPTED = 0; - HTLC_SETTLED = 1; - HTLC_CANCELLED = 2; -} - -message Htlc { - HtlcState state = 1; - uint64 msat = 2; - uint64 created_at = 3; - string short_channel_id = 4; - uint64 id = 5; -} - -message Invoice { - string payment_hash = 1; - optional string payment_preimage = 2; - InvoiceState state = 3; - string bolt11 = 4; - uint64 created_at = 5; - repeated Htlc htlcs = 6; - uint64 amount_msat = 7; -} - -message ListResponse { - repeated Invoice invoices = 1; -} - -message SettleRequest { - string payment_preimage = 1; -} -message SettleResponse {} - -message CancelRequest { - string payment_hash = 1; -} -message CancelResponse {} - -message TrackRequest { - string payment_hash = 1; -} -message TrackResponse { - InvoiceState state = 1; -} - -message TrackAllRequest {} -message TrackAllResponse { - string payment_hash = 1; - string bolt11 = 2; - InvoiceState state = 3; -} - -message PayStatusRequest { - optional string bolt11 = 1; -} - -message PayStatusResponse { - message PayStatus { - message Attempt { - enum AttemptState { - ATTEMPT_PENDING = 0; - ATTEMPT_COMPLETED = 1; - } - - message Success { - uint64 id = 1; - string payment_preimage = 2; - } - - message Failure { - message Data { - uint64 id = 1; - string raw_message = 2; - uint64 fail_code = 3; - string fail_codename = 4; - uint64 erring_index = 5; - string erring_node = 6; - } - - string message = 1; - uint64 code = 2; - optional Data data = 3; - } - - string strategy = 1; - uint64 start_time = 2; - uint64 age_in_seconds = 3; - optional uint64 end_time = 4; - AttemptState state = 5; - optional Success success = 6; - optional Failure failure = 7; - } - - string bolt11 = 1; - uint64 amount_msat = 2; - string destination = 3; - repeated Attempt attempts = 4; - } - - repeated PayStatus status = 1; -} - -message GetRouteRequest { - string destination = 1; - uint64 amount_msat = 2; - uint32 max_retries = 3; - optional uint32 risk_factor = 4; - optional uint64 max_cltv = 5; - optional uint64 final_cltv_delta = 6; -} - -message GetRouteResponse { - message Hop { - string id = 1; - string channel = 2; - uint32 direction = 3; - uint64 amount_msat = 4; - uint64 delay = 5; - string style = 6; - } - - repeated Hop hops = 1; - uint64 fees_msat = 2; -} diff --git a/tools/plugins/hold/protos/hold_pb2.py b/tools/plugins/hold/protos/hold_pb2.py deleted file mode 100644 index 2760f93a..00000000 --- a/tools/plugins/hold/protos/hold_pb2.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: hold.proto -# Protobuf Python Version: 5.26.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nhold.proto\x12\x04hold\"\x10\n\x0eGetInfoRequest\"\"\n\x0fGetInfoResponse\x12\x0f\n\x07version\x18\x01 \x01(\t\"\xa1\x02\n\x0eInvoiceRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\x12\x13\n\x0b\x61mount_msat\x18\x02 \x01(\x04\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1d\n\x10\x64\x65scription_hash\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x65xpiry\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\"\n\x15min_final_cltv_expiry\x18\x05 \x01(\x04H\x03\x88\x01\x01\x12(\n\rrouting_hints\x18\x06 \x03(\x0b\x32\x11.hold.RoutingHintB\x0e\n\x0c_descriptionB\x13\n\x11_description_hashB\t\n\x07_expiryB\x18\n\x16_min_final_cltv_expiry\"!\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\"#\n\x13RoutingHintsRequest\x12\x0c\n\x04node\x18\x01 \x01(\t\"q\n\x03Hop\x12\x12\n\npublic_key\x18\x01 \x01(\t\x12\x18\n\x10short_channel_id\x18\x02 \x01(\t\x12\x10\n\x08\x62\x61se_fee\x18\x03 \x01(\x04\x12\x0f\n\x07ppm_fee\x18\x04 \x01(\x04\x12\x19\n\x11\x63ltv_expiry_delta\x18\x05 \x01(\x04\"&\n\x0bRoutingHint\x12\x17\n\x04hops\x18\x01 \x03(\x0b\x32\t.hold.Hop\"8\n\x14RoutingHintsResponse\x12 \n\x05hints\x18\x01 \x03(\x0b\x32\x11.hold.RoutingHint\"9\n\x0bListRequest\x12\x19\n\x0cpayment_hash\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_payment_hash\"n\n\x04Htlc\x12\x1e\n\x05state\x18\x01 \x01(\x0e\x32\x0f.hold.HtlcState\x12\x0c\n\x04msat\x18\x02 \x01(\x04\x12\x12\n\ncreated_at\x18\x03 \x01(\x04\x12\x18\n\x10short_channel_id\x18\x04 \x01(\t\x12\n\n\x02id\x18\x05 \x01(\x04\"\xca\x01\n\x07Invoice\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\x12\x1d\n\x10payment_preimage\x18\x02 \x01(\tH\x00\x88\x01\x01\x12!\n\x05state\x18\x03 \x01(\x0e\x32\x12.hold.InvoiceState\x12\x0e\n\x06\x62olt11\x18\x04 \x01(\t\x12\x12\n\ncreated_at\x18\x05 \x01(\x04\x12\x19\n\x05htlcs\x18\x06 \x03(\x0b\x32\n.hold.Htlc\x12\x13\n\x0b\x61mount_msat\x18\x07 \x01(\x04\x42\x13\n\x11_payment_preimage\"/\n\x0cListResponse\x12\x1f\n\x08invoices\x18\x01 \x03(\x0b\x32\r.hold.Invoice\")\n\rSettleRequest\x12\x18\n\x10payment_preimage\x18\x01 \x01(\t\"\x10\n\x0eSettleResponse\"%\n\rCancelRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\"\x10\n\x0e\x43\x61ncelResponse\"$\n\x0cTrackRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\"2\n\rTrackResponse\x12!\n\x05state\x18\x01 \x01(\x0e\x32\x12.hold.InvoiceState\"\x11\n\x0fTrackAllRequest\"[\n\x10TrackAllResponse\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\x12\x0e\n\x06\x62olt11\x18\x02 \x01(\t\x12!\n\x05state\x18\x03 \x01(\x0e\x32\x12.hold.InvoiceState\"2\n\x10PayStatusRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_bolt11\"\x94\x07\n\x11PayStatusResponse\x12\x31\n\x06status\x18\x01 \x03(\x0b\x32!.hold.PayStatusResponse.PayStatus\x1a\xcb\x06\n\tPayStatus\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x13\n\x0b\x61mount_msat\x18\x02 \x01(\x04\x12\x13\n\x0b\x64\x65stination\x18\x03 \x01(\t\x12;\n\x08\x61ttempts\x18\x04 \x03(\x0b\x32).hold.PayStatusResponse.PayStatus.Attempt\x1a\xc6\x05\n\x07\x41ttempt\x12\x10\n\x08strategy\x18\x01 \x01(\t\x12\x12\n\nstart_time\x18\x02 \x01(\x04\x12\x16\n\x0e\x61ge_in_seconds\x18\x03 \x01(\x04\x12\x15\n\x08\x65nd_time\x18\x04 \x01(\x04H\x00\x88\x01\x01\x12\x45\n\x05state\x18\x05 \x01(\x0e\x32\x36.hold.PayStatusResponse.PayStatus.Attempt.AttemptState\x12G\n\x07success\x18\x06 \x01(\x0b\x32\x31.hold.PayStatusResponse.PayStatus.Attempt.SuccessH\x01\x88\x01\x01\x12G\n\x07\x66\x61ilure\x18\x07 \x01(\x0b\x32\x31.hold.PayStatusResponse.PayStatus.Attempt.FailureH\x02\x88\x01\x01\x1a/\n\x07Success\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x18\n\x10payment_preimage\x18\x02 \x01(\t\x1a\xfa\x01\n\x07\x46\x61ilure\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\x04\x12I\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x36.hold.PayStatusResponse.PayStatus.Attempt.Failure.DataH\x00\x88\x01\x01\x1a|\n\x04\x44\x61ta\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x13\n\x0braw_message\x18\x02 \x01(\t\x12\x11\n\tfail_code\x18\x03 \x01(\x04\x12\x15\n\rfail_codename\x18\x04 \x01(\t\x12\x14\n\x0c\x65rring_index\x18\x05 \x01(\x04\x12\x13\n\x0b\x65rring_node\x18\x06 \x01(\tB\x07\n\x05_data\":\n\x0c\x41ttemptState\x12\x13\n\x0f\x41TTEMPT_PENDING\x10\x00\x12\x15\n\x11\x41TTEMPT_COMPLETED\x10\x01\x42\x0b\n\t_end_timeB\n\n\x08_successB\n\n\x08_failure\"\xd2\x01\n\x0fGetRouteRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12\x13\n\x0b\x61mount_msat\x18\x02 \x01(\x04\x12\x13\n\x0bmax_retries\x18\x03 \x01(\r\x12\x18\n\x0brisk_factor\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x15\n\x08max_cltv\x18\x05 \x01(\x04H\x01\x88\x01\x01\x12\x1d\n\x10\x66inal_cltv_delta\x18\x06 \x01(\x04H\x02\x88\x01\x01\x42\x0e\n\x0c_risk_factorB\x0b\n\t_max_cltvB\x13\n\x11_final_cltv_delta\"\xb9\x01\n\x10GetRouteResponse\x12(\n\x04hops\x18\x01 \x03(\x0b\x32\x1a.hold.GetRouteResponse.Hop\x12\x11\n\tfees_msat\x18\x02 \x01(\x04\x1ah\n\x03Hop\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12\x13\n\x0b\x61mount_msat\x18\x04 \x01(\x04\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\x04\x12\r\n\x05style\x18\x06 \x01(\t*a\n\x0cInvoiceState\x12\x12\n\x0eINVOICE_UNPAID\x10\x00\x12\x14\n\x10INVOICE_ACCEPTED\x10\x01\x12\x10\n\x0cINVOICE_PAID\x10\x02\x12\x15\n\x11INVOICE_CANCELLED\x10\x03*D\n\tHtlcState\x12\x11\n\rHTLC_ACCEPTED\x10\x00\x12\x10\n\x0cHTLC_SETTLED\x10\x01\x12\x12\n\x0eHTLC_CANCELLED\x10\x02\x32\xd2\x04\n\x04Hold\x12\x38\n\x07GetInfo\x12\x14.hold.GetInfoRequest\x1a\x15.hold.GetInfoResponse\"\x00\x12\x38\n\x07Invoice\x12\x14.hold.InvoiceRequest\x1a\x15.hold.InvoiceResponse\"\x00\x12G\n\x0cRoutingHints\x12\x19.hold.RoutingHintsRequest\x1a\x1a.hold.RoutingHintsResponse\"\x00\x12/\n\x04List\x12\x11.hold.ListRequest\x1a\x12.hold.ListResponse\"\x00\x12\x35\n\x06Settle\x12\x13.hold.SettleRequest\x1a\x14.hold.SettleResponse\"\x00\x12\x35\n\x06\x43\x61ncel\x12\x13.hold.CancelRequest\x1a\x14.hold.CancelResponse\"\x00\x12\x34\n\x05Track\x12\x12.hold.TrackRequest\x1a\x13.hold.TrackResponse\"\x00\x30\x01\x12=\n\x08TrackAll\x12\x15.hold.TrackAllRequest\x1a\x16.hold.TrackAllResponse\"\x00\x30\x01\x12>\n\tPayStatus\x12\x16.hold.PayStatusRequest\x1a\x17.hold.PayStatusResponse\"\x00\x12\x39\n\x08GetRoute\x12\x15.hold.GetRouteRequest\x1a\x16.hold.GetRouteResponseb\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'hold_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals['_INVOICESTATE']._serialized_start=2768 - _globals['_INVOICESTATE']._serialized_end=2865 - _globals['_HTLCSTATE']._serialized_start=2867 - _globals['_HTLCSTATE']._serialized_end=2935 - _globals['_GETINFOREQUEST']._serialized_start=20 - _globals['_GETINFOREQUEST']._serialized_end=36 - _globals['_GETINFORESPONSE']._serialized_start=38 - _globals['_GETINFORESPONSE']._serialized_end=72 - _globals['_INVOICEREQUEST']._serialized_start=75 - _globals['_INVOICEREQUEST']._serialized_end=364 - _globals['_INVOICERESPONSE']._serialized_start=366 - _globals['_INVOICERESPONSE']._serialized_end=399 - _globals['_ROUTINGHINTSREQUEST']._serialized_start=401 - _globals['_ROUTINGHINTSREQUEST']._serialized_end=436 - _globals['_HOP']._serialized_start=438 - _globals['_HOP']._serialized_end=551 - _globals['_ROUTINGHINT']._serialized_start=553 - _globals['_ROUTINGHINT']._serialized_end=591 - _globals['_ROUTINGHINTSRESPONSE']._serialized_start=593 - _globals['_ROUTINGHINTSRESPONSE']._serialized_end=649 - _globals['_LISTREQUEST']._serialized_start=651 - _globals['_LISTREQUEST']._serialized_end=708 - _globals['_HTLC']._serialized_start=710 - _globals['_HTLC']._serialized_end=820 - _globals['_INVOICE']._serialized_start=823 - _globals['_INVOICE']._serialized_end=1025 - _globals['_LISTRESPONSE']._serialized_start=1027 - _globals['_LISTRESPONSE']._serialized_end=1074 - _globals['_SETTLEREQUEST']._serialized_start=1076 - _globals['_SETTLEREQUEST']._serialized_end=1117 - _globals['_SETTLERESPONSE']._serialized_start=1119 - _globals['_SETTLERESPONSE']._serialized_end=1135 - _globals['_CANCELREQUEST']._serialized_start=1137 - _globals['_CANCELREQUEST']._serialized_end=1174 - _globals['_CANCELRESPONSE']._serialized_start=1176 - _globals['_CANCELRESPONSE']._serialized_end=1192 - _globals['_TRACKREQUEST']._serialized_start=1194 - _globals['_TRACKREQUEST']._serialized_end=1230 - _globals['_TRACKRESPONSE']._serialized_start=1232 - _globals['_TRACKRESPONSE']._serialized_end=1282 - _globals['_TRACKALLREQUEST']._serialized_start=1284 - _globals['_TRACKALLREQUEST']._serialized_end=1301 - _globals['_TRACKALLRESPONSE']._serialized_start=1303 - _globals['_TRACKALLRESPONSE']._serialized_end=1394 - _globals['_PAYSTATUSREQUEST']._serialized_start=1396 - _globals['_PAYSTATUSREQUEST']._serialized_end=1446 - _globals['_PAYSTATUSRESPONSE']._serialized_start=1449 - _globals['_PAYSTATUSRESPONSE']._serialized_end=2365 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS']._serialized_start=1522 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS']._serialized_end=2365 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT']._serialized_start=1655 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT']._serialized_end=2365 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_SUCCESS']._serialized_start=1968 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_SUCCESS']._serialized_end=2015 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_FAILURE']._serialized_start=2018 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_FAILURE']._serialized_end=2268 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_FAILURE_DATA']._serialized_start=2135 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_FAILURE_DATA']._serialized_end=2259 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_ATTEMPTSTATE']._serialized_start=2270 - _globals['_PAYSTATUSRESPONSE_PAYSTATUS_ATTEMPT_ATTEMPTSTATE']._serialized_end=2328 - _globals['_GETROUTEREQUEST']._serialized_start=2368 - _globals['_GETROUTEREQUEST']._serialized_end=2578 - _globals['_GETROUTERESPONSE']._serialized_start=2581 - _globals['_GETROUTERESPONSE']._serialized_end=2766 - _globals['_GETROUTERESPONSE_HOP']._serialized_start=2662 - _globals['_GETROUTERESPONSE_HOP']._serialized_end=2766 - _globals['_HOLD']._serialized_start=2938 - _globals['_HOLD']._serialized_end=3532 -# @@protoc_insertion_point(module_scope) diff --git a/tools/plugins/hold/protos/hold_pb2.pyi b/tools/plugins/hold/protos/hold_pb2.pyi deleted file mode 100644 index 4d963628..00000000 --- a/tools/plugins/hold/protos/hold_pb2.pyi +++ /dev/null @@ -1,299 +0,0 @@ -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class InvoiceState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INVOICE_UNPAID: _ClassVar[InvoiceState] - INVOICE_ACCEPTED: _ClassVar[InvoiceState] - INVOICE_PAID: _ClassVar[InvoiceState] - INVOICE_CANCELLED: _ClassVar[InvoiceState] - -class HtlcState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - HTLC_ACCEPTED: _ClassVar[HtlcState] - HTLC_SETTLED: _ClassVar[HtlcState] - HTLC_CANCELLED: _ClassVar[HtlcState] -INVOICE_UNPAID: InvoiceState -INVOICE_ACCEPTED: InvoiceState -INVOICE_PAID: InvoiceState -INVOICE_CANCELLED: InvoiceState -HTLC_ACCEPTED: HtlcState -HTLC_SETTLED: HtlcState -HTLC_CANCELLED: HtlcState - -class GetInfoRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class GetInfoResponse(_message.Message): - __slots__ = ("version",) - VERSION_FIELD_NUMBER: _ClassVar[int] - version: str - def __init__(self, version: _Optional[str] = ...) -> None: ... - -class InvoiceRequest(_message.Message): - __slots__ = ("payment_hash", "amount_msat", "description", "description_hash", "expiry", "min_final_cltv_expiry", "routing_hints") - PAYMENT_HASH_FIELD_NUMBER: _ClassVar[int] - AMOUNT_MSAT_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_HASH_FIELD_NUMBER: _ClassVar[int] - EXPIRY_FIELD_NUMBER: _ClassVar[int] - MIN_FINAL_CLTV_EXPIRY_FIELD_NUMBER: _ClassVar[int] - ROUTING_HINTS_FIELD_NUMBER: _ClassVar[int] - payment_hash: str - amount_msat: int - description: str - description_hash: str - expiry: int - min_final_cltv_expiry: int - routing_hints: _containers.RepeatedCompositeFieldContainer[RoutingHint] - def __init__(self, payment_hash: _Optional[str] = ..., amount_msat: _Optional[int] = ..., description: _Optional[str] = ..., description_hash: _Optional[str] = ..., expiry: _Optional[int] = ..., min_final_cltv_expiry: _Optional[int] = ..., routing_hints: _Optional[_Iterable[_Union[RoutingHint, _Mapping]]] = ...) -> None: ... - -class InvoiceResponse(_message.Message): - __slots__ = ("bolt11",) - BOLT11_FIELD_NUMBER: _ClassVar[int] - bolt11: str - def __init__(self, bolt11: _Optional[str] = ...) -> None: ... - -class RoutingHintsRequest(_message.Message): - __slots__ = ("node",) - NODE_FIELD_NUMBER: _ClassVar[int] - node: str - def __init__(self, node: _Optional[str] = ...) -> None: ... - -class Hop(_message.Message): - __slots__ = ("public_key", "short_channel_id", "base_fee", "ppm_fee", "cltv_expiry_delta") - PUBLIC_KEY_FIELD_NUMBER: _ClassVar[int] - SHORT_CHANNEL_ID_FIELD_NUMBER: _ClassVar[int] - BASE_FEE_FIELD_NUMBER: _ClassVar[int] - PPM_FEE_FIELD_NUMBER: _ClassVar[int] - CLTV_EXPIRY_DELTA_FIELD_NUMBER: _ClassVar[int] - public_key: str - short_channel_id: str - base_fee: int - ppm_fee: int - cltv_expiry_delta: int - def __init__(self, public_key: _Optional[str] = ..., short_channel_id: _Optional[str] = ..., base_fee: _Optional[int] = ..., ppm_fee: _Optional[int] = ..., cltv_expiry_delta: _Optional[int] = ...) -> None: ... - -class RoutingHint(_message.Message): - __slots__ = ("hops",) - HOPS_FIELD_NUMBER: _ClassVar[int] - hops: _containers.RepeatedCompositeFieldContainer[Hop] - def __init__(self, hops: _Optional[_Iterable[_Union[Hop, _Mapping]]] = ...) -> None: ... - -class RoutingHintsResponse(_message.Message): - __slots__ = ("hints",) - HINTS_FIELD_NUMBER: _ClassVar[int] - hints: _containers.RepeatedCompositeFieldContainer[RoutingHint] - def __init__(self, hints: _Optional[_Iterable[_Union[RoutingHint, _Mapping]]] = ...) -> None: ... - -class ListRequest(_message.Message): - __slots__ = ("payment_hash",) - PAYMENT_HASH_FIELD_NUMBER: _ClassVar[int] - payment_hash: str - def __init__(self, payment_hash: _Optional[str] = ...) -> None: ... - -class Htlc(_message.Message): - __slots__ = ("state", "msat", "created_at", "short_channel_id", "id") - STATE_FIELD_NUMBER: _ClassVar[int] - MSAT_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - SHORT_CHANNEL_ID_FIELD_NUMBER: _ClassVar[int] - ID_FIELD_NUMBER: _ClassVar[int] - state: HtlcState - msat: int - created_at: int - short_channel_id: str - id: int - def __init__(self, state: _Optional[_Union[HtlcState, str]] = ..., msat: _Optional[int] = ..., created_at: _Optional[int] = ..., short_channel_id: _Optional[str] = ..., id: _Optional[int] = ...) -> None: ... - -class Invoice(_message.Message): - __slots__ = ("payment_hash", "payment_preimage", "state", "bolt11", "created_at", "htlcs", "amount_msat") - PAYMENT_HASH_FIELD_NUMBER: _ClassVar[int] - PAYMENT_PREIMAGE_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - BOLT11_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - HTLCS_FIELD_NUMBER: _ClassVar[int] - AMOUNT_MSAT_FIELD_NUMBER: _ClassVar[int] - payment_hash: str - payment_preimage: str - state: InvoiceState - bolt11: str - created_at: int - htlcs: _containers.RepeatedCompositeFieldContainer[Htlc] - amount_msat: int - def __init__(self, payment_hash: _Optional[str] = ..., payment_preimage: _Optional[str] = ..., state: _Optional[_Union[InvoiceState, str]] = ..., bolt11: _Optional[str] = ..., created_at: _Optional[int] = ..., htlcs: _Optional[_Iterable[_Union[Htlc, _Mapping]]] = ..., amount_msat: _Optional[int] = ...) -> None: ... - -class ListResponse(_message.Message): - __slots__ = ("invoices",) - INVOICES_FIELD_NUMBER: _ClassVar[int] - invoices: _containers.RepeatedCompositeFieldContainer[Invoice] - def __init__(self, invoices: _Optional[_Iterable[_Union[Invoice, _Mapping]]] = ...) -> None: ... - -class SettleRequest(_message.Message): - __slots__ = ("payment_preimage",) - PAYMENT_PREIMAGE_FIELD_NUMBER: _ClassVar[int] - payment_preimage: str - def __init__(self, payment_preimage: _Optional[str] = ...) -> None: ... - -class SettleResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class CancelRequest(_message.Message): - __slots__ = ("payment_hash",) - PAYMENT_HASH_FIELD_NUMBER: _ClassVar[int] - payment_hash: str - def __init__(self, payment_hash: _Optional[str] = ...) -> None: ... - -class CancelResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TrackRequest(_message.Message): - __slots__ = ("payment_hash",) - PAYMENT_HASH_FIELD_NUMBER: _ClassVar[int] - payment_hash: str - def __init__(self, payment_hash: _Optional[str] = ...) -> None: ... - -class TrackResponse(_message.Message): - __slots__ = ("state",) - STATE_FIELD_NUMBER: _ClassVar[int] - state: InvoiceState - def __init__(self, state: _Optional[_Union[InvoiceState, str]] = ...) -> None: ... - -class TrackAllRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TrackAllResponse(_message.Message): - __slots__ = ("payment_hash", "bolt11", "state") - PAYMENT_HASH_FIELD_NUMBER: _ClassVar[int] - BOLT11_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - payment_hash: str - bolt11: str - state: InvoiceState - def __init__(self, payment_hash: _Optional[str] = ..., bolt11: _Optional[str] = ..., state: _Optional[_Union[InvoiceState, str]] = ...) -> None: ... - -class PayStatusRequest(_message.Message): - __slots__ = ("bolt11",) - BOLT11_FIELD_NUMBER: _ClassVar[int] - bolt11: str - def __init__(self, bolt11: _Optional[str] = ...) -> None: ... - -class PayStatusResponse(_message.Message): - __slots__ = ("status",) - class PayStatus(_message.Message): - __slots__ = ("bolt11", "amount_msat", "destination", "attempts") - class Attempt(_message.Message): - __slots__ = ("strategy", "start_time", "age_in_seconds", "end_time", "state", "success", "failure") - class AttemptState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - ATTEMPT_PENDING: _ClassVar[PayStatusResponse.PayStatus.Attempt.AttemptState] - ATTEMPT_COMPLETED: _ClassVar[PayStatusResponse.PayStatus.Attempt.AttemptState] - ATTEMPT_PENDING: PayStatusResponse.PayStatus.Attempt.AttemptState - ATTEMPT_COMPLETED: PayStatusResponse.PayStatus.Attempt.AttemptState - class Success(_message.Message): - __slots__ = ("id", "payment_preimage") - ID_FIELD_NUMBER: _ClassVar[int] - PAYMENT_PREIMAGE_FIELD_NUMBER: _ClassVar[int] - id: int - payment_preimage: str - def __init__(self, id: _Optional[int] = ..., payment_preimage: _Optional[str] = ...) -> None: ... - class Failure(_message.Message): - __slots__ = ("message", "code", "data") - class Data(_message.Message): - __slots__ = ("id", "raw_message", "fail_code", "fail_codename", "erring_index", "erring_node") - ID_FIELD_NUMBER: _ClassVar[int] - RAW_MESSAGE_FIELD_NUMBER: _ClassVar[int] - FAIL_CODE_FIELD_NUMBER: _ClassVar[int] - FAIL_CODENAME_FIELD_NUMBER: _ClassVar[int] - ERRING_INDEX_FIELD_NUMBER: _ClassVar[int] - ERRING_NODE_FIELD_NUMBER: _ClassVar[int] - id: int - raw_message: str - fail_code: int - fail_codename: str - erring_index: int - erring_node: str - def __init__(self, id: _Optional[int] = ..., raw_message: _Optional[str] = ..., fail_code: _Optional[int] = ..., fail_codename: _Optional[str] = ..., erring_index: _Optional[int] = ..., erring_node: _Optional[str] = ...) -> None: ... - MESSAGE_FIELD_NUMBER: _ClassVar[int] - CODE_FIELD_NUMBER: _ClassVar[int] - DATA_FIELD_NUMBER: _ClassVar[int] - message: str - code: int - data: PayStatusResponse.PayStatus.Attempt.Failure.Data - def __init__(self, message: _Optional[str] = ..., code: _Optional[int] = ..., data: _Optional[_Union[PayStatusResponse.PayStatus.Attempt.Failure.Data, _Mapping]] = ...) -> None: ... - STRATEGY_FIELD_NUMBER: _ClassVar[int] - START_TIME_FIELD_NUMBER: _ClassVar[int] - AGE_IN_SECONDS_FIELD_NUMBER: _ClassVar[int] - END_TIME_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - SUCCESS_FIELD_NUMBER: _ClassVar[int] - FAILURE_FIELD_NUMBER: _ClassVar[int] - strategy: str - start_time: int - age_in_seconds: int - end_time: int - state: PayStatusResponse.PayStatus.Attempt.AttemptState - success: PayStatusResponse.PayStatus.Attempt.Success - failure: PayStatusResponse.PayStatus.Attempt.Failure - def __init__(self, strategy: _Optional[str] = ..., start_time: _Optional[int] = ..., age_in_seconds: _Optional[int] = ..., end_time: _Optional[int] = ..., state: _Optional[_Union[PayStatusResponse.PayStatus.Attempt.AttemptState, str]] = ..., success: _Optional[_Union[PayStatusResponse.PayStatus.Attempt.Success, _Mapping]] = ..., failure: _Optional[_Union[PayStatusResponse.PayStatus.Attempt.Failure, _Mapping]] = ...) -> None: ... - BOLT11_FIELD_NUMBER: _ClassVar[int] - AMOUNT_MSAT_FIELD_NUMBER: _ClassVar[int] - DESTINATION_FIELD_NUMBER: _ClassVar[int] - ATTEMPTS_FIELD_NUMBER: _ClassVar[int] - bolt11: str - amount_msat: int - destination: str - attempts: _containers.RepeatedCompositeFieldContainer[PayStatusResponse.PayStatus.Attempt] - def __init__(self, bolt11: _Optional[str] = ..., amount_msat: _Optional[int] = ..., destination: _Optional[str] = ..., attempts: _Optional[_Iterable[_Union[PayStatusResponse.PayStatus.Attempt, _Mapping]]] = ...) -> None: ... - STATUS_FIELD_NUMBER: _ClassVar[int] - status: _containers.RepeatedCompositeFieldContainer[PayStatusResponse.PayStatus] - def __init__(self, status: _Optional[_Iterable[_Union[PayStatusResponse.PayStatus, _Mapping]]] = ...) -> None: ... - -class GetRouteRequest(_message.Message): - __slots__ = ("destination", "amount_msat", "max_retries", "risk_factor", "max_cltv", "final_cltv_delta") - DESTINATION_FIELD_NUMBER: _ClassVar[int] - AMOUNT_MSAT_FIELD_NUMBER: _ClassVar[int] - MAX_RETRIES_FIELD_NUMBER: _ClassVar[int] - RISK_FACTOR_FIELD_NUMBER: _ClassVar[int] - MAX_CLTV_FIELD_NUMBER: _ClassVar[int] - FINAL_CLTV_DELTA_FIELD_NUMBER: _ClassVar[int] - destination: str - amount_msat: int - max_retries: int - risk_factor: int - max_cltv: int - final_cltv_delta: int - def __init__(self, destination: _Optional[str] = ..., amount_msat: _Optional[int] = ..., max_retries: _Optional[int] = ..., risk_factor: _Optional[int] = ..., max_cltv: _Optional[int] = ..., final_cltv_delta: _Optional[int] = ...) -> None: ... - -class GetRouteResponse(_message.Message): - __slots__ = ("hops", "fees_msat") - class Hop(_message.Message): - __slots__ = ("id", "channel", "direction", "amount_msat", "delay", "style") - ID_FIELD_NUMBER: _ClassVar[int] - CHANNEL_FIELD_NUMBER: _ClassVar[int] - DIRECTION_FIELD_NUMBER: _ClassVar[int] - AMOUNT_MSAT_FIELD_NUMBER: _ClassVar[int] - DELAY_FIELD_NUMBER: _ClassVar[int] - STYLE_FIELD_NUMBER: _ClassVar[int] - id: str - channel: str - direction: int - amount_msat: int - delay: int - style: str - def __init__(self, id: _Optional[str] = ..., channel: _Optional[str] = ..., direction: _Optional[int] = ..., amount_msat: _Optional[int] = ..., delay: _Optional[int] = ..., style: _Optional[str] = ...) -> None: ... - HOPS_FIELD_NUMBER: _ClassVar[int] - FEES_MSAT_FIELD_NUMBER: _ClassVar[int] - hops: _containers.RepeatedCompositeFieldContainer[GetRouteResponse.Hop] - fees_msat: int - def __init__(self, hops: _Optional[_Iterable[_Union[GetRouteResponse.Hop, _Mapping]]] = ..., fees_msat: _Optional[int] = ...) -> None: ... diff --git a/tools/plugins/hold/protos/hold_pb2_grpc.py b/tools/plugins/hold/protos/hold_pb2_grpc.py deleted file mode 100644 index f8ccf2b7..00000000 --- a/tools/plugins/hold/protos/hold_pb2_grpc.py +++ /dev/null @@ -1,491 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings - -import hold_pb2 as hold__pb2 - -GRPC_GENERATED_VERSION = '1.65.5' -GRPC_VERSION = grpc.__version__ -EXPECTED_ERROR_RELEASE = '1.66.0' -SCHEDULED_RELEASE_DATE = 'August 6, 2024' -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - warnings.warn( - f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in hold_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},' - + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.', - RuntimeWarning - ) - - -class HoldStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetInfo = channel.unary_unary( - '/hold.Hold/GetInfo', - request_serializer=hold__pb2.GetInfoRequest.SerializeToString, - response_deserializer=hold__pb2.GetInfoResponse.FromString, - _registered_method=True) - self.Invoice = channel.unary_unary( - '/hold.Hold/Invoice', - request_serializer=hold__pb2.InvoiceRequest.SerializeToString, - response_deserializer=hold__pb2.InvoiceResponse.FromString, - _registered_method=True) - self.RoutingHints = channel.unary_unary( - '/hold.Hold/RoutingHints', - request_serializer=hold__pb2.RoutingHintsRequest.SerializeToString, - response_deserializer=hold__pb2.RoutingHintsResponse.FromString, - _registered_method=True) - self.List = channel.unary_unary( - '/hold.Hold/List', - request_serializer=hold__pb2.ListRequest.SerializeToString, - response_deserializer=hold__pb2.ListResponse.FromString, - _registered_method=True) - self.Settle = channel.unary_unary( - '/hold.Hold/Settle', - request_serializer=hold__pb2.SettleRequest.SerializeToString, - response_deserializer=hold__pb2.SettleResponse.FromString, - _registered_method=True) - self.Cancel = channel.unary_unary( - '/hold.Hold/Cancel', - request_serializer=hold__pb2.CancelRequest.SerializeToString, - response_deserializer=hold__pb2.CancelResponse.FromString, - _registered_method=True) - self.Track = channel.unary_stream( - '/hold.Hold/Track', - request_serializer=hold__pb2.TrackRequest.SerializeToString, - response_deserializer=hold__pb2.TrackResponse.FromString, - _registered_method=True) - self.TrackAll = channel.unary_stream( - '/hold.Hold/TrackAll', - request_serializer=hold__pb2.TrackAllRequest.SerializeToString, - response_deserializer=hold__pb2.TrackAllResponse.FromString, - _registered_method=True) - self.PayStatus = channel.unary_unary( - '/hold.Hold/PayStatus', - request_serializer=hold__pb2.PayStatusRequest.SerializeToString, - response_deserializer=hold__pb2.PayStatusResponse.FromString, - _registered_method=True) - self.GetRoute = channel.unary_unary( - '/hold.Hold/GetRoute', - request_serializer=hold__pb2.GetRouteRequest.SerializeToString, - response_deserializer=hold__pb2.GetRouteResponse.FromString, - _registered_method=True) - - -class HoldServicer(object): - """Missing associated documentation comment in .proto file.""" - - def GetInfo(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Invoice(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RoutingHints(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def List(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Settle(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Cancel(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Track(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def TrackAll(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def PayStatus(self, request, context): - """Workaround to expose the paystatus command via gRPC, since CLN doesn't - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetRoute(self, request, context): - """Custom algorithm that allows specifying a max delay - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_HoldServicer_to_server(servicer, server): - rpc_method_handlers = { - 'GetInfo': grpc.unary_unary_rpc_method_handler( - servicer.GetInfo, - request_deserializer=hold__pb2.GetInfoRequest.FromString, - response_serializer=hold__pb2.GetInfoResponse.SerializeToString, - ), - 'Invoice': grpc.unary_unary_rpc_method_handler( - servicer.Invoice, - request_deserializer=hold__pb2.InvoiceRequest.FromString, - response_serializer=hold__pb2.InvoiceResponse.SerializeToString, - ), - 'RoutingHints': grpc.unary_unary_rpc_method_handler( - servicer.RoutingHints, - request_deserializer=hold__pb2.RoutingHintsRequest.FromString, - response_serializer=hold__pb2.RoutingHintsResponse.SerializeToString, - ), - 'List': grpc.unary_unary_rpc_method_handler( - servicer.List, - request_deserializer=hold__pb2.ListRequest.FromString, - response_serializer=hold__pb2.ListResponse.SerializeToString, - ), - 'Settle': grpc.unary_unary_rpc_method_handler( - servicer.Settle, - request_deserializer=hold__pb2.SettleRequest.FromString, - response_serializer=hold__pb2.SettleResponse.SerializeToString, - ), - 'Cancel': grpc.unary_unary_rpc_method_handler( - servicer.Cancel, - request_deserializer=hold__pb2.CancelRequest.FromString, - response_serializer=hold__pb2.CancelResponse.SerializeToString, - ), - 'Track': grpc.unary_stream_rpc_method_handler( - servicer.Track, - request_deserializer=hold__pb2.TrackRequest.FromString, - response_serializer=hold__pb2.TrackResponse.SerializeToString, - ), - 'TrackAll': grpc.unary_stream_rpc_method_handler( - servicer.TrackAll, - request_deserializer=hold__pb2.TrackAllRequest.FromString, - response_serializer=hold__pb2.TrackAllResponse.SerializeToString, - ), - 'PayStatus': grpc.unary_unary_rpc_method_handler( - servicer.PayStatus, - request_deserializer=hold__pb2.PayStatusRequest.FromString, - response_serializer=hold__pb2.PayStatusResponse.SerializeToString, - ), - 'GetRoute': grpc.unary_unary_rpc_method_handler( - servicer.GetRoute, - request_deserializer=hold__pb2.GetRouteRequest.FromString, - response_serializer=hold__pb2.GetRouteResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'hold.Hold', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('hold.Hold', rpc_method_handlers) - - - # This class is part of an EXPERIMENTAL API. -class Hold(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def GetInfo(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/GetInfo', - hold__pb2.GetInfoRequest.SerializeToString, - hold__pb2.GetInfoResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Invoice(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/Invoice', - hold__pb2.InvoiceRequest.SerializeToString, - hold__pb2.InvoiceResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def RoutingHints(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/RoutingHints', - hold__pb2.RoutingHintsRequest.SerializeToString, - hold__pb2.RoutingHintsResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def List(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/List', - hold__pb2.ListRequest.SerializeToString, - hold__pb2.ListResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Settle(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/Settle', - hold__pb2.SettleRequest.SerializeToString, - hold__pb2.SettleResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Cancel(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/Cancel', - hold__pb2.CancelRequest.SerializeToString, - hold__pb2.CancelResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def Track(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream( - request, - target, - '/hold.Hold/Track', - hold__pb2.TrackRequest.SerializeToString, - hold__pb2.TrackResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def TrackAll(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_stream( - request, - target, - '/hold.Hold/TrackAll', - hold__pb2.TrackAllRequest.SerializeToString, - hold__pb2.TrackAllResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def PayStatus(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/PayStatus', - hold__pb2.PayStatusRequest.SerializeToString, - hold__pb2.PayStatusResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) - - @staticmethod - def GetRoute(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/hold.Hold/GetRoute', - hold__pb2.GetRouteRequest.SerializeToString, - hold__pb2.GetRouteResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) diff --git a/tools/plugins/hold/route_hints.py b/tools/plugins/hold/route_hints.py deleted file mode 100644 index 8a778fef..00000000 --- a/tools/plugins/hold/route_hints.py +++ /dev/null @@ -1,31 +0,0 @@ -from bolt11.models.routehint import Route, RouteHint -from pyln.client import Plugin, RpcError - - -class RouteHints: - _id: str - - def __init__(self, plugin: Plugin) -> None: - self._plugin = plugin - - def get_private_channels(self, node: str) -> list[RouteHint]: - try: - chans = self._plugin.rpc.listpeerchannels(peer_id=node)["channels"] - except RpcError: - return [] - - return [ - RouteHint( - [ - Route( - public_key=node, - short_channel_id=chan["short_channel_id"], - base_fee=int(chan["updates"]["remote"]["fee_base_msat"]), - ppm_fee=chan["updates"]["remote"]["fee_proportional_millionths"], - cltv_expiry_delta=chan["updates"]["remote"]["cltv_expiry_delta"], - ) - ] - ) - for chan in chans - if chan["private"] - ] diff --git a/tools/plugins/hold/router.py b/tools/plugins/hold/router.py deleted file mode 100644 index 88dc740c..00000000 --- a/tools/plugins/hold/router.py +++ /dev/null @@ -1,115 +0,0 @@ -from dataclasses import dataclass -from typing import Any - -from pyln.client import Plugin, RpcError - - -class NoRouteError(Exception): - pass - - -@dataclass -class Hop: - node_id: str - channel: str - direction: int - amount_msat: int - delay: int - style: str - - def to_dict(self) -> dict[str, Any]: - return dict(self.__dict__.items()) - - -# TODO: exclude our channels where we don't have enough balance -class Router: - plugin: Plugin - - def __init__(self, plugin: Plugin) -> None: - self.plugin = plugin - - def get_route( - self, - destination: str, - amount_msat: int, - risk_factor: int, - max_cltv: int | None, - final_cltv_delta: int | None, - max_retries: int | None, - ) -> list[Hop]: - exclude: list[str] = [] - - for _ in range(max_retries if max_retries is not None else 10): - route = self._get_route( - destination, amount_msat, risk_factor, final_cltv_delta, exclude - ) - if len(route) == 0: - raise NoRouteError - - cltv_too_high = max_cltv is not None and route[0].delay > max_cltv - if not cltv_too_high: - return route - - most_expensive = Router._most_expensive_channel(route) - exclude.append(f"{most_expensive.channel}/{most_expensive.direction}") - - raise NoRouteError - - def _get_route( - self, - destination: str, - amount_msat: int, - risk_factor: int, - final_cltv_delta: int, - exclude: list[str], - ) -> list[Hop]: - try: - return Router._transform_route_res( - self.plugin.rpc.getroute( - node_id=destination, - amount_msat=amount_msat, - riskfactor=risk_factor, - cltv=final_cltv_delta if final_cltv_delta is not None else 9, - exclude=exclude, - ) - ) - except RpcError: - raise NoRouteError from None - - @staticmethod - def _most_expensive_channel(route: list[Hop]) -> Hop: - if len(route) < 2: - return route[0] - - max_hops = [] - max_delta = route[0].delay - route[1].delay - max_hops.append(route[0]) - - for i in range(1, len(route) - 1): - delta = route[i].delay - route[i + 1].delay - - if delta == max_delta: - max_hops.append(route[i]) - elif delta > max_delta: - max_hops = [route[i]] - max_delta = delta - - return max_hops[-1] - - @staticmethod - def _transform_route_res(res: dict[str, any]) -> list[Hop]: - return ( - [ - Hop( - node_id=hop["id"], - channel=hop["channel"], - direction=hop["direction"], - amount_msat=int(hop["amount_msat"]), - delay=hop["delay"], - style=hop["style"], - ) - for hop in res["route"] - ] - if "route" in res - else [] - ) diff --git a/tools/plugins/hold/server.py b/tools/plugins/hold/server.py deleted file mode 100644 index 37c58d53..00000000 --- a/tools/plugins/hold/server.py +++ /dev/null @@ -1,196 +0,0 @@ -from collections.abc import Iterable -from queue import Empty -from typing import TypeVar - -import grpc -from pyln.client import Plugin - -from plugins.hold.consts import PLUGIN_NAME, VERSION -from plugins.hold.encoder import Defaults -from plugins.hold.enums import invoice_state_final -from plugins.hold.grpc_server import GrpcServer, handle_grpc_error -from plugins.hold.hold import Hold, NoSuchInvoiceError -from plugins.hold.protos.hold_pb2 import ( - CancelRequest, - CancelResponse, - GetInfoRequest, - GetInfoResponse, - GetRouteRequest, - GetRouteResponse, - InvoiceRequest, - InvoiceResponse, - ListRequest, - ListResponse, - PayStatusRequest, - PayStatusResponse, - RoutingHintsRequest, - RoutingHintsResponse, - SettleRequest, - SettleResponse, - TrackAllRequest, - TrackAllResponse, - TrackRequest, - TrackResponse, -) -from plugins.hold.protos.hold_pb2_grpc import HoldServicer, add_HoldServicer_to_server -from plugins.hold.transformers import INVOICE_STATE_TO_GRPC, Transformers - -T = TypeVar("T") - - -def optional_default(value: T | None, default: T, fallback: T) -> T: - return value if value is not None and value != default else fallback - - -class HoldService(HoldServicer): - def __init__(self, plugin: Plugin, hold: Hold) -> None: - self._plugin = plugin - self._hold = hold - - def GetInfo( # noqa: N802 - self, - request: GetInfoRequest, # noqa: ARG002 - context: grpc.ServicerContext, # noqa: ARG002 - ) -> GetInfoResponse: - return GetInfoResponse(version=VERSION) - - def Invoice( # noqa: N802 - self, - request: InvoiceRequest, - context: grpc.ServicerContext, # noqa: ARG002 - ) -> InvoiceResponse: - return InvoiceResponse( - bolt11=self._hold.invoice( - request.payment_hash, - request.amount_msat, - request.description, - request.description_hash, - optional_default(request.expiry, 0, Defaults.Expiry), - optional_default( - request.min_final_cltv_expiry, - 0, - Defaults.MinFinalCltvExpiry, - ), - Transformers.routing_hints_from_grpc(list(request.routing_hints)), - ) - ) - - def RoutingHints( # noqa: N802 - self, - request: RoutingHintsRequest, - context: grpc.ServicerContext, # noqa: ARG002 - ) -> RoutingHintsResponse: - return Transformers.routing_hints_to_grpc(self._hold.get_private_channels(request.node)) - - def List( # noqa: N802 - self, - request: ListRequest, - context: grpc.ServicerContext, # noqa: ARG002 - ) -> ListResponse: - return ListResponse( - invoices=[ - Transformers.invoice_to_grpc(inv) - for inv in self._hold.list_invoices(request.payment_hash) - ] - ) - - def Settle( # noqa: N802 - self, - request: SettleRequest, - context: grpc.ServicerContext, # noqa: ARG002 - ) -> SettleResponse: - self._hold.settle(request.payment_preimage) - return SettleResponse() - - def Cancel( # noqa: N802 - self, - request: CancelRequest, - context: grpc.ServicerContext, # noqa: ARG002 - ) -> CancelResponse: - self._hold.cancel(request.payment_hash) - return CancelResponse() - - def Track( # noqa: N802 - self, request: TrackRequest, context: grpc.ServicerContext - ) -> Iterable[TrackResponse]: - try: - queue = self._hold.tracker.track(request.payment_hash) - invoices = self._hold.list_invoices(request.payment_hash) - - if len(invoices) == 0: - self._hold.tracker.stop_tracking(request.payment_hash, queue) - raise NoSuchInvoiceError # noqa: TRY301 - - yield TrackResponse(state=INVOICE_STATE_TO_GRPC[invoices[0].state]) - - while context.is_active(): - state = queue.get() - yield TrackResponse(state=INVOICE_STATE_TO_GRPC[state]) - - if invoice_state_final(state): - break - - self._hold.tracker.stop_tracking(request.payment_hash, queue) - except Exception as e: - handle_grpc_error(self._plugin, self.Track.__name__, context, e) - - def TrackAll( # noqa: N802 - self, - request: TrackAllRequest, # noqa: ARG002 - context: grpc.ServicerContext, - ) -> Iterable[TrackAllResponse]: - try: - queue = self._hold.tracker.track_all() - - while context.is_active(): - # Trick to stop the stream when the client cancels - try: - ev = queue.get(block=True, timeout=1) - yield TrackAllResponse( - payment_hash=ev.payment_hash, - bolt11=ev.bolt11, - state=INVOICE_STATE_TO_GRPC[ev.update], - ) - except Empty: # noqa: PERF203 - pass - - except Exception as e: - handle_grpc_error(self._plugin, self.TrackAll.__name__, context, e) - - def PayStatus( # noqa: N802 - self, - request: PayStatusRequest, - context: grpc.ServicerContext, # noqa: ARG002 - ) -> PayStatusResponse: - return Transformers.pay_status_response_to_grpc( - self._plugin.rpc.paystatus(request.bolt11 if request.bolt11 != "" else None) - ) - - def GetRoute( # noqa: N802 - self, - request: GetRouteRequest, - context: grpc.ServicerContext, # noqa: ARG002 - ) -> GetRouteResponse: - route = self._hold.router.get_route( - request.destination, - request.amount_msat, - request.risk_factor, - request.max_cltv if request.max_cltv != 0 else None, - request.final_cltv_delta if request.final_cltv_delta != 0 else None, - request.max_retries if request.max_retries != 0 else None, - ) - return GetRouteResponse( - hops=Transformers.route_to_grpc(route), - fees_msat=route[0].amount_msat - request.amount_msat, - ) - - -class Server(GrpcServer): - _hold: Hold - - def __init__(self, plugin: Plugin, hold: Hold) -> None: - super().__init__(PLUGIN_NAME, plugin) - self._hold = hold - - def _register_service(self) -> None: - add_HoldServicer_to_server(HoldService(self._plugin, self._hold), self._server) diff --git a/tools/plugins/hold/settler.py b/tools/plugins/hold/settler.py deleted file mode 100644 index 558ec68f..00000000 --- a/tools/plugins/hold/settler.py +++ /dev/null @@ -1,110 +0,0 @@ -from dataclasses import dataclass - -from pyln.client.plugin import Request - -from plugins.hold.enums import HtlcFailureMessage, HtlcState -from plugins.hold.invoice import HoldInvoice, Htlc, InvoiceState -from plugins.hold.tracker import Tracker - - -@dataclass -class HtlcRequest: - short_channel_id: str - channel_id: int - request: Request - - -class Settler: - _tracker: Tracker - _htlcs: dict[str, list[HtlcRequest]] - - def __init__(self, tracker: Tracker) -> None: - self._htlcs = {} - self._tracker = tracker - - def add_htlc(self, payment_hash: str, request: Request, htlc: Htlc) -> None: - if payment_hash not in self._htlcs: - self._htlcs[payment_hash] = [] - - self._htlcs[payment_hash].append( - HtlcRequest( - short_channel_id=htlc.short_channel_id, - channel_id=htlc.channel_id, - request=request, - ) - ) - - def settle(self, invoice: HoldInvoice) -> None: - for htlc in self._pop_requests(invoice.payment_hash): - self.settle_callback(htlc.request, invoice.payment_preimage) - Settler._update_htlc_state(invoice, htlc, HtlcState.Paid) - - invoice.set_state(self._tracker, InvoiceState.Paid) - - def cancel(self, invoice: HoldInvoice) -> None: - for htlc in self._pop_requests(invoice.payment_hash): - self.fail_callback(htlc.request, HtlcFailureMessage.IncorrectPaymentDetails) - Settler._update_htlc_state(invoice, htlc, HtlcState.Cancelled) - - invoice.set_state(self._tracker, InvoiceState.Cancelled) - - def pending_payment_hashes(self) -> list[str]: - return list(self._htlcs.keys()) - - def find_htlc_request(self, payment_hash: str, htlc: Htlc) -> Request | None: - if payment_hash not in self._htlcs: - return None - - return next( - ( - htlc_req.request - for htlc_req in self._htlcs[payment_hash] - if htlc_req.short_channel_id == htlc.short_channel_id - and htlc_req.channel_id == htlc.channel_id - ), - None, - ) - - def remove_htlc(self, payment_hash: str, to_remove: Htlc) -> None: - if payment_hash not in self._htlcs: - return - - self._htlcs[payment_hash] = [ - htlc - for htlc in self._htlcs[payment_hash] - if htlc.short_channel_id != to_remove.short_channel_id - or htlc.channel_id != to_remove.channel_id - ] - - def _pop_requests(self, payment_hash: str) -> list[HtlcRequest]: - return self._htlcs.pop(payment_hash, []) - - @staticmethod - def _update_htlc_state(invoice: HoldInvoice, htlc: HtlcRequest, new_state: HtlcState) -> None: - invoice.htlcs.find_htlc(htlc.short_channel_id, htlc.channel_id).state = new_state - - @staticmethod - def fail_callback(req: Request, message: HtlcFailureMessage) -> None: - req.set_result( - { - "result": "fail", - "failure_message": message, - } - ) - - @staticmethod - def continue_callback(req: Request) -> None: - req.set_result( - { - "result": "continue", - } - ) - - @staticmethod - def settle_callback(req: Request, preimage: str) -> None: - req.set_result( - { - "result": "resolve", - "payment_key": preimage, - } - ) diff --git a/tools/plugins/hold/tests/__init__.py b/tools/plugins/hold/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/plugins/hold/tests/test_certs.py b/tools/plugins/hold/tests/test_certs.py deleted file mode 100644 index 6e9a04f7..00000000 --- a/tools/plugins/hold/tests/test_certs.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -from pathlib import Path - -from cryptography import x509 - -from plugins.hold.certs import get_cert -from plugins.hold.utils import time_now - -SUBJECT = "test" -CA_NAME = "ca" -CLIENT_NAME = "client" - - -class TestCerts: - def test_create_cert(self) -> None: - cert = get_cert(SUBJECT, "", CA_NAME) - parsed = x509.load_pem_x509_certificate(cert.cert) - assert parsed.not_valid_after.year >= time_now().year + 9 - - for path in [Path(f"{CA_NAME}.pem"), Path(f"{CA_NAME}-key.pem")]: - assert Path.exists(path) - - def test_open_cert(self) -> None: - ca_cert = get_cert(SUBJECT, "", CA_NAME) - - assert ca_cert.cert == Path.read_bytes(Path(f"{CA_NAME}.pem")) - assert ca_cert.key == Path.read_bytes(Path(f"{CA_NAME}-key.pem")) - - def test_create_from_ca(self) -> None: - cert = get_cert(SUBJECT, "", CA_NAME) - get_cert(SUBJECT, "", CLIENT_NAME, cert.key) - - cert_verification = os.popen( - f"openssl verify -verbose -CAfile {CA_NAME}.pem {CLIENT_NAME}.pem" - ).read() - assert cert_verification.strip() == f"{CLIENT_NAME}.pem: OK" - - def test_clean(self) -> None: - for path in [ - f"{name}{suffix}" for name in [CA_NAME, CLIENT_NAME] for suffix in [".pem", "-key.pem"] - ]: - Path(path).unlink() diff --git a/tools/plugins/hold/tests/test_encoder.py b/tools/plugins/hold/tests/test_encoder.py deleted file mode 100644 index 3238cf1e..00000000 --- a/tools/plugins/hold/tests/test_encoder.py +++ /dev/null @@ -1,171 +0,0 @@ -import random - -import pytest -from bolt11.models.routehint import Route, RouteHint - -from plugins.hold.encoder import Defaults, Encoder, get_network_prefix, get_payment_secret -from plugins.hold.tests.utils import RpcPlugin, cln_con -from plugins.hold.utils import time_now - -route_hint = RouteHint( - routes=[ - Route( - public_key="02e425026d928083eb432886c4c209abff4aea1e6bafca208671fdb0e42be4b63d", - short_channel_id="117x1x0", - base_fee=1000, - ppm_fee=1, - cltv_expiry_delta=80, - ) - ] -) - - -class TestEncoder: - # noinspection PyTypeChecker - en = Encoder(RpcPlugin()) - - @pytest.mark.parametrize( - ("network", "prefix"), - [ - ("bitcoin", "bc"), - ("testnet", "tb"), - ("signet", "tbs"), - ("regtest", "bcrt"), - ("unknown", "bc"), - ("not found", "bc"), - ], - ) - def test_get_network_prefix(self, network: str, prefix: str) -> None: - assert get_network_prefix(network) == prefix - - def test_get_payment_secret(self) -> None: - assert get_payment_secret("val") == "val" - assert len(get_payment_secret(None)) == 64 - - def test_init(self) -> None: - self.en.init() - assert self.en._prefix == "bcrt" # noqa: SLF001 - - features = self.en._features # noqa: SLF001 - assert features is not None - - def test_encode(self) -> None: - payment_hash = random.randbytes(32).hex() - amount = 10_000 - description = "memo" - - invoice = self.en.encode(payment_hash, amount, description) - dec = cln_con("decode", invoice) - - assert dec["valid"] - assert dec["payment_secret"] != "" - assert dec["amount_msat"] == amount - assert dec["expiry"] == Defaults.Expiry - assert dec["description"] == description - assert dec["payment_hash"] == payment_hash - assert dec["created_at"] - int(time_now().timestamp()) < 2 - assert dec["min_final_cltv_expiry"] == Defaults.MinFinalCltvExpiry - - def test_encode_empty_description(self) -> None: - invoice = self.en.encode( - random.randbytes(32).hex(), - 10_000, - ) - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert dec["description"] == "" - - def test_encode_description_hash(self) -> None: - description_hash = "c84cfc6d31834f01b1c36af114883dd9eb700a4dfef4adbcff7b9af401d54ce7" - invoice = self.en.encode( - random.randbytes(32).hex(), - 10_000, - description_hash=description_hash, - ) - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert dec["description_hash"] == description_hash - - def test_encode_description_hash_invalid(self) -> None: - description_hash = "c84cfc6d31834f01b1c36af114883dd9eb700a4dfef4adbcff7b9af401d54ce" - - with pytest.raises(ValueError, match="description_hash must be 64 bytes"): - self.en.encode( - random.randbytes(32).hex(), - 10_000, - description_hash=description_hash, - ) - - @pytest.mark.parametrize("expiry", [1, 60, 1200, 3600, 3601, 7200, 86400]) - def test_encode_expiry(self, expiry: int) -> None: - invoice = self.en.encode(random.randbytes(32).hex(), 10_000, expiry=expiry) - dec = cln_con("decode", invoice) - - assert dec["expiry"] == expiry - - @pytest.mark.parametrize("cltv", [1, 2, 3, 80, 90, 144, 150]) - def test_encode_min_final_cltv_expiry(self, cltv: int) -> None: - invoice = self.en.encode( - random.randbytes(32).hex(), - 10_000, - min_final_cltv_expiry=cltv, - ) - dec = cln_con("decode", invoice) - - assert dec["valid"] - assert dec["min_final_cltv_expiry"] == cltv - - def test_encode_payment_secret(self) -> None: - payment_secret = random.randbytes(32).hex() - - invoice = self.en.encode( - random.randbytes(32).hex(), - 10_000, - "memo", - payment_secret=payment_secret, - ) - - dec = cln_con("decode", invoice) - - assert dec["valid"] - assert dec["payment_secret"] == payment_secret - - def test_encode_route_hints(self) -> None: - invoice = self.en.encode( - random.randbytes(32).hex(), - 10_000, - "memo", - route_hints=[route_hint], - ) - - dec = cln_con("decode", invoice) - assert dec["valid"] - - routes = dec["routes"] - assert len(routes) == 1 - - route = routes[0] - assert len(route) == 1 - - hop = route[0] - assert hop["pubkey"] == route_hint.routes[0].public_key - assert hop["fee_base_msat"] == route_hint.routes[0].base_fee - assert hop["short_channel_id"] == route_hint.routes[0].short_channel_id - assert hop["fee_proportional_millionths"] == route_hint.routes[0].ppm_fee - - def test_encode_route_hints_multiple(self) -> None: - invoice = self.en.encode( - random.randbytes(32).hex(), - 10_000, - "memo", - route_hints=[route_hint, route_hint], - ) - - dec = cln_con("decode", invoice) - assert dec["valid"] - - routes = dec["routes"] - assert len(routes) == 2 - assert routes[0] == routes[1] diff --git a/tools/plugins/hold/tests/test_grpc.py b/tools/plugins/hold/tests/test_grpc.py deleted file mode 100644 index 67a3cf2a..00000000 --- a/tools/plugins/hold/tests/test_grpc.py +++ /dev/null @@ -1,593 +0,0 @@ -import concurrent.futures -import random -import time -from hashlib import sha256 -from pathlib import Path - -import grpc -import pytest - -# noinspection PyProtectedMember -from grpc._channel import _InactiveRpcError, _MultiThreadedRendezvous - -from plugins.hold.config import OptionDefaults -from plugins.hold.consts import VERSION -from plugins.hold.encoder import Defaults -from plugins.hold.protos.hold_pb2 import ( - INVOICE_ACCEPTED, - INVOICE_CANCELLED, - INVOICE_PAID, - INVOICE_UNPAID, - CancelRequest, - GetInfoRequest, - GetInfoResponse, - HtlcState, - InvoiceRequest, - InvoiceState, - ListRequest, - ListResponse, - PayStatusRequest, - PayStatusResponse, - RoutingHintsRequest, - RoutingHintsResponse, - SettleRequest, - TrackAllRequest, - TrackRequest, -) -from plugins.hold.protos.hold_pb2_grpc import HoldStub -from plugins.hold.tests.utils import ( - LndNode, - LndPay, - cln_con, - connect_peers, - lnd, - start_plugin, - stop_plugin, -) -from plugins.hold.utils import time_now - - -def add_hold_invoice(cl: HoldStub) -> tuple[str, str, str]: - payment_preimage = random.randbytes(32) - payment_hash = sha256(payment_preimage).hexdigest() - - invoice = cl.Invoice( - InvoiceRequest(payment_hash=payment_hash, amount_msat=100000), - ).bolt11 - - return payment_preimage.hex(), payment_hash, invoice - - -class TestGrpc: - @pytest.fixture(scope="class", autouse=True) - def cl(self) -> HoldStub: - stop_plugin(cln_con) - start_plugin(cln_con) - cln_con("dev-wipeholdinvoices") - - connect_peers(cln_con) - - cert_path = Path("../docker/regtest/data/cln/hold") - creds = grpc.ssl_channel_credentials( - root_certificates=cert_path.joinpath("ca.pem").read_bytes(), - private_key=cert_path.joinpath("client-key.pem").read_bytes(), - certificate_chain=cert_path.joinpath("client.pem").read_bytes(), - ) - channel = grpc.secure_channel( - f"127.0.0.1:{OptionDefaults.GrpcPort}", - creds, - options=(("grpc.ssl_target_name_override", "hold"),), - ) - client = HoldStub(channel) - - yield client - - channel.close() - - cln_con("dev-wipeholdinvoices") - stop_plugin(cln_con) - - def test_get_info(self, cl: HoldStub) -> None: - res: GetInfoResponse = cl.GetInfo(GetInfoRequest()) - assert res.version == VERSION - - def test_invoice(self, cl: HoldStub) -> None: - amount = 10_000 - payment_hash = random.randbytes(32).hex() - - res = cl.Invoice(InvoiceRequest(payment_hash=payment_hash, amount_msat=amount)) - assert res.bolt11 != "" - - dec = cln_con("decode", res.bolt11) - assert dec["valid"] - assert dec["amount_msat"] == amount - assert dec["payment_hash"] == payment_hash - - def test_invoice_defaults(self, cl: HoldStub) -> None: - amount = 10_000 - payment_hash = random.randbytes(32).hex() - - res = cl.Invoice(InvoiceRequest(payment_hash=payment_hash, amount_msat=amount)) - assert res.bolt11 != "" - - dec = cln_con("decode", res.bolt11) - assert dec["valid"] - assert dec["description"] == "" - assert dec["amount_msat"] == amount - assert dec["expiry"] == Defaults.Expiry - assert dec["payment_hash"] == payment_hash - assert dec["min_final_cltv_expiry"] == Defaults.MinFinalCltvExpiry - - @pytest.mark.parametrize("description", ["some", "text", "Send to BTC address"]) - def test_invoice_description(self, cl: HoldStub, description: str) -> None: - invoice = cl.Invoice( - InvoiceRequest( - payment_hash=random.randbytes(32).hex(), - amount_msat=10_000, - description=description, - ) - ).bolt11 - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert dec["description"] == description - - def test_invoice_description_hash(self, cl: HoldStub) -> None: - description_hash = "e9a88bde48ab1318da7e914405c144a8a4f898d4e24da23e10bcdbfd7978e9e7" - invoice = cl.Invoice( - InvoiceRequest( - payment_hash=random.randbytes(32).hex(), - amount_msat=10_000, - description_hash=description_hash, - ) - ).bolt11 - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert dec["description_hash"] == description_hash - - @pytest.mark.parametrize("expiry", [1, 2, 3, 3600, 24000, 86400]) - def test_invoice_expiry(self, cl: HoldStub, expiry: int) -> None: - invoice = cl.Invoice( - InvoiceRequest( - payment_hash=random.randbytes(32).hex(), - amount_msat=10_000, - expiry=expiry, - ) - ).bolt11 - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert dec["expiry"] == expiry - - @pytest.mark.parametrize("min_final_cltv_expiry", [1, 2, 3, 80, 144, 150, 200]) - def test_invoice_min_final_cltv_expiry( - self, - cl: HoldStub, - min_final_cltv_expiry: int, - ) -> None: - invoice = cl.Invoice( - InvoiceRequest( - payment_hash=random.randbytes(32).hex(), - amount_msat=10_000, - min_final_cltv_expiry=min_final_cltv_expiry, - ) - ).bolt11 - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert dec["min_final_cltv_expiry"] == min_final_cltv_expiry - - def test_invoice_routing_hints(self, cl: HoldStub) -> None: - lnd_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - routing_hints: RoutingHintsResponse = cl.RoutingHints(RoutingHintsRequest(node=lnd_pubkey)) - - invoice = cl.Invoice( - InvoiceRequest( - payment_hash=random.randbytes(32).hex(), - amount_msat=10_000, - routing_hints=routing_hints.hints, - ) - ).bolt11 - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert len(dec["routes"]) == 1 - assert len(dec["routes"][0]) == 1 - - hop = dec["routes"][0][0] - hint = routing_hints.hints[0].hops[0] - - assert hop["pubkey"] == hint.public_key - assert hop["fee_base_msat"] == hint.base_fee - assert hop["short_channel_id"] == hint.short_channel_id - assert hop["fee_proportional_millionths"] == hint.ppm_fee - - def test_invoice_routing_hints_multiple(self, cl: HoldStub) -> None: - lnd_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - routing_hints: RoutingHintsResponse = cl.RoutingHints(RoutingHintsRequest(node=lnd_pubkey)) - - routing_hints.hints.append(routing_hints.hints[0]) - - invoice = cl.Invoice( - InvoiceRequest( - payment_hash=random.randbytes(32).hex(), - amount_msat=10_000, - routing_hints=routing_hints.hints, - ) - ).bolt11 - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert len(dec["routes"]) == 2 - assert len(dec["routes"][0]) == 1 - assert len(dec["routes"][1]) == 1 - - assert dec["routes"][0] == dec["routes"][1] - - def test_routing_hints(self, cl: HoldStub) -> None: - lnd_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - - res: RoutingHintsResponse = cl.RoutingHints(RoutingHintsRequest(node=lnd_pubkey)) - assert len(res.hints) == 1 - - hops = res.hints[0].hops - assert len(hops) == 1 - - hop = hops[0] - - channel_info = next( - chan - for chan in cln_con(f"listpeerchannels {lnd_pubkey}")["channels"] - if chan["short_channel_id"] == hop.short_channel_id - ) - - updates = channel_info["updates"]["remote"] - - assert hop.base_fee == updates["fee_base_msat"] - assert hop.cltv_expiry_delta == updates["cltv_expiry_delta"] - assert hop.ppm_fee == updates["fee_proportional_millionths"] - assert hop.short_channel_id == channel_info["short_channel_id"] - - def test_routing_hints_none_found(self, cl: HoldStub) -> None: - res: RoutingHintsResponse = cl.RoutingHints(RoutingHintsRequest(node="not found")) - assert len(res.hints) == 0 - - def test_list(self, cl: HoldStub) -> None: - invoices = cl.List(ListRequest()).invoices - assert len(invoices) > 1 - - def test_list_single(self, cl: HoldStub) -> None: - amount_msat = 10_000 - payment_hash = random.randbytes(32).hex() - - cl.Invoice(InvoiceRequest(payment_hash=payment_hash, amount_msat=amount_msat)) - - invoice = cl.List(ListRequest(payment_hash=payment_hash)).invoices - - assert len(invoice) == 1 - assert invoice[0].amount_msat == amount_msat - assert invoice[0].payment_hash == payment_hash - - def test_list_created_at(self, cl: HoldStub) -> None: - payment_hash = random.randbytes(32).hex() - cl.Invoice(InvoiceRequest(payment_hash=payment_hash, amount_msat=10_000)) - res: ListResponse = cl.List(ListRequest(payment_hash=payment_hash)) - - now = int(time_now().timestamp()) - assert now - res.invoices[0].created_at < 2 - - def test_list_not_found(self, cl: HoldStub) -> None: - payment_hash = random.randbytes(32).hex() - invoices = cl.List(ListRequest(payment_hash=payment_hash)).invoices - - assert len(invoices) == 0 - - def test_settle_accepted(self, cl: HoldStub) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cl) - - pay = LndPay(LndNode.One, invoice) - pay.start() - - time.sleep(1) - - assert cl.List(ListRequest(payment_hash=payment_hash)).invoices[0].state == INVOICE_ACCEPTED - - cl.Settle(SettleRequest(payment_preimage=payment_preimage)) - pay.join() - - assert pay.res["status"] == "SUCCEEDED" - - assert cl.List(ListRequest(payment_hash=payment_hash)).invoices[0].state == INVOICE_PAID - - def test_settle_unpaid(self, cl: HoldStub) -> None: - payment_preimage, _, _ = add_hold_invoice(cl) - - with pytest.raises(_InactiveRpcError) as err: - cl.Settle(SettleRequest(payment_preimage=payment_preimage)) - - assert err.value.code() == grpc.StatusCode.INTERNAL - assert err.value.details() == "illegal hold invoice state transition (unpaid -> paid)" - - def test_settle_non_existent(self, cl: HoldStub) -> None: - payment_preimage = random.randbytes(32).hex() - - with pytest.raises(_InactiveRpcError) as err: - cl.Settle(SettleRequest(payment_preimage=payment_preimage)) - - assert err.value.code() == grpc.StatusCode.INTERNAL - assert err.value.details() == "NoSuchInvoiceError()" - - def test_cancel_unpaid(self, cl: HoldStub) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cl) - cl.Cancel(CancelRequest(payment_hash=payment_hash)) - - assert ( - cl.List(ListRequest(payment_hash=payment_hash)).invoices[0].state == INVOICE_CANCELLED - ) - - def test_cancel_non_existent(self, cl: HoldStub) -> None: - payment_hash = random.randbytes(32).hex() - - with pytest.raises(_InactiveRpcError) as err: - cl.Cancel(CancelRequest(payment_hash=payment_hash)) - - assert err.value.code() == grpc.StatusCode.INTERNAL - assert err.value.details() == "NoSuchInvoiceError()" - - def test_track_non_existent(self, cl: HoldStub) -> None: - payment_hash = random.randbytes(32).hex() - - with pytest.raises(_MultiThreadedRendezvous) as err: - cl.Track(TrackRequest(payment_hash=payment_hash)).__next__() - - assert err.value.code() == grpc.StatusCode.INTERNAL - assert err.value.details() == "NoSuchInvoiceError()" - - def test_track_settle(self, cl: HoldStub) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cl) - - def track_states() -> list[InvoiceState]: - return [update.state for update in cl.Track(TrackRequest(payment_hash=payment_hash))] - - with concurrent.futures.ThreadPoolExecutor() as pool: - fut = pool.submit(track_states) - - pay = LndPay(LndNode.One, invoice) - pay.start() - time.sleep(1) - - invoice_state = cl.List(ListRequest(payment_hash=payment_hash)).invoices[0] - assert len(invoice_state.htlcs) == 1 - assert invoice_state.htlcs[0].state == HtlcState.HTLC_ACCEPTED - assert invoice_state.htlcs[0].short_channel_id != "" - - cl.Settle(SettleRequest(payment_preimage=payment_preimage)) - pay.join() - - assert fut.result() == [ - INVOICE_UNPAID, - INVOICE_ACCEPTED, - INVOICE_PAID, - ] - - invoice_state = cl.List(ListRequest(payment_hash=payment_hash)).invoices[0] - assert len(invoice_state.htlcs) == 1 - assert invoice_state.htlcs[0].state == HtlcState.HTLC_SETTLED - - def test_track_cancel(self, cl: HoldStub) -> None: - _, payment_hash, invoice = add_hold_invoice(cl) - - def track_states() -> list[InvoiceState]: - return [update.state for update in cl.Track(TrackRequest(payment_hash=payment_hash))] - - with concurrent.futures.ThreadPoolExecutor() as pool: - fut = pool.submit(track_states) - - pay = LndPay(LndNode.One, invoice) - pay.start() - time.sleep(1) - - cl.Cancel(CancelRequest(payment_hash=payment_hash)) - pay.join() - - assert fut.result() == [ - INVOICE_UNPAID, - INVOICE_ACCEPTED, - INVOICE_CANCELLED, - ] - - invoice_state = cl.List(ListRequest(payment_hash=payment_hash)).invoices[0] - assert len(invoice_state.htlcs) == 1 - assert invoice_state.htlcs[0].state == HtlcState.HTLC_CANCELLED - - def test_track_multiple(self, cl: HoldStub) -> None: - _, payment_hash, invoice = add_hold_invoice(cl) - - def track_states() -> list[InvoiceState]: - return [update.state for update in cl.Track(TrackRequest(payment_hash=payment_hash))] - - with concurrent.futures.ThreadPoolExecutor() as pool: - futs = [pool.submit(track_states), pool.submit(track_states)] - - pay = LndPay(LndNode.One, invoice) - pay.start() - time.sleep(1) - - cl.Cancel(CancelRequest(payment_hash=payment_hash)) - pay.join() - - for res in [fut.result() for fut in futs]: - assert res == [ - INVOICE_UNPAID, - INVOICE_ACCEPTED, - INVOICE_CANCELLED, - ] - - def test_track_cancelled_sub(self, cl: HoldStub) -> None: - _, payment_hash, invoice = add_hold_invoice(cl) - - sub = cl.Track(TrackRequest(payment_hash=payment_hash)) - - for update in sub: - assert update.state == INVOICE_UNPAID - break - - assert sub.cancel() - - pay = LndPay(LndNode.One, invoice) - pay.start() - time.sleep(1) - - cl.Cancel(CancelRequest(payment_hash=payment_hash)) - pay.join() - - # Make sure the plugin is still alive - invoice_res = cl.List(ListRequest(payment_hash=payment_hash)).invoices[0] - assert invoice_res.bolt11 == invoice - assert invoice_res.state == INVOICE_CANCELLED - - def test_track_multiple_cancelled_sub(self, cl: HoldStub) -> None: - _, payment_hash, invoice = add_hold_invoice(cl) - - def track_states(cancel: bool) -> list[InvoiceState]: - if cancel: - sub = cl.Track(TrackRequest(payment_hash=payment_hash)) - - updates = [] - for update in sub: - updates = [update.state] - sub.cancel() - break - - return updates - - return [update.state for update in cl.Track(TrackRequest(payment_hash=payment_hash))] - - with concurrent.futures.ThreadPoolExecutor(2) as pool: - futs = [ - pool.submit(track_states, True), - pool.submit(track_states, False), - ] - - pay = LndPay(LndNode.One, invoice) - pay.start() - time.sleep(1) - - cl.Cancel(CancelRequest(payment_hash=payment_hash)) - pay.join() - - res = [fut.result() for fut in futs] - assert res[0] == [INVOICE_UNPAID] - assert res[1] == [ - INVOICE_UNPAID, - INVOICE_ACCEPTED, - INVOICE_CANCELLED, - ] - - def test_track_all(self, cl: HoldStub) -> None: - expected_events = 6 - - def track_states() -> list[tuple[str, str, str]]: - evs = [] - - sub = cl.TrackAll(TrackAllRequest()) - for ev in sub: - evs.append((ev.payment_hash, ev.bolt11, ev.state)) - if len(evs) == expected_events: - sub.cancel() - break - - return evs - - with concurrent.futures.ThreadPoolExecutor() as pool: - fut = pool.submit(track_states) - - _, payment_hash_created, invoice_created = add_hold_invoice(cl) - _, payment_hash_cancelled, invoice_cancelled = add_hold_invoice(cl) - ( - payment_preimage_settled, - payment_hash_settled, - invoice_settled, - ) = add_hold_invoice(cl) - - cl.Cancel(CancelRequest(payment_hash=payment_hash_cancelled)) - - pay = LndPay(LndNode.One, invoice_settled) - pay.start() - time.sleep(1) - - cl.Settle(SettleRequest(payment_preimage=payment_preimage_settled)) - pay.join() - - res = fut.result() - assert len(res) == expected_events - assert res == [ - (payment_hash_created, invoice_created, INVOICE_UNPAID), - (payment_hash_cancelled, invoice_cancelled, INVOICE_UNPAID), - (payment_hash_settled, invoice_settled, INVOICE_UNPAID), - (payment_hash_cancelled, invoice_cancelled, INVOICE_CANCELLED), - (payment_hash_settled, invoice_settled, INVOICE_ACCEPTED), - (payment_hash_settled, invoice_settled, INVOICE_PAID), - ] - - def test_pay_status_empty(self, cl: HoldStub) -> None: - _, _, invoice = add_hold_invoice(cl) - res: PayStatusResponse = cl.PayStatus(PayStatusRequest(bolt11=invoice)) - assert res.status == [] - - def test_pay_status_success(self, cl: HoldStub) -> None: - amount = 100 - inv_res = lnd(LndNode.One, "addinvoice", str(amount)) - cln_con("pay", inv_res["payment_request"]) - - res: PayStatusResponse = cl.PayStatus(PayStatusRequest(bolt11=inv_res["payment_request"])) - assert len(res.status) == 1 - - status = res.status[0] - - assert status.bolt11 == inv_res["payment_request"] - assert status.amount_msat == amount * 1000 - assert status.destination == lnd(LndNode.One, "getinfo")["identity_pubkey"] - - assert len(status.attempts) >= 1 - attempt = status.attempts[len(status.attempts) - 1] - - assert attempt.strategy == "Initial attempt" - assert attempt.start_time > 0 - assert attempt.age_in_seconds in [0, 1] - assert attempt.end_time > 0 - assert attempt.state == PayStatusResponse.PayStatus.Attempt.ATTEMPT_COMPLETED - assert attempt.success.id > 0 - assert ( - attempt.success.payment_preimage - == lnd(LndNode.One, "lookupinvoice", inv_res["r_hash"])["r_preimage"] - ) - - def test_pay_status_failure(self, cl: HoldStub) -> None: - amount = 100 - inv_res = lnd(LndNode.One, "addinvoice", str(amount)) - lnd(LndNode.One, "cancelinvoice", inv_res["r_hash"]) - cln_con("pay", inv_res["payment_request"]) - - res: PayStatusResponse = cl.PayStatus(PayStatusRequest(bolt11=inv_res["payment_request"])) - assert len(res.status) == 1 - - status = res.status[0] - assert len(status.attempts) == 1 - failure: PayStatusResponse.PayStatus.Attempt.Failure = status.attempts[0].failure - - assert failure.code == 203 - assert ( - failure.message - == "failed: WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS (reply from remote)" - ) - assert failure.data.id > 0 - assert failure.data.fail_codename == "WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS" - assert failure.data.fail_code == 16399 - assert failure.data.erring_index == 1 - assert failure.data.erring_node == lnd(LndNode.One, "getinfo")["identity_pubkey"] - - def test_pay_status_all(self, cl: HoldStub) -> None: - res: PayStatusResponse = cl.PayStatus(PayStatusRequest()) - assert len(res.status) > 1 diff --git a/tools/plugins/hold/tests/test_plugin.py b/tools/plugins/hold/tests/test_plugin.py deleted file mode 100644 index 41a02163..00000000 --- a/tools/plugins/hold/tests/test_plugin.py +++ /dev/null @@ -1,724 +0,0 @@ -import json -import random -import time -import uuid -from hashlib import sha256 - -import bolt11 -import pytest -from bolt11.types import MilliSatoshi - -from plugins.hold.consts import OVERPAYMENT_FACTOR, PLUGIN_NAME -from plugins.hold.encoder import Defaults -from plugins.hold.tests.utils import ( - PLUGIN_PATH, - CliCaller, - LndNode, - LndPay, - cln_con, - connect_peers, - format_json, - lnd, - start_plugin, - stop_plugin, -) - - -def add_hold_invoice(cln: CliCaller, amount_msat: int = 100_000) -> tuple[str, str, str]: - payment_preimage = random.randbytes(32) - payment_hash = sha256(payment_preimage).hexdigest() - - invoice = cln( - "holdinvoice", - payment_hash, - f"{amount_msat}", - )["bolt11"] - - return payment_preimage.hex(), payment_hash, invoice - - -class TestHold: - @pytest.fixture(scope="class", autouse=True) - def cln(self) -> CliCaller: - stop_plugin(cln_con) - start_plugin(cln_con) - cln_con("dev-wipeholdinvoices") - - connect_peers(cln_con) - - yield cln_con - - cln_con("dev-wipeholdinvoices") - stop_plugin(cln_con) - - def test_add(self, cln: CliCaller) -> None: - payment_hash = random.randbytes(32).hex() - - cln_res = cln("holdinvoice", payment_hash, "10000") - assert "bolt11" in cln_res - - hold_invoices = cln("listholdinvoices")["holdinvoices"] - assert len(hold_invoices) == 1 - assert hold_invoices[0]["state"] == "unpaid" - assert hold_invoices[0]["payment_preimage"] is None - assert hold_invoices[0]["bolt11"] == cln_res["bolt11"] - assert hold_invoices[0]["payment_hash"] == payment_hash - - def test_add_defaults(self, cln: CliCaller) -> None: - amount = 10_000 - payment_hash = random.randbytes(32).hex() - - invoice = cln("holdinvoice", payment_hash, str(amount))["bolt11"] - - dec = cln("decode", invoice) - assert dec["valid"] - assert dec["description"] == "" - assert dec["amount_msat"] == amount - assert dec["expiry"] == Defaults.Expiry - assert dec["payment_hash"] == payment_hash - assert dec["min_final_cltv_expiry"] == Defaults.MinFinalCltvExpiry - - @pytest.mark.parametrize("length", [30, 31, 33, 34, 64]) - def test_add_invalid_payment_hash_length(self, cln: CliCaller, length: int) -> None: - amount = 10_000 - payment_hash = random.randbytes(length).hex() - - res = cln("holdinvoice", payment_hash, str(amount)) - assert res["code"] == 2104 - assert res["message"] == "invalid payment hash length" - - @pytest.mark.parametrize("description", ["some", "text", "Send to BTC address"]) - def test_add_description(self, cln: CliCaller, description: str) -> None: - invoice = cln( - "holdinvoice", - random.randbytes(32).hex(), - "10000", - f'"{description}"', - )["bolt11"] - - dec = cln("decode", invoice) - assert dec["valid"] - assert dec["description"] == description - - @pytest.mark.parametrize("expiry", [1, 2, 3, 3600, 24000, 86400]) - def test_add_expiry(self, cln: CliCaller, expiry: int) -> None: - invoice = cln( - "-k", - "holdinvoice", - f"payment_hash={random.randbytes(32).hex()}", - "amount_msat=10000", - f"expiry={expiry}", - )["bolt11"] - - dec = cln("decode", invoice) - assert dec["valid"] - assert dec["expiry"] == expiry - - @pytest.mark.parametrize("min_final_cltv_expiry", [1, 2, 3, 80, 144, 150, 200]) - def test_add_min_final_cltv_expiry( - self, - cln: CliCaller, - min_final_cltv_expiry: int, - ) -> None: - invoice = cln( - "-k", - "holdinvoice", - f"payment_hash={random.randbytes(32).hex()}", - "amount_msat=10000", - f"min_final_cltv_expiry={min_final_cltv_expiry}", - )["bolt11"] - - dec = cln("decode", invoice) - assert dec["valid"] - assert dec["min_final_cltv_expiry"] == min_final_cltv_expiry - - def test_invoice_routing_hints(self, cln: CliCaller) -> None: - lnd_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - hints = cln("routinghints", lnd_pubkey)["hints"] - - invoice = cln( - "-k", - "holdinvoice", - f"payment_hash={random.randbytes(32).hex()}", - "amount_msat=10000", - f"routing_hints={format_json(hints)}", - )["bolt11"] - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert len(dec["routes"]) == 1 - assert len(dec["routes"][0]) == 1 - - hop = dec["routes"][0][0] - hint = hints[0]["routes"][0] - - assert hop["pubkey"] == hint["public_key"] - assert hop["fee_base_msat"] == hint["base_fee"] - assert hop["short_channel_id"] == hint["short_channel_id"] - assert hop["fee_proportional_millionths"] == hint["ppm_fee"] - - def test_invoice_routing_hints_multiple(self, cln: CliCaller) -> None: - lnd_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - hints = cln("routinghints", lnd_pubkey)["hints"] - hints.append(hints[0]) - - invoice = cln( - "-k", - "holdinvoice", - f"payment_hash={random.randbytes(32).hex()}", - "amount_msat=10000", - f"routing_hints={format_json(hints)}", - )["bolt11"] - - dec = cln_con("decode", invoice) - assert dec["valid"] - assert len(dec["routes"]) == 2 - assert len(dec["routes"][0]) == 1 - assert len(dec["routes"][1]) == 1 - - assert dec["routes"][0] == dec["routes"][1] - - def test_add_duplicate_fail(self, cln: CliCaller) -> None: - amount = 10000 - payment_hash = random.randbytes(32).hex() - - assert "bolt11" in cln("holdinvoice", payment_hash, str(amount)) - - cln_res = cln("holdinvoice", payment_hash, str(amount)) - assert cln_res["code"] == 2101 - assert cln_res["message"] == "hold invoice with that payment hash exists already" - - def test_add_invoice_duplicate_fail(self, cln: CliCaller) -> None: - payment_hash = cln("invoice", "1000", str(uuid.uuid4()), '""')["payment_hash"] - - cln_res = cln("holdinvoice", payment_hash, "10000") - assert cln_res["code"] == 2101 - assert cln_res["message"] == "hold invoice with that payment hash exists already" - - def test_list(self, cln: CliCaller) -> None: - invoices = cln("listholdinvoices")["holdinvoices"] - assert len(invoices) > 1 - - def test_list_single(self, cln: CliCaller) -> None: - amount = 123_000 - _, payment_hash, invoice = add_hold_invoice(cln, amount) - - invoice = cln("listholdinvoices", payment_hash)["holdinvoices"] - assert len(invoice) == 1 - - assert invoice[0]["payment_hash"] == payment_hash - assert invoice[0]["amount_msat"] == amount - - def test_list_legacy_format(self, cln: CliCaller) -> None: - data = { - "state": "unpaid", - "payment_preimage": None, - "created_at": 1697995743, - "payment_hash": "e3e9513787fae9478704447fc954cbd1de61299f4656f2b5afb7d1a02628d3be", - "bolt11": "lnbcrt12323230p1pjn2k7lsp57u9d0zghvyenzmxtk4xzq2yjkgj3hspcg82jzp0szvyyqnl0cekspp5u054zdu8lt550pcyg3luj4xt680xz2vlget09dd0klg6qf3g6wlqdqqcqzzs9qxpqysgqlnxpq3fd0g9wsfvpmd0anlc6n6umef9v48wjgw8myp4c9fgsf68nt4hchp9v62s8ppqxa858gk4yyats6unr2nhv2r9jntu5sj79xxcpugvr9l", # noqa: E501 - } - - data_dump = json.dumps(data).replace('"', '\\"').replace("{", "\\{").replace("}", "\\}") - cln( - "datastore", - format_json([PLUGIN_NAME, "invoices", data["payment_hash"]]), - f'"{data_dump}"', - ) - cln( - "listdatastore", - format_json([PLUGIN_NAME, "invoices", data["payment_hash"]]), - ) - - invoices = cln("listholdinvoices", data["payment_hash"])["holdinvoices"] - assert len(invoices) == 1 - assert invoices[0]["amount_msat"] == 1232323 - - @pytest.mark.parametrize("payment_hash_param", ["", "none", "null"]) - def test_list_by_invoice(self, cln: CliCaller, payment_hash_param: str) -> None: - _, payment_hash, invoice = add_hold_invoice(cln) - - invoice_res = cln("listholdinvoices", payment_hash_param, invoice)["holdinvoices"] - assert len(invoice_res) == 1 - assert invoice_res[0]["bolt11"] == invoice - assert invoice_res[0]["payment_hash"] == payment_hash - - def test_list_by_invoice_first_param(self, cln: CliCaller) -> None: - _, payment_hash, invoice = add_hold_invoice(cln) - - invoice_res = cln("listholdinvoices", invoice)["holdinvoices"] - assert len(invoice_res) == 1 - assert invoice_res[0]["bolt11"] == invoice - assert invoice_res[0]["payment_hash"] == payment_hash - - def test_list_not_found(self, cln: CliCaller) -> None: - payment_hash = random.randbytes(32).hex() - invoices = cln("listholdinvoices", payment_hash) - - assert len(invoices["holdinvoices"]) == 0 - - def test_settle_accepted(self, cln: CliCaller) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cln) - - pay = LndPay(LndNode.One, invoice) - pay.start() - - time.sleep(1) - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "accepted" - for htlc in list_invoice["htlcs"]: - assert htlc["state"] == "accepted" - assert htlc["channel_id"] != 0 - assert htlc["short_channel_id"] != "" - - cln("settleholdinvoice", payment_preimage) - pay.join() - - assert pay.res["status"] == "SUCCEEDED" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - - assert list_invoice["state"] == "paid" - for htlc in list_invoice["htlcs"]: - assert htlc["state"] == "paid" - assert htlc["channel_id"] != 0 - assert htlc["short_channel_id"] != "" - - @pytest.mark.parametrize("parts", [2, 4]) - def test_settle_accepted_mpp(self, cln: CliCaller, parts: int) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cln) - amount = int(lnd(LndNode.One, "decodepayreq", invoice)["num_satoshis"]) - - pay = LndPay(LndNode.One, invoice, max_shard_size=int(amount / parts)) - pay.start() - - time.sleep(1) - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - - assert list_invoice["state"] == "accepted" - assert len(list_invoice["htlcs"]) == parts - for htlc in list_invoice["htlcs"]: - assert htlc["state"] == "accepted" - - cln("settleholdinvoice", payment_preimage) - pay.join() - - assert pay.res["status"] == "SUCCEEDED" - assert len(pay.res["htlcs"]) == parts - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - - assert list_invoice["state"] == "paid" - assert len(list_invoice["htlcs"]) == parts - for htlc in list_invoice["htlcs"]: - assert htlc["state"] == "paid" - - def test_reject_pay_settled(self, cln: CliCaller) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cln) - - pay = LndPay(LndNode.One, invoice) - pay.start() - - time.sleep(1) - - cln("settleholdinvoice", payment_preimage) - pay.join() - - assert pay.res["status"] == "SUCCEEDED" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "paid" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "paid" - - pay = LndPay(LndNode.Two, invoice) - pay.start() - pay.join() - - assert pay.res["status"] == "FAILED" - assert pay.res["failure_reason"] == "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "paid" - assert len(list_invoice["htlcs"]) == 2 - assert list_invoice["htlcs"][0]["state"] == "paid" - assert list_invoice["htlcs"][1]["state"] == "cancelled" - - def test_reject_pay_accepted(self, cln: CliCaller) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cln) - - pay = LndPay(LndNode.One, invoice) - pay.start() - - time.sleep(1) - - pay_two = LndPay(LndNode.Two, invoice) - pay_two.start() - pay_two.join() - - assert pay_two.res["status"] == "FAILED" - assert pay_two.res["failure_reason"] == "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "accepted" - assert len(list_invoice["htlcs"]) == 2 - assert list_invoice["htlcs"][0]["state"] == "accepted" - assert list_invoice["htlcs"][1]["state"] == "cancelled" - - cln("settleholdinvoice", payment_preimage) - pay.join() - - assert pay.res["status"] == "SUCCEEDED" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "paid" - assert len(list_invoice["htlcs"]) == 2 - assert list_invoice["htlcs"][0]["state"] == "paid" - assert list_invoice["htlcs"][1]["state"] == "cancelled" - - def test_settle_unpaid(self, cln: CliCaller) -> None: - payment_preimage, _, _ = add_hold_invoice(cln) - - err_res = cln("settleholdinvoice", payment_preimage) - assert err_res["code"] == 2103 - assert err_res["message"] == "illegal hold invoice state transition (unpaid -> paid)" - - def test_settle_cancelled(self, cln: CliCaller) -> None: - payment_preimage, payment_hash, _ = add_hold_invoice(cln) - - cln("cancelholdinvoice", payment_hash) - err_res = cln("settleholdinvoice", payment_preimage) - assert err_res["code"] == 2103 - assert err_res["message"] == "illegal hold invoice state transition (cancelled -> paid)" - - def test_settle_non_existent(self, cln: CliCaller) -> None: - payment_preimage = random.randbytes(32).hex() - res = cln("settleholdinvoice", payment_preimage) - - assert res["code"] == 2102 - assert res["message"] == "hold invoice with that payment hash does not exist" - - def test_cancel_unpaid(self, cln: CliCaller) -> None: - payment_hash = random.randbytes(32).hex() - cln("holdinvoice", payment_hash, "100000") - - assert len(cln("cancelholdinvoice", payment_hash)) == 0 - assert ( - cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0]["state"] - == "cancelled" - ) - - def test_cancel_accepted(self, cln: CliCaller) -> None: - _, payment_hash, invoice = add_hold_invoice(cln) - - pay = LndPay(LndNode.One, invoice) - pay.start() - - time.sleep(0.5) - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "accepted" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "accepted" - - cln("cancelholdinvoice", payment_hash) - pay.join() - - assert pay.res["status"] == "FAILED" - assert pay.res["failure_reason"] == "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "cancelled" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "cancelled" - - def test_cancel_cancelled(self, cln: CliCaller) -> None: - payment_hash = random.randbytes(32).hex() - cln("holdinvoice", payment_hash, "100000") - - assert len(cln("cancelholdinvoice", payment_hash)) == 0 - assert len(cln("cancelholdinvoice", payment_hash)) == 0 - - def test_cancel_non_existent(self, cln: CliCaller) -> None: - payment_hash = random.randbytes(32).hex() - res = cln("cancelholdinvoice", payment_hash) - - assert res["code"] == 2102 - assert res["message"] == "hold invoice with that payment hash does not exist" - - def test_mpp_timeout(self, cln: CliCaller) -> None: - _, payment_hash, invoice = add_hold_invoice(cln) - dec = bolt11.decode(invoice) - dec.amount_msat = MilliSatoshi(dec.amount_msat - 1000) - - less_invoice = cln("signinvoice", bolt11.encode(dec))["bolt11"] - - pay = LndPay(LndNode.One, less_invoice, timeout=5) - pay.start() - - time.sleep(0.5) - assert ( - cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0]["state"] - == "unpaid" - ) - - pay.join() - - assert pay.res["status"] == "FAILED" - assert pay.res["failure_reason"] == "FAILURE_REASON_TIMEOUT" - assert len(pay.res["htlcs"]) == 1 - - htlc = pay.res["htlcs"][0] - assert htlc["failure"]["code"] == "MPP_TIMEOUT" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "unpaid" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "cancelled" - - def test_htlc_too_little_cltv(self, cln: CliCaller) -> None: - _, payment_hash, invoice = add_hold_invoice(cln) - dec = lnd(LndNode.One, "decodepayreq", invoice) - block_height = lnd(LndNode.One, "getinfo")["block_height"] - - routes = lnd( - LndNode.One, - "queryroutes", - dec["destination"], - dec["num_satoshis"], - ) - - time_lock = int(block_height) + int(dec["cltv_expiry"]) - 1 - routes["routes"][0]["total_time_lock"] = time_lock - routes["routes"][0]["hops"][0]["expiry"] = time_lock - - res = lnd( - LndNode.One, - "sendtoroute", - "--payment_hash", - payment_hash, - format_json(routes), - ) - - assert res["status"] == "FAILED" - assert res["failure"]["code"] == "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "unpaid" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "cancelled" - - def test_htlc_payment_secret_wrong(self, cln: CliCaller) -> None: - payment_preimage, payment_hash, invoice = add_hold_invoice(cln) - cltv = cln_con("decode", invoice)["min_final_cltv_expiry"] - - cln_invoice = cln_con( - "invoice", - "-k", - "amount_msat=10000", - f"label={uuid.uuid4()!s}", - "description=copy", - f"preimage={payment_preimage}", - f"cltv={cltv}", - )["bolt11"] - - pay = LndPay(LndNode.One, cln_invoice) - pay.start() - pay.join() - - assert pay.res["status"] == "FAILED" - assert pay.res["failure_reason"] == "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "unpaid" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "cancelled" - - def test_htlc_payment_secret_missing(self, cln: CliCaller) -> None: - _, payment_hash, invoice = add_hold_invoice(cln) - dec = lnd(LndNode.One, "decodepayreq", invoice) - - routes = lnd( - LndNode.One, - "queryroutes", - dec["destination"], - dec["num_satoshis"], - ) - res = lnd( - LndNode.One, - "sendtoroute", - "--payment_hash", - payment_hash, - format_json(routes), - ) - - assert res["status"] == "FAILED" - assert res["failure"]["code"] == "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "unpaid" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "cancelled" - - def test_overpayment_protection(self, cln: CliCaller) -> None: - _, payment_hash, invoice = add_hold_invoice(cln) - dec = bolt11.decode(invoice) - dec.amount_msat = MilliSatoshi((dec.amount_msat * OVERPAYMENT_FACTOR) + 1) - - overpay_invoice = cln("signinvoice", bolt11.encode(dec))["bolt11"] - - pay = LndPay(LndNode.One, overpay_invoice, timeout=5) - pay.start() - - time.sleep(0.5) - assert ( - cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0]["state"] - == "unpaid" - ) - - pay.join() - - assert pay.res["status"] == "FAILED" - assert pay.res["failure_reason"] == "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS" - - htlc = pay.res["htlcs"][0] - assert htlc["failure"]["code"] == "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS" - - list_invoice = cln( - "listholdinvoices", - payment_hash, - )["holdinvoices"][0] - assert list_invoice["state"] == "unpaid" - assert len(list_invoice["htlcs"]) == 1 - assert list_invoice["htlcs"][0]["state"] == "cancelled" - - def test_routinghints(self, cln: CliCaller) -> None: - lnd_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - hints = cln("routinghints", lnd_pubkey)["hints"] - assert len(hints) == 1 - - routes = hints[0] - assert len(routes) == 1 - assert len(routes["routes"]) == 1 - - route = routes["routes"][0] - - channel_info = next( - chan - for chan in cln_con(f"listpeerchannels {lnd_pubkey}")["channels"] - if chan["short_channel_id"] == route["short_channel_id"] - ) - - updates = channel_info["updates"]["remote"] - - assert route["base_fee"] == updates["fee_base_msat"] - assert route["cltv_expiry_delta"] == updates["cltv_expiry_delta"] - assert route["ppm_fee"] == updates["fee_proportional_millionths"] - assert route["short_channel_id"] == channel_info["short_channel_id"] - - def test_routinghints_none_found(self, cln: CliCaller) -> None: - res = cln("routinghints", "none") - assert "hints" in res - assert len(res["hints"]) == 0 - - def test_wipe_single(self, cln: CliCaller) -> None: - _, payment_hash, _ = add_hold_invoice(cln) - res = cln("dev-wipeholdinvoices", payment_hash) - - assert res["deleted_count"] == 1 - assert len(cln("listholdinvoices", payment_hash)["holdinvoices"]) == 0 - - def test_wipe(self, cln: CliCaller) -> None: - for _ in range(11): - add_hold_invoice(cln) - - invoices = len(cln("listholdinvoices")["holdinvoices"]) - - assert cln("dev-wipeholdinvoices")["deleted_count"] == invoices - assert len(cln("listholdinvoices")["holdinvoices"]) == 0 - - def test_wipe_not_found(self, cln: CliCaller) -> None: - payment_hash = random.randbytes(32).hex() - res = cln("dev-wipeholdinvoices", payment_hash) - - assert res["code"] == 2102 - assert res["message"] == "hold invoice with that payment hash does not exist" - - def test_ignore_non_hold(self, cln: CliCaller) -> None: - invoice = cln("invoice", "1000", str(uuid.uuid4()), '""')["bolt11"] - - pay = LndPay(LndNode.One, invoice) - pay.start() - pay.join() - - assert pay.res["status"] == "SUCCEEDED" - - def test_ignore_forward(self, cln: CliCaller) -> None: - cln_id = cln("getinfo")["id"] - channels = lnd(LndNode.One, "listchannels")["channels"] - cln_channel = next(c for c in channels if c["remote_pubkey"] == cln_id)["chan_id"] - - invoice = lnd(LndNode.Two, "addinvoice", "10000")["payment_request"] - - pay = LndPay(LndNode.One, invoice, outgoing_chan_id=cln_channel) - pay.start() - pay.join() - - assert pay.res["status"] == "SUCCEEDED" - assert len(pay.res["htlcs"][0]["route"]["hops"]) == 2 - - def test_plugin_still_alive(self, cln: CliCaller) -> None: - plugins = cln("plugin", "list")["plugins"] - assert any(PLUGIN_PATH in plugin["name"] for plugin in plugins) diff --git a/tools/plugins/hold/tests/test_route_hints.py b/tools/plugins/hold/tests/test_route_hints.py deleted file mode 100644 index 828f36a5..00000000 --- a/tools/plugins/hold/tests/test_route_hints.py +++ /dev/null @@ -1,39 +0,0 @@ -from plugins.hold.route_hints import RouteHints -from plugins.hold.tests.utils import LndNode, RpcPlugin, cln_con, lnd - - -class TestRouteHints: - # noinspection PyTypeChecker - rh = RouteHints(RpcPlugin()) - - def test_get_private_channels(self) -> None: - other_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - - hints = self.rh.get_private_channels(other_pubkey) - assert len(hints) == 1 - - hint = hints[0] - assert len(hint.routes) == 1 - - route = hint.routes[0] - assert route.public_key == other_pubkey - - channel_info = next( - chan - for chan in cln_con(f"listpeerchannels {other_pubkey}")["channels"] - if chan["private"] - ) - updates = channel_info["updates"]["remote"] - - assert route.base_fee == updates["fee_base_msat"] - assert route.cltv_expiry_delta == updates["cltv_expiry_delta"] - assert route.ppm_fee == updates["fee_proportional_millionths"] - assert route.short_channel_id == channel_info["short_channel_id"] - - def test_get_private_channels_none_found(self) -> None: - assert ( - self.rh.get_private_channels( - "0394c0450766d4029e980dd2934fbc4ca665222e3149c2a4a7b8a6251544a12033" - ) - == [] - ) diff --git a/tools/plugins/hold/tests/test_router.py b/tools/plugins/hold/tests/test_router.py deleted file mode 100644 index e205f8cd..00000000 --- a/tools/plugins/hold/tests/test_router.py +++ /dev/null @@ -1,63 +0,0 @@ -import pytest - -from plugins.hold.router import Hop, NoRouteError, Router -from plugins.hold.tests.utils import LndNode, RpcPlugin, lnd - - -class TestRouter: - # noinspection PyTypeChecker - r = Router(RpcPlugin()) - - def test_get_route(self) -> None: - other_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - route = self.r.get_route(other_pubkey, 1000, 0, None, None, None) - assert len(route) == 1 - - def test_get_route_final_cltv(self) -> None: - other_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - route = self.r.get_route(other_pubkey, 1000, 0, None, 90, None) - assert len(route) == 1 - assert route[0].delay == 90 - - def test_get_route_too_little_max_cltv(self) -> None: - other_pubkey = lnd(LndNode.One, "getinfo")["identity_pubkey"] - - with pytest.raises(NoRouteError): - self.r.get_route(other_pubkey, 1000, 0, 1, None, None) - - def test_get_route_no_channels(self) -> None: - with pytest.raises(NoRouteError): - self.r.get_route( - "03aaf57c1641e070b0b84d203d223083319eeeddbb43170adf8da0f010bcecff5b,", - 1000, - 0, - None, - None, - None, - ) - - @pytest.mark.parametrize( - ("delays", "result"), - [ - ([1], 0), - ([81, 1], 0), - ([101, 100], 0), - ([120, 81, 1], 1), - ([80, 60, 40, 20, 0], 3), - ([241, 209, 169, 129, 89, 9], 4), - ], - ) - def test_parse_time(self, delays: list[int], result: int) -> None: - hops = [ - Hop( - node_id=f"{delay}", - channel="", - direction=0, - amount_msat=0, - delay=delay, - style="", - ) - for delay in delays - ] - - assert Router._most_expensive_channel(hops) == hops[result] # noqa: SLF001 diff --git a/tools/plugins/hold/tests/test_server.py b/tools/plugins/hold/tests/test_server.py deleted file mode 100644 index 0ae6b5c0..00000000 --- a/tools/plugins/hold/tests/test_server.py +++ /dev/null @@ -1,88 +0,0 @@ -import socket -from contextlib import closing -from unittest.mock import MagicMock - -import grpc -import pytest - -# noinspection PyProtectedMember -from grpc._channel import _InactiveRpcError - -from plugins.hold.protos.hold_pb2 import InvoiceRequest -from plugins.hold.protos.hold_pb2_grpc import HoldStub -from plugins.hold.server import Server - - -def free_port() -> int: - with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s: - s.bind(("", 0)) - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - return s.getsockname()[1] - - -class TestServer: - hold = MagicMock() - plugin = MagicMock() - - @pytest.fixture(scope="class", autouse=True) - def client(self) -> HoldStub: - host = "127.0.0.1" - port = free_port() - server = Server(self.plugin, self.hold) - server.start(host, port, None) - - channel = grpc.insecure_channel(f"{host}:{port}") - hold = HoldStub(channel) - - yield hold - - channel.close() - server.stop() - - def test_log_request(self, client: HoldStub) -> None: - expected = "invoice" - self.hold.invoice.return_value = expected - - assert client.Invoice(InvoiceRequest()).bolt11 == expected - - assert self.hold.invoice.call_count == 1 - assert self.plugin.log.call_count == 2 - assert self.plugin.log.call_args_list[1][0] == ("gRPC call /hold.Hold/Invoice",) - assert self.plugin.log.call_args_list[1][1] == {"level": "debug"} - - def test_log_error(self, client: HoldStub) -> None: - class TestError(Exception): - def __init__(self, message: str) -> None: - super().__init__(message) - - self.hold.invoice.side_effect = TestError("critical error") - - with pytest.raises(_InactiveRpcError): - client.Invoice(InvoiceRequest()) - - assert self.hold.invoice.call_count == 2 - assert self.plugin.log.call_count == 4 - assert self.plugin.log.call_args_list[2][0] == ("gRPC call /hold.Hold/Invoice",) - assert self.plugin.log.call_args_list[2][1] == {"level": "debug"} - assert self.plugin.log.call_args_list[3][0] == ( - "gRPC call /hold.Hold/Invoice failed: critical error", - ) - assert self.plugin.log.call_args_list[3][1] == {"level": "warn"} - - def test_log_error_repr(self, client: HoldStub) -> None: - class CustomNameError(Exception): - pass - - self.hold.invoice.side_effect = CustomNameError() - - with pytest.raises(_InactiveRpcError): - client.Invoice(InvoiceRequest()) - - assert self.hold.invoice.call_count == 3 - assert self.plugin.log.call_count == 6 - assert self.plugin.log.call_args_list[4][0] == ("gRPC call /hold.Hold/Invoice",) - assert self.plugin.log.call_args_list[4][1] == {"level": "debug"} - assert self.plugin.log.call_args_list[5][0] == ( - f"gRPC call /hold.Hold/Invoice failed: {CustomNameError()!r}", - ) - assert self.plugin.log.call_args_list[5][1] == {"level": "warn"} diff --git a/tools/plugins/hold/tests/test_tracker.py b/tools/plugins/hold/tests/test_tracker.py deleted file mode 100644 index dbdca021..00000000 --- a/tools/plugins/hold/tests/test_tracker.py +++ /dev/null @@ -1,116 +0,0 @@ -import random - -from plugins.hold.enums import InvoiceState -from plugins.hold.tracker import InvoiceUpdate, Tracker - - -class TestTracker: - def test_track_new_payment_hash(self) -> None: - payment_hash = random.randbytes(32).hex() - - track = Tracker() - q = track.track(payment_hash) - - assert track._fwds[payment_hash].size() == 1 # noqa: SLF001 - assert track._fwds[payment_hash]._qs[0] == q # noqa: SLF001 - - def test_track_existing_payment_hash(self) -> None: - payment_hash = random.randbytes(32).hex() - track = Tracker() - - q1 = track.track(payment_hash) - q2 = track.track(payment_hash) - - assert track._fwds[payment_hash].size() == 2 # noqa: SLF001 - assert track._fwds[payment_hash]._qs[0] == q1 # noqa: SLF001 - assert track._fwds[payment_hash]._qs[1] == q2 # noqa: SLF001 - - def test_stop_tracking_empty_afterwards(self) -> None: - payment_hash = random.randbytes(32).hex() - track = Tracker() - q = track.track(payment_hash) - - track.stop_tracking(payment_hash, q) - - assert len(track._fwds) == 0 # noqa: SLF001 - - def test_stop_tracking(self) -> None: - payment_hash = random.randbytes(32).hex() - track = Tracker() - q1 = track.track(payment_hash) - q2 = track.track(payment_hash) - - track.stop_tracking(payment_hash, q1) - - assert track._fwds[payment_hash].size() == 1 # noqa: SLF001 - assert track._fwds[payment_hash]._qs[0] == q2 # noqa: SLF001 - - def test_send_update_no_queues(self) -> None: - payment_hash = random.randbytes(32).hex() - track = Tracker() - track.send_update(payment_hash, "invoice", InvoiceState.Paid) - - def test_send_update_queue(self) -> None: - payment_hash = random.randbytes(32).hex() - track = Tracker() - q = track.track(payment_hash) - - update = InvoiceState.Accepted - track.send_update(payment_hash, "invoice", update) - - assert q.get() == update - - def test_send_update_queues(self) -> None: - payment_hash = random.randbytes(32).hex() - track = Tracker() - q1 = track.track(payment_hash) - q2 = track.track(payment_hash) - - update = InvoiceState.Accepted - track.send_update(payment_hash, "invoice", update) - - assert q1.get() == update - assert q2.get() == update - - def test_track_all(self) -> None: - track = Tracker() - q = track.track_all() - - assert track._all_fwds is not None # noqa: SLF001 - assert track._all_fwds.size() == 1 # noqa: SLF001 - assert track._all_fwds._qs[0] == q # noqa: SLF001 - - def test_stop_tracking_all(self) -> None: - track = Tracker() - q1 = track.track_all() - q2 = track.track_all() - - track.stop_tracking_all(q1) - - assert track._all_fwds.size() == 1 # noqa: SLF001 - assert track._all_fwds._qs[0] == q2 # noqa: SLF001 - - def test_send_update_all(self) -> None: - payment_hash = random.randbytes(32).hex() - track = Tracker() - q = track.track_all() - - invoice = "lnbc" - update = InvoiceState.Accepted - track.send_update(payment_hash, invoice, update) - - assert q.get() == InvoiceUpdate(payment_hash, invoice, update) - - def test_send_update_single_all(self) -> None: - invoice = "lnbcrt" - payment_hash = random.randbytes(32).hex() - track = Tracker() - - q = track.track(payment_hash) - q_all = track.track_all() - - update = InvoiceState.Accepted - track.send_update(payment_hash, invoice, update) - - assert q.get() == update - assert q_all.get() == InvoiceUpdate(payment_hash, invoice, update) diff --git a/tools/plugins/hold/tracker.py b/tools/plugins/hold/tracker.py deleted file mode 100644 index 3cc12065..00000000 --- a/tools/plugins/hold/tracker.py +++ /dev/null @@ -1,88 +0,0 @@ -import threading -from dataclasses import dataclass -from queue import SimpleQueue -from typing import Generic, TypeVar - -from plugins.hold.enums import InvoiceState - - -@dataclass(frozen=True) -class InvoiceUpdate: - payment_hash: str - bolt11: str - update: InvoiceState - - -T = TypeVar("T") - - -class MultiForward(Generic[T]): - _qs: list[SimpleQueue[T]] - - def __init__(self) -> None: - self._qs = [] - - def size(self) -> int: - return len(self._qs) - - def send_update(self, update: T) -> None: - for q in self._qs: - q.put(update) - - def track(self) -> SimpleQueue[T]: - q = SimpleQueue() - self._qs.append(q) - return q - - def stop_tracking(self, q: SimpleQueue[T]) -> None: - self._qs.remove(q) - - -class Tracker: - _lock: threading.Lock - - _fwds: dict[str, MultiForward[InvoiceState]] - _all_fwds: MultiForward[InvoiceUpdate] - - def __init__(self) -> None: - self._fwds = {} - self._all_fwds = MultiForward() - self._lock = threading.Lock() - - def send_update(self, payment_hash: str, bolt11: str, update: InvoiceState) -> None: - with self._lock: - fwd = self._fwds.get(payment_hash) - if fwd is not None: - fwd.send_update(update) - - self._all_fwds.send_update( - InvoiceUpdate(payment_hash=payment_hash, bolt11=bolt11, update=update) - ) - - def track(self, payment_hash: str) -> SimpleQueue[InvoiceState]: - with self._lock: - fwd = self._fwds.get(payment_hash) - - if fwd is None: - fwd = MultiForward() - self._fwds[payment_hash] = fwd - - return fwd.track() - - def track_all(self) -> SimpleQueue[InvoiceUpdate]: - with self._lock: - return self._all_fwds.track() - - def stop_tracking(self, payment_hash: str, q: SimpleQueue[InvoiceState]) -> None: - with self._lock: - fwd = self._fwds.get(payment_hash) - if fwd is None: - return - - fwd.stop_tracking(q) - if fwd.size() == 0: - del self._fwds[payment_hash] - - def stop_tracking_all(self, q: SimpleQueue[InvoiceUpdate]) -> None: - with self._lock: - self._all_fwds.stop_tracking(q) diff --git a/tools/plugins/hold/transformers.py b/tools/plugins/hold/transformers.py deleted file mode 100644 index 3924eeb5..00000000 --- a/tools/plugins/hold/transformers.py +++ /dev/null @@ -1,213 +0,0 @@ -from typing import Any - -from bolt11.models.routehint import Route, RouteHint - -from plugins.hold import router -from plugins.hold.enums import HtlcState, InvoiceState -from plugins.hold.invoice import HoldInvoice, Htlc -from plugins.hold.protos.hold_pb2 import ( - HTLC_ACCEPTED, - HTLC_CANCELLED, - HTLC_SETTLED, - INVOICE_ACCEPTED, - INVOICE_CANCELLED, - INVOICE_PAID, - INVOICE_UNPAID, - GetRouteResponse, - Hop, - Invoice, - PayStatusResponse, - RoutingHint, - RoutingHintsResponse, -) -from plugins.hold.protos.hold_pb2 import ( - Htlc as HtlcGrpc, -) -from plugins.hold.utils import parse_time - -INVOICE_STATE_TO_GRPC = { - InvoiceState.Paid: INVOICE_PAID, - InvoiceState.Unpaid: INVOICE_UNPAID, - InvoiceState.Accepted: INVOICE_ACCEPTED, - InvoiceState.Cancelled: INVOICE_CANCELLED, -} - -HTLC_STATE_TO_GRPC = { - HtlcState.Paid: HTLC_SETTLED, - HtlcState.Accepted: HTLC_ACCEPTED, - HtlcState.Cancelled: HTLC_CANCELLED, -} - -PAY_STATUS_STATE_TO_GRPC = { - "pending": PayStatusResponse.PayStatus.Attempt.AttemptState.ATTEMPT_PENDING, - "completed": PayStatusResponse.PayStatus.Attempt.AttemptState.ATTEMPT_COMPLETED, -} - - -class Transformers: - @staticmethod - def invoice_to_grpc(invoice: HoldInvoice) -> Invoice: - return Invoice( - payment_hash=invoice.payment_hash, - payment_preimage=invoice.payment_preimage, - state=INVOICE_STATE_TO_GRPC[invoice.state], - bolt11=invoice.bolt11, - amount_msat=invoice.amount_msat, - created_at=int(invoice.created_at.timestamp()), - htlcs=[Transformers.htlc_to_grpc(htlc) for htlc in invoice.htlcs.htlcs], - ) - - @staticmethod - def htlc_to_grpc(htlc: Htlc) -> HtlcGrpc: - return HtlcGrpc( - state=HTLC_STATE_TO_GRPC[htlc.state], - msat=htlc.msat, - created_at=int(htlc.created_at.timestamp()), - short_channel_id=htlc.short_channel_id, - id=htlc.channel_id, - ) - - @staticmethod - def routing_hints_to_grpc(hints: list[RouteHint]) -> RoutingHintsResponse: - return RoutingHintsResponse( - hints=[Transformers.routing_hint_to_grpc(hint) for hint in hints] - ) - - @staticmethod - def routing_hint_to_grpc(hint: RouteHint) -> RoutingHint: - return RoutingHint(hops=[Transformers.hop_to_grpc(hop) for hop in hint.routes]) - - @staticmethod - def hop_to_grpc(hop: Route) -> Hop: - return Hop( - public_key=hop.public_key, - short_channel_id=hop.short_channel_id, - base_fee=hop.base_fee, - ppm_fee=hop.ppm_fee, - cltv_expiry_delta=hop.cltv_expiry_delta, - ) - - @staticmethod - def routing_hints_from_grpc(hints: list[RoutingHint]) -> list[RouteHint]: - return [Transformers.routing_hint_from_grpc(hint) for hint in hints] - - @staticmethod - def routing_hint_from_grpc(hint: RoutingHint) -> RouteHint: - return RouteHint(routes=[Transformers.hop_from_grpc(hop) for hop in hint.hops]) - - @staticmethod - def hop_from_grpc(hop: Hop) -> Route: - return Route( - public_key=hop.public_key, - short_channel_id=hop.short_channel_id, - base_fee=hop.base_fee, - ppm_fee=hop.ppm_fee, - cltv_expiry_delta=hop.cltv_expiry_delta, - ) - - @staticmethod - def routing_hints_from_json(hints: list[Any]) -> list[RouteHint]: - return [Transformers.routing_hint_from_json(hint) for hint in hints] - - @staticmethod - def routing_hint_from_json(hint: dict[str, Any]) -> RouteHint: - return RouteHint(routes=[Transformers.hop_from_json(hop) for hop in hint["routes"]]) - - @staticmethod - def hop_from_json(hop: dict[str, str | int]) -> Route: - return Route( - public_key=hop["public_key"], - short_channel_id=hop["short_channel_id"], - base_fee=hop["base_fee"], - ppm_fee=hop["ppm_fee"], - cltv_expiry_delta=hop["cltv_expiry_delta"], - ) - - @staticmethod - def pay_status_response_to_grpc(res: dict[str, Any]) -> PayStatusResponse: - return PayStatusResponse( - status=[ - PayStatusResponse.PayStatus( - bolt11=status["bolt11"], - amount_msat=int(status["amount_msat"]), - destination=status["destination"], - attempts=[ - Transformers.pay_status_attempt_to_grpc(attempt) - for attempt in status["attempts"] - ], - ) - for status in res["pay"] - ] - ) - - @staticmethod - def pay_status_attempt_to_grpc( - res: dict[str, Any], - ) -> PayStatusResponse.PayStatus.Attempt: - def transform_failure_data( - failure_data: dict[str, Any], - ) -> PayStatusResponse.PayStatus.Attempt.Failure.Data: - return PayStatusResponse.PayStatus.Attempt.Failure.Data( - id=failure_data["id"], - raw_message=failure_data["raw_message"], - fail_code=failure_data["failcode"], - fail_codename=failure_data["failcodename"], - erring_index=failure_data["erring_index"], - erring_node=failure_data["erring_node"], - ) - - def transform_failure( - failure: dict[str, Any], - ) -> PayStatusResponse.PayStatus.Attempt.Failure: - return PayStatusResponse.PayStatus.Attempt.Failure( - message=failure["message"], - code=failure["code"], - data=transform_failure_data(failure["data"]) if "data" in failure else None, - ) - - attempt = PayStatusResponse.PayStatus.Attempt( - strategy=res.get("strategy", ""), - start_time=parse_time(res["start_time"]), - age_in_seconds=res["age_in_seconds"], - state=PAY_STATUS_STATE_TO_GRPC[res["state"]], - success=PayStatusResponse.PayStatus.Attempt.Success( - id=res["success"]["id"], - payment_preimage=res["success"]["payment_preimage"], - ) - if "success" in res - else None, - failure=transform_failure(res["failure"]) if "failure" in res else None, - ) - - if "end_time" in res: - attempt.end_time = parse_time(res["end_time"]) - - return attempt - - @staticmethod - def route_to_grpc(route: list[router.Hop]) -> list[GetRouteResponse.Hop]: - return [ - GetRouteResponse.Hop( - id=hop.node_id, - channel=hop.channel, - direction=hop.direction, - amount_msat=hop.amount_msat, - delay=hop.delay, - style=hop.style, - ) - for hop in route - ] - - @staticmethod - def named_tuples_to_dict(val: object) -> object: - if isinstance(val, list): - return [Transformers.named_tuples_to_dict(entry) for entry in val] - - if isinstance(val, tuple) and hasattr(val, "_asdict"): - # noinspection PyProtectedMember - return Transformers.named_tuples_to_dict(val._asdict()) - - if isinstance(val, dict): - return {key: Transformers.named_tuples_to_dict(value) for key, value in val.items()} - - return val diff --git a/tools/plugins/hold/utils.py b/tools/plugins/hold/utils.py deleted file mode 100644 index 72c39925..00000000 --- a/tools/plugins/hold/utils.py +++ /dev/null @@ -1,30 +0,0 @@ -from collections.abc import Callable -from datetime import datetime, timezone -from typing import TypeVar - - -def time_now() -> datetime: - return datetime.now(tz=timezone.utc) - - -def parse_time(time: str) -> int: - try: - return int(datetime.strptime(time, "%Y-%m-%dT%H:%M:%S.%f%z").timestamp()) - except ValueError: - return 0 - - -T = TypeVar("T") - - -def partition(iterable: list[T], pred: Callable[[T], bool]) -> tuple[list[T], list[T]]: - trues = [] - falses = [] - - for item in iterable: - if pred(item): - trues.append(item) - else: - falses.append(item) - - return trues, falses diff --git a/tools/plugins/mpay/config.py b/tools/plugins/mpay/config.py index 57f8cdce..137f3aed 100644 --- a/tools/plugins/mpay/config.py +++ b/tools/plugins/mpay/config.py @@ -3,8 +3,7 @@ from pyln.client import Plugin, __version__ from strenum import StrEnum -from plugins.hold.consts import GRPC_HOST_REGTEST, Network -from plugins.mpay.consts import PLUGIN_NAME +from plugins.mpay.consts import GRPC_HOST_REGTEST, PLUGIN_NAME, Network class OptionKeys(StrEnum): @@ -47,7 +46,7 @@ def register_options(pl: Plugin) -> None: # pyln.client added full dynamic option support in 24.05 ver = __version__.split(".") - if ver[0] > "24" or (ver[0] == "24" and int(ver[1]) >= 5): + if int(ver[0]) > 24 or (ver[0] == "24" and int(ver[1]) >= 5): pl.add_option( OptionKeys.OverridePay, OptionDefaults.DefaultOverridePay, diff --git a/tools/plugins/mpay/consts.py b/tools/plugins/mpay/consts.py index e465f64d..fca17a20 100644 --- a/tools/plugins/mpay/consts.py +++ b/tools/plugins/mpay/consts.py @@ -1,2 +1,14 @@ +from strenum import StrEnum + + +class Network(StrEnum): + Mainnet = "bitcoin" + Testnet = "testnet" + Signet = "signet" + Regtest = "regtest" + + PLUGIN_NAME = "mpay" VERSION = "0.1.2" + +GRPC_HOST_REGTEST = "0.0.0.0" # noqa: S104 diff --git a/tools/plugins/mpay/data/tests/test_network_info.py b/tools/plugins/mpay/data/tests/test_network_info.py index 4ea680ab..2b56fa2b 100644 --- a/tools/plugins/mpay/data/tests/test_network_info.py +++ b/tools/plugins/mpay/data/tests/test_network_info.py @@ -1,7 +1,7 @@ import pytest -from plugins.hold.tests.utils import LndNode, RpcPlugin, cln_con, lnd from plugins.mpay.data.network_info import ChannelInfo, NetworkInfo +from plugins.mpay.tests.utils import LndNode, RpcPlugin, cln_con, lnd class TestNetworkInfo: diff --git a/tools/plugins/mpay/pay/invoice_check.py b/tools/plugins/mpay/pay/invoice_check.py index deab70a6..dcb5a3f9 100644 --- a/tools/plugins/mpay/pay/invoice_check.py +++ b/tools/plugins/mpay/pay/invoice_check.py @@ -3,7 +3,7 @@ from bolt11 import Bolt11, decode from pyln.client import Plugin -from plugins.hold.encoder import get_network_prefix +from plugins.mpay.consts import Network class InvoiceNoSelfPaymentError(Exception): @@ -22,6 +22,23 @@ class InvoiceNoAmountError(Exception): pass +NETWORK_PREFIXES = { + Network.Mainnet: "bc", + Network.Testnet: "tb", + Network.Signet: "tbs", + Network.Regtest: "bcrt", +} + + +def get_network_prefix(network: str) -> str: + # noinspection PyTypeChecker + return ( + NETWORK_PREFIXES[network] + if network in NETWORK_PREFIXES + else NETWORK_PREFIXES[Network.Mainnet] + ) + + class InvoiceChecker: _pl: Plugin _node_id: str diff --git a/tools/plugins/mpay/pay/tests/test_channels.py b/tools/plugins/mpay/pay/tests/test_channels.py index 59e9c59d..44e55776 100644 --- a/tools/plugins/mpay/pay/tests/test_channels.py +++ b/tools/plugins/mpay/pay/tests/test_channels.py @@ -3,11 +3,11 @@ import pytest from pyln.client import Millisatoshi -from plugins.hold.tests.utils import LndNode, RpcPlugin, cln_con, lnd from plugins.mpay.data.network_info import NetworkInfo from plugins.mpay.pay.channels import ChannelsHelper, NoRouteError, PeerChannels from plugins.mpay.pay.excludes import Excludes, ExcludesPayment from plugins.mpay.pay.route import Fees, Route +from plugins.mpay.tests.utils import LndNode, RpcPlugin, cln_con, lnd class TestPeerChannels: diff --git a/tools/plugins/mpay/pay/tests/test_invoice_check.py b/tools/plugins/mpay/pay/tests/test_invoice_check.py index 16b8f680..952afbbf 100644 --- a/tools/plugins/mpay/pay/tests/test_invoice_check.py +++ b/tools/plugins/mpay/pay/tests/test_invoice_check.py @@ -4,11 +4,11 @@ import pytest from bolt11 import Bolt11, MilliSatoshi, decode, encode from bolt11.models.tags import Tag, TagChar, Tags -from secp256k1 import PrivateKey +from coincurve import PrivateKey -from plugins.hold.consts import Network -from plugins.hold.encoder import NETWORK_PREFIXES +from plugins.mpay.consts import Network from plugins.mpay.pay.invoice_check import ( + NETWORK_PREFIXES, InvoiceChecker, InvoiceExpiredError, InvoiceNetworkInvalidError, @@ -101,7 +101,7 @@ def test_check_self_payment(self, invoice: str, ok: bool) -> None: ), MilliSatoshi(10_000), ), - PrivateKey().serialize(), + PrivateKey().secret.hex(), ), ), ( diff --git a/tools/plugins/mpay/pay/tests/test_route.py b/tools/plugins/mpay/pay/tests/test_route.py index c0e640bc..affc6c19 100644 --- a/tools/plugins/mpay/pay/tests/test_route.py +++ b/tools/plugins/mpay/pay/tests/test_route.py @@ -7,9 +7,9 @@ import pytest from pyln.client import Millisatoshi -from plugins.hold.tests.utils import RpcPlugin from plugins.mpay.data.network_info import ChannelInfo, NetworkInfo from plugins.mpay.pay.route import Fees, Route, RoutingHint +from plugins.mpay.tests.utils import RpcPlugin class TestRoute: diff --git a/tools/plugins/mpay/protos/mpay_pb2.py b/tools/plugins/mpay/protos/mpay_pb2.py index 3cec1723..e843db76 100644 --- a/tools/plugins/mpay/protos/mpay_pb2.py +++ b/tools/plugins/mpay/protos/mpay_pb2.py @@ -1,12 +1,22 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE # source: mpay.proto -# Protobuf Python Version: 5.26.1 +# Protobuf Python Version: 5.27.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 5, + 27, + 2, + '', + 'mpay.proto' +) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() diff --git a/tools/plugins/mpay/protos/mpay_pb2_grpc.py b/tools/plugins/mpay/protos/mpay_pb2_grpc.py index 1bfd9a07..531daa44 100644 --- a/tools/plugins/mpay/protos/mpay_pb2_grpc.py +++ b/tools/plugins/mpay/protos/mpay_pb2_grpc.py @@ -5,10 +5,8 @@ import mpay_pb2 as mpay__pb2 -GRPC_GENERATED_VERSION = '1.65.5' +GRPC_GENERATED_VERSION = '1.66.0' GRPC_VERSION = grpc.__version__ -EXPECTED_ERROR_RELEASE = '1.66.0' -SCHEDULED_RELEASE_DATE = 'August 6, 2024' _version_not_supported = False try: @@ -18,15 +16,12 @@ _version_not_supported = True if _version_not_supported: - warnings.warn( + raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in mpay_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},' - + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.', - RuntimeWarning ) diff --git a/tools/plugins/hold/certs.py b/tools/plugins/mpay/rpc/certs.py similarity index 98% rename from tools/plugins/hold/certs.py rename to tools/plugins/mpay/rpc/certs.py index d07b06ca..b2be35ee 100644 --- a/tools/plugins/hold/certs.py +++ b/tools/plugins/mpay/rpc/certs.py @@ -10,7 +10,7 @@ ) from cryptography.x509.oid import NameOID -from plugins.hold.utils import time_now +from plugins.mpay.utils import time_now @dataclass diff --git a/tools/plugins/hold/grpc_server.py b/tools/plugins/mpay/rpc/grpc_server.py similarity index 98% rename from tools/plugins/hold/grpc_server.py rename to tools/plugins/mpay/rpc/grpc_server.py index 7d18e12c..48bb11ea 100644 --- a/tools/plugins/hold/grpc_server.py +++ b/tools/plugins/mpay/rpc/grpc_server.py @@ -7,7 +7,7 @@ from grpc_interceptor import ServerInterceptor from pyln.client import Plugin -from plugins.hold.certs import load_certs +from plugins.mpay.rpc.certs import load_certs def handle_grpc_error( diff --git a/tools/plugins/mpay/rpc/server.py b/tools/plugins/mpay/rpc/server.py index f1023d5a..a272bebb 100644 --- a/tools/plugins/mpay/rpc/server.py +++ b/tools/plugins/mpay/rpc/server.py @@ -3,7 +3,6 @@ from pyln.client import Plugin from sqlalchemy.orm import Session -from plugins.hold.grpc_server import GrpcServer from plugins.mpay.consts import PLUGIN_NAME, VERSION from plugins.mpay.data.payments import Payments from plugins.mpay.data.routes import Routes @@ -23,6 +22,7 @@ ResetPathMemoryResponse, ) from plugins.mpay.protos.mpay_pb2_grpc import MpayServicer, add_MpayServicer_to_server +from plugins.mpay.rpc.grpc_server import GrpcServer from plugins.mpay.rpc.transformers import payment_to_grpc, routes_to_grpc diff --git a/tools/plugins/mpay/rpc/tests/test_server.py b/tools/plugins/mpay/rpc/tests/test_server.py index 4048fccb..e8e4af12 100644 --- a/tools/plugins/mpay/rpc/tests/test_server.py +++ b/tools/plugins/mpay/rpc/tests/test_server.py @@ -8,15 +8,6 @@ # noinspection PyProtectedMember from grpc._channel import _InactiveRpcError -from plugins.hold.tests.utils import ( - PLUGIN_PATH_MPAY, - LndNode, - cln_con, - connect_peers, - lnd, - start_plugin, - stop_plugin, -) from plugins.mpay.config import OptionDefaults from plugins.mpay.consts import VERSION from plugins.mpay.pay.sendpay import STATUS_COMPLETE @@ -34,6 +25,15 @@ ResetPathMemoryResponse, ) from plugins.mpay.protos.mpay_pb2_grpc import MpayStub +from plugins.mpay.tests.utils import ( + PLUGIN_PATH_MPAY, + LndNode, + cln_con, + connect_peers, + lnd, + start_plugin, + stop_plugin, +) class TestGrpc: diff --git a/tools/plugins/hold/tests/utils.py b/tools/plugins/mpay/tests/utils.py similarity index 55% rename from tools/plugins/hold/tests/utils.py rename to tools/plugins/mpay/tests/utils.py index 8fb4c6d9..73909ebf 100644 --- a/tools/plugins/hold/tests/utils.py +++ b/tools/plugins/mpay/tests/utils.py @@ -1,20 +1,18 @@ import json import os -from collections.abc import Callable from enum import Enum -from threading import Thread -from typing import Any +from typing import Any, Callable -import pytest - -from plugins.hold.utils import parse_time - -PLUGIN_PATH = "/root/hold.sh" PLUGIN_PATH_MPAY = "/root/mpay.sh" CliCaller = Callable[..., dict[str, Any]] +class LndNode(Enum): + One = 1 + Two = 2 + + class RpcCaller: @staticmethod def getinfo() -> dict: @@ -57,9 +55,24 @@ class RpcPlugin: rpc = RpcCaller() -class LndNode(Enum): - One = 1 - Two = 2 +def start_plugin(cln: CliCaller, path: str) -> None: + cln("plugin", "start", path) + + +def stop_plugin(cln: CliCaller, path: str) -> None: + plugins = cln("plugin", "list")["plugins"] + if not any(path in plugin["name"] for plugin in plugins): + return + + cln("plugin", "stop", path) + + +def cln_con(*args: str) -> dict[str, Any]: + return json.load( + os.popen( + f"docker exec regtest lightning-cli {' '.join(args)}", + ) + ) def lnd_raw(node: LndNode, *args: str) -> str: @@ -77,10 +90,6 @@ def lnd(node: LndNode, *args: str) -> dict[str, Any]: return json.loads(lnd_raw(node, *args)) -def format_json(args: dict[str, Any] | list[Any]) -> str: - return json.dumps(args).replace('"', '\\"').replace(" ", "") - - def connect_peers(cln: CliCaller) -> None: cln_id = cln("getinfo")["id"] @@ -92,72 +101,3 @@ def lnd_connect(node: LndNode) -> None: for i in LndNode: lnd_connect(i) - - -def start_plugin(cln: CliCaller, path: str = PLUGIN_PATH) -> None: - cln("plugin", "start", path) - - -def stop_plugin(cln: CliCaller, path: str = PLUGIN_PATH) -> None: - plugins = cln("plugin", "list")["plugins"] - if not any(path in plugin["name"] for plugin in plugins): - return - - cln("plugin", "stop", path) - - -class LndPay(Thread): - res: dict[str, Any] = None - - def __init__( - self, - node: LndNode, - invoice: str, - max_shard_size: int | None = None, - outgoing_chan_id: str | None = None, - timeout: int | None = None, - ) -> None: - Thread.__init__(self) - - self.node = node - self.timeout = timeout - self.invoice = invoice - self.max_shard_size = max_shard_size - self.outgoing_chan_id = outgoing_chan_id - - def run(self) -> None: - cmd = "payinvoice --force --json" - - if self.outgoing_chan_id is not None: - cmd += f" --outgoing_chan_id {self.outgoing_chan_id}" - - if self.max_shard_size is not None: - cmd += f" --max_shard_size_sat {self.max_shard_size}" - - if self.timeout is not None: - cmd += f" --timeout {self.timeout}s" - - res = lnd_raw(self.node, f"{cmd} {self.invoice} 2> /dev/null") - res = res[res.find("{") :] - self.res = json.loads(res) - - -def cln_con(*args: str) -> dict[str, Any]: - return json.load( - os.popen( - f"docker exec regtest lightning-cli {' '.join(args)}", - ) - ) - - -class TestUtils: - @pytest.mark.parametrize( - ("data", "result"), - [ - ("1970-01-01T00:00:48.1904", 0), - ("2023-09-04T00:37:36.349Z", 1693787856), - ("2023-09-05T10:56:22.874Z", 1693911382), - ], - ) - def test_parse_time(self, data: str, result: int) -> None: - assert parse_time(data) == result diff --git a/tools/plugins/mpay/utils.py b/tools/plugins/mpay/utils.py index 2b469a8d..946127e5 100644 --- a/tools/plugins/mpay/utils.py +++ b/tools/plugins/mpay/utils.py @@ -1,6 +1,12 @@ +from datetime import datetime, timezone + from pyln.client import Millisatoshi +def time_now() -> datetime: + return datetime.now(tz=timezone.utc) + + def format_error(e: BaseException) -> str: return str(e) if str(e) != "" else repr(e) diff --git a/tools/poetry.lock b/tools/poetry.lock index 818cd1ef..5275ffb8 100644 --- a/tools/poetry.lock +++ b/tools/poetry.lock @@ -240,13 +240,13 @@ bitarray = ">=2.9.0,<3.0.0" [[package]] name = "bolt11" -version = "2.0.6" +version = "2.1.0" description = "A library for encoding and decoding BOLT11 payment requests." optional = false python-versions = ">=3.8.1" files = [ - {file = "bolt11-2.0.6-py3-none-any.whl", hash = "sha256:5a1b4d33e028ce110bd3e5a2b8a95d8a2c5221f2e0dd64cbccb8c70153e7d643"}, - {file = "bolt11-2.0.6.tar.gz", hash = "sha256:02d7e6273a8869911504dbcb732894d58e1d8c96b53ed0e968a9c5f90ab5c5a7"}, + {file = "bolt11-2.1.0-py3-none-any.whl", hash = "sha256:1535e441233414a9d8031a99fd3be07de4674bffda948033579404d44a42f614"}, + {file = "bolt11-2.1.0.tar.gz", hash = "sha256:177c63cd88d1eaba669eddb5937364676226253f2e9e5b77e8fe317ef32e62dd"}, ] [package.dependencies] @@ -254,18 +254,17 @@ base58 = "*" bech32 = "*" bitstring = "*" click = "*" -ecdsa = "*" -secp256k1 = "*" +coincurve = "*" [[package]] name = "cachetools" -version = "5.3.3" +version = "5.5.0" description = "Extensible memoizing collections and decorators" optional = false python-versions = ">=3.7" files = [ - {file = "cachetools-5.3.3-py3-none-any.whl", hash = "sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945"}, - {file = "cachetools-5.3.3.tar.gz", hash = "sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105"}, + {file = "cachetools-5.5.0-py3-none-any.whl", hash = "sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292"}, + {file = "cachetools-5.5.0.tar.gz", hash = "sha256:2cc24fb4cbe39633fb7badd9db9ca6295d766d9c2995f245725a46715d050f2a"}, ] [[package]] @@ -281,63 +280,78 @@ files = [ [[package]] name = "cffi" -version = "1.16.0" +version = "1.17.0" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" files = [ - {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, - {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614"}, - {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743"}, - {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d"}, - {file = "cffi-1.16.0-cp310-cp310-win32.whl", hash = "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a"}, - {file = "cffi-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1"}, - {file = "cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404"}, - {file = "cffi-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e"}, - {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc"}, - {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb"}, - {file = "cffi-1.16.0-cp311-cp311-win32.whl", hash = "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab"}, - {file = "cffi-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba"}, - {file = "cffi-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956"}, - {file = "cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969"}, - {file = "cffi-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520"}, - {file = "cffi-1.16.0-cp312-cp312-win32.whl", hash = "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b"}, - {file = "cffi-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235"}, - {file = "cffi-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324"}, - {file = "cffi-1.16.0-cp38-cp38-win32.whl", hash = "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a"}, - {file = "cffi-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36"}, - {file = "cffi-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed"}, - {file = "cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098"}, - {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000"}, - {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe"}, - {file = "cffi-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4"}, - {file = "cffi-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8"}, - {file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"}, + {file = "cffi-1.17.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f9338cc05451f1942d0d8203ec2c346c830f8e86469903d5126c1f0a13a2bcbb"}, + {file = "cffi-1.17.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0ce71725cacc9ebf839630772b07eeec220cbb5f03be1399e0457a1464f8e1a"}, + {file = "cffi-1.17.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c815270206f983309915a6844fe994b2fa47e5d05c4c4cef267c3b30e34dbe42"}, + {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6bdcd415ba87846fd317bee0774e412e8792832e7805938987e4ede1d13046d"}, + {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a98748ed1a1df4ee1d6f927e151ed6c1a09d5ec21684de879c7ea6aa96f58f2"}, + {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0a048d4f6630113e54bb4b77e315e1ba32a5a31512c31a273807d0027a7e69ab"}, + {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24aa705a5f5bd3a8bcfa4d123f03413de5d86e497435693b638cbffb7d5d8a1b"}, + {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:856bf0924d24e7f93b8aee12a3a1095c34085600aa805693fb7f5d1962393206"}, + {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:4304d4416ff032ed50ad6bb87416d802e67139e31c0bde4628f36a47a3164bfa"}, + {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:331ad15c39c9fe9186ceaf87203a9ecf5ae0ba2538c9e898e3a6967e8ad3db6f"}, + {file = "cffi-1.17.0-cp310-cp310-win32.whl", hash = "sha256:669b29a9eca6146465cc574659058ed949748f0809a2582d1f1a324eb91054dc"}, + {file = "cffi-1.17.0-cp310-cp310-win_amd64.whl", hash = "sha256:48b389b1fd5144603d61d752afd7167dfd205973a43151ae5045b35793232aa2"}, + {file = "cffi-1.17.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5d97162c196ce54af6700949ddf9409e9833ef1003b4741c2b39ef46f1d9720"}, + {file = "cffi-1.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5ba5c243f4004c750836f81606a9fcb7841f8874ad8f3bf204ff5e56332b72b9"}, + {file = "cffi-1.17.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bb9333f58fc3a2296fb1d54576138d4cf5d496a2cc118422bd77835e6ae0b9cb"}, + {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:435a22d00ec7d7ea533db494da8581b05977f9c37338c80bc86314bec2619424"}, + {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d1df34588123fcc88c872f5acb6f74ae59e9d182a2707097f9e28275ec26a12d"}, + {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:df8bb0010fdd0a743b7542589223a2816bdde4d94bb5ad67884348fa2c1c67e8"}, + {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8b5b9712783415695663bd463990e2f00c6750562e6ad1d28e072a611c5f2a6"}, + {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ffef8fd58a36fb5f1196919638f73dd3ae0db1a878982b27a9a5a176ede4ba91"}, + {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4e67d26532bfd8b7f7c05d5a766d6f437b362c1bf203a3a5ce3593a645e870b8"}, + {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:45f7cd36186db767d803b1473b3c659d57a23b5fa491ad83c6d40f2af58e4dbb"}, + {file = "cffi-1.17.0-cp311-cp311-win32.whl", hash = "sha256:a9015f5b8af1bb6837a3fcb0cdf3b874fe3385ff6274e8b7925d81ccaec3c5c9"}, + {file = "cffi-1.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:b50aaac7d05c2c26dfd50c3321199f019ba76bb650e346a6ef3616306eed67b0"}, + {file = "cffi-1.17.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aec510255ce690d240f7cb23d7114f6b351c733a74c279a84def763660a2c3bc"}, + {file = "cffi-1.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2770bb0d5e3cc0e31e7318db06efcbcdb7b31bcb1a70086d3177692a02256f59"}, + {file = "cffi-1.17.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:db9a30ec064129d605d0f1aedc93e00894b9334ec74ba9c6bdd08147434b33eb"}, + {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a47eef975d2b8b721775a0fa286f50eab535b9d56c70a6e62842134cf7841195"}, + {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f3e0992f23bbb0be00a921eae5363329253c3b86287db27092461c887b791e5e"}, + {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6107e445faf057c118d5050560695e46d272e5301feffda3c41849641222a828"}, + {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb862356ee9391dc5a0b3cbc00f416b48c1b9a52d252d898e5b7696a5f9fe150"}, + {file = "cffi-1.17.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c1c13185b90bbd3f8b5963cd8ce7ad4ff441924c31e23c975cb150e27c2bf67a"}, + {file = "cffi-1.17.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:17c6d6d3260c7f2d94f657e6872591fe8733872a86ed1345bda872cfc8c74885"}, + {file = "cffi-1.17.0-cp312-cp312-win32.whl", hash = "sha256:c3b8bd3133cd50f6b637bb4322822c94c5ce4bf0d724ed5ae70afce62187c492"}, + {file = "cffi-1.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:dca802c8db0720ce1c49cce1149ff7b06e91ba15fa84b1d59144fef1a1bc7ac2"}, + {file = "cffi-1.17.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6ce01337d23884b21c03869d2f68c5523d43174d4fc405490eb0091057943118"}, + {file = "cffi-1.17.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cab2eba3830bf4f6d91e2d6718e0e1c14a2f5ad1af68a89d24ace0c6b17cced7"}, + {file = "cffi-1.17.0-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:14b9cbc8f7ac98a739558eb86fabc283d4d564dafed50216e7f7ee62d0d25377"}, + {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b00e7bcd71caa0282cbe3c90966f738e2db91e64092a877c3ff7f19a1628fdcb"}, + {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:41f4915e09218744d8bae14759f983e466ab69b178de38066f7579892ff2a555"}, + {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4760a68cab57bfaa628938e9c2971137e05ce48e762a9cb53b76c9b569f1204"}, + {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:011aff3524d578a9412c8b3cfaa50f2c0bd78e03eb7af7aa5e0df59b158efb2f"}, + {file = "cffi-1.17.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:a003ac9edc22d99ae1286b0875c460351f4e101f8c9d9d2576e78d7e048f64e0"}, + {file = "cffi-1.17.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ef9528915df81b8f4c7612b19b8628214c65c9b7f74db2e34a646a0a2a0da2d4"}, + {file = "cffi-1.17.0-cp313-cp313-win32.whl", hash = "sha256:70d2aa9fb00cf52034feac4b913181a6e10356019b18ef89bc7c12a283bf5f5a"}, + {file = "cffi-1.17.0-cp313-cp313-win_amd64.whl", hash = "sha256:b7b6ea9e36d32582cda3465f54c4b454f62f23cb083ebc7a94e2ca6ef011c3a7"}, + {file = "cffi-1.17.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:964823b2fc77b55355999ade496c54dde161c621cb1f6eac61dc30ed1b63cd4c"}, + {file = "cffi-1.17.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:516a405f174fd3b88829eabfe4bb296ac602d6a0f68e0d64d5ac9456194a5b7e"}, + {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dec6b307ce928e8e112a6bb9921a1cb00a0e14979bf28b98e084a4b8a742bd9b"}, + {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e4094c7b464cf0a858e75cd14b03509e84789abf7b79f8537e6a72152109c76e"}, + {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2404f3de742f47cb62d023f0ba7c5a916c9c653d5b368cc966382ae4e57da401"}, + {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3aa9d43b02a0c681f0bfbc12d476d47b2b2b6a3f9287f11ee42989a268a1833c"}, + {file = "cffi-1.17.0-cp38-cp38-win32.whl", hash = "sha256:0bb15e7acf8ab35ca8b24b90af52c8b391690ef5c4aec3d31f38f0d37d2cc499"}, + {file = "cffi-1.17.0-cp38-cp38-win_amd64.whl", hash = "sha256:93a7350f6706b31f457c1457d3a3259ff9071a66f312ae64dc024f049055f72c"}, + {file = "cffi-1.17.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a2ddbac59dc3716bc79f27906c010406155031a1c801410f1bafff17ea304d2"}, + {file = "cffi-1.17.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6327b572f5770293fc062a7ec04160e89741e8552bf1c358d1a23eba68166759"}, + {file = "cffi-1.17.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbc183e7bef690c9abe5ea67b7b60fdbca81aa8da43468287dae7b5c046107d4"}, + {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bdc0f1f610d067c70aa3737ed06e2726fd9d6f7bfee4a351f4c40b6831f4e82"}, + {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6d872186c1617d143969defeadac5a904e6e374183e07977eedef9c07c8953bf"}, + {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0d46ee4764b88b91f16661a8befc6bfb24806d885e27436fdc292ed7e6f6d058"}, + {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f76a90c345796c01d85e6332e81cab6d70de83b829cf1d9762d0a3da59c7932"}, + {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0e60821d312f99d3e1569202518dddf10ae547e799d75aef3bca3a2d9e8ee693"}, + {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:eb09b82377233b902d4c3fbeeb7ad731cdab579c6c6fda1f763cd779139e47c3"}, + {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:24658baf6224d8f280e827f0a50c46ad819ec8ba380a42448e24459daf809cf4"}, + {file = "cffi-1.17.0-cp39-cp39-win32.whl", hash = "sha256:0fdacad9e0d9fc23e519efd5ea24a70348305e8d7d85ecbb1a5fa66dc834e7fb"}, + {file = "cffi-1.17.0-cp39-cp39-win_amd64.whl", hash = "sha256:7cbc78dc018596315d4e7841c8c3a7ae31cc4d638c9b627f87d52e8abaaf2d29"}, + {file = "cffi-1.17.0.tar.gz", hash = "sha256:f3157624b7558b914cb039fd1af735e5e8049a87c817cc215109ad1c8779df76"}, ] [package.dependencies] @@ -567,33 +581,15 @@ ssh = ["bcrypt (>=3.1.5)"] test = ["pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] -[[package]] -name = "ecdsa" -version = "0.19.0" -description = "ECDSA cryptographic signature library (pure python)" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.6" -files = [ - {file = "ecdsa-0.19.0-py2.py3-none-any.whl", hash = "sha256:2cea9b88407fdac7bbeca0833b189e4c9c53f2ef1e1eaa29f6224dbc809b707a"}, - {file = "ecdsa-0.19.0.tar.gz", hash = "sha256:60eaad1199659900dd0af521ed462b793bbdf867432b3948e87416ae4caf6bf8"}, -] - -[package.dependencies] -six = ">=1.9.0" - -[package.extras] -gmpy = ["gmpy"] -gmpy2 = ["gmpy2"] - [[package]] name = "exceptiongroup" -version = "1.2.1" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, - {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -689,131 +685,131 @@ testing = ["protobuf (>=4.21.9)"] [[package]] name = "grpcio" -version = "1.65.5" +version = "1.66.0" description = "HTTP/2-based RPC framework" optional = false python-versions = ">=3.8" files = [ - {file = "grpcio-1.65.5-cp310-cp310-linux_armv7l.whl", hash = "sha256:b67d450f1e008fedcd81e097a3a400a711d8be1a8b20f852a7b8a73fead50fe3"}, - {file = "grpcio-1.65.5-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:a70a20eed87bba647a38bedd93b3ce7db64b3f0e8e0952315237f7f5ca97b02d"}, - {file = "grpcio-1.65.5-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:f79c87c114bf37adf408026b9e2e333fe9ff31dfc9648f6f80776c513145c813"}, - {file = "grpcio-1.65.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f17f9fa2d947dbfaca01b3ab2c62eefa8240131fdc67b924eb42ce6032e3e5c1"}, - {file = "grpcio-1.65.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32d60e18ff7c34fe3f6db3d35ad5c6dc99f5b43ff3982cb26fad4174462d10b1"}, - {file = "grpcio-1.65.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:fe6505376f5b00bb008e4e1418152e3ad3d954b629da286c7913ff3cfc0ff740"}, - {file = "grpcio-1.65.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:33158e56c6378063923c417e9fbdb28660b6e0e2835af42e67f5a7793f587af7"}, - {file = "grpcio-1.65.5-cp310-cp310-win32.whl", hash = "sha256:1cbc208edb9acf1cc339396a1a36b83796939be52f34e591c90292045b579fbf"}, - {file = "grpcio-1.65.5-cp310-cp310-win_amd64.whl", hash = "sha256:bc74f3f745c37e2c5685c9d2a2d5a94de00f286963f5213f763ae137bf4f2358"}, - {file = "grpcio-1.65.5-cp311-cp311-linux_armv7l.whl", hash = "sha256:3207ae60d07e5282c134b6e02f9271a2cb523c6d7a346c6315211fe2bf8d61ed"}, - {file = "grpcio-1.65.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a2f80510f99f82d4eb825849c486df703f50652cea21c189eacc2b84f2bde764"}, - {file = "grpcio-1.65.5-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:a80e9a5e3f93c54f5eb82a3825ea1fc4965b2fa0026db2abfecb139a5c4ecdf1"}, - {file = "grpcio-1.65.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0b2944390a496567de9e70418f3742b477d85d8ca065afa90432edc91b4bb8ad"}, - {file = "grpcio-1.65.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3655139d7be213c32c79ef6fb2367cae28e56ef68e39b1961c43214b457f257"}, - {file = "grpcio-1.65.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:05f02d68fc720e085f061b704ee653b181e6d5abfe315daef085719728d3d1fd"}, - {file = "grpcio-1.65.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1c4caafe71aef4dabf53274bbf4affd6df651e9f80beedd6b8e08ff438ed3260"}, - {file = "grpcio-1.65.5-cp311-cp311-win32.whl", hash = "sha256:84c901cdec16a092099f251ef3360d15e29ef59772150fa261d94573612539b5"}, - {file = "grpcio-1.65.5-cp311-cp311-win_amd64.whl", hash = "sha256:11f8b16121768c1cb99d7dcb84e01510e60e6a206bf9123e134118802486f035"}, - {file = "grpcio-1.65.5-cp312-cp312-linux_armv7l.whl", hash = "sha256:ee6ed64a27588a2c94e8fa84fe8f3b5c89427d4d69c37690903d428ec61ca7e4"}, - {file = "grpcio-1.65.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:76991b7a6fb98630a3328839755181ce7c1aa2b1842aa085fd4198f0e5198960"}, - {file = "grpcio-1.65.5-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:89c00a18801b1ed9cc441e29b521c354725d4af38c127981f2c950c796a09b6e"}, - {file = "grpcio-1.65.5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:078038e150a897e5e402ed3d57f1d31ebf604cbed80f595bd281b5da40762a92"}, - {file = "grpcio-1.65.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c97962720489ef31b5ad8a916e22bc31bba3664e063fb9f6702dce056d4aa61b"}, - {file = "grpcio-1.65.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:b8270b15b99781461b244f5c81d5c2bc9696ab9189fb5ff86c841417fb3b39fe"}, - {file = "grpcio-1.65.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8e5c4c15ac3fe1eb68e46bc51e66ad29be887479f231f8237cf8416058bf0cc1"}, - {file = "grpcio-1.65.5-cp312-cp312-win32.whl", hash = "sha256:f5b5970341359341d0e4c789da7568264b2a89cd976c05ea476036852b5950cd"}, - {file = "grpcio-1.65.5-cp312-cp312-win_amd64.whl", hash = "sha256:238a625f391a1b9f5f069bdc5930f4fd71b74426bea52196fc7b83f51fa97d34"}, - {file = "grpcio-1.65.5-cp38-cp38-linux_armv7l.whl", hash = "sha256:6c4e62bcf297a1568f627f39576dbfc27f1e5338a691c6dd5dd6b3979da51d1c"}, - {file = "grpcio-1.65.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:d7df567b67d16d4177835a68d3f767bbcbad04da9dfb52cbd19171f430c898bd"}, - {file = "grpcio-1.65.5-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:b7ca419f1462390851eec395b2089aad1e49546b52d4e2c972ceb76da69b10f8"}, - {file = "grpcio-1.65.5-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fa36dd8496d3af0d40165252a669fa4f6fd2db4b4026b9a9411cbf060b9d6a15"}, - {file = "grpcio-1.65.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a101696f9ece90a0829988ff72f1b1ea2358f3df035bdf6d675dd8b60c2c0894"}, - {file = "grpcio-1.65.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:2a6d8169812932feac514b420daffae8ab8e36f90f3122b94ae767e633296b17"}, - {file = "grpcio-1.65.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:47d0aaaab82823f0aa6adea5184350b46e2252e13a42a942db84da5b733f2e05"}, - {file = "grpcio-1.65.5-cp38-cp38-win32.whl", hash = "sha256:85ae8f8517d5bcc21fb07dbf791e94ed84cc28f84c903cdc2bd7eaeb437c8f45"}, - {file = "grpcio-1.65.5-cp38-cp38-win_amd64.whl", hash = "sha256:770bd4bd721961f6dd8049bc27338564ba8739913f77c0f381a9815e465ff965"}, - {file = "grpcio-1.65.5-cp39-cp39-linux_armv7l.whl", hash = "sha256:ab5ec837d8cee8dbce9ef6386125f119b231e4333cc6b6d57b6c5c7c82a72331"}, - {file = "grpcio-1.65.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cabd706183ee08d8026a015af5819a0b3a8959bdc9d1f6fdacd1810f09200f2a"}, - {file = "grpcio-1.65.5-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:ec71fc5b39821ad7d80db7473c8f8c2910f3382f0ddadfbcfc2c6c437107eb67"}, - {file = "grpcio-1.65.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d3a9e35bcb045e39d7cac30464c285389b9a816ac2067e4884ad2c02e709ef8e"}, - {file = "grpcio-1.65.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d750e9330eb14236ca11b78d0c494eed13d6a95eb55472298f0e547c165ee324"}, - {file = "grpcio-1.65.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2b91ce647b6307f25650872454a4d02a2801f26a475f90d0b91ed8110baae589"}, - {file = "grpcio-1.65.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8da58ff80bc4556cf29bc03f5fff1f03b8387d6aaa7b852af9eb65b2cf833be4"}, - {file = "grpcio-1.65.5-cp39-cp39-win32.whl", hash = "sha256:7a412959aa5f08c5ac04aa7b7c3c041f5e4298cadd4fcc2acff195b56d185ebc"}, - {file = "grpcio-1.65.5-cp39-cp39-win_amd64.whl", hash = "sha256:55714ea852396ec9568f45f487639945ab674de83c12bea19d5ddbc3ae41ada3"}, - {file = "grpcio-1.65.5.tar.gz", hash = "sha256:ec6f219fb5d677a522b0deaf43cea6697b16f338cb68d009e30930c4aa0d2209"}, + {file = "grpcio-1.66.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:ad7256f224437b2c29c2bef98ddd3130454c5b1ab1f0471fc11794cefd4dbd3d"}, + {file = "grpcio-1.66.0-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:5f4b3357e59dfba9140a51597287297bc638710d6a163f99ee14efc19967a821"}, + {file = "grpcio-1.66.0-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:e8d20308eeae15b3e182f47876f05acbdec1eebd9473a9814a44e46ec4a84c04"}, + {file = "grpcio-1.66.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1eb03524d0f55b965d6c86aa44e5db9e5eaa15f9ed3b164621e652e5b927f4b8"}, + {file = "grpcio-1.66.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37514b68a42e9cf24536345d3cf9e580ffd29117c158b4eeea34625200256067"}, + {file = "grpcio-1.66.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:516fdbc8e156db71a004bc431a6303bca24cfde186babe96dde7bd01e8f0cc70"}, + {file = "grpcio-1.66.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d0439a970d65327de21c299ea0e0c2ad0987cdaf18ba5066621dea5f427f922b"}, + {file = "grpcio-1.66.0-cp310-cp310-win32.whl", hash = "sha256:5f93fc84b72bbc7b84a42f3ca9dc055fa00d2303d9803be011ebf7a10a4eb833"}, + {file = "grpcio-1.66.0-cp310-cp310-win_amd64.whl", hash = "sha256:8fc5c710ddd51b5a0dc36ef1b6663430aa620e0ce029b87b150dafd313b978c3"}, + {file = "grpcio-1.66.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:dd614370e939f9fceeeb2915111a0795271b4c11dfb5fc0f58449bee40c726a5"}, + {file = "grpcio-1.66.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:245b08f9b3c645a6a623f3ed4fa43dcfcd6ad701eb9c32511c1bb7380e8c3d23"}, + {file = "grpcio-1.66.0-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:aaf30c75cbaf30e561ca45f21eb1f729f0fab3f15c592c1074795ed43e3ff96f"}, + {file = "grpcio-1.66.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:49234580a073ce7ac490112f6c67c874cbcb27804c4525978cdb21ba7f3f193c"}, + {file = "grpcio-1.66.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de9e20a0acb709dcfa15a622c91f584f12c9739a79c47999f73435d2b3cc8a3b"}, + {file = "grpcio-1.66.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:bc008c6afa1e7c8df99bd9154abc4f0470d26b7730ca2521122e99e771baa8c7"}, + {file = "grpcio-1.66.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:50cea8ce2552865b87e3dffbb85eb21e6b98d928621600c0feda2f02449cd837"}, + {file = "grpcio-1.66.0-cp311-cp311-win32.whl", hash = "sha256:508411df1f2b7cfa05d4d7dbf3d576fe4f949cd61c03f3a6f0378c84e3d7b963"}, + {file = "grpcio-1.66.0-cp311-cp311-win_amd64.whl", hash = "sha256:6d586a95c05c82a5354be48bb4537e1accaf2472d8eb7e9086d844cbff934482"}, + {file = "grpcio-1.66.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:5ea27f4ce8c0daccfdd2c7961e6ba404b6599f47c948415c4cca5728739107a3"}, + {file = "grpcio-1.66.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:296a45ea835e12a1cc35ab0c57e455346c272af7b0d178e29c67742167262b4c"}, + {file = "grpcio-1.66.0-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:e36fa838ac1d6c87198ca149cbfcc92e1af06bb8c8cd852622f8e58f33ea3324"}, + {file = "grpcio-1.66.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:684a4c07883cbd4ac864f0d08d927267404f5f0c76f31c85f9bbe05f2daae2f2"}, + {file = "grpcio-1.66.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3084e590e857ba7585ae91078e4c9b6ef55aaf1dc343ce26400ba59a146eada"}, + {file = "grpcio-1.66.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:526d4f6ca19f31b25606d5c470ecba55c0b22707b524e4de8987919e8920437d"}, + {file = "grpcio-1.66.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:423ae18637cd99ddcf2e5a6851c61828c49e9b9d022d0442d979b4f230109787"}, + {file = "grpcio-1.66.0-cp312-cp312-win32.whl", hash = "sha256:7bc9d823e05d63a87511fb456dcc48dc0fced86c282bf60229675e7ee7aac1a1"}, + {file = "grpcio-1.66.0-cp312-cp312-win_amd64.whl", hash = "sha256:230cdd696751e7eb1395718cd308234749daa217bb8d128f00357dc4df102558"}, + {file = "grpcio-1.66.0-cp38-cp38-linux_armv7l.whl", hash = "sha256:0f3010bf46b2a01c9e40644cb9ed91b4b8435e5c500a275da5f9f62580e31e80"}, + {file = "grpcio-1.66.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ba18cfdc09312eb2eea6fa0ce5d2eec3cf345ea78f6528b2eaed6432105e0bd0"}, + {file = "grpcio-1.66.0-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:53d4c6706b49e358a2a33345dbe9b6b3bb047cecd7e8c07ba383bd09349bfef8"}, + {file = "grpcio-1.66.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:643d8d9632a688ae69661e924b862e23c83a3575b24e52917ec5bcc59543d212"}, + {file = "grpcio-1.66.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba60ae3b465b3e85080ae3bfbc36fd0305ae495ab16fcf8022fc7d7a23aac846"}, + {file = "grpcio-1.66.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9d5251578767fe44602688c851c2373b5513048ac84c21a0fe946590a8e7933d"}, + {file = "grpcio-1.66.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5e8140b39f10d7be2263afa2838112de29374c5c740eb0afd99146cb5bdbd990"}, + {file = "grpcio-1.66.0-cp38-cp38-win32.whl", hash = "sha256:5b15ef1b296c4e78f15f64fc65bf8081f8774480ffcac45642f69d9d753d9c6b"}, + {file = "grpcio-1.66.0-cp38-cp38-win_amd64.whl", hash = "sha256:c072f90a1f0409f827ae86266984cba65e89c5831a0726b9fc7f4b5fb940b853"}, + {file = "grpcio-1.66.0-cp39-cp39-linux_armv7l.whl", hash = "sha256:a639d3866bfb5a678b5c0b92cd7ab543033ed8988854290fd86145e71731fd4c"}, + {file = "grpcio-1.66.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:6ed35bf7da3fb3b1949e32bdf47a8b5ffe0aed11722d948933bd068531cd4682"}, + {file = "grpcio-1.66.0-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:1c5466222470cb7fbc9cc898af1d48eefd297cb2e2f59af6d4a851c862fa90ac"}, + {file = "grpcio-1.66.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:921b8f7f25d5300d7c6837a1e0639ef145fbdbfb728e0a5db2dbccc9fc0fd891"}, + {file = "grpcio-1.66.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3f6feb0dc8456d025e566709f7dd02885add99bedaac50229013069242a1bfd"}, + {file = "grpcio-1.66.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748452dbd5a047475d5413bdef08b0b9ceb2c0c0e249d4ee905a5fb82c6328dc"}, + {file = "grpcio-1.66.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:832945e64176520520317b50d64ec7d79924429528d5747669b52d0bf2c7bd78"}, + {file = "grpcio-1.66.0-cp39-cp39-win32.whl", hash = "sha256:8096a922eb91bc97c839f675c3efa1257c6ef181ae1b25d3fb97f2cae4c57c01"}, + {file = "grpcio-1.66.0-cp39-cp39-win_amd64.whl", hash = "sha256:375b58892301a5fc6ca7d7ff689c9dc9d00895f5d560604ace9f4f0573013c63"}, + {file = "grpcio-1.66.0.tar.gz", hash = "sha256:c1ea4c528e7db6660718e4165fd1b5ac24b79a70c870a7bc0b7bdb9babab7c1e"}, ] [package.extras] -protobuf = ["grpcio-tools (>=1.65.5)"] +protobuf = ["grpcio-tools (>=1.66.0)"] [[package]] name = "grpcio-tools" -version = "1.65.5" +version = "1.66.0" description = "Protobuf code generator for gRPC" optional = false python-versions = ">=3.8" files = [ - {file = "grpcio_tools-1.65.5-cp310-cp310-linux_armv7l.whl", hash = "sha256:f141f247a93e4c7faf33ac683a9cab93bb6570946a219260d33e2e62079db6e8"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:a6d05950c62024ac54dfb7b7987fd45e22e832143aa88768439aa12073e9d035"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:675df59961e2ab7808a3c0222ad995d8886bbbb7e77000fba1059214c9ce3e09"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fe5a21e4970cc2555066ba37c7c743749ccd0bd056d4262e97678927c586def8"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d0d7d34b4b3fba78075a923de2f962b33bcc04926569966c00219d5f41f2589"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:474d5905ee0700662b42f71ce2fc5901786c88d5a54c08749fa5bccae1db27af"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0f698f34be22a89426f986310ee866b8faa812355aab5d241fdaf742b546c36c"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-win32.whl", hash = "sha256:3d8cee4c1f0bca80115cfa99f25ab6e6c6797b4443b1f0d5fa949bf2e9ac5af9"}, - {file = "grpcio_tools-1.65.5-cp310-cp310-win_amd64.whl", hash = "sha256:ac013d5d118dfafc887c3da1649dbd5087a7161d969dab236050e54c55fa0725"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-linux_armv7l.whl", hash = "sha256:553b3f406a681719f6c11e70c993fe77383ab6adead9173ad1c6a611e5aaaf48"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:2a520fbb9be5a05b5a0cdb5c5d481f63fea5db2f048f47f19b613685009890f2"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:eca7be231ba6de3ac38556dcba1f94c05422e7cc62341bc2787ac9881aed3026"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd1e9134e266fefdd49e1c9989d1bdf74578a9f237d7d9df01d871d898deda9b"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:777243e4f7152da9d226d9cc1e6d7c2b94335e267c618260e6255a063bb7dfcb"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:a2e63bf9b6444f28ec684faf3c5fc8394b035fe221842186c3b9ff0121c20534"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:969c0b5079beb08ae0a22237652289bfc0e34602403e040bab419f46cb775e50"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-win32.whl", hash = "sha256:b9aefd9dc742c20bc5fb16f497f6d04b4f4f5c7d44cc86654a334ce7ea9c8021"}, - {file = "grpcio_tools-1.65.5-cp311-cp311-win_amd64.whl", hash = "sha256:ba27d67421dad33cbb42cdcd144dabed0516f0a5ee48d37250dd1b37c97cca72"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-linux_armv7l.whl", hash = "sha256:b48943492a7c00a3ce6d7159c37761d006085f7dcd4a13931dcc74ecb8a24b56"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ef44822eee4834158eb03cd432e4cf7e716d7d03051cc8314be4956ee9e9da3f"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:6077a87bb3028797175dd437e08ff42b559045f9588a14eb9c943dd8bde32dcc"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ee220c430f87378c598b7217c8c32ce7aeab3d8a93bc92cee92ce6940d870dd"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c86a003bfcbf98b6261a89c2aad97197672c99d057fe441440210f052c9b54f1"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:475ef5e8d91cbcf9bd9edbf51ac135931853d1c2fe6f8ae0c496b9ef422b41e4"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:e680b32e90c42d08363a02e9971e690bcf2509cb7bf647e232113b3e777eac9a"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-win32.whl", hash = "sha256:cc6b010bc26566ca35e858a94daa18992a02e7b70f688a78f3308dada54fc063"}, - {file = "grpcio_tools-1.65.5-cp312-cp312-win_amd64.whl", hash = "sha256:3ddce72654ce415cbe36561b5e124fc0fcb461582e829016b7aa726824bcadc9"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-linux_armv7l.whl", hash = "sha256:e5ae4a000c3344c32c1fa63e137ef42e65eae9adb5576dab636e3bc092653ae6"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:23bce4fcee7cad2e085923fdfd65ed2bd2173bfc298c8c8964d3dddaef1f49ae"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:56617905a4e478132b3732fd9dda71e35f1e7adedd34c92248c9a04a3892cb01"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5c38a8dc81900b7211fc5b1a14ace7f4ffd8cfbfd17e504f40044f0918b99825"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13b4f00f66a3f024e9bfaf535e2be8a373ada199eb928507945685208bf29536"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b2072ad56bec624d0190e605c6b56205a6336f31a35617b90d927791c14aa4ad"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:c8f8241b859413b8f0c5c8cfd4d9021862d29cf090e60fb8b30968737b575b52"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-win32.whl", hash = "sha256:e099bff2328931064aef565e811a7ce6ecbe7359c4d377534eee12dc6c35deb8"}, - {file = "grpcio_tools-1.65.5-cp38-cp38-win_amd64.whl", hash = "sha256:bf78ed1cfc9304dca4d1a5ec578a91b65a5946bf4ee923358a721fb47e35ffdf"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-linux_armv7l.whl", hash = "sha256:02ed771ce6aea1a5620d818ae41380a7fcf65c6d499c53d1ddaf6ded882640a9"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5b6a50253f950fd02caff90a021d6564731a86ffad38b7c0a76423f6ed58e779"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:8848d509b88631be77b4c40119c02a37d0e884d10b10f0ddb1e3e551d7023b0d"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:853ebfa33ed5336b51d0fa5d068bd5b42cb84d09077670ffa6b2dc7980f000cd"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:221fd8f4c3f54ced15d9dac2b8800fd1b254bf9cd29414d500ce6f7ddb59be25"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b6b33e23bfc6919c71329dabec632e7693de62efbed24b3e34616c09827909d8"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:21122fa43c48e15ff0d656258f942fdf7c3ed2b7ab1530c7d37d3027b71a5872"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-win32.whl", hash = "sha256:0e092c51089251f41e6e2c03519311509162be3aba2c71a91983d7d86ed300f3"}, - {file = "grpcio_tools-1.65.5-cp39-cp39-win_amd64.whl", hash = "sha256:2819a3a50c61306074cc95938db97e365acfca873b2cce986ad2d1f519d51f2f"}, - {file = "grpcio_tools-1.65.5.tar.gz", hash = "sha256:7c3a47ad0070bc907c7818caf55aa1948e9282d24e27afd21015872a25594bc7"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-linux_armv7l.whl", hash = "sha256:e0841fe0aa865694468243b682792d6649a9eaaeec103984a74fcf4289851a83"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:30261ab79e460e93002117627ec42a960c0d3d6292e3fd44a43eae94aedbae9a"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:879a70a153f05d61fae8e7dd88ad67c63c1a30ee22c344509ec2b898f1e29250"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff704d5b2c66e15aee1f34c74d8a44f0b613e9205d69c22172ffa056f9791db4"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24773294210f554cdf282feaa3f95b79e22de56f78ec7a2e66c990266100480b"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2da55cab0569eb2bae8fc445cb9eaafad488918e4a443f831dbdd2ce60c47684"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:72e86d15d5dab2f25385e40608f5dc6b512172c3b10d01952d3d25f2d0648b7c"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-win32.whl", hash = "sha256:923c60602e2025e1082cd3a1d7a5f74314f945ebb4763a939cc3f5a667d48d7f"}, + {file = "grpcio_tools-1.66.0-cp310-cp310-win_amd64.whl", hash = "sha256:95edac51be6cd1391726024dea3a2a852c0a4c63e90de1ec52b5857d1ad5fef1"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-linux_armv7l.whl", hash = "sha256:81123f93a4f93f8e2bd7ba4a106c1eb1529e0336368c3b93c077f7649b48d784"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:95e3d1506bb3c6574c9d359ac78eaaad18276a3aaa328852796ee10d28a10656"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:51cdcdf9dc9087bfc5d7aa03c4c76614350e0f7ef0689763f69938d1a7ebfac4"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ef97b6e945e77575d07dc2158773313aa1b36ddab41c59a1c51803b4620abd"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc188a5fbaf25e3a5f91f815d3928b1e40ba38f5a5f5b5e86f640c575f7db1c9"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:fddc8f3216199f47f2370f8a22ecc10a4e0b5c434eeab0ec47a79fb292e5a6f8"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:87a654381cdc43a64f890e1f68ca14f09c5bcafe9fe2481f50029a220b748d15"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-win32.whl", hash = "sha256:ecb781e41b08b094742137f56740acebedc29a18480a37c16d5dfed2aef0597a"}, + {file = "grpcio_tools-1.66.0-cp311-cp311-win_amd64.whl", hash = "sha256:cf5906367329121b90942de6a2f77b316090ce15980254c61ecd5043526dc03d"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-linux_armv7l.whl", hash = "sha256:bcb7f09c1569c2e5f1600e5b1eb6a8321e789a3e1d2f9ec5c236c62d61d22879"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:ca654c732029483a0355164f551b4531eae1d1f64e269d389d97d79a0b087966"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:b117868e2040489d8d542348a45cce6225fc87e1bc5e6092ad05bea343d4723d"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d72c6a8e1470832199764a4ac4aa999def0ccfb0fe0266c73aae003812acb957"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7055599f250713662022f5096956c220ff0f43a7ab500d080b0f343ba8d98e14"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4ecd2caa15c2070182e49aa1771cbf8e6181e5072833222401d965c6338a075c"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b7da029e5a1270a0342c01f897436ab690677502e12f18664b7387a5e6938134"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-win32.whl", hash = "sha256:bde2aca5fd16e5ab37cf83a8a7b805ccb7faceb804c562387852a3146bfd7eaf"}, + {file = "grpcio_tools-1.66.0-cp312-cp312-win_amd64.whl", hash = "sha256:e5507e1fee9caa19e2525d280016af8f4404affaad1a7c08beb7060797bd7972"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-linux_armv7l.whl", hash = "sha256:01449e9b20347fc7661f79090a9c0317e6de2759748170ac04cc0a4db74a681f"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9c026adf37d1dacc3270c60ef479945c68756a251c362aef51c250e1f69f6a18"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:2e31ac9a93feb5a4fbbb72de7a9a39709f28eea8183bab5e88f90a7facccf00b"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:63897f679ea55bc25accc825329b53acef2ad1266237d90be63c5aeaaa5bf175"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d38a0b97d16343b3389228edc58c9dfea69bd3833fe458681f9cf66d13bb2e0"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8e197458cc1747f56a5b6bddd635247f86d3eb2a8a191e3f43ce0e6f2bf374c5"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fd70b60d6b62df3d232e6c4f6c061c6bb5e071af88fe6323487d0b3b97ac87d2"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-win32.whl", hash = "sha256:65dfc1019a6dc3343161360a9436ca34f4aa4ffc40f4cdcd98e1e887dbe87cf8"}, + {file = "grpcio_tools-1.66.0-cp38-cp38-win_amd64.whl", hash = "sha256:2a76db15aea734e583158c7190615f9e82de19fbb1f8d15f7a34fa9e4c3938a5"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-linux_armv7l.whl", hash = "sha256:95f1d076a310007fff710b4eea648a98ec75e0eb755b9df9af03b38a120ed8ac"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:eaf20f8141646b1db73f36711960d1bdf96435fbce670417e0754b15fbc52e76"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:d84db86038507c86bfa148c9b6dde5a17b8b2e529eecbf1ca427c367043a56e8"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ca7080ac2aed6d303fab162c5945d920c0243a7a393df71c9f98882583dcda5"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:af2f8f944e779cb8dd5b5e8a689514775c745068cd564df662e00cab45430d40"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e67a36da1ca3501933f26bd65589b7a5abdf5cfed79fd419054a0924f79fa760"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2e78e94d9db3d686bc76f0ecedf5634ca3fad2d94e50c564a7d87630326719e8"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-win32.whl", hash = "sha256:00aafd7714f2e2f618ec75b0f13df6a6f174f2bc50ad70c79443d8f5aa60df96"}, + {file = "grpcio_tools-1.66.0-cp39-cp39-win_amd64.whl", hash = "sha256:a236df9ac2dd1f6009adc94bce1da10ac46dd87a04dea86bfbeadaa261c7adea"}, + {file = "grpcio_tools-1.66.0.tar.gz", hash = "sha256:6e111f73f400d64b8dc32f5dab67c5e806c290eb2658fecdbfc44c2bb1020efc"}, ] [package.dependencies] -grpcio = ">=1.65.5" +grpcio = ">=1.66.0" protobuf = ">=5.26.1,<6.0dev" setuptools = "*" [[package]] name = "idna" -version = "3.7" +version = "3.8" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.5" +python-versions = ">=3.6" files = [ - {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, - {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, + {file = "idna-3.8-py3-none-any.whl", hash = "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac"}, + {file = "idna-3.8.tar.gz", hash = "sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603"}, ] [[package]] @@ -829,13 +825,13 @@ files = [ [[package]] name = "minio" -version = "7.2.7" +version = "7.2.8" description = "MinIO Python SDK for Amazon S3 Compatible Cloud Storage" optional = false -python-versions = "*" +python-versions = ">3.8" files = [ - {file = "minio-7.2.7-py3-none-any.whl", hash = "sha256:59d1f255d852fe7104018db75b3bebbd987e538690e680f7c5de835e422de837"}, - {file = "minio-7.2.7.tar.gz", hash = "sha256:473d5d53d79f340f3cd632054d0c82d2f93177ce1af2eac34a235bea55708d98"}, + {file = "minio-7.2.8-py3-none-any.whl", hash = "sha256:aa3b485788b63b12406a5798465d12a57e4be2ac2a58a8380959b6b748e64ddd"}, + {file = "minio-7.2.8.tar.gz", hash = "sha256:f8af2dafc22ebe1aef3ac181b8e217037011c430aa6da276ed627e55aaf7c815"}, ] [package.dependencies] @@ -847,58 +843,74 @@ urllib3 = "*" [[package]] name = "numpy" -version = "1.26.4" +version = "2.1.0" description = "Fundamental package for array computing in Python" optional = false -python-versions = ">=3.9" +python-versions = ">=3.10" files = [ - {file = "numpy-1.26.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0"}, - {file = "numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a"}, - {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4"}, - {file = "numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f"}, - {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a"}, - {file = "numpy-1.26.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2"}, - {file = "numpy-1.26.4-cp310-cp310-win32.whl", hash = "sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07"}, - {file = "numpy-1.26.4-cp310-cp310-win_amd64.whl", hash = "sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5"}, - {file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"}, - {file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"}, - {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e"}, - {file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5"}, - {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a"}, - {file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a"}, - {file = "numpy-1.26.4-cp311-cp311-win32.whl", hash = "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20"}, - {file = "numpy-1.26.4-cp311-cp311-win_amd64.whl", hash = "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2"}, - {file = "numpy-1.26.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218"}, - {file = "numpy-1.26.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b"}, - {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b"}, - {file = "numpy-1.26.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed"}, - {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a"}, - {file = "numpy-1.26.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0"}, - {file = "numpy-1.26.4-cp312-cp312-win32.whl", hash = "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110"}, - {file = "numpy-1.26.4-cp312-cp312-win_amd64.whl", hash = "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818"}, - {file = "numpy-1.26.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c"}, - {file = "numpy-1.26.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be"}, - {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764"}, - {file = "numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3"}, - {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd"}, - {file = "numpy-1.26.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c"}, - {file = "numpy-1.26.4-cp39-cp39-win32.whl", hash = "sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6"}, - {file = "numpy-1.26.4-cp39-cp39-win_amd64.whl", hash = "sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea"}, - {file = "numpy-1.26.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30"}, - {file = "numpy-1.26.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c"}, - {file = "numpy-1.26.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0"}, - {file = "numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6326ab99b52fafdcdeccf602d6286191a79fe2fda0ae90573c5814cd2b0bc1b8"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0937e54c09f7a9a68da6889362ddd2ff584c02d015ec92672c099b61555f8911"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:30014b234f07b5fec20f4146f69e13cfb1e33ee9a18a1879a0142fbb00d47673"}, + {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:899da829b362ade41e1e7eccad2cf274035e1cb36ba73034946fccd4afd8606b"}, + {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08801848a40aea24ce16c2ecde3b756f9ad756586fb2d13210939eb69b023f5b"}, + {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:398049e237d1aae53d82a416dade04defed1a47f87d18d5bd615b6e7d7e41d1f"}, + {file = "numpy-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0abb3916a35d9090088a748636b2c06dc9a6542f99cd476979fb156a18192b84"}, + {file = "numpy-2.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:10e2350aea18d04832319aac0f887d5fcec1b36abd485d14f173e3e900b83e33"}, + {file = "numpy-2.1.0-cp310-cp310-win32.whl", hash = "sha256:f6b26e6c3b98adb648243670fddc8cab6ae17473f9dc58c51574af3e64d61211"}, + {file = "numpy-2.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:f505264735ee074250a9c78247ee8618292091d9d1fcc023290e9ac67e8f1afa"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:76368c788ccb4f4782cf9c842b316140142b4cbf22ff8db82724e82fe1205dce"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f8e93a01a35be08d31ae33021e5268f157a2d60ebd643cfc15de6ab8e4722eb1"}, + {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:9523f8b46485db6939bd069b28b642fec86c30909cea90ef550373787f79530e"}, + {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54139e0eb219f52f60656d163cbe67c31ede51d13236c950145473504fa208cb"}, + {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5ebbf9fbdabed208d4ecd2e1dfd2c0741af2f876e7ae522c2537d404ca895c3"}, + {file = "numpy-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:378cb4f24c7d93066ee4103204f73ed046eb88f9ad5bb2275bb9fa0f6a02bd36"}, + {file = "numpy-2.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8f699a709120b220dfe173f79c73cb2a2cab2c0b88dd59d7b49407d032b8ebd"}, + {file = "numpy-2.1.0-cp311-cp311-win32.whl", hash = "sha256:ffbd6faeb190aaf2b5e9024bac9622d2ee549b7ec89ef3a9373fa35313d44e0e"}, + {file = "numpy-2.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:0af3a5987f59d9c529c022c8c2a64805b339b7ef506509fba7d0556649b9714b"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fe76d75b345dc045acdbc006adcb197cc680754afd6c259de60d358d60c93736"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f358ea9e47eb3c2d6eba121ab512dfff38a88db719c38d1e67349af210bc7529"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:dd94ce596bda40a9618324547cfaaf6650b1a24f5390350142499aa4e34e53d1"}, + {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:b47c551c6724960479cefd7353656498b86e7232429e3a41ab83be4da1b109e8"}, + {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0756a179afa766ad7cb6f036de622e8a8f16ffdd55aa31f296c870b5679d745"}, + {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24003ba8ff22ea29a8c306e61d316ac74111cebf942afbf692df65509a05f111"}, + {file = "numpy-2.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b34fa5e3b5d6dc7e0a4243fa0f81367027cb6f4a7215a17852979634b5544ee0"}, + {file = "numpy-2.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c4f982715e65036c34897eb598d64aef15150c447be2cfc6643ec7a11af06574"}, + {file = "numpy-2.1.0-cp312-cp312-win32.whl", hash = "sha256:c4cd94dfefbefec3f8b544f61286584292d740e6e9d4677769bc76b8f41deb02"}, + {file = "numpy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0cdef204199278f5c461a0bed6ed2e052998276e6d8ab2963d5b5c39a0500bc"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8ab81ccd753859ab89e67199b9da62c543850f819993761c1e94a75a814ed667"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:442596f01913656d579309edcd179a2a2f9977d9a14ff41d042475280fc7f34e"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:848c6b5cad9898e4b9ef251b6f934fa34630371f2e916261070a4eb9092ffd33"}, + {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:54c6a63e9d81efe64bfb7bcb0ec64332a87d0b87575f6009c8ba67ea6374770b"}, + {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:652e92fc409e278abdd61e9505649e3938f6d04ce7ef1953f2ec598a50e7c195"}, + {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ab32eb9170bf8ffcbb14f11613f4a0b108d3ffee0832457c5d4808233ba8977"}, + {file = "numpy-2.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:8fb49a0ba4d8f41198ae2d52118b050fd34dace4b8f3fb0ee34e23eb4ae775b1"}, + {file = "numpy-2.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44e44973262dc3ae79e9063a1284a73e09d01b894b534a769732ccd46c28cc62"}, + {file = "numpy-2.1.0-cp313-cp313-win32.whl", hash = "sha256:ab83adc099ec62e044b1fbb3a05499fa1e99f6d53a1dde102b2d85eff66ed324"}, + {file = "numpy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:de844aaa4815b78f6023832590d77da0e3b6805c644c33ce94a1e449f16d6ab5"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:343e3e152bf5a087511cd325e3b7ecfd5b92d369e80e74c12cd87826e263ec06"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f07fa2f15dabe91259828ce7d71b5ca9e2eb7c8c26baa822c825ce43552f4883"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5474dad8c86ee9ba9bb776f4b99ef2d41b3b8f4e0d199d4f7304728ed34d0300"}, + {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:1f817c71683fd1bb5cff1529a1d085a57f02ccd2ebc5cd2c566f9a01118e3b7d"}, + {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a3336fbfa0d38d3deacd3fe7f3d07e13597f29c13abf4d15c3b6dc2291cbbdd"}, + {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a894c51fd8c4e834f00ac742abad73fc485df1062f1b875661a3c1e1fb1c2f6"}, + {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:9156ca1f79fc4acc226696e95bfcc2b486f165a6a59ebe22b2c1f82ab190384a"}, + {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:624884b572dff8ca8f60fab591413f077471de64e376b17d291b19f56504b2bb"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:15ef8b2177eeb7e37dd5ef4016f30b7659c57c2c0b57a779f1d537ff33a72c7b"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:e5f0642cdf4636198a4990de7a71b693d824c56a757862230454629cf62e323d"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15976718c004466406342789f31b6673776360f3b1e3c575f25302d7e789575"}, + {file = "numpy-2.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:6c1de77ded79fef664d5098a66810d4d27ca0224e9051906e634b3f7ead134c2"}, + {file = "numpy-2.1.0.tar.gz", hash = "sha256:7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2"}, ] [[package]] name = "packaging" -version = "24.0" +version = "24.1" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, - {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] [[package]] @@ -909,7 +921,6 @@ optional = false python-versions = ">=3.9" files = [ {file = "pandas-2.2.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:90c6fca2acf139569e74e8781709dccb6fe25940488755716d1d354d6bc58bce"}, - {file = "pandas-2.2.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c7adfc142dac335d8c1e0dcbd37eb8617eac386596eb9e1a1b77791cf2498238"}, {file = "pandas-2.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4abfe0be0d7221be4f12552995e58723c7422c80a659da13ca382697de830c08"}, {file = "pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8635c16bf3d99040fdf3ca3db669a7250ddf49c55dc4aa8fe0ae0fa8d6dcc1f0"}, {file = "pandas-2.2.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:40ae1dffb3967a52203105a077415a86044a2bea011b5f321c6aa64b379a3f51"}, @@ -923,14 +934,12 @@ files = [ {file = "pandas-2.2.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0cace394b6ea70c01ca1595f839cf193df35d1575986e484ad35c4aeae7266c1"}, {file = "pandas-2.2.2-cp311-cp311-win_amd64.whl", hash = "sha256:873d13d177501a28b2756375d59816c365e42ed8417b41665f346289adc68d24"}, {file = "pandas-2.2.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9dfde2a0ddef507a631dc9dc4af6a9489d5e2e740e226ad426a05cabfbd7c8ef"}, - {file = "pandas-2.2.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e9b79011ff7a0f4b1d6da6a61aa1aa604fb312d6647de5bad20013682d1429ce"}, {file = "pandas-2.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1cb51fe389360f3b5a4d57dbd2848a5f033350336ca3b340d1c53a1fad33bcad"}, {file = "pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eee3a87076c0756de40b05c5e9a6069c035ba43e8dd71c379e68cab2c20f16ad"}, {file = "pandas-2.2.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3e374f59e440d4ab45ca2fffde54b81ac3834cf5ae2cdfa69c90bc03bde04d76"}, {file = "pandas-2.2.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:43498c0bdb43d55cb162cdc8c06fac328ccb5d2eabe3cadeb3529ae6f0517c32"}, {file = "pandas-2.2.2-cp312-cp312-win_amd64.whl", hash = "sha256:d187d355ecec3629624fccb01d104da7d7f391db0311145817525281e2804d23"}, {file = "pandas-2.2.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0ca6377b8fca51815f382bd0b697a0814c8bda55115678cbc94c30aacbb6eff2"}, - {file = "pandas-2.2.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9057e6aa78a584bc93a13f0a9bf7e753a5e9770a30b4d758b8d5f2a62a9433cd"}, {file = "pandas-2.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:001910ad31abc7bf06f49dcc903755d2f7f3a9186c0c040b827e522e9cef0863"}, {file = "pandas-2.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:66b479b0bd07204e37583c191535505410daa8df638fd8e75ae1b383851fe921"}, {file = "pandas-2.2.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a77e9d1c386196879aa5eb712e77461aaee433e54c68cf253053a73b7e49c33a"}, @@ -991,118 +1000,108 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "protobuf" -version = "5.27.1" +version = "5.27.3" description = "" optional = false python-versions = ">=3.8" files = [ - {file = "protobuf-5.27.1-cp310-abi3-win32.whl", hash = "sha256:3adc15ec0ff35c5b2d0992f9345b04a540c1e73bfee3ff1643db43cc1d734333"}, - {file = "protobuf-5.27.1-cp310-abi3-win_amd64.whl", hash = "sha256:25236b69ab4ce1bec413fd4b68a15ef8141794427e0b4dc173e9d5d9dffc3bcd"}, - {file = "protobuf-5.27.1-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:4e38fc29d7df32e01a41cf118b5a968b1efd46b9c41ff515234e794011c78b17"}, - {file = "protobuf-5.27.1-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:917ed03c3eb8a2d51c3496359f5b53b4e4b7e40edfbdd3d3f34336e0eef6825a"}, - {file = "protobuf-5.27.1-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:ee52874a9e69a30271649be88ecbe69d374232e8fd0b4e4b0aaaa87f429f1631"}, - {file = "protobuf-5.27.1-cp38-cp38-win32.whl", hash = "sha256:7a97b9c5aed86b9ca289eb5148df6c208ab5bb6906930590961e08f097258107"}, - {file = "protobuf-5.27.1-cp38-cp38-win_amd64.whl", hash = "sha256:f6abd0f69968792da7460d3c2cfa7d94fd74e1c21df321eb6345b963f9ec3d8d"}, - {file = "protobuf-5.27.1-cp39-cp39-win32.whl", hash = "sha256:dfddb7537f789002cc4eb00752c92e67885badcc7005566f2c5de9d969d3282d"}, - {file = "protobuf-5.27.1-cp39-cp39-win_amd64.whl", hash = "sha256:39309898b912ca6febb0084ea912e976482834f401be35840a008da12d189340"}, - {file = "protobuf-5.27.1-py3-none-any.whl", hash = "sha256:4ac7249a1530a2ed50e24201d6630125ced04b30619262f06224616e0030b6cf"}, - {file = "protobuf-5.27.1.tar.gz", hash = "sha256:df5e5b8e39b7d1c25b186ffdf9f44f40f810bbcc9d2b71d9d3156fee5a9adf15"}, + {file = "protobuf-5.27.3-cp310-abi3-win32.whl", hash = "sha256:dcb307cd4ef8fec0cf52cb9105a03d06fbb5275ce6d84a6ae33bc6cf84e0a07b"}, + {file = "protobuf-5.27.3-cp310-abi3-win_amd64.whl", hash = "sha256:16ddf3f8c6c41e1e803da7abea17b1793a97ef079a912e42351eabb19b2cffe7"}, + {file = "protobuf-5.27.3-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:68248c60d53f6168f565a8c76dc58ba4fa2ade31c2d1ebdae6d80f969cdc2d4f"}, + {file = "protobuf-5.27.3-cp38-abi3-manylinux2014_aarch64.whl", hash = "sha256:b8a994fb3d1c11156e7d1e427186662b64694a62b55936b2b9348f0a7c6625ce"}, + {file = "protobuf-5.27.3-cp38-abi3-manylinux2014_x86_64.whl", hash = "sha256:a55c48f2a2092d8e213bd143474df33a6ae751b781dd1d1f4d953c128a415b25"}, + {file = "protobuf-5.27.3-cp38-cp38-win32.whl", hash = "sha256:043853dcb55cc262bf2e116215ad43fa0859caab79bb0b2d31b708f128ece035"}, + {file = "protobuf-5.27.3-cp38-cp38-win_amd64.whl", hash = "sha256:c2a105c24f08b1e53d6c7ffe69cb09d0031512f0b72f812dd4005b8112dbe91e"}, + {file = "protobuf-5.27.3-cp39-cp39-win32.whl", hash = "sha256:c84eee2c71ed83704f1afbf1a85c3171eab0fd1ade3b399b3fad0884cbcca8bf"}, + {file = "protobuf-5.27.3-cp39-cp39-win_amd64.whl", hash = "sha256:af7c0b7cfbbb649ad26132e53faa348580f844d9ca46fd3ec7ca48a1ea5db8a1"}, + {file = "protobuf-5.27.3-py3-none-any.whl", hash = "sha256:8572c6533e544ebf6899c360e91d6bcbbee2549251643d32c52cf8a5de295ba5"}, + {file = "protobuf-5.27.3.tar.gz", hash = "sha256:82460903e640f2b7e34ee81a947fdaad89de796d324bcbc38ff5430bcdead82c"}, ] [[package]] name = "psycopg" -version = "3.1.19" +version = "3.2.1" description = "PostgreSQL database adapter for Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "psycopg-3.1.19-py3-none-any.whl", hash = "sha256:dca5e5521c859f6606686432ae1c94e8766d29cc91f2ee595378c510cc5b0731"}, - {file = "psycopg-3.1.19.tar.gz", hash = "sha256:92d7b78ad82426cdcf1a0440678209faa890c6e1721361c2f8901f0dccd62961"}, + {file = "psycopg-3.2.1-py3-none-any.whl", hash = "sha256:ece385fb413a37db332f97c49208b36cf030ff02b199d7635ed2fbd378724175"}, + {file = "psycopg-3.2.1.tar.gz", hash = "sha256:dc8da6dc8729dacacda3cc2f17d2c9397a70a66cf0d2b69c91065d60d5f00cb7"}, ] [package.dependencies] -psycopg-binary = {version = "3.1.19", optional = true, markers = "implementation_name != \"pypy\" and extra == \"binary\""} -typing-extensions = ">=4.1" +psycopg-binary = {version = "3.2.1", optional = true, markers = "implementation_name != \"pypy\" and extra == \"binary\""} +typing-extensions = ">=4.4" tzdata = {version = "*", markers = "sys_platform == \"win32\""} [package.extras] -binary = ["psycopg-binary (==3.1.19)"] -c = ["psycopg-c (==3.1.19)"] -dev = ["black (>=24.1.0)", "codespell (>=2.2)", "dnspython (>=2.1)", "flake8 (>=4.0)", "mypy (>=1.4.1)", "types-setuptools (>=57.4)", "wheel (>=0.37)"] +binary = ["psycopg-binary (==3.2.1)"] +c = ["psycopg-c (==3.2.1)"] +dev = ["ast-comments (>=1.1.2)", "black (>=24.1.0)", "codespell (>=2.2)", "dnspython (>=2.1)", "flake8 (>=4.0)", "mypy (>=1.6)", "types-setuptools (>=57.4)", "wheel (>=0.37)"] docs = ["Sphinx (>=5.0)", "furo (==2022.6.21)", "sphinx-autobuild (>=2021.3.14)", "sphinx-autodoc-typehints (>=1.12)"] pool = ["psycopg-pool"] -test = ["anyio (>=3.6.2,<4.0)", "mypy (>=1.4.1)", "pproxy (>=2.7)", "pytest (>=6.2.5)", "pytest-cov (>=3.0)", "pytest-randomly (>=3.5)"] +test = ["anyio (>=4.0)", "mypy (>=1.6)", "pproxy (>=2.7)", "pytest (>=6.2.5)", "pytest-cov (>=3.0)", "pytest-randomly (>=3.5)"] [[package]] name = "psycopg-binary" -version = "3.1.19" +version = "3.2.1" description = "PostgreSQL database adapter for Python -- C optimisation distribution" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "psycopg_binary-3.1.19-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7204818f05151dd08f8f851defb01972ec9d2cc925608eb0de232563f203f354"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6d4e67fd86758dbeac85641419a54f84d74495a8683b58ad5dfad08b7fc37a8f"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e12173e34b176e93ad2da913de30f774d5119c2d4d4640c6858d2d77dfa6c9bf"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:052f5193304066318853b4b2e248f523c8f52b371fc4e95d4ef63baee3f30955"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29008f3f8977f600b8a7fb07c2e041b01645b08121760609cc45e861a0364dc9"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c6a9a651a08d876303ed059c9553df18b3c13c3406584a70a8f37f1a1fe2709"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:91a645e6468c4f064b7f4f3b81074bdd68fe5aa2b8c5107de15dcd85ba6141be"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:5c6956808fd5cf0576de5a602243af8e04594b25b9a28675feddc71c5526410a"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:1622ca27d5a7a98f7d8f35e8b146dc7efda4a4b6241d2edf7e076bd6bcecbeb4"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a100482950a55228f648bd382bb71bfaff520002f29845274fccbbf02e28bd52"}, - {file = "psycopg_binary-3.1.19-cp310-cp310-win_amd64.whl", hash = "sha256:955ca8905c0251fc4af7ce0a20999e824a25652f53a558ab548b60969f1f368e"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cf49e91dcf699b8a449944ed898ef1466b39b92720613838791a551bc8f587a"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:964c307e400c5f33fa762ba1e19853e048814fcfbd9679cc923431adb7a2ead2"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3433924e1b14074798331dc2bfae2af452ed7888067f2fc145835704d8981b15"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00879d4c6be4b3afc510073f48a5e960f797200e261ab3d9bd9b7746a08c669d"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:34a6997c80f86d3dd80a4f078bb3b200079c47eeda4fd409d8899b883c90d2ac"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0106e42b481677c41caa69474fe530f786dcef88b11b70000f0e45a03534bc8f"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:81efe09ba27533e35709905c3061db4dc9fb814f637360578d065e2061fbb116"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d312d6dddc18d9c164e1893706269c293cba1923118349d375962b1188dafb01"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:bfd2c734da9950f7afaad5f132088e0e1478f32f042881fca6651bb0c8d14206"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8a732610a5a6b4f06dadcf9288688a8ff202fd556d971436a123b7adb85596e2"}, - {file = "psycopg_binary-3.1.19-cp311-cp311-win_amd64.whl", hash = "sha256:321814a9a3ad785855a821b842aba08ca1b7de7dfb2979a2f0492dca9ec4ae70"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:4aa0ca13bb8a725bb6d12c13999217fd5bc8b86a12589f28a74b93e076fbb959"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:469424e354ebcec949aa6aa30e5a9edc352a899d9a68ad7a48f97df83cc914cf"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b04f5349313529ae1f1c42fe1aa0443faaf50fdf12d13866c2cc49683bfa53d0"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:959feabddc7fffac89b054d6f23f3b3c62d7d3c90cd414a02e3747495597f150"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e9da624a6ca4bc5f7fa1f03f8485446b5b81d5787b6beea2b4f8d9dbef878ad7"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1823221a6b96e38b15686170d4fc5b36073efcb87cce7d3da660440b50077f6"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:866db42f986298f0cf15d805225eb8df2228bf19f7997d7f1cb5f388cbfc6a0f"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:738c34657305b5973af6dbb6711b07b179dfdd21196d60039ca30a74bafe9648"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:fb9758473200384a04374d0e0cac6f451218ff6945a024f65a1526802c34e56e"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0e991632777e217953ac960726158987da684086dd813ac85038c595e7382c91"}, - {file = "psycopg_binary-3.1.19-cp312-cp312-win_amd64.whl", hash = "sha256:1d87484dd42c8783c44a30400949efb3d81ef2487eaa7d64d1c54df90cf8b97a"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d1d1723d7449c12bb61aca7eb6e0c6ab2863cd8dc0019273cc4d4a1982f84bdb"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e538a8671005641fa195eab962f85cf0504defbd3b548c4c8fc27102a59f687b"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c50592bc8517092f40979e4a5d934f96a1737a77724bb1d121eb78b614b30fc8"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:95f16ae82bc242b76cd3c3e5156441e2bd85ff9ec3a9869d750aad443e46073c"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aebd1e98e865e9a28ce0cb2c25b7dfd752f0d1f0a423165b55cd32a431dcc0f4"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:49cd7af7d49e438a39593d1dd8cab106a1912536c2b78a4d814ebdff2786094e"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:affebd61aa3b7a8880fd4ac3ee94722940125ff83ff485e1a7c76be9adaabb38"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:d1bac282f140fa092f2bbb6c36ed82270b4a21a6fc55d4b16748ed9f55e50fdb"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1285aa54449e362b1d30d92b2dc042ad3ee80f479cc4e323448d0a0a8a1641fa"}, - {file = "psycopg_binary-3.1.19-cp37-cp37m-win_amd64.whl", hash = "sha256:6cff31af8155dc9ee364098a328bab688c887c732c66b8d027e5b03818ca0287"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d9b689c4a17dd3130791dcbb8c30dbf05602f7c2d56c792e193fb49adc7bf5f8"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:017518bd2de4851adc826a224fb105411e148ad845e11355edd6786ba3dfedf5"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c35fd811f339a3cbe7f9b54b2d9a5e592e57426c6cc1051632a62c59c4810208"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:38ed45ec9673709bfa5bc17f140e71dd4cca56d4e58ef7fd50d5a5043a4f55c6"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:433f1c256108f9e26f480a8cd6ddb0fb37dbc87d7f5a97e4540a9da9b881f23f"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ed61e43bf5dc8d0936daf03a19fef3168d64191dbe66483f7ad08c4cea0bc36b"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4ae8109ff9fdf1fa0cb87ab6645298693fdd2666a7f5f85660df88f6965e0bb7"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:a53809ee02e3952fae7977c19b30fd828bd117b8f5edf17a3a94212feb57faaf"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:9d39d5ffc151fb33bcd55b99b0e8957299c0b1b3e5a1a5f4399c1287ef0051a9"}, - {file = "psycopg_binary-3.1.19-cp38-cp38-win_amd64.whl", hash = "sha256:e14bc8250000921fcccd53722f86b3b3d1b57db901e206e49e2ab2afc5919c2d"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cd88c5cea4efe614d5004fb5f5dcdea3d7d59422be796689e779e03363102d24"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:621a814e60825162d38760c66351b4df679fd422c848b7c2f86ad399bff27145"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46e50c05952b59a214e27d3606f6d510aaa429daed898e16b8a37bfbacc81acc"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:03354a9db667c27946e70162cb0042c3929154167f3678a30d23cebfe0ad55b5"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:703c2f3b79037581afec7baa2bdbcb0a1787f1758744a7662099b0eca2d721cb"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:6469ebd9e93327e9f5f36dcf8692fb1e7aeaf70087c1c15d4f2c020e0be3a891"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:85bca9765c04b6be90cb46e7566ffe0faa2d7480ff5c8d5e055ac427f039fd24"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:a836610d5c75e9cff98b9fdb3559c007c785c09eaa84a60d5d10ef6f85f671e8"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ef8de7a1d9fb3518cc6b58e3c80b75a824209ad52b90c542686c912db8553dad"}, - {file = "psycopg_binary-3.1.19-cp39-cp39-win_amd64.whl", hash = "sha256:76fcd33342f38e35cd6b5408f1bc117d55ab8b16e5019d99b6d3ce0356c51717"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:cad2de17804c4cfee8640ae2b279d616bb9e4734ac3c17c13db5e40982bd710d"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:592b27d6c46a40f9eeaaeea7c1fef6f3c60b02c634365eb649b2d880669f149f"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9a997efbaadb5e1a294fb5760e2f5643d7b8e4e3fe6cb6f09e6d605fd28e0291"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1d2b6438fb83376f43ebb798bf0ad5e57bc56c03c9c29c85bc15405c8c0ac5a"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b1f087bd84bdcac78bf9f024ebdbfacd07fc0a23ec8191448a50679e2ac4a19e"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:415c3b72ea32119163255c6504085f374e47ae7345f14bc3f0ef1f6e0976a879"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f092114f10f81fb6bae544a0ec027eb720e2d9c74a4fcdaa9dd3899873136935"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:06a7aae34edfe179ddc04da005e083ff6c6b0020000399a2cbf0a7121a8a22ea"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0b018631e5c80ce9bc210b71ea885932f9cca6db131e4df505653d7e3873a938"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f8a509aeaac364fa965454e80cd110fe6d48ba2c80f56c9b8563423f0b5c3cfd"}, + {file = "psycopg_binary-3.2.1-cp310-cp310-win_amd64.whl", hash = "sha256:413977d18412ff83486eeb5875eb00b185a9391c57febac45b8993bf9c0ff489"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:62b1b7b07e00ee490afb39c0a47d8282a9c2822c7cfed9553a04b0058adf7e7f"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f8afb07114ea9b924a4a0305ceb15354ccf0ef3c0e14d54b8dbeb03e50182dd7"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40bb515d042f6a345714ec0403df68ccf13f73b05e567837d80c886c7c9d3805"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6418712ba63cebb0c88c050b3997185b0ef54173b36568522d5634ac06153040"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:101472468d59c74bb8565fab603e032803fd533d16be4b2d13da1bab8deb32a3"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa3931f308ab4a479d0ee22dc04bea867a6365cac0172e5ddcba359da043854b"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:dc314a47d44fe1a8069b075a64abffad347a3a1d8652fed1bab5d3baea37acb2"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:cc304a46be1e291031148d9d95c12451ffe783ff0cc72f18e2cc7ec43cdb8c68"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:6f9e13600647087df5928875559f0eb8f496f53e6278b7da9511b4b3d0aff960"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b140182830c76c74d17eba27df3755a46442ce8d4fb299e7f1cf2f74a87c877b"}, + {file = "psycopg_binary-3.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:3c838806eeb99af39f934b7999e35f947a8e577997cc892c12b5053a97a9057f"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:7066d3dca196ed0dc6172f9777b2d62e4f138705886be656cccff2d555234d60"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:28ada5f610468c57d8a4a055a8ea915d0085a43d794266c4f3b9d02f4288f4db"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e8213bf50af073b1aa8dc3cff123bfeedac86332a16c1b7274910bc88a847c7"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:74d623261655a169bc84a9669890975c229f2fa6e19a7f2d10a77675dcf1a707"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:42781ba94e8842ee98bca5a7d0c44cc9d067500fedca2d6a90fa3609b6d16b42"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33e6669091d09f8ba36e10ce678a6d9916e110446236a9b92346464a3565635e"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b09e8a576a2ac69d695032ee76f31e03b30781828b5dd6d18c6a009e5a3d1c35"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:8f28ff0cb9f1defdc4a6f8c958bf6787274247e7dfeca811f6e2f56602695fb1"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4c84fcac8a3a3479ac14673095cc4e1fdba2935499f72c436785ac679bec0d1a"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:950fd666ec9e9fe6a8eeb2b5a8f17301790e518953730ad44d715b59ffdbc67f"}, + {file = "psycopg_binary-3.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:334046a937bb086c36e2c6889fe327f9f29bfc085d678f70fac0b0618949f674"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:1d6833f607f3fc7b22226a9e121235d3b84c0eda1d3caab174673ef698f63788"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d353e028b8f848b9784450fc2abf149d53a738d451eab3ee4c85703438128b9"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f34e369891f77d0738e5d25727c307d06d5344948771e5379ea29c76c6d84555"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ab58213cc976a1666f66bc1cb2e602315cd753b7981a8e17237ac2a185bd4a1"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0104a72a17aa84b3b7dcab6c84826c595355bf54bb6ea6d284dcb06d99c6801"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:059cbd4e6da2337e17707178fe49464ed01de867dc86c677b30751755ec1dc51"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:73f9c9b984be9c322b5ec1515b12df1ee5896029f5e72d46160eb6517438659c"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:af0469c00f24c4bec18c3d2ede124bf62688d88d1b8a5f3c3edc2f61046fe0d7"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:463d55345f73ff391df8177a185ad57b552915ad33f5cc2b31b930500c068b22"}, + {file = "psycopg_binary-3.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:302b86f92c0d76e99fe1b5c22c492ae519ce8b98b88d37ef74fda4c9e24c6b46"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:0879b5d76b7d48678d31278242aaf951bc2d69ca4e4d7cef117e4bbf7bfefda9"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f99e59f8a5f4dcd9cbdec445f3d8ac950a492fc0e211032384d6992ed3c17eb7"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84837e99353d16c6980603b362d0f03302d4b06c71672a6651f38df8a482923d"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ce965caf618061817f66c0906f0452aef966c293ae0933d4fa5a16ea6eaf5bb"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78c2007caf3c90f08685c5378e3ceb142bafd5636be7495f7d86ec8a977eaeef"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:7a84b5eb194a258116154b2a4ff2962ea60ea52de089508db23a51d3d6b1c7d1"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4a42b8f9ab39affcd5249b45cac763ac3cf12df962b67e23fd15a2ee2932afe5"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:788ffc43d7517c13e624c83e0e553b7b8823c9655e18296566d36a829bfb373f"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:21927f41c4d722ae8eb30d62a6ce732c398eac230509af5ba1749a337f8a63e2"}, + {file = "psycopg_binary-3.2.1-cp39-cp39-win_amd64.whl", hash = "sha256:921f0c7f39590763d64a619de84d1b142587acc70fd11cbb5ba8fa39786f3073"}, ] [[package]] @@ -1229,13 +1228,13 @@ files = [ [[package]] name = "pytest" -version = "8.2.2" +version = "8.3.2" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-8.2.2-py3-none-any.whl", hash = "sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343"}, - {file = "pytest-8.2.2.tar.gz", hash = "sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977"}, + {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, + {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, ] [package.dependencies] @@ -1243,7 +1242,7 @@ colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" -pluggy = ">=1.5,<2.0" +pluggy = ">=1.5,<2" tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] @@ -1307,79 +1306,46 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.4.8" +version = "0.6.2" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.4.8-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7663a6d78f6adb0eab270fa9cf1ff2d28618ca3a652b60f2a234d92b9ec89066"}, - {file = "ruff-0.4.8-py3-none-macosx_11_0_arm64.whl", hash = "sha256:eeceb78da8afb6de0ddada93112869852d04f1cd0f6b80fe464fd4e35c330913"}, - {file = "ruff-0.4.8-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aad360893e92486662ef3be0a339c5ca3c1b109e0134fcd37d534d4be9fb8de3"}, - {file = "ruff-0.4.8-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:284c2e3f3396fb05f5f803c9fffb53ebbe09a3ebe7dda2929ed8d73ded736deb"}, - {file = "ruff-0.4.8-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7354f921e3fbe04d2a62d46707e569f9315e1a613307f7311a935743c51a764"}, - {file = "ruff-0.4.8-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:72584676164e15a68a15778fd1b17c28a519e7a0622161eb2debdcdabdc71883"}, - {file = "ruff-0.4.8-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9678d5c9b43315f323af2233a04d747409d1e3aa6789620083a82d1066a35199"}, - {file = "ruff-0.4.8-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704977a658131651a22b5ebeb28b717ef42ac6ee3b11e91dc87b633b5d83142b"}, - {file = "ruff-0.4.8-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d05f8d6f0c3cce5026cecd83b7a143dcad503045857bc49662f736437380ad45"}, - {file = "ruff-0.4.8-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:6ea874950daca5697309d976c9afba830d3bf0ed66887481d6bca1673fc5b66a"}, - {file = "ruff-0.4.8-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fc95aac2943ddf360376be9aa3107c8cf9640083940a8c5bd824be692d2216dc"}, - {file = "ruff-0.4.8-py3-none-musllinux_1_2_i686.whl", hash = "sha256:384154a1c3f4bf537bac69f33720957ee49ac8d484bfc91720cc94172026ceed"}, - {file = "ruff-0.4.8-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e9d5ce97cacc99878aa0d084c626a15cd21e6b3d53fd6f9112b7fc485918e1fa"}, - {file = "ruff-0.4.8-py3-none-win32.whl", hash = "sha256:6d795d7639212c2dfd01991259460101c22aabf420d9b943f153ab9d9706e6a9"}, - {file = "ruff-0.4.8-py3-none-win_amd64.whl", hash = "sha256:e14a3a095d07560a9d6769a72f781d73259655919d9b396c650fc98a8157555d"}, - {file = "ruff-0.4.8-py3-none-win_arm64.whl", hash = "sha256:14019a06dbe29b608f6b7cbcec300e3170a8d86efaddb7b23405cb7f7dcaf780"}, - {file = "ruff-0.4.8.tar.gz", hash = "sha256:16d717b1d57b2e2fd68bd0bf80fb43931b79d05a7131aa477d66fc40fbd86268"}, -] - -[[package]] -name = "secp256k1" -version = "0.14.0" -description = "FFI bindings to libsecp256k1" -optional = false -python-versions = "*" -files = [ - {file = "secp256k1-0.14.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:f666c67dcf1dc69e1448b2ede5e12aaf382b600204a61dbc65e4f82cea444405"}, - {file = "secp256k1-0.14.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:fcabb3c3497a902fb61eec72d1b69bf72747d7bcc2a732d56d9319a1e8322262"}, - {file = "secp256k1-0.14.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:7a27c479ab60571502516a1506a562d0a9df062de8ad645313fabfcc97252816"}, - {file = "secp256k1-0.14.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f4b9306bff6dde020444dfee9ca9b9f5b20ca53a2c0b04898361a3f43d5daf2e"}, - {file = "secp256k1-0.14.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:72735da6cb28273e924431cd40aa607e7f80ef09608c8c9300be2e0e1d2417b4"}, - {file = "secp256k1-0.14.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:87f4ad42a370f768910585989a301d1d65de17dcd86f6e8def9b021364b34d5c"}, - {file = "secp256k1-0.14.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:130f119b06142e597c10eb4470b5a38eae865362d01aaef06b113478d77f728d"}, - {file = "secp256k1-0.14.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:3aedcfe6eb1c5fa7c6be25b7cc91c76d8eb984271920ba0f7a934ae41ed56f51"}, - {file = "secp256k1-0.14.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:c91dd3154f6c46ac798d9a41166120e1751222587f54516cc3f378f56ce4ac82"}, - {file = "secp256k1-0.14.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:fec790cb6d0d37129ca0ce5b3f8e85692d5fb618d1c440f189453d18694035df"}, - {file = "secp256k1-0.14.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:63eb148196b8f646922d4be6739b17fbbf50ebb3a020078c823e2445d88b7a81"}, - {file = "secp256k1-0.14.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:adc23a4c5d24c95191638eb2ca313097827f07db102e77b59faed15d50c98cae"}, - {file = "secp256k1-0.14.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ce0314788d3248b275426501228969fd32f6501c9d1837902ee0e7bd8264a36f"}, - {file = "secp256k1-0.14.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bc761894b3634021686714278fc62b73395fa3eded33453eadfd8a00a6c44ef3"}, - {file = "secp256k1-0.14.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:373dc8bca735f3c2d73259aa2711a9ecea2f3c7edbb663555fe3422e3dd76102"}, - {file = "secp256k1-0.14.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fe3f503c9dfdf663b500d3e0688ad842e116c2907ad3f1e1d685812df3f56290"}, - {file = "secp256k1-0.14.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:4b1bf09953cde181132cf5e9033065615e5c2694e803165e2db763efa47695e5"}, - {file = "secp256k1-0.14.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6af07be5f8612628c3638dc7b208f6cc78d0abae3e25797eadb13890c7d5da81"}, - {file = "secp256k1-0.14.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:a8dbd75a9fb6f42de307f3c5e24573fe59c3374637cbf39136edc66c200a4029"}, - {file = "secp256k1-0.14.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:97a30c8dae633cb18135c76b6517ae99dc59106818e8985be70dbc05dcc06c0d"}, - {file = "secp256k1-0.14.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:f4062d8c101aa63b9ecb3709f1f075ad9c01b6672869bbaa1bd77271816936a7"}, - {file = "secp256k1-0.14.0-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c9e7c024ff17e9b9d7c392bb2a917da231d6cb40ab119389ff1f51dca10339a4"}, - {file = "secp256k1-0.14.0.tar.gz", hash = "sha256:82c06712d69ef945220c8b53c1a0d424c2ff6a1f64aee609030df79ad8383397"}, + {file = "ruff-0.6.2-py3-none-linux_armv6l.whl", hash = "sha256:5c8cbc6252deb3ea840ad6a20b0f8583caab0c5ef4f9cca21adc5a92b8f79f3c"}, + {file = "ruff-0.6.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:17002fe241e76544448a8e1e6118abecbe8cd10cf68fde635dad480dba594570"}, + {file = "ruff-0.6.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3dbeac76ed13456f8158b8f4fe087bf87882e645c8e8b606dd17b0b66c2c1158"}, + {file = "ruff-0.6.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:094600ee88cda325988d3f54e3588c46de5c18dae09d683ace278b11f9d4d534"}, + {file = "ruff-0.6.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:316d418fe258c036ba05fbf7dfc1f7d3d4096db63431546163b472285668132b"}, + {file = "ruff-0.6.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d72b8b3abf8a2d51b7b9944a41307d2f442558ccb3859bbd87e6ae9be1694a5d"}, + {file = "ruff-0.6.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:2aed7e243be68487aa8982e91c6e260982d00da3f38955873aecd5a9204b1d66"}, + {file = "ruff-0.6.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d371f7fc9cec83497fe7cf5eaf5b76e22a8efce463de5f775a1826197feb9df8"}, + {file = "ruff-0.6.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8f310d63af08f583363dfb844ba8f9417b558199c58a5999215082036d795a1"}, + {file = "ruff-0.6.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7db6880c53c56addb8638fe444818183385ec85eeada1d48fc5abe045301b2f1"}, + {file = "ruff-0.6.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1175d39faadd9a50718f478d23bfc1d4da5743f1ab56af81a2b6caf0a2394f23"}, + {file = "ruff-0.6.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:5b939f9c86d51635fe486585389f54582f0d65b8238e08c327c1534844b3bb9a"}, + {file = "ruff-0.6.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d0d62ca91219f906caf9b187dea50d17353f15ec9bb15aae4a606cd697b49b4c"}, + {file = "ruff-0.6.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:7438a7288f9d67ed3c8ce4d059e67f7ed65e9fe3aa2ab6f5b4b3610e57e3cb56"}, + {file = "ruff-0.6.2-py3-none-win32.whl", hash = "sha256:279d5f7d86696df5f9549b56b9b6a7f6c72961b619022b5b7999b15db392a4da"}, + {file = "ruff-0.6.2-py3-none-win_amd64.whl", hash = "sha256:d9f3469c7dd43cd22eb1c3fc16926fb8258d50cb1b216658a07be95dd117b0f2"}, + {file = "ruff-0.6.2-py3-none-win_arm64.whl", hash = "sha256:f28fcd2cd0e02bdf739297516d5643a945cc7caf09bd9bcb4d932540a5ea4fa9"}, + {file = "ruff-0.6.2.tar.gz", hash = "sha256:239ee6beb9e91feb8e0ec384204a763f36cb53fb895a1a364618c6abb076b3be"}, ] -[package.dependencies] -cffi = ">=1.3.0" - [[package]] name = "setuptools" -version = "70.0.0" +version = "73.0.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.0.0-py3-none-any.whl", hash = "sha256:54faa7f2e8d2d11bcd2c07bed282eef1046b5c080d1c32add737d7b5817b1ad4"}, - {file = "setuptools-70.0.0.tar.gz", hash = "sha256:f211a66637b8fa059bb28183da127d4e86396c991a942b028c6650d4319c3fd0"}, + {file = "setuptools-73.0.1-py3-none-any.whl", hash = "sha256:b208925fcb9f7af924ed2dc04708ea89791e24bde0d3020b27df0e116088b34e"}, + {file = "setuptools-73.0.1.tar.gz", hash = "sha256:d59a3e788ab7e012ab2c4baed1b376da6366883ee20d7a5fc426816e3d7b1193"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.1)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] [[package]] name = "six" @@ -1394,64 +1360,64 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.30" +version = "2.0.32" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.30-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3b48154678e76445c7ded1896715ce05319f74b1e73cf82d4f8b59b46e9c0ddc"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2753743c2afd061bb95a61a51bbb6a1a11ac1c44292fad898f10c9839a7f75b2"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a7bfc726d167f425d4c16269a9a10fe8630ff6d14b683d588044dcef2d0f6be7"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4f61ada6979223013d9ab83a3ed003ded6959eae37d0d685db2c147e9143797"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a365eda439b7a00732638f11072907c1bc8e351c7665e7e5da91b169af794af"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bba002a9447b291548e8d66fd8c96a6a7ed4f2def0bb155f4f0a1309fd2735d5"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-win32.whl", hash = "sha256:0138c5c16be3600923fa2169532205d18891b28afa817cb49b50e08f62198bb8"}, - {file = "SQLAlchemy-2.0.30-cp310-cp310-win_amd64.whl", hash = "sha256:99650e9f4cf3ad0d409fed3eec4f071fadd032e9a5edc7270cd646a26446feeb"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:955991a09f0992c68a499791a753523f50f71a6885531568404fa0f231832aa0"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f69e4c756ee2686767eb80f94c0125c8b0a0b87ede03eacc5c8ae3b54b99dc46"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69c9db1ce00e59e8dd09d7bae852a9add716efdc070a3e2068377e6ff0d6fdaa"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1429a4b0f709f19ff3b0cf13675b2b9bfa8a7e79990003207a011c0db880a13"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:efedba7e13aa9a6c8407c48facfdfa108a5a4128e35f4c68f20c3407e4376aa9"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:16863e2b132b761891d6c49f0a0f70030e0bcac4fd208117f6b7e053e68668d0"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-win32.whl", hash = "sha256:2ecabd9ccaa6e914e3dbb2aa46b76dede7eadc8cbf1b8083c94d936bcd5ffb49"}, - {file = "SQLAlchemy-2.0.30-cp311-cp311-win_amd64.whl", hash = "sha256:0b3f4c438e37d22b83e640f825ef0f37b95db9aa2d68203f2c9549375d0b2260"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5a79d65395ac5e6b0c2890935bad892eabb911c4aa8e8015067ddb37eea3d56c"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9a5baf9267b752390252889f0c802ea13b52dfee5e369527da229189b8bd592e"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cb5a646930c5123f8461f6468901573f334c2c63c795b9af350063a736d0134"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:296230899df0b77dec4eb799bcea6fbe39a43707ce7bb166519c97b583cfcab3"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c62d401223f468eb4da32627bffc0c78ed516b03bb8a34a58be54d618b74d472"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3b69e934f0f2b677ec111b4d83f92dc1a3210a779f69bf905273192cf4ed433e"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-win32.whl", hash = "sha256:77d2edb1f54aff37e3318f611637171e8ec71472f1fdc7348b41dcb226f93d90"}, - {file = "SQLAlchemy-2.0.30-cp312-cp312-win_amd64.whl", hash = "sha256:b6c7ec2b1f4969fc19b65b7059ed00497e25f54069407a8701091beb69e591a5"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5a8e3b0a7e09e94be7510d1661339d6b52daf202ed2f5b1f9f48ea34ee6f2d57"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b60203c63e8f984df92035610c5fb76d941254cf5d19751faab7d33b21e5ddc0"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f1dc3eabd8c0232ee8387fbe03e0a62220a6f089e278b1f0aaf5e2d6210741ad"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:40ad017c672c00b9b663fcfcd5f0864a0a97828e2ee7ab0c140dc84058d194cf"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e42203d8d20dc704604862977b1470a122e4892791fe3ed165f041e4bf447a1b"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-win32.whl", hash = "sha256:2a4f4da89c74435f2bc61878cd08f3646b699e7d2eba97144030d1be44e27584"}, - {file = "SQLAlchemy-2.0.30-cp37-cp37m-win_amd64.whl", hash = "sha256:b6bf767d14b77f6a18b6982cbbf29d71bede087edae495d11ab358280f304d8e"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bc0c53579650a891f9b83fa3cecd4e00218e071d0ba00c4890f5be0c34887ed3"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:311710f9a2ee235f1403537b10c7687214bb1f2b9ebb52702c5aa4a77f0b3af7"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:408f8b0e2c04677e9c93f40eef3ab22f550fecb3011b187f66a096395ff3d9fd"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37a4b4fb0dd4d2669070fb05b8b8824afd0af57587393015baee1cf9890242d9"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:a943d297126c9230719c27fcbbeab57ecd5d15b0bd6bfd26e91bfcfe64220621"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0a089e218654e740a41388893e090d2e2c22c29028c9d1353feb38638820bbeb"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-win32.whl", hash = "sha256:fa561138a64f949f3e889eb9ab8c58e1504ab351d6cf55259dc4c248eaa19da6"}, - {file = "SQLAlchemy-2.0.30-cp38-cp38-win_amd64.whl", hash = "sha256:7d74336c65705b986d12a7e337ba27ab2b9d819993851b140efdf029248e818e"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ae8c62fe2480dd61c532ccafdbce9b29dacc126fe8be0d9a927ca3e699b9491a"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2383146973a15435e4717f94c7509982770e3e54974c71f76500a0136f22810b"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8409de825f2c3b62ab15788635ccaec0c881c3f12a8af2b12ae4910a0a9aeef6"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0094c5dc698a5f78d3d1539853e8ecec02516b62b8223c970c86d44e7a80f6c7"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:edc16a50f5e1b7a06a2dcc1f2205b0b961074c123ed17ebda726f376a5ab0953"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f7703c2010355dd28f53deb644a05fc30f796bd8598b43f0ba678878780b6e4c"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-win32.whl", hash = "sha256:1f9a727312ff6ad5248a4367358e2cf7e625e98b1028b1d7ab7b806b7d757513"}, - {file = "SQLAlchemy-2.0.30-cp39-cp39-win_amd64.whl", hash = "sha256:a0ef36b28534f2a5771191be6edb44cc2673c7b2edf6deac6562400288664221"}, - {file = "SQLAlchemy-2.0.30-py3-none-any.whl", hash = "sha256:7108d569d3990c71e26a42f60474b4c02c8586c4681af5fd67e51a044fdea86a"}, - {file = "SQLAlchemy-2.0.30.tar.gz", hash = "sha256:2b1708916730f4830bc69d6f49d37f7698b5bd7530aca7f04f785f8849e95255"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0c9045ecc2e4db59bfc97b20516dfdf8e41d910ac6fb667ebd3a79ea54084619"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1467940318e4a860afd546ef61fefb98a14d935cd6817ed07a228c7f7c62f389"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5954463675cb15db8d4b521f3566a017c8789222b8316b1e6934c811018ee08b"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167e7497035c303ae50651b351c28dc22a40bb98fbdb8468cdc971821b1ae533"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b27dfb676ac02529fb6e343b3a482303f16e6bc3a4d868b73935b8792edb52d0"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bf2360a5e0f7bd75fa80431bf8ebcfb920c9f885e7956c7efde89031695cafb8"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-win32.whl", hash = "sha256:306fe44e754a91cd9d600a6b070c1f2fadbb4a1a257b8781ccf33c7067fd3e4d"}, + {file = "SQLAlchemy-2.0.32-cp310-cp310-win_amd64.whl", hash = "sha256:99db65e6f3ab42e06c318f15c98f59a436f1c78179e6a6f40f529c8cc7100b22"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:21b053be28a8a414f2ddd401f1be8361e41032d2ef5884b2f31d31cb723e559f"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b178e875a7a25b5938b53b006598ee7645172fccafe1c291a706e93f48499ff5"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723a40ee2cc7ea653645bd4cf024326dea2076673fc9d3d33f20f6c81db83e1d"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:295ff8689544f7ee7e819529633d058bd458c1fd7f7e3eebd0f9268ebc56c2a0"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:49496b68cd190a147118af585173ee624114dfb2e0297558c460ad7495f9dfe2"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:acd9b73c5c15f0ec5ce18128b1fe9157ddd0044abc373e6ecd5ba376a7e5d961"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-win32.whl", hash = "sha256:9365a3da32dabd3e69e06b972b1ffb0c89668994c7e8e75ce21d3e5e69ddef28"}, + {file = "SQLAlchemy-2.0.32-cp311-cp311-win_amd64.whl", hash = "sha256:8bd63d051f4f313b102a2af1cbc8b80f061bf78f3d5bd0843ff70b5859e27924"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6bab3db192a0c35e3c9d1560eb8332463e29e5507dbd822e29a0a3c48c0a8d92"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:19d98f4f58b13900d8dec4ed09dd09ef292208ee44cc9c2fe01c1f0a2fe440e9"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cd33c61513cb1b7371fd40cf221256456d26a56284e7d19d1f0b9f1eb7dd7e8"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d6ba0497c1d066dd004e0f02a92426ca2df20fac08728d03f67f6960271feec"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2b6be53e4fde0065524f1a0a7929b10e9280987b320716c1509478b712a7688c"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:916a798f62f410c0b80b63683c8061f5ebe237b0f4ad778739304253353bc1cb"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-win32.whl", hash = "sha256:31983018b74908ebc6c996a16ad3690301a23befb643093fcfe85efd292e384d"}, + {file = "SQLAlchemy-2.0.32-cp312-cp312-win_amd64.whl", hash = "sha256:4363ed245a6231f2e2957cccdda3c776265a75851f4753c60f3004b90e69bfeb"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b8afd5b26570bf41c35c0121801479958b4446751a3971fb9a480c1afd85558e"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c750987fc876813f27b60d619b987b057eb4896b81117f73bb8d9918c14f1cad"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ada0102afff4890f651ed91120c1120065663506b760da4e7823913ebd3258be"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:78c03d0f8a5ab4f3034c0e8482cfcc415a3ec6193491cfa1c643ed707d476f16"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:3bd1cae7519283ff525e64645ebd7a3e0283f3c038f461ecc1c7b040a0c932a1"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-win32.whl", hash = "sha256:01438ebcdc566d58c93af0171c74ec28efe6a29184b773e378a385e6215389da"}, + {file = "SQLAlchemy-2.0.32-cp37-cp37m-win_amd64.whl", hash = "sha256:4979dc80fbbc9d2ef569e71e0896990bc94df2b9fdbd878290bd129b65ab579c"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c742be912f57586ac43af38b3848f7688863a403dfb220193a882ea60e1ec3a"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:62e23d0ac103bcf1c5555b6c88c114089587bc64d048fef5bbdb58dfd26f96da"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:251f0d1108aab8ea7b9aadbd07fb47fb8e3a5838dde34aa95a3349876b5a1f1d"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ef18a84e5116340e38eca3e7f9eeaaef62738891422e7c2a0b80feab165905f"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3eb6a97a1d39976f360b10ff208c73afb6a4de86dd2a6212ddf65c4a6a2347d5"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0c1c9b673d21477cec17ab10bc4decb1322843ba35b481585facd88203754fc5"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-win32.whl", hash = "sha256:c41a2b9ca80ee555decc605bd3c4520cc6fef9abde8fd66b1cf65126a6922d65"}, + {file = "SQLAlchemy-2.0.32-cp38-cp38-win_amd64.whl", hash = "sha256:8a37e4d265033c897892279e8adf505c8b6b4075f2b40d77afb31f7185cd6ecd"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:52fec964fba2ef46476312a03ec8c425956b05c20220a1a03703537824b5e8e1"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:328429aecaba2aee3d71e11f2477c14eec5990fb6d0e884107935f7fb6001632"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85a01b5599e790e76ac3fe3aa2f26e1feba56270023d6afd5550ed63c68552b3"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aaf04784797dcdf4c0aa952c8d234fa01974c4729db55c45732520ce12dd95b4"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4488120becf9b71b3ac718f4138269a6be99a42fe023ec457896ba4f80749525"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:14e09e083a5796d513918a66f3d6aedbc131e39e80875afe81d98a03312889e6"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-win32.whl", hash = "sha256:0d322cc9c9b2154ba7e82f7bf25ecc7c36fbe2d82e2933b3642fc095a52cfc78"}, + {file = "SQLAlchemy-2.0.32-cp39-cp39-win_amd64.whl", hash = "sha256:7dd8583df2f98dea28b5cd53a1beac963f4f9d087888d75f22fcc93a07cf8d84"}, + {file = "SQLAlchemy-2.0.32-py3-none-any.whl", hash = "sha256:e567a8793a692451f706b363ccf3c45e056b67d90ead58c3bc9471af5d212202"}, + {file = "SQLAlchemy-2.0.32.tar.gz", hash = "sha256:c1b88cc8b02b6a5f0efb0345a03672d4c897dc7d92585176f88c67346f565ea8"}, ] [package.dependencies] -greenlet = {version = "!=0.4.17", markers = "platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\""} +greenlet = {version = "!=0.4.17", markers = "python_version < \"3.13\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")"} typing-extensions = ">=4.6.0" [package.extras] @@ -1562,4 +1528,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.13" -content-hash = "91f03da9d782869a946b69e95942f6b5380fbc3762fdfc000d991cb85feb81d7" +content-hash = "0eb04c77292901cb8a4c7a7119f14d2a1a6d370cee0e842b56fe22dff29531a9" diff --git a/tools/pyproject.toml b/tools/pyproject.toml index ab05f8ca..9981cc1f 100644 --- a/tools/pyproject.toml +++ b/tools/pyproject.toml @@ -9,19 +9,19 @@ python = ">=3.10,<3.13" python-bitcoinrpc = "^1.0" pyotp = "^2.8.0" sseclient = "^0.0.27" -ruff = "^0.4.8" +ruff = "^0.6.2" pyln-client = "^24.5" -bolt11 = "^2.0.6" -grpcio = "1.65.5" -grpcio-tools = "1.65.5" +bolt11 = "^2.1.0" +grpcio = "^1.66.0" +grpcio-tools = "^1.66.0" grpc-interceptor = "^0.15.4" -cryptography = "^41.0.7" -psycopg = { version = "^3.1.18", extras = ["binary"] } -sqlalchemy = "^2.0.30" -cachetools = "^5.3.2" +psycopg = { version = "^3.2.1", extras = ["binary"] } +sqlalchemy = "^2.0.32" +cachetools = "^5.5.0" pandas = "^2.2.2" strenum = "^0.4.15" -minio = "^7.2.7" +minio = "^7.2.8" +cryptography = "^41" [tool.poetry.group.test.dependencies] pytest = "^8.2.2"