diff --git a/.dockerignore b/.dockerignore index 45ce9d45..7fab354e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ -.git -.github -build -node_modules +.git +.github +build +node_modules diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index ba493827..6dc5f558 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ -# These are supported funding model platforms - -github: [shocknet,] +# These are supported funding model platforms + +github: [shocknet,] diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 588258e1..69861a4a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,63 +1,63 @@ -name: Create and publish a Docker image - -on: - release: - types: [created, published, prereleased] - workflow_dispatch: # This allows manual triggering of the workflow - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - id-token: write - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - push: true - tags: ghcr.io/${{ github.repository_owner }}/lightning-pub:latest - labels: ${{ steps.meta.outputs.labels }} - - - name: Capture image digest - id: capture-digest - run: | - DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ github.repository_owner }}/lightning-pub:latest | cut -d'@' -f2) - echo "Raw Digest is $DIGEST" - echo "::set-output name=digest::$DIGEST" - - - name: Debug Print Digest - run: echo "Digest is ${{ steps.capture-digest.outputs.digest }}" - - - name: Attest build provenance - uses: actions/attest-build-provenance@v1 - with: - subject-digest: ${{ steps.capture-digest.outputs.digest }} - subject-name: ghcr.io/${{ github.repository_owner }}/lightning-pub:latest - github-token: ${{ secrets.PAT_TOKEN }} +name: Create and publish a Docker image + +on: + release: + types: [created, published, prereleased] + workflow_dispatch: # This allows manual triggering of the workflow + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ghcr.io/${{ github.repository_owner }}/lightning-pub:latest + labels: ${{ steps.meta.outputs.labels }} + + - name: Capture image digest + id: capture-digest + run: | + DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ github.repository_owner }}/lightning-pub:latest | cut -d'@' -f2) + echo "Raw Digest is $DIGEST" + echo "::set-output name=digest::$DIGEST" + + - name: Debug Print Digest + run: echo "Digest is ${{ steps.capture-digest.outputs.digest }}" + + - name: Attest build provenance + uses: actions/attest-build-provenance@v1 + with: + subject-digest: ${{ steps.capture-digest.outputs.digest }} + subject-name: ghcr.io/${{ github.repository_owner }}/lightning-pub:latest + github-token: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0a72069a..c8284316 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,55 +1,55 @@ -name: Docker Compose Actions Workflow -on: push -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: unzip the file - run: unzip src/tests/regtestNetwork.zip - - name: list files - run: ls -la - - name: Build the stack - run: docker-compose --project-directory ./ -f src/tests/docker-compose.yml up -d - - name: Copy alice cert file - run: docker cp polar-n2-alice:/home/lnd/.lnd/tls.cert alice-tls.cert - - name: Copy bob cert file - run: docker cp polar-n2-bob:/home/lnd/.lnd/tls.cert bob-tls.cert - - name: Copy carol cert file - run: docker cp polar-n2-carol:/home/lnd/.lnd/tls.cert carol-tls.cert - - name: Copy dave cert file - run: docker cp polar-n2-dave:/home/lnd/.lnd/tls.cert dave-tls.cert - - name: Copy alice macaroon file - run: docker cp polar-n2-alice:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon alice-admin.macaroon - - name: Copy bob macaroon file - run: docker cp polar-n2-bob:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon bob-admin.macaroon - - name: Copy carol macaroon file - run: docker cp polar-n2-carol:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon carol-admin.macaroon - - name: Copy dave macaroon file - run: docker cp polar-n2-dave:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon dave-admin.macaroon - - name: copy env file - run: cp src/tests/.env.test .env - - name: List files - run: ls -la - - name: Cache node modules - id: cache-npm - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} - name: List the state of node modules - continue-on-error: true - run: npm list - - name: Install dependencies - run: npm install - - name: Run tests - run: npm test +name: Docker Compose Actions Workflow +on: push +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: unzip the file + run: unzip src/tests/regtestNetwork.zip + - name: list files + run: ls -la + - name: Build the stack + run: docker-compose --project-directory ./ -f src/tests/docker-compose.yml up -d + - name: Copy alice cert file + run: docker cp polar-n2-alice:/home/lnd/.lnd/tls.cert alice-tls.cert + - name: Copy bob cert file + run: docker cp polar-n2-bob:/home/lnd/.lnd/tls.cert bob-tls.cert + - name: Copy carol cert file + run: docker cp polar-n2-carol:/home/lnd/.lnd/tls.cert carol-tls.cert + - name: Copy dave cert file + run: docker cp polar-n2-dave:/home/lnd/.lnd/tls.cert dave-tls.cert + - name: Copy alice macaroon file + run: docker cp polar-n2-alice:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon alice-admin.macaroon + - name: Copy bob macaroon file + run: docker cp polar-n2-bob:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon bob-admin.macaroon + - name: Copy carol macaroon file + run: docker cp polar-n2-carol:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon carol-admin.macaroon + - name: Copy dave macaroon file + run: docker cp polar-n2-dave:/home/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon dave-admin.macaroon + - name: copy env file + run: cp src/tests/.env.test .env + - name: List files + run: ls -la + - name: Cache node modules + id: cache-npm + uses: actions/cache@v3 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + continue-on-error: true + run: npm list + - name: Install dependencies + run: npm install + - name: Run tests + run: npm test diff --git a/.gitignore b/.gitignore index d65a34da..fb16387f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,13 @@ -.idea/ -.vscode/ -node_modules/ -build/ -tmp/ -temp/ -.env -build/ -db.sqlite -metrics.sqlite -.key/ -logs +.idea/ +.vscode/ +node_modules/ +build/ +tmp/ +temp/ +.env +build/ +db.sqlite +metrics.sqlite +.key/ +logs .jwt_secret \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 935ab8ed..77d8a5f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM node:18 - -WORKDIR /app - -COPY package*.json /app - -RUN npm i - -COPY . /app - -CMD [ "npm", "start" ] +FROM node:18 + +WORKDIR /app + +COPY package*.json /app + +RUN npm i + +COPY . /app + +CMD [ "npm", "start" ] diff --git a/LICENSE b/LICENSE index be3f7b28..1468d07c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,661 +1,661 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md index 39f2dce4..270d1c93 100644 --- a/README.md +++ b/README.md @@ -1,113 +1,113 @@ -![Lightning.Pub](https://github.com/shocknet/Lightning.Pub/raw/master/pub_logo.png) - -![GitHub last commit](https://img.shields.io/github/last-commit/shocknet/Lightning.Pub?style=flat-square) -[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/ShockBTC) -![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square&logo=bitcoin) - - -### Don't just run a Lightning Node, run a Lightning Pub. - -"Pub" is a [Nostr](https://nostr.info)-native account system designed to make running Lightning infrastructure for your friends/family/customers easier than previously thought possible. - -It may come as a surprise that the biggest hurdle to more Uncle Jim nodes hasn't been with Bitcoin/Lightning node management itself, as we've seen liquidity easily automated even in unreliable environments like mobile nodes. - -It's the legacy baggage of traditional Client-Server web infrastructure, things like IP4, Reverse Proxies, DNS, Firewalls and SSL certificates, all of which require a personal configuration that is a hurdle for most. - -Tor as a workaround has proven too slow and unreliable, and a dead-end for clearnet-web usecases. Bxlt12, being a re-implementation of Tor, appears destined for the same fate. - -Pub solves these challenges with a P2P-like design that is also web-friendly, by implementing a full RPC that is Nostr-native. Being Nostr-native eliminates the complexity of configuring your node like a server by using commodity Nostr relays. These relays, unlike LNURL proxies, are trustless by nature of Nostr's own encryption spec (NIP44). - -Additionally, support for optional services are integrated into Pub for operators seeking backward compatibility with legacy LNURLs and Lightning Addresses. - -By solving the networking and programability hurdles, Pub provides Lightning with a 3rd Layer that enables node-runners and Uncle Jims to more easily bring their personal network into Bitcoin's permissionless economy. In doing so, Pub runners can keep the Lightning Network decentralized, with custodial scaling that is free of fiat rails, large banks, and other forms of high-time-preference shitcoinery. - -#### Features: - -- Wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases) that can serve accounts over LNURL and NOSTR -- A growing number of [methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md) -- Accounting SubLayers for Application Pools and Users - - A fee regime allows applications owners to monetize users, or node operators to host distinctly monetized applications. - -![Accounts](https://github.com/shocknet/Lightning.Pub/raw/master/accounting_layers.png) - -- Connecting via ShockWallet is as easy as pasting an nprofile -- Or use a link to share your nprofile with friends and family - - Connect Wallet Invite Guests - - -#### Planned -- [ ] A management dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2) -- [ ] Nostr native "offers" (successor to LNURL-Pay, Lightning Address, Bxlt12) -- [ ] Automated Channels -- [ ] Bootstrap Peering (Passive "LSP") -- [ ] Event Notifications -- [ ] Swap integration -- [ ] High-Availabilty / Clustering - -Dashboard Wireframe: - - Pub Dashboard - -> [!IMPORTANT] -> ShockWallet and Lightning.Pub are free software. If you would like to see continued development, please show your [**support**](https://github.com/sponsors/shocknet) 😊
- -License -
- -> [!WARNING] -> While this software has been used in a high-profile production environment for over a year, it should still be considered bleeding edge. Special care has been taken to mitigate the risk of drainage attacks, which is a common risk to all Lightning API's. An integrated Watchdog service will terminate spends if it detects a discrepency between LND and the database, for this reason **IT IS NOT RECOMMENDED TO USE PUB ALONGSIDE OTHER ACCOUNT SYSTEMS**. While we give the utmost care and attention to security, **the internet is an adversarial environment and SECURITY/RELIABILITY ARE NOT GUARANTEED- USE AT YOUR OWN RISK**. - -## Umbrel Installation - -Coming Soon - -## Desktop Installation - -Coming Soon - -## Docker - -`docker pull ghcr.io/shocknet/lightning-pub:latest` - -## Manual CLI Installation - -#### Notes: -* Use of a reverse proxy is only required if you wish to serve LNURLs -* The service defaults to port `1776` -* Requires [Node.js](https://nodejs.org) >=18.x -* Commands for your specific OS may differ slightly, Ubuntu/Debian used for example - -#### Steps: -1) Run [LND](https://github.com/lightningnetwork/lnd/releases) if you aren't already - -*Example mainnet startup*: - - ``` - ./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.addpeer=neutrino.shock.network --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json - ``` - - -2) Download and Install Lightning.Pub - - - * `git clone https://github.com/shocknet/Lightning.Pub` - - * `cd Lightning.Pub && npm i` - - -3) Configure values to env file as desired - * `cp env.example .env && nano .env` - -5) `npm start` - -- A default "wallet" application pool will be automatically created, if you wish to create other app pools: - - * `curl -XPOST -H 'Authorization: Bearer defined_in_ADMIN_TOKEN_env' -H "Content-type: application/json" -d '{"name":"ExampleApplicationPoolName"}' 'http://localhost:8080/api/admin/app/add'` - -5) Connect with [wallet2](https://github.com/shocknet/wallet2) using the wallet nprofile that gets logged at startup. -> [!NOTE] -> Connecting with wallet will create an account on the node, it will not show or have access to the full LND balance - - +![Lightning.Pub](https://github.com/shocknet/Lightning.Pub/raw/master/pub_logo.png) + +![GitHub last commit](https://img.shields.io/github/last-commit/shocknet/Lightning.Pub?style=flat-square) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) +[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/ShockBTC) +![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square&logo=bitcoin) + + +### Don't just run a Lightning Node, run a Lightning Pub. + +"Pub" is a [Nostr](https://nostr.info)-native account system designed to make running Lightning infrastructure for your friends/family/customers easier than previously thought possible. + +It may come as a surprise that the biggest hurdle to more Uncle Jim nodes hasn't been with Bitcoin/Lightning node management itself, as we've seen liquidity easily automated even in unreliable environments like mobile nodes. + +It's the legacy baggage of traditional Client-Server web infrastructure, things like IP4, Reverse Proxies, DNS, Firewalls and SSL certificates, all of which require a personal configuration that is a hurdle for most. + +Tor as a workaround has proven too slow and unreliable, and a dead-end for clearnet-web usecases. Bxlt12, being a re-implementation of Tor, appears destined for the same fate. + +Pub solves these challenges with a P2P-like design that is also web-friendly, by implementing a full RPC that is Nostr-native. Being Nostr-native eliminates the complexity of configuring your node like a server by using commodity Nostr relays. These relays, unlike LNURL proxies, are trustless by nature of Nostr's own encryption spec (NIP44). + +Additionally, support for optional services are integrated into Pub for operators seeking backward compatibility with legacy LNURLs and Lightning Addresses. + +By solving the networking and programability hurdles, Pub provides Lightning with a 3rd Layer that enables node-runners and Uncle Jims to more easily bring their personal network into Bitcoin's permissionless economy. In doing so, Pub runners can keep the Lightning Network decentralized, with custodial scaling that is free of fiat rails, large banks, and other forms of high-time-preference shitcoinery. + +#### Features: + +- Wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases) that can serve accounts over LNURL and NOSTR +- A growing number of [methods](https://github.com/shocknet/Lightning.Pub/blob/master/proto/autogenerated/client.md) +- Accounting SubLayers for Application Pools and Users + - A fee regime allows applications owners to monetize users, or node operators to host distinctly monetized applications. + +![Accounts](https://github.com/shocknet/Lightning.Pub/raw/master/accounting_layers.png) + +- Connecting via ShockWallet is as easy as pasting an nprofile +- Or use a link to share your nprofile with friends and family + + Connect Wallet Invite Guests + + +#### Planned +- [ ] A management dashboard is actively being integrated into [ShockWallet](https://github.com/shocknet/wallet2) +- [ ] Nostr native "offers" (successor to LNURL-Pay, Lightning Address, Bxlt12) +- [ ] Automated Channels +- [ ] Bootstrap Peering (Passive "LSP") +- [ ] Event Notifications +- [ ] Swap integration +- [ ] High-Availabilty / Clustering + +Dashboard Wireframe: + + Pub Dashboard + +> [!IMPORTANT] +> ShockWallet and Lightning.Pub are free software. If you would like to see continued development, please show your [**support**](https://github.com/sponsors/shocknet) 😊
+ +License +
+ +> [!WARNING] +> While this software has been used in a high-profile production environment for over a year, it should still be considered bleeding edge. Special care has been taken to mitigate the risk of drainage attacks, which is a common risk to all Lightning API's. An integrated Watchdog service will terminate spends if it detects a discrepency between LND and the database, for this reason **IT IS NOT RECOMMENDED TO USE PUB ALONGSIDE OTHER ACCOUNT SYSTEMS**. While we give the utmost care and attention to security, **the internet is an adversarial environment and SECURITY/RELIABILITY ARE NOT GUARANTEED- USE AT YOUR OWN RISK**. + +## Umbrel Installation + +Coming Soon + +## Desktop Installation + +Coming Soon + +## Docker + +`docker pull ghcr.io/shocknet/lightning-pub:latest` + +## Manual CLI Installation + +#### Notes: +* Use of a reverse proxy is only required if you wish to serve LNURLs +* The service defaults to port `1776` +* Requires [Node.js](https://nodejs.org) >=18.x +* Commands for your specific OS may differ slightly, Ubuntu/Debian used for example + +#### Steps: +1) Run [LND](https://github.com/lightningnetwork/lnd/releases) if you aren't already + +*Example mainnet startup*: + + ``` + ./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.addpeer=neutrino.shock.network --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json + ``` + + +2) Download and Install Lightning.Pub + + + * `git clone https://github.com/shocknet/Lightning.Pub` + + * `cd Lightning.Pub && npm i` + + +3) Configure values to env file as desired + * `cp env.example .env && nano .env` + +5) `npm start` + +- A default "wallet" application pool will be automatically created, if you wish to create other app pools: + + * `curl -XPOST -H 'Authorization: Bearer defined_in_ADMIN_TOKEN_env' -H "Content-type: application/json" -d '{"name":"ExampleApplicationPoolName"}' 'http://localhost:8080/api/admin/app/add'` + +5) Connect with [wallet2](https://github.com/shocknet/wallet2) using the wallet nprofile that gets logged at startup. +> [!NOTE] +> Connecting with wallet will create an account on the node, it will not show or have access to the full LND balance + + diff --git a/Umbrel/docker-compose.yml b/Umbrel/docker-compose.yml index 7c569e5c..085659b4 100644 --- a/Umbrel/docker-compose.yml +++ b/Umbrel/docker-compose.yml @@ -1,22 +1,22 @@ -version: "3.7" -services: - app_proxy: - environment: - APP_HOST: lightning-pub - APP_PORT: 1776 - - server: - image: ghcr.io/shocknet/lightning.pub:umbrel-works - volumes: - - "${APP_DATA_DIR}/data:/data" - - "${APP_LIGHTNING_NODE_DATA_DIR}:/lnd:ro" - environment: - LN_BACKEND_TYPE: "LND" - LND_ADDRESS: $APP_LIGHTNING_NODE_IP:$APP_LIGHTNING_NODE_GRPC_PORT - LND_CERT_PATH: "/lnd/tls.cert" - LND_MACAROON_PATH: "/lnd/data/chain/bitcoin/${APP_BITCOIN_NETWORK}/admin.macaroon" - DATABASE_FILE: "/data/db.sqlite" - METRICS_DATABASE_FILE: "/data/metrics.sqlite" - PORT: 1776 - restart: on-failure - stop_grace_period: 1m +version: "3.7" +services: + app_proxy: + environment: + APP_HOST: lightning-pub + APP_PORT: 1776 + + server: + image: ghcr.io/shocknet/lightning.pub:umbrel-works + volumes: + - "${APP_DATA_DIR}/data:/data" + - "${APP_LIGHTNING_NODE_DATA_DIR}:/lnd:ro" + environment: + LN_BACKEND_TYPE: "LND" + LND_ADDRESS: $APP_LIGHTNING_NODE_IP:$APP_LIGHTNING_NODE_GRPC_PORT + LND_CERT_PATH: "/lnd/tls.cert" + LND_MACAROON_PATH: "/lnd/data/chain/bitcoin/${APP_BITCOIN_NETWORK}/admin.macaroon" + DATABASE_FILE: "/data/db.sqlite" + METRICS_DATABASE_FILE: "/data/metrics.sqlite" + PORT: 1776 + restart: on-failure + stop_grace_period: 1m diff --git a/Umbrel/umbrel-app.yml b/Umbrel/umbrel-app.yml index 5bb9ee2e..630c8b5d 100644 --- a/Umbrel/umbrel-app.yml +++ b/Umbrel/umbrel-app.yml @@ -1,36 +1,36 @@ - manifestVersion: 1 -id: lightning-pub -category: finance -name: Lightning.Pub -version: "1.0.0" -tagline: lightning, nostr, accounts, lnurl, web -description: >- -"Pub" is a Nostr-native account system designed -to make running Lightning infrastructure for your friends/family/customers -easier than previously thought possible. - - Being Nostr-native eliminates the complexity of configuring your node like a server by using commodity Nostr relays. -These relays, unlike LNURL proxies, are trustless by nature of Nostr's own encryption spec (NIP44). - - Support for optional services are integrated into Pub for operators seeking backward compatibility with legacy LNURLs and Lightning Addresses. - - By solving the networking and programability hurdles, Pub provides Lightning with a 3rd Layer that enables node-runners and - Uncle Jims to more easily bring their personal network into Bitcoin's permissionless economy. In doing so, Pub runners - can keep the Lightning Network decentralized, with custodial scaling that is free of fiat rails, large banks, - and other forms of high-time-preference shitcoinery. -developer: shocknet -website: https://shock.network -dependencies: - - lightning -repo: https://github.com/shocknet/Lightning.Pub -support: https://github.com/shocknet/Lightning.Pub/discussions -port: 1776 -gallery: - - 1.jpg - - 2.jpg - - 3.jpg -path: "" -defaultUsername: "" -defaultPassword: "" -submitter: shocknet + manifestVersion: 1 +id: lightning-pub +category: finance +name: Lightning.Pub +version: "1.0.0" +tagline: lightning, nostr, accounts, lnurl, web +description: >- +"Pub" is a Nostr-native account system designed +to make running Lightning infrastructure for your friends/family/customers +easier than previously thought possible. + + Being Nostr-native eliminates the complexity of configuring your node like a server by using commodity Nostr relays. +These relays, unlike LNURL proxies, are trustless by nature of Nostr's own encryption spec (NIP44). + + Support for optional services are integrated into Pub for operators seeking backward compatibility with legacy LNURLs and Lightning Addresses. + + By solving the networking and programability hurdles, Pub provides Lightning with a 3rd Layer that enables node-runners and + Uncle Jims to more easily bring their personal network into Bitcoin's permissionless economy. In doing so, Pub runners + can keep the Lightning Network decentralized, with custodial scaling that is free of fiat rails, large banks, + and other forms of high-time-preference shitcoinery. +developer: shocknet +website: https://shock.network +dependencies: + - lightning +repo: https://github.com/shocknet/Lightning.Pub +support: https://github.com/shocknet/Lightning.Pub/discussions +port: 1776 +gallery: + - 1.jpg + - 2.jpg + - 3.jpg +path: "" +defaultUsername: "" +defaultPassword: "" +submitter: shocknet submission: https://github.com/getumbrel/umbrel/pull/334 \ No newline at end of file diff --git a/datasource.js b/datasource.js index e097d81f..16ae8679 100644 --- a/datasource.js +++ b/datasource.js @@ -1,25 +1,25 @@ -import { DataSource } from "typeorm" -import { User } from "./build/src/services/storage/entity/User.js" -import { UserReceivingInvoice } from "./build/src/services/storage/entity/UserReceivingInvoice.js" -import { AddressReceivingTransaction } from "./build/src/services/storage/entity/AddressReceivingTransaction.js" -import { Application } from "./build/src/services/storage/entity/Application.js" -import { ApplicationUser } from "./build/src/services/storage/entity/ApplicationUser.js" -import { BalanceEvent } from "./build/src/services/storage/entity/BalanceEvent.js" -import { ChannelBalanceEvent } from "./build/src/services/storage/entity/ChannelsBalanceEvent.js" -import { Product } from "./build/src/services/storage/entity/Product.js" -import { RoutingEvent } from "./build/src/services/storage/entity/RoutingEvent.js" -import { UserBasicAuth } from "./build/src/services/storage/entity/UserBasicAuth.js" -import { UserEphemeralKey } from "./build/src/services/storage/entity/UserEphemeralKey.js" -import { UserInvoicePayment } from "./build/src/services/storage/entity/UserInvoicePayment.js" -import { UserReceivingAddress } from "./build/src/services/storage/entity/UserReceivingAddress.js" -import { UserToUserPayment } from "./build/src/services/storage/entity/UserToUserPayment.js" -import { UserTransactionPayment } from "./build/src/services/storage/entity/UserTransactionPayment.js" - -export default new DataSource({ - type: "sqlite", - database: "source.sqlite", - // logging: true, - entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, - UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment, RoutingEvent, BalanceEvent, ChannelBalanceEvent], - // synchronize: true, +import { DataSource } from "typeorm" +import { User } from "./build/src/services/storage/entity/User.js" +import { UserReceivingInvoice } from "./build/src/services/storage/entity/UserReceivingInvoice.js" +import { AddressReceivingTransaction } from "./build/src/services/storage/entity/AddressReceivingTransaction.js" +import { Application } from "./build/src/services/storage/entity/Application.js" +import { ApplicationUser } from "./build/src/services/storage/entity/ApplicationUser.js" +import { BalanceEvent } from "./build/src/services/storage/entity/BalanceEvent.js" +import { ChannelBalanceEvent } from "./build/src/services/storage/entity/ChannelsBalanceEvent.js" +import { Product } from "./build/src/services/storage/entity/Product.js" +import { RoutingEvent } from "./build/src/services/storage/entity/RoutingEvent.js" +import { UserBasicAuth } from "./build/src/services/storage/entity/UserBasicAuth.js" +import { UserEphemeralKey } from "./build/src/services/storage/entity/UserEphemeralKey.js" +import { UserInvoicePayment } from "./build/src/services/storage/entity/UserInvoicePayment.js" +import { UserReceivingAddress } from "./build/src/services/storage/entity/UserReceivingAddress.js" +import { UserToUserPayment } from "./build/src/services/storage/entity/UserToUserPayment.js" +import { UserTransactionPayment } from "./build/src/services/storage/entity/UserTransactionPayment.js" + +export default new DataSource({ + type: "sqlite", + database: "source.sqlite", + // logging: true, + entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, + UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment, RoutingEvent, BalanceEvent, ChannelBalanceEvent], + // synchronize: true, }) \ No newline at end of file diff --git a/env.example b/env.example index 42bc9330..e38bf4cd 100644 --- a/env.example +++ b/env.example @@ -1,89 +1,89 @@ -# Example configuration for Lightning.Pub -# Copy this file as .env in the Pub folder and uncomment the desired settings to override defaults -# Alternatively, these settings can be passed as environment variables at startup - -#LND_CONNECTION -# Defaults typical for straight Linux -# Containers, Mac and Windows may need more detailed paths -#LND_ADDRESS=127.0.0.1:10009 -#LND_CERT_PATH=~/.lnd/tls.cert -#LND_MACAROON_PATH=~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon - -LIQUIDITY_PROVIDER_PUB= - -#DB -#DATABASE_FILE=db.sqlite -#METRICS_DATABASE_FILE=metrics.sqlite -#LOGS_DIR=logs - -#LOCALHOST -#ADMIN_TOKEN= -#PORT=1776 -#JWT_SECRET= - -#LIGHTNING -# Maximum amount in network fees passed to LND when it pays an external invoice -# BPS are basis points, 100 BPS = 1% -#OUTBOUND_MAX_FEE_BPS=60 -#OUTBOUND_MAX_FEE_EXTRA_SATS=100 -# If the back-end doesn't have adequate channel capacity, buy one from an LSP -# Will execute when it costs less than 1% of balance and uses a trusted peer -#BOOTSTRAP=1 - -#ROOT_FEES -# Applied to either debits or credits and sent to an admin account -# BPS are basis points, 100 BPS = 1% -#INCOMING_CHAIN_FEE_ROOT_BPS=0 -#INCOMING_INVOICE_FEE_ROOT_BPS=0 -# Chain spends are currently unstable and thus disabled, do not use until further notice -#OUTGOING_CHAIN_FEE_ROOT_BPS=60 -# Outgoing Invoice Fee must be >= Lightning Outbound Max Fee so admins don't incur losses on spends -#OUTGOING_INVOICE_FEE_ROOT_BPS=60 -# Internal user fees bugged, do not use until further notice -#TX_FEE_INTERNAL_ROOT_BPS=0 #applied to inter-application txns - -#APP_FEES -# An extra fee applied at the app level and sent to the application owner -#INCOMING_INVOICE_FEE_USER_BPS=0 -#OUTGOING_INVOICE_FEE_USER_BPS=0 -#TX_FEE_INTERNAL_USER_BPS=0 - -#NOSTR -# Default relay may become rate-limited without a paid subscription -#NOSTR_RELAYS=wss://strfry.shock.network - -#LNURL -# Optional -# If undefined, LNURLs (including Lightning Address) will be disabled -# To enable, add a reachable https endpoint for requests (or purchase a subscription) -# You also need an SSL reverse proxy from the domain to this local host -# Read more at https://docs.shock.network -#SERVICE_URL=https://yourdomainhere.xyz - -#SUBSCRIPTION_SERVICES -# Opt-in to cloud relays for LNURL and Nostr -# A small monthly fee supports the developers -# Read more at https://docs.shock.network -#SUBSCRIBER=1 - -#DEV_OPTS -#MOCK_LND=false -#ALLOW_BALANCE_MIGRATION=false -#MIGRATE_DB=false -#LOG_LEVEL=DEBUG - -#METRICS -#RECORD_PERFORMANCE=true -#SKIP_SANITY_CHECK=false -# A read-only token that can be used with dashboard to view reports -#METRICS_TOKEN= -# Disable outbound payments aka honeypot mode -#DISABLE_EXTERNAL_PAYMENTS=false - -#WATCHDOG SECURITY -# A last line of defense against 0-day drainage attacks -# This will monitor LND separately and terminate sends if a balance discrepency is detected -# This setting defaults to 0 meaning no discrepency will be tolerated -# Increase this values to add a spending buffer for non-Pub services sharing LND -# Max difference between users balance and LND balance at Pub startup -#WATCHDOG_MAX_DIFF_SATS=0 +# Example configuration for Lightning.Pub +# Copy this file as .env in the Pub folder and uncomment the desired settings to override defaults +# Alternatively, these settings can be passed as environment variables at startup + +#LND_CONNECTION +# Defaults typical for straight Linux +# Containers, Mac and Windows may need more detailed paths +#LND_ADDRESS=127.0.0.1:10009 +#LND_CERT_PATH=~/.lnd/tls.cert +#LND_MACAROON_PATH=~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon + +LIQUIDITY_PROVIDER_PUB= + +#DB +#DATABASE_FILE=db.sqlite +#METRICS_DATABASE_FILE=metrics.sqlite +#LOGS_DIR=logs + +#LOCALHOST +#ADMIN_TOKEN= +#PORT=1776 +#JWT_SECRET= + +#LIGHTNING +# Maximum amount in network fees passed to LND when it pays an external invoice +# BPS are basis points, 100 BPS = 1% +#OUTBOUND_MAX_FEE_BPS=60 +#OUTBOUND_MAX_FEE_EXTRA_SATS=100 +# If the back-end doesn't have adequate channel capacity, buy one from an LSP +# Will execute when it costs less than 1% of balance and uses a trusted peer +#BOOTSTRAP=1 + +#ROOT_FEES +# Applied to either debits or credits and sent to an admin account +# BPS are basis points, 100 BPS = 1% +#INCOMING_CHAIN_FEE_ROOT_BPS=0 +#INCOMING_INVOICE_FEE_ROOT_BPS=0 +# Chain spends are currently unstable and thus disabled, do not use until further notice +#OUTGOING_CHAIN_FEE_ROOT_BPS=60 +# Outgoing Invoice Fee must be >= Lightning Outbound Max Fee so admins don't incur losses on spends +#OUTGOING_INVOICE_FEE_ROOT_BPS=60 +# Internal user fees bugged, do not use until further notice +#TX_FEE_INTERNAL_ROOT_BPS=0 #applied to inter-application txns + +#APP_FEES +# An extra fee applied at the app level and sent to the application owner +#INCOMING_INVOICE_FEE_USER_BPS=0 +#OUTGOING_INVOICE_FEE_USER_BPS=0 +#TX_FEE_INTERNAL_USER_BPS=0 + +#NOSTR +# Default relay may become rate-limited without a paid subscription +#NOSTR_RELAYS=wss://strfry.shock.network + +#LNURL +# Optional +# If undefined, LNURLs (including Lightning Address) will be disabled +# To enable, add a reachable https endpoint for requests (or purchase a subscription) +# You also need an SSL reverse proxy from the domain to this local host +# Read more at https://docs.shock.network +#SERVICE_URL=https://yourdomainhere.xyz + +#SUBSCRIPTION_SERVICES +# Opt-in to cloud relays for LNURL and Nostr +# A small monthly fee supports the developers +# Read more at https://docs.shock.network +#SUBSCRIBER=1 + +#DEV_OPTS +#MOCK_LND=false +#ALLOW_BALANCE_MIGRATION=false +#MIGRATE_DB=false +#LOG_LEVEL=DEBUG + +#METRICS +#RECORD_PERFORMANCE=true +#SKIP_SANITY_CHECK=false +# A read-only token that can be used with dashboard to view reports +#METRICS_TOKEN= +# Disable outbound payments aka honeypot mode +#DISABLE_EXTERNAL_PAYMENTS=false + +#WATCHDOG SECURITY +# A last line of defense against 0-day drainage attacks +# This will monitor LND separately and terminate sends if a balance discrepency is detected +# This setting defaults to 0 meaning no discrepency will be tolerated +# Increase this values to add a spending buffer for non-Pub services sharing LND +# Max difference between users balance and LND balance at Pub startup +#WATCHDOG_MAX_DIFF_SATS=0 diff --git a/genkey.js b/genkey.js index b5155eef..94cccfbb 100644 --- a/genkey.js +++ b/genkey.js @@ -1,6 +1,6 @@ -import { generatePrivateKey, getPublicKey } from 'nostr-tools' -const p = generatePrivateKey() -console.log({ - privateKey: p, - publicKey: getPublicKey(Buffer.from(p, 'hex')) -}) +import { generatePrivateKey, getPublicKey } from 'nostr-tools' +const p = generatePrivateKey() +console.log({ + privateKey: p, + publicKey: getPublicKey(Buffer.from(p, 'hex')) +}) diff --git a/metricsDatasource.js b/metricsDatasource.js index fc8e901a..4e7ece3a 100644 --- a/metricsDatasource.js +++ b/metricsDatasource.js @@ -1,10 +1,10 @@ -import { DataSource } from "typeorm" -import { ChannelRouting } from "./build/src/services/storage/entity/ChannelRouting.js" - - - -export default new DataSource({ - type: "sqlite", - database: "metrics.sqlite", - entities: [ChannelRouting], +import { DataSource } from "typeorm" +import { ChannelRouting } from "./build/src/services/storage/entity/ChannelRouting.js" + + + +export default new DataSource({ + type: "sqlite", + database: "metrics.sqlite", + entities: [ChannelRouting], }); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d512cee5..c4eee097 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9318 +1,9318 @@ -{ - "name": "lightning.pub", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "lightning.pub", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@grpc/grpc-js": "^1.6.7", - "@protobuf-ts/grpc-transport": "^2.5.0", - "@protobuf-ts/plugin": "^2.5.0", - "@protobuf-ts/runtime": "^2.5.0", - "@stablelib/xchacha20": "^1.0.1", - "@types/express": "^4.17.13", - "@types/node": "^17.0.31", - "@types/secp256k1": "^4.0.3", - "axios": "^0.28.0", - "bech32": "^2.0.0", - "bitcoin-core": "^4.2.0", - "chai": "^4.3.7", - "chai-string": "^1.5.0", - "copyfiles": "^2.4.1", - "cors": "^2.8.5", - "csv": "^6.3.8", - "dotenv": "^16.0.0", - "eccrypto": "^1.1.6", - "express": "^4.19.2", - "globby": "^13.1.2", - "grpc-tools": "^1.11.2", - "jsonwebtoken": "^9.0.0", - "lodash": "^4.17.21", - "nostr-tools": "^1.9.0", - "pg": "^8.4.0", - "reflect-metadata": "^0.1.13", - "rimraf": "^3.0.2", - "rxjs": "^7.5.5", - "secp256k1": "^4.0.3", - "sqlite3": "^5.1.5", - "ts-node": "^10.7.0", - "ts-proto": "^1.131.2", - "typeorm": "0.3.15", - "typescript": "^4.6.4", - "uuid": "^8.3.2", - "websocket": "^1.0.34", - "websocket-polyfill": "^0.0.3" - }, - "devDependencies": { - "@types/chai": "^4.3.4", - "@types/chai-string": "^1.4.5", - "@types/cors": "^2.8.12", - "@types/eccrypto": "^1.1.3", - "@types/jsonwebtoken": "^8.5.9", - "@types/lodash": "^4.14.182", - "@types/node": "^16.11.10", - "@types/node-fetch": "^2.6.3", - "@types/uuid": "^8.3.4", - "@types/websocket": "^1.0.6", - "nodemon": "^2.0.20", - "ts-node": "10.7.0", - "typescript": "4.5.2" - } - }, - "node_modules/@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "devOptional": true, - "engines": { - "node": ">= 12" - } - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", - "devOptional": true, - "dependencies": { - "@cspotcode/source-map-consumer": "0.8.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", - "optional": true - }, - "node_modules/@grpc/grpc-js": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", - "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", - "dependencies": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - }, - "engines": { - "node": "^8.13.0 || >=10.10.0" - } - }, - "node_modules/@grpc/proto-loader": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", - "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", - "dependencies": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^16.2.0" - }, - "bin": { - "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", - "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/@noble/curves": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.0.0.tgz", - "integrity": "sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/hashes": "1.3.0" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz", - "integrity": "sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@npmcli/fs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", - "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", - "optional": true, - "dependencies": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "node_modules/@npmcli/move-file": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", - "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "deprecated": "This functionality has been moved to @npmcli/fs", - "optional": true, - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@protobuf-ts/grpc-transport": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-transport/-/grpc-transport-2.8.1.tgz", - "integrity": "sha512-SgXCskzPRPN/6Ns5ohuC64Qkwchb9I758n2/2RpnAy0Kr6E5kIqav5WGkNLCD08erl8wvjuLdyxZfig4sf1yvQ==", - "dependencies": { - "@protobuf-ts/runtime": "^2.8.1", - "@protobuf-ts/runtime-rpc": "^2.8.1" - }, - "peerDependencies": { - "@grpc/grpc-js": "^1.6.0" - } - }, - "node_modules/@protobuf-ts/plugin": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.8.1.tgz", - "integrity": "sha512-lacRdXJ9TkTbI28U0KApsnVqnxeq1aZftOdq6LNPQJaIzBrVRxrMkqnnGWGQFYe0Tr93OKeW4A2lLjTkn32CuA==", - "dependencies": { - "@protobuf-ts/plugin-framework": "^2.8.1", - "@protobuf-ts/protoc": "^2.8.1", - "@protobuf-ts/runtime": "^2.8.1", - "@protobuf-ts/runtime-rpc": "^2.8.1", - "typescript": "^3.9" - }, - "bin": { - "protoc-gen-dump": "bin/protoc-gen-dump", - "protoc-gen-ts": "bin/protoc-gen-ts" - } - }, - "node_modules/@protobuf-ts/plugin-framework": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.8.1.tgz", - "integrity": "sha512-hfLoYIyxCI6Ro6LY1BltNBDcXWL+36SwnWR/hcF4ttPHLE3rMIpYbz4IwQsfeU2SKbBeGFhZv9rcnDJB22cXog==", - "dependencies": { - "@protobuf-ts/runtime": "^2.8.1", - "typescript": "^3.9" - } - }, - "node_modules/@protobuf-ts/plugin-framework/node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/@protobuf-ts/plugin/node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/@protobuf-ts/protoc": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.8.1.tgz", - "integrity": "sha512-6fehuL9bS22zCgPBBlESZjnoA4fxAUkOjMcaFMJSlVpN6CDN2O+c/Mo1pCXaNDO7FAidMPj5yhz48Kws4kOXEA==", - "bin": { - "protoc": "protoc.js" - } - }, - "node_modules/@protobuf-ts/runtime": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.8.1.tgz", - "integrity": "sha512-D9M5hSumYCovIfNllt7N6ODh4q+LrjiMWtNETvooaf+a2XheZJ7kgjFlsFghti0CFWwtA//of4JXQfw9hU+cCw==" - }, - "node_modules/@protobuf-ts/runtime-rpc": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.8.1.tgz", - "integrity": "sha512-hc+HJpoAu50by8aBS55UygcrzD8jAvRKWZMCRJ9XY3h9Gl2tciYysfzSH1SWtF6XOT/4b5CKnnmdMR3ad7uU5g==", - "dependencies": { - "@protobuf-ts/runtime": "^2.8.1" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, - "node_modules/@scure/base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", - "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/@scure/bip32": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.0.tgz", - "integrity": "sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/curves": "~1.0.0", - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/@scure/bip39": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.0.tgz", - "integrity": "sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "node_modules/@sqltools/formatter": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", - "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" - }, - "node_modules/@stablelib/binary": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", - "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", - "dependencies": { - "@stablelib/int": "^1.0.1" - } - }, - "node_modules/@stablelib/chacha": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", - "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@stablelib/int": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" - }, - "node_modules/@stablelib/wipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" - }, - "node_modules/@stablelib/xchacha20": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/xchacha20/-/xchacha20-1.0.1.tgz", - "integrity": "sha512-1YkiZnFF4veUwBVhDnDYwo6EHeKzQK4FnLiO7ezCl/zu64uG0bCCAUROJaBkaLH+5BEsO3W7BTXTguMbSLlWSw==", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/chacha": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "optional": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "devOptional": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "devOptional": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "devOptional": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", - "devOptional": true - }, - "node_modules/@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", - "dependencies": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "node_modules/@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", - "dev": true - }, - "node_modules/@types/chai-string": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.4.5.tgz", - "integrity": "sha512-IecXRMSnpUvRnTztdpSdjcmcW7EdNme65bfDCQMi7XrSEPGmyDYYTEfc5fcactWDA6ioSm8o7NUqg9QxjBCCEw==", - "dev": true, - "dependencies": { - "@types/chai": "*" - } - }, - "node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true - }, - "node_modules/@types/eccrypto": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@types/eccrypto/-/eccrypto-1.1.3.tgz", - "integrity": "sha512-3O0qER6JMYReqVbcQTGmXeMHdw3O+rVps63tlo5g5zoB3altJS8yzSvboSivwVWeYO9o5jSATu7P0UIqYZPgow==", - "dev": true, - "dependencies": { - "@types/expect": "^1.20.4", - "@types/node": "*" - } - }, - "node_modules/@types/expect": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", - "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", - "dev": true - }, - "node_modules/@types/express": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "node_modules/@types/express-serve-static-core": { - "version": "4.17.31", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", - "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", - "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - } - }, - "node_modules/@types/jsonwebtoken": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", - "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/lodash": { - "version": "4.14.189", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.189.tgz", - "integrity": "sha512-kb9/98N6X8gyME9Cf7YaqIMvYGnBSWqEci6tiettE6iJWH1XdJz/PO8LB0GtLCG7x8dU3KWhZT+lA1a35127tA==", - "dev": true - }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, - "node_modules/@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" - }, - "node_modules/@types/node": { - "version": "16.18.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.3.tgz", - "integrity": "sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==" - }, - "node_modules/@types/node-fetch": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.3.tgz", - "integrity": "sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==", - "dev": true, - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/@types/object-hash": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", - "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" - }, - "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" - }, - "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" - }, - "node_modules/@types/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", - "dependencies": { - "@types/mime": "*", - "@types/node": "*" - } - }, - "node_modules/@types/uuid": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", - "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", - "dev": true - }, - "node_modules/@types/websocket": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.6.tgz", - "integrity": "sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@uphold/request-logger": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@uphold/request-logger/-/request-logger-2.0.0.tgz", - "integrity": "sha512-UvGS+v87C7VTtQDcFHDLfvfl1zaZaLSwSmAnV35Ne7CzAVvotmZqt9lAIoNpMpaoRpdjVIcnUDwPSeIeA//EoQ==", - "dependencies": { - "uuid": "^3.0.1" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "request": ">=2.27.0" - } - }, - "node_modules/@uphold/request-logger/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "devOptional": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/agentkeepalive": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", - "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", - "optional": true, - "dependencies": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/agentkeepalive/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agentkeepalive/node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/agentkeepalive/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "optional": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" - }, - "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/app-root-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", - "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" - }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/are-we-there-yet/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "devOptional": true - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "engines": { - "node": "*" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" - }, - "node_modules/axios": { - "version": "0.28.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.0.tgz", - "integrity": "sha512-Tu7NYoGY4Yoc7I+Npf9HhUMtEEpV7ZiLH9yndTCoNhcpBH0kwcvFbzYN9/u5QKI5A6uefjsNNWaz5olJVYS62Q==", - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/bech32": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" - }, - "node_modules/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, - "node_modules/bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", - "optional": true, - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/bitcoin-core": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/bitcoin-core/-/bitcoin-core-4.2.0.tgz", - "integrity": "sha512-QFmer//rZhyuYm0mBOVAmMhIG/EFmXDahC3a1LvNTwM8/KszxUGEAjvAT4tzm1FaDj4c7pQWMG/vOWtoKjeR3Q==", - "dependencies": { - "@uphold/request-logger": "^2.0.0", - "debugnyan": "^1.0.0", - "json-bigint": "^1.0.0", - "lodash": "^4.0.0", - "request": "^2.53.0", - "semver": "^5.1.0", - "standard-error": "^1.1.0" - }, - "engines": { - "node": ">=7" - } - }, - "node_modules/bitcoin-core/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "optional": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, - "node_modules/buffer-writer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "optional": true - }, - "node_modules/bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/bunyan": { - "version": "1.8.15", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", - "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", - "engines": [ - "node >=0.10.0" - ], - "bin": { - "bunyan": "bin/bunyan" - }, - "optionalDependencies": { - "dtrace-provider": "~0.8", - "moment": "^2.19.3", - "mv": "~2", - "safe-json-stringify": "~1" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", - "optional": true, - "dependencies": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" - }, - "node_modules/chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chai-string": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz", - "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==", - "peerDependencies": { - "chai": "^4.1.2" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", - "engines": { - "node": "*" - } - }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "optional": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/cli-highlight": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", - "dependencies": { - "chalk": "^4.0.0", - "highlight.js": "^10.7.1", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^6.0.0", - "yargs": "^16.0.0" - }, - "bin": { - "highlight": "bin/highlight" - }, - "engines": { - "node": ">=8.0.0", - "npm": ">=5.0.0" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/copyfiles": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", - "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", - "dependencies": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^1.0.4", - "noms": "0.0.0", - "through2": "^2.0.1", - "untildify": "^4.0.0", - "yargs": "^16.1.0" - }, - "bin": { - "copyfiles": "copyfiles", - "copyup": "copyfiles" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "optional": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "optional": true, - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "devOptional": true - }, - "node_modules/csv": { - "version": "6.3.8", - "resolved": "https://registry.npmjs.org/csv/-/csv-6.3.8.tgz", - "integrity": "sha512-gRh3yiT9bHBA5ka2yOpyFqAVu/ZpwWzajMUR/es0ljevAE88WyHBuMUy7jzd2o5j6LYQesEO/AyhbQ9BhbDXUA==", - "dependencies": { - "csv-generate": "^4.4.0", - "csv-parse": "^5.5.5", - "csv-stringify": "^6.4.6", - "stream-transform": "^3.3.1" - }, - "engines": { - "node": ">= 0.1.90" - } - }, - "node_modules/csv-generate": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-4.4.0.tgz", - "integrity": "sha512-geM01acNPZ0wr4/9sKev5fCzFG/tsc/NbuFWrhLc47M1zQyUdEJH65+cxTLIVafEwhBjIYwQ7fdOL9roBqVltQ==" - }, - "node_modules/csv-parse": { - "version": "5.5.5", - "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-5.5.5.tgz", - "integrity": "sha512-erCk7tyU3yLWAhk6wvKxnyPtftuy/6Ak622gOO7BCJ05+TYffnPCJF905wmOQm+BpkX54OdAl8pveJwUdpnCXQ==" - }, - "node_modules/csv-stringify": { - "version": "6.4.6", - "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-6.4.6.tgz", - "integrity": "sha512-h2V2XZ3uOTLilF5dPIptgUfN/o2ia/80Ie0Lly18LAnw5s8Eb7kt8rfxSUy24AztJZas9f6DPZpVlzDUtFt/ag==" - }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/dataloader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", - "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/debugnyan": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/debugnyan/-/debugnyan-1.0.0.tgz", - "integrity": "sha512-dTvKxcLZCammDLFYi31NRVr5g6vjJ33uf1wcdbIPPxPxxnJ9/xj00Mh/YQkhFMw/VGavaG5KpjSC+4o9r/JjRg==", - "dependencies": { - "bunyan": "^1.8.1", - "debug": "^2.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/deep-eql": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.2.tgz", - "integrity": "sha512-gT18+YW4CcW/DBNTwAmqTtkJh7f9qqScu2qFVlx7kCoeY9tlBu9cUcr7+I+Z/noG8INehS3xQgLpTtd/QUTn4w==", - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "devOptional": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", - "engines": { - "node": ">=12" - } - }, - "node_modules/dprint-node": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.7.tgz", - "integrity": "sha512-NTZOW9A7ipb0n7z7nC3wftvsbceircwVHSgzobJsEQa+7RnOMbhrfX5IflA6CtC4GA63DSAiHYXa4JKEy9F7cA==", - "dependencies": { - "detect-libc": "^1.0.3" - } - }, - "node_modules/dprint-node/node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", - "optional": true, - "dependencies": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/dtrace-provider": { - "version": "0.8.8", - "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", - "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", - "hasInstallScript": true, - "optional": true, - "dependencies": { - "nan": "^2.14.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/eccrypto": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/eccrypto/-/eccrypto-1.1.6.tgz", - "integrity": "sha512-d78ivVEzu7Tn0ZphUUaL43+jVPKTMPFGtmgtz1D0LrFn7cY3K8CdrvibuLz2AAkHBLKZtR8DMbB2ukRYFk987A==", - "hasInstallScript": true, - "dependencies": { - "acorn": "7.1.1", - "elliptic": "6.5.4", - "es6-promise": "4.2.8", - "nan": "2.14.0" - }, - "optionalDependencies": { - "secp256k1": "3.7.1" - } - }, - "node_modules/eccrypto/node_modules/secp256k1": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", - "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", - "hasInstallScript": true, - "optional": true, - "dependencies": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.4.1", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, - "node_modules/encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "optional": true - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "hasInstallScript": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esniff/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "optional": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.2", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.6.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/ext/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "engines": { - "node": "*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "optional": true - }, - "node_modules/grpc-tools": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.11.3.tgz", - "integrity": "sha512-cRSK2uhDKHtZ9hLRM35HxaMAMxyh/L7C96Ojt58DhQBdwTOQlV1VIJHSK6X/pDeSQKhaQqWMFfebt8tIcvRfjQ==", - "hasInstallScript": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.5" - }, - "bin": { - "grpc_tools_node_protoc": "bin/protoc.js", - "grpc_tools_node_protoc_plugin": "bin/protoc_plugin.js" - } - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "optional": true, - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "optional": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/hash-base/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "optional": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", - "engines": { - "node": "*" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "optional": true - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "optional": true, - "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/http-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "optional": true, - "dependencies": { - "ms": "^2.0.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "engines": { - "node": ">= 4" - } - }, - "node_modules/ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "optional": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "optional": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", - "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", - "optional": true - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", - "optional": true - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, - "node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "optional": true - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" - }, - "node_modules/json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "dependencies": { - "bignumber.js": "^9.0.0" - } - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" - }, - "node_modules/jsonwebtoken": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", - "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", - "dependencies": { - "jws": "^3.2.2", - "lodash": "^4.17.21", - "ms": "^2.1.1", - "semver": "^7.3.8" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - } - }, - "node_modules/jsonwebtoken/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", - "dependencies": { - "get-func-name": "^2.0.0" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "devOptional": true - }, - "node_modules/make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", - "optional": true, - "dependencies": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "optional": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "optional": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-fetch": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", - "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", - "optional": true, - "dependencies": { - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "optionalDependencies": { - "encoding": "^0.1.12" - } - }, - "node_modules/minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/moment": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/mv": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", - "integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==", - "optional": true, - "dependencies": { - "mkdirp": "~0.5.1", - "ncp": "~2.0.0", - "rimraf": "~2.4.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/mv/node_modules/glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==", - "optional": true, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mv/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "optional": true, - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/mv/node_modules/rimraf": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", - "integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==", - "optional": true, - "dependencies": { - "glob": "^6.0.1" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "node_modules/nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - }, - "node_modules/ncp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", - "optional": true, - "bin": { - "ncp": "bin/ncp" - } - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, - "node_modules/node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", - "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", - "optional": true, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^9.1.0", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 10.12.0" - } - }, - "node_modules/node-gyp-build": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", - "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/node-gyp/node_modules/are-we-there-yet": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-gyp/node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "optional": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-gyp/node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "optional": true, - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-gyp/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "optional": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/node-gyp/node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "optional": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/nodemon": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", - "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", - "dev": true, - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^3.2.7", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^5.7.1", - "simple-update-notifier": "^1.0.7", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "bin": { - "nodemon": "bin/nodemon.js" - }, - "engines": { - "node": ">=8.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } - }, - "node_modules/nodemon/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/nodemon/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/nodemon/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/nodemon/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/nodemon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/noms": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - } - }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/nostr-tools": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-1.9.0.tgz", - "integrity": "sha512-ZvFf1uiBqWLWhLBHD2nY0KsdSdNWKb3PrQUmYMWxSzfT4k48cDrDJu2qgULkOhQbFX7oty8IpaKnLvixhqefqA==", - "dependencies": { - "@noble/curves": "1.0.0", - "@noble/hashes": "1.3.0", - "@scure/base": "1.1.1", - "@scure/bip32": "1.3.0", - "@scure/bip39": "1.2.0" - } - }, - "node_modules/npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "engines": { - "node": "*" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "optional": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/packet-reader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" - }, - "node_modules/parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" - }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "dependencies": { - "parse5": "^6.0.1" - } - }, - "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "engines": { - "node": "*" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" - }, - "node_modules/pg": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", - "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", - "dependencies": { - "buffer-writer": "2.0.0", - "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.2", - "pg-protocol": "^1.5.0", - "pg-types": "^2.1.0", - "pgpass": "1.x" - }, - "engines": { - "node": ">= 8.0.0" - }, - "peerDependencies": { - "pg-native": ">=3.0.1" - }, - "peerDependenciesMeta": { - "pg-native": { - "optional": true - } - } - }, - "node_modules/pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" - }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/pg-pool": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", - "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", - "peerDependencies": { - "pg": ">=8.0" - } - }, - "node_modules/pg-protocol": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", - "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", - "dependencies": { - "split2": "^4.1.0" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "dependencies": { - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", - "optional": true - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "optional": true, - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/protobufjs": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz", - "integrity": "sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/protobufjs/node_modules/long": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", - "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, - "node_modules/pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" - }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/request/node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "optional": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "optional": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/rxjs": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz", - "integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safe-json-stringify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", - "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", - "optional": true - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "hasInstallScript": true, - "dependencies": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "node_modules/simple-update-notifier": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", - "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", - "dev": true, - "dependencies": { - "semver": "~7.0.0" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/simple-update-notifier/node_modules/semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "optional": true, - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", - "optional": true, - "dependencies": { - "ip": "^2.0.0", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", - "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", - "optional": true, - "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/socks-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "node_modules/split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/sqlite3": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.5.tgz", - "integrity": "sha512-7sP16i4wI+yKnGOO2q2ijze7EjQ9US+Vw7DYYwxfFtqNZDGgBcEw0oeDaDvUTq66uJOzVd/z6MkIg+c9erSJKg==", - "hasInstallScript": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^4.2.0", - "tar": "^6.1.11" - }, - "optionalDependencies": { - "node-gyp": "8.x" - }, - "peerDependencies": { - "node-gyp": "8.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - } - }, - "node_modules/sqlite3/node_modules/node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" - }, - "node_modules/sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "optional": true, - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/standard-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/standard-error/-/standard-error-1.1.0.tgz", - "integrity": "sha512-4v7qzU7oLJfMI5EltUSHCaaOd65J6S4BqKRWgzMi4EYaE5fvNabPxmAPGdxpGXqrcWjhDGI/H09CIdEuUOUeXg==" - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/stream-transform": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-3.3.1.tgz", - "integrity": "sha512-BL8pv9QL8Ikd11oZwlRDp1qYMhGR0i50zI9ltoijKGc4ubQWal/Rc4p6SYJp1TBOGpE0uAGchwbxOZ1ycwTuqQ==" - }, - "node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tar": { - "version": "6.1.12", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", - "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/through2/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/through2/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/through2/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/through2/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/touch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", - "dev": true, - "dependencies": { - "nopt": "~1.0.10" - }, - "bin": { - "nodetouch": "bin/nodetouch.js" - } - }, - "node_modules/touch/node_modules/nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", - "dev": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", - "devOptional": true, - "dependencies": { - "@cspotcode/source-map-support": "0.7.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.0", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/ts-node/node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", - "devOptional": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ts-poet": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.1.0.tgz", - "integrity": "sha512-PFwbNJjGrb44wzHUGQicG2/nhjR+3+k7zYLDTa8D61NVUitl7K/JgIc9/P+8oMNenntKzLc8tjLDOkPrxIhm6A==", - "dependencies": { - "dprint-node": "^1.0.7" - } - }, - "node_modules/ts-proto": { - "version": "1.131.2", - "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.131.2.tgz", - "integrity": "sha512-SFQMXoNrZ/Ybcc2wwS/s0Lser/aVRr6HMN1LLHIvsbx3aK1eM02CLmWbic+DblGyoua8ZzuonbnCWBhcjwPTFA==", - "dependencies": { - "@types/object-hash": "^1.3.0", - "dataloader": "^1.4.0", - "object-hash": "^1.3.1", - "protobufjs": "^6.11.3", - "ts-poet": "^6.1.0", - "ts-proto-descriptors": "1.7.1" - }, - "bin": { - "protoc-gen-ts_proto": "protoc-gen-ts_proto" - } - }, - "node_modules/ts-proto-descriptors": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz", - "integrity": "sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw==", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "^6.8.8" - } - }, - "node_modules/ts-proto-descriptors/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/ts-proto/node_modules/protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } - }, - "node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" - }, - "node_modules/tstl": { - "version": "2.5.13", - "resolved": "https://registry.npmjs.org/tstl/-/tstl-2.5.13.tgz", - "integrity": "sha512-h9wayHHFI5+yqt8iau0vqH96cTNhezhZ/Fk/hrIdpfkiMu3lg9nzyvMfs5bIdX51IVzZO6DudLqhkL/rVXpT6g==" - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" - }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "engines": { - "node": ">=4" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/typeorm": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.15.tgz", - "integrity": "sha512-R4JSw8QjDP1W+ypeRz/XrCXIqubrLSnNAzJAp9EQSQIPHTv+YmUHZis8g08lOwFpuhqL9m8jkPSz8GWEKlU/ow==", - "dependencies": { - "@sqltools/formatter": "^1.2.5", - "app-root-path": "^3.1.0", - "buffer": "^6.0.3", - "chalk": "^4.1.2", - "cli-highlight": "^2.1.11", - "debug": "^4.3.4", - "dotenv": "^16.0.3", - "glob": "^8.1.0", - "mkdirp": "^2.1.3", - "reflect-metadata": "^0.1.13", - "sha.js": "^2.4.11", - "tslib": "^2.5.0", - "uuid": "^9.0.0", - "yargs": "^17.6.2" - }, - "bin": { - "typeorm": "cli.js", - "typeorm-ts-node-commonjs": "cli-ts-node-commonjs.js", - "typeorm-ts-node-esm": "cli-ts-node-esm.js" - }, - "engines": { - "node": ">= 12.9.0" - }, - "funding": { - "url": "https://opencollective.com/typeorm" - }, - "peerDependencies": { - "@google-cloud/spanner": "^5.18.0", - "@sap/hana-client": "^2.12.25", - "better-sqlite3": "^7.1.2 || ^8.0.0", - "hdb-pool": "^0.1.6", - "ioredis": "^5.0.4", - "mongodb": "^5.2.0", - "mssql": "^9.1.1", - "mysql2": "^2.2.5 || ^3.0.1", - "oracledb": "^5.1.0", - "pg": "^8.5.1", - "pg-native": "^3.0.0", - "pg-query-stream": "^4.0.0", - "redis": "^3.1.1 || ^4.0.0", - "sql.js": "^1.4.0", - "sqlite3": "^5.0.3", - "ts-node": "^10.7.0", - "typeorm-aurora-data-api-driver": "^2.0.0" - }, - "peerDependenciesMeta": { - "@google-cloud/spanner": { - "optional": true - }, - "@sap/hana-client": { - "optional": true - }, - "better-sqlite3": { - "optional": true - }, - "hdb-pool": { - "optional": true - }, - "ioredis": { - "optional": true - }, - "mongodb": { - "optional": true - }, - "mssql": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "oracledb": { - "optional": true - }, - "pg": { - "optional": true - }, - "pg-native": { - "optional": true - }, - "pg-query-stream": { - "optional": true - }, - "redis": { - "optional": true - }, - "sql.js": { - "optional": true - }, - "sqlite3": { - "optional": true - }, - "ts-node": { - "optional": true - }, - "typeorm-aurora-data-api-driver": { - "optional": true - } - } - }, - "node_modules/typeorm/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/typeorm/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/typeorm/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/typeorm/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/typeorm/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/typeorm/node_modules/mkdirp": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", - "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", - "bin": { - "mkdirp": "dist/cjs/src/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/typeorm/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/typeorm/node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/typeorm/node_modules/yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/typeorm/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/typescript": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", - "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", - "devOptional": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true - }, - "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "optional": true, - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "optional": true, - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/untildify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "devOptional": true - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/verror/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/websocket-polyfill": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/websocket-polyfill/-/websocket-polyfill-0.0.3.tgz", - "integrity": "sha512-pF3kR8Uaoau78MpUmFfzbIRxXj9PeQrCuPepGE6JIsfsJ/o/iXr07Q2iQNzKSSblQJ0FiGWlS64N4pVSm+O3Dg==", - "dependencies": { - "tstl": "^2.0.7", - "websocket": "^1.0.28" - } - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "optional": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", - "engines": { - "node": ">=0.10.32" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "devOptional": true, - "engines": { - "node": ">=6" - } - } - }, - "dependencies": { - "@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "devOptional": true - }, - "@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", - "devOptional": true, - "requires": { - "@cspotcode/source-map-consumer": "0.8.0" - } - }, - "@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", - "optional": true - }, - "@grpc/grpc-js": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", - "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", - "requires": { - "@grpc/proto-loader": "^0.7.0", - "@types/node": ">=12.12.47" - } - }, - "@grpc/proto-loader": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", - "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", - "requires": { - "@types/long": "^4.0.1", - "lodash.camelcase": "^4.3.0", - "long": "^4.0.0", - "protobufjs": "^7.0.0", - "yargs": "^16.2.0" - } - }, - "@mapbox/node-pre-gyp": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", - "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", - "requires": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - } - }, - "@noble/curves": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.0.0.tgz", - "integrity": "sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==", - "requires": { - "@noble/hashes": "1.3.0" - } - }, - "@noble/hashes": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz", - "integrity": "sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==" - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@npmcli/fs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", - "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", - "optional": true, - "requires": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "@npmcli/move-file": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", - "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "optional": true, - "requires": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - } - }, - "@protobuf-ts/grpc-transport": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-transport/-/grpc-transport-2.8.1.tgz", - "integrity": "sha512-SgXCskzPRPN/6Ns5ohuC64Qkwchb9I758n2/2RpnAy0Kr6E5kIqav5WGkNLCD08erl8wvjuLdyxZfig4sf1yvQ==", - "requires": { - "@protobuf-ts/runtime": "^2.8.1", - "@protobuf-ts/runtime-rpc": "^2.8.1" - } - }, - "@protobuf-ts/plugin": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.8.1.tgz", - "integrity": "sha512-lacRdXJ9TkTbI28U0KApsnVqnxeq1aZftOdq6LNPQJaIzBrVRxrMkqnnGWGQFYe0Tr93OKeW4A2lLjTkn32CuA==", - "requires": { - "@protobuf-ts/plugin-framework": "^2.8.1", - "@protobuf-ts/protoc": "^2.8.1", - "@protobuf-ts/runtime": "^2.8.1", - "@protobuf-ts/runtime-rpc": "^2.8.1", - "typescript": "^3.9" - }, - "dependencies": { - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" - } - } - }, - "@protobuf-ts/plugin-framework": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.8.1.tgz", - "integrity": "sha512-hfLoYIyxCI6Ro6LY1BltNBDcXWL+36SwnWR/hcF4ttPHLE3rMIpYbz4IwQsfeU2SKbBeGFhZv9rcnDJB22cXog==", - "requires": { - "@protobuf-ts/runtime": "^2.8.1", - "typescript": "^3.9" - }, - "dependencies": { - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" - } - } - }, - "@protobuf-ts/protoc": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.8.1.tgz", - "integrity": "sha512-6fehuL9bS22zCgPBBlESZjnoA4fxAUkOjMcaFMJSlVpN6CDN2O+c/Mo1pCXaNDO7FAidMPj5yhz48Kws4kOXEA==" - }, - "@protobuf-ts/runtime": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.8.1.tgz", - "integrity": "sha512-D9M5hSumYCovIfNllt7N6ODh4q+LrjiMWtNETvooaf+a2XheZJ7kgjFlsFghti0CFWwtA//of4JXQfw9hU+cCw==" - }, - "@protobuf-ts/runtime-rpc": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.8.1.tgz", - "integrity": "sha512-hc+HJpoAu50by8aBS55UygcrzD8jAvRKWZMCRJ9XY3h9Gl2tciYysfzSH1SWtF6XOT/4b5CKnnmdMR3ad7uU5g==", - "requires": { - "@protobuf-ts/runtime": "^2.8.1" - } - }, - "@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "requires": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, - "@scure/base": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", - "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==" - }, - "@scure/bip32": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.0.tgz", - "integrity": "sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==", - "requires": { - "@noble/curves": "~1.0.0", - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "@scure/bip39": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.0.tgz", - "integrity": "sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==", - "requires": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" - } - }, - "@sqltools/formatter": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", - "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" - }, - "@stablelib/binary": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", - "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", - "requires": { - "@stablelib/int": "^1.0.1" - } - }, - "@stablelib/chacha": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", - "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", - "requires": { - "@stablelib/binary": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "@stablelib/int": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", - "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" - }, - "@stablelib/wipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", - "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" - }, - "@stablelib/xchacha20": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@stablelib/xchacha20/-/xchacha20-1.0.1.tgz", - "integrity": "sha512-1YkiZnFF4veUwBVhDnDYwo6EHeKzQK4FnLiO7ezCl/zu64uG0bCCAUROJaBkaLH+5BEsO3W7BTXTguMbSLlWSw==", - "requires": { - "@stablelib/binary": "^1.0.1", - "@stablelib/chacha": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "optional": true - }, - "@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "devOptional": true - }, - "@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "devOptional": true - }, - "@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "devOptional": true - }, - "@tsconfig/node16": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", - "devOptional": true - }, - "@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", - "requires": { - "@types/connect": "*", - "@types/node": "*" - } - }, - "@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", - "dev": true - }, - "@types/chai-string": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.4.5.tgz", - "integrity": "sha512-IecXRMSnpUvRnTztdpSdjcmcW7EdNme65bfDCQMi7XrSEPGmyDYYTEfc5fcactWDA6ioSm8o7NUqg9QxjBCCEw==", - "dev": true, - "requires": { - "@types/chai": "*" - } - }, - "@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", - "requires": { - "@types/node": "*" - } - }, - "@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true - }, - "@types/eccrypto": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@types/eccrypto/-/eccrypto-1.1.3.tgz", - "integrity": "sha512-3O0qER6JMYReqVbcQTGmXeMHdw3O+rVps63tlo5g5zoB3altJS8yzSvboSivwVWeYO9o5jSATu7P0UIqYZPgow==", - "dev": true, - "requires": { - "@types/expect": "^1.20.4", - "@types/node": "*" - } - }, - "@types/expect": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", - "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", - "dev": true - }, - "@types/express": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", - "requires": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" - } - }, - "@types/express-serve-static-core": { - "version": "4.17.31", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", - "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", - "requires": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" - } - }, - "@types/jsonwebtoken": { - "version": "8.5.9", - "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", - "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/lodash": { - "version": "4.14.189", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.189.tgz", - "integrity": "sha512-kb9/98N6X8gyME9Cf7YaqIMvYGnBSWqEci6tiettE6iJWH1XdJz/PO8LB0GtLCG7x8dU3KWhZT+lA1a35127tA==", - "dev": true - }, - "@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, - "@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" - }, - "@types/node": { - "version": "16.18.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.3.tgz", - "integrity": "sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==" - }, - "@types/node-fetch": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.3.tgz", - "integrity": "sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==", - "dev": true, - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - }, - "dependencies": { - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - } - } - }, - "@types/object-hash": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", - "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" - }, - "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" - }, - "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" - }, - "@types/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", - "requires": { - "@types/node": "*" - } - }, - "@types/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", - "requires": { - "@types/mime": "*", - "@types/node": "*" - } - }, - "@types/uuid": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", - "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", - "dev": true - }, - "@types/websocket": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.6.tgz", - "integrity": "sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@uphold/request-logger": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@uphold/request-logger/-/request-logger-2.0.0.tgz", - "integrity": "sha512-UvGS+v87C7VTtQDcFHDLfvfl1zaZaLSwSmAnV35Ne7CzAVvotmZqt9lAIoNpMpaoRpdjVIcnUDwPSeIeA//EoQ==", - "requires": { - "uuid": "^3.0.1" - }, - "dependencies": { - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - } - } - }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - } - }, - "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" - }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "devOptional": true - }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "agentkeepalive": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", - "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", - "optional": true, - "requires": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "requires": { - "ms": "2.1.2" - } - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", - "optional": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - } - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "optional": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" - }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "app-root-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", - "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==" - }, - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" - }, - "are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "devOptional": true - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==" - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==" - }, - "aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" - }, - "axios": { - "version": "0.28.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.0.tgz", - "integrity": "sha512-Tu7NYoGY4Yoc7I+Npf9HhUMtEEpV7ZiLH9yndTCoNhcpBH0kwcvFbzYN9/u5QKI5A6uefjsNNWaz5olJVYS62Q==", - "requires": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bech32": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" - }, - "bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==" - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bip66": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bitcoin-core": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/bitcoin-core/-/bitcoin-core-4.2.0.tgz", - "integrity": "sha512-QFmer//rZhyuYm0mBOVAmMhIG/EFmXDahC3a1LvNTwM8/KszxUGEAjvAT4tzm1FaDj4c7pQWMG/vOWtoKjeR3Q==", - "requires": { - "@uphold/request-logger": "^2.0.0", - "debugnyan": "^1.0.0", - "json-bigint": "^1.0.0", - "lodash": "^4.0.0", - "request": "^2.53.0", - "semver": "^5.1.0", - "standard-error": "^1.1.0" - }, - "dependencies": { - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" - } - } - }, - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "optional": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" - }, - "buffer-writer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "optional": true - }, - "bufferutil": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", - "requires": { - "node-gyp-build": "^4.3.0" - } - }, - "bunyan": { - "version": "1.8.15", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", - "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", - "requires": { - "dtrace-provider": "~0.8", - "moment": "^2.19.3", - "mv": "~2", - "safe-json-stringify": "~1" - } - }, - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" - }, - "cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", - "optional": true, - "requires": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - } - }, - "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "requires": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" - }, - "chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" - } - }, - "chai-string": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz", - "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==", - "requires": {} - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==" - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "optional": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "optional": true - }, - "cli-highlight": { - "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", - "requires": { - "chalk": "^4.0.0", - "highlight.js": "^10.7.1", - "mz": "^2.4.0", - "parse5": "^5.1.1", - "parse5-htmlparser2-tree-adapter": "^6.0.0", - "yargs": "^16.0.0" - } - }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, - "content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { - "safe-buffer": "5.2.1" - } - }, - "content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" - }, - "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "copyfiles": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", - "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", - "requires": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^1.0.4", - "noms": "0.0.0", - "through2": "^2.0.1", - "untildify": "^4.0.0", - "yargs": "^16.1.0" - } - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "optional": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "optional": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "devOptional": true - }, - "csv": { - "version": "6.3.8", - "resolved": "https://registry.npmjs.org/csv/-/csv-6.3.8.tgz", - "integrity": "sha512-gRh3yiT9bHBA5ka2yOpyFqAVu/ZpwWzajMUR/es0ljevAE88WyHBuMUy7jzd2o5j6LYQesEO/AyhbQ9BhbDXUA==", - "requires": { - "csv-generate": "^4.4.0", - "csv-parse": "^5.5.5", - "csv-stringify": "^6.4.6", - "stream-transform": "^3.3.1" - } - }, - "csv-generate": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-4.4.0.tgz", - "integrity": "sha512-geM01acNPZ0wr4/9sKev5fCzFG/tsc/NbuFWrhLc47M1zQyUdEJH65+cxTLIVafEwhBjIYwQ7fdOL9roBqVltQ==" - }, - "csv-parse": { - "version": "5.5.5", - "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-5.5.5.tgz", - "integrity": "sha512-erCk7tyU3yLWAhk6wvKxnyPtftuy/6Ak622gOO7BCJ05+TYffnPCJF905wmOQm+BpkX54OdAl8pveJwUdpnCXQ==" - }, - "csv-stringify": { - "version": "6.4.6", - "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-6.4.6.tgz", - "integrity": "sha512-h2V2XZ3uOTLilF5dPIptgUfN/o2ia/80Ie0Lly18LAnw5s8Eb7kt8rfxSUy24AztJZas9f6DPZpVlzDUtFt/ag==" - }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "dataloader": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", - "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "debugnyan": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/debugnyan/-/debugnyan-1.0.0.tgz", - "integrity": "sha512-dTvKxcLZCammDLFYi31NRVr5g6vjJ33uf1wcdbIPPxPxxnJ9/xj00Mh/YQkhFMw/VGavaG5KpjSC+4o9r/JjRg==", - "requires": { - "bunyan": "^1.8.1", - "debug": "^2.2.0" - } - }, - "deep-eql": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.2.tgz", - "integrity": "sha512-gT18+YW4CcW/DBNTwAmqTtkJh7f9qqScu2qFVlx7kCoeY9tlBu9cUcr7+I+Z/noG8INehS3xQgLpTtd/QUTn4w==", - "requires": { - "type-detect": "^4.0.0" - } - }, - "define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "requires": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, - "destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" - }, - "detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "devOptional": true - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "requires": { - "path-type": "^4.0.0" - } - }, - "dotenv": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", - "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" - }, - "dprint-node": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.7.tgz", - "integrity": "sha512-NTZOW9A7ipb0n7z7nC3wftvsbceircwVHSgzobJsEQa+7RnOMbhrfX5IflA6CtC4GA63DSAiHYXa4JKEy9F7cA==", - "requires": { - "detect-libc": "^1.0.3" - }, - "dependencies": { - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==" - } - } - }, - "drbg.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", - "optional": true, - "requires": { - "browserify-aes": "^1.0.6", - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4" - } - }, - "dtrace-provider": { - "version": "0.8.8", - "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", - "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", - "optional": true, - "requires": { - "nan": "^2.14.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "eccrypto": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/eccrypto/-/eccrypto-1.1.6.tgz", - "integrity": "sha512-d78ivVEzu7Tn0ZphUUaL43+jVPKTMPFGtmgtz1D0LrFn7cY3K8CdrvibuLz2AAkHBLKZtR8DMbB2ukRYFk987A==", - "requires": { - "acorn": "7.1.1", - "elliptic": "6.5.4", - "es6-promise": "4.2.8", - "nan": "2.14.0", - "secp256k1": "3.7.1" - }, - "dependencies": { - "secp256k1": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", - "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.4.1", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" - } - } - } - }, - "ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" - }, - "encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "requires": { - "iconv-lite": "^0.6.2" - }, - "dependencies": { - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - } - } - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "optional": true - }, - "err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "optional": true - }, - "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { - "get-intrinsic": "^1.2.4" - } - }, - "es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" - }, - "es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "requires": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "requires": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "dependencies": { - "type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - } - } - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" - }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "optional": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", - "requires": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.2", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.6.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - } - }, - "ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "requires": { - "type": "^2.7.2" - }, - "dependencies": { - "type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "requires": { - "reusify": "^1.0.4" - } - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - } - }, - "follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==" - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" - }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { - "minipass": "^3.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" - }, - "gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - } - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==" - }, - "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "requires": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - } - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "globby": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", - "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", - "requires": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.11", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^4.0.0" - } - }, - "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { - "get-intrinsic": "^1.1.3" - } - }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "optional": true - }, - "grpc-tools": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.11.3.tgz", - "integrity": "sha512-cRSK2uhDKHtZ9hLRM35HxaMAMxyh/L7C96Ojt58DhQBdwTOQlV1VIJHSK6X/pDeSQKhaQqWMFfebt8tIcvRfjQ==", - "requires": { - "@mapbox/node-pre-gyp": "^1.0.5" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==" - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "requires": { - "es-define-property": "^1.0.0" - } - }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "optional": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "optional": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "optional": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "requires": { - "function-bind": "^1.1.2" - } - }, - "highlight.js": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "optional": true - }, - "http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "requires": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - } - }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "optional": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - } - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "requires": { - "agent-base": "6", - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - } - } - }, - "humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "optional": true, - "requires": { - "ms": "^2.0.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" - }, - "ignore-by-default": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", - "dev": true - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "optional": true - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "optional": true - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "optional": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", - "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", - "optional": true - }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", - "optional": true - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "optional": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" - }, - "json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "requires": { - "bignumber.js": "^9.0.0" - } - }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" - }, - "jsonwebtoken": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", - "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", - "requires": { - "jws": "^3.2.2", - "lodash": "^4.17.21", - "ms": "^2.1.1", - "semver": "^7.3.8" - }, - "dependencies": { - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } - } - }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, - "jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "requires": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "requires": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", - "requires": { - "get-func-name": "^2.0.0" - } - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" - } - } - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "devOptional": true - }, - "make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", - "optional": true, - "requires": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "optional": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { - "mime-db": "1.52.0" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "optional": true - }, - "minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "optional": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-fetch": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", - "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", - "optional": true, - "requires": { - "encoding": "^0.1.12", - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - } - }, - "minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "optional": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "optional": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "optional": true, - "requires": { - "minipass": "^3.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, - "moment": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "optional": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "mv": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", - "integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==", - "optional": true, - "requires": { - "mkdirp": "~0.5.1", - "ncp": "~2.0.0", - "rimraf": "~2.4.0" - }, - "dependencies": { - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==", - "optional": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "optional": true, - "requires": { - "minimist": "^1.2.6" - } - }, - "rimraf": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", - "integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==", - "optional": true, - "requires": { - "glob": "^6.0.1" - } - } - } - }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" - }, - "ncp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", - "optional": true - }, - "negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" - }, - "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, - "node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node-gyp": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", - "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", - "optional": true, - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^9.1.0", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "dependencies": { - "are-we-there-yet": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, - "gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "optional": true, - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - } - }, - "npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "optional": true, - "requires": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "optional": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "optional": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } - } - }, - "node-gyp-build": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", - "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" - }, - "nodemon": { - "version": "2.0.20", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", - "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", - "dev": true, - "requires": { - "chokidar": "^3.5.2", - "debug": "^3.2.7", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.1.2", - "pstree.remy": "^1.1.8", - "semver": "^5.7.1", - "simple-update-notifier": "^1.0.7", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "noms": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", - "requires": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - } - }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "requires": { - "abbrev": "1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "nostr-tools": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-1.9.0.tgz", - "integrity": "sha512-ZvFf1uiBqWLWhLBHD2nY0KsdSdNWKb3PrQUmYMWxSzfT4k48cDrDJu2qgULkOhQbFX7oty8IpaKnLvixhqefqA==", - "requires": { - "@noble/curves": "1.0.0", - "@noble/hashes": "1.3.0", - "@scure/base": "1.1.1", - "@scure/bip32": "1.3.0", - "@scure/bip39": "1.2.0" - } - }, - "npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "requires": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" - }, - "object-hash": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", - "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==" - }, - "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "requires": { - "wrappy": "1" - } - }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "optional": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "packet-reader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" - }, - "parse5": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" - }, - "parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "requires": { - "parse5": "^6.0.1" - }, - "dependencies": { - "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" - } - } - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" - }, - "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" - }, - "pg": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", - "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", - "requires": { - "buffer-writer": "2.0.0", - "packet-reader": "1.0.0", - "pg-connection-string": "^2.5.0", - "pg-pool": "^3.5.2", - "pg-protocol": "^1.5.0", - "pg-types": "^2.1.0", - "pgpass": "1.x" - } - }, - "pg-connection-string": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", - "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" - }, - "pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" - }, - "pg-pool": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", - "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", - "requires": {} - }, - "pg-protocol": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", - "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" - }, - "pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "requires": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - } - }, - "pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", - "requires": { - "split2": "^4.1.0" - } - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, - "postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==" - }, - "postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==" - }, - "postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==" - }, - "postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "requires": { - "xtend": "^4.0.0" - } - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", - "optional": true - }, - "promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "optional": true, - "requires": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - } - }, - "protobufjs": { - "version": "7.2.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz", - "integrity": "sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "dependencies": { - "long": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", - "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" - } - } - }, - "proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "requires": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - } - }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, - "psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" - }, - "pstree.remy": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", - "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", - "dev": true - }, - "punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "requires": { - "side-channel": "^1.0.4" - } - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" - }, - "raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "requires": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - } - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" - }, - "retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "optional": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "optional": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "rxjs": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz", - "integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==", - "requires": { - "tslib": "^2.1.0" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - }, - "safe-json-stringify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", - "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "requires": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { - "lru-cache": "^6.0.0" - } - }, - "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "requires": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "dependencies": { - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } - } - }, - "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, - "set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "requires": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - } - }, - "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "requires": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - } - }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "simple-update-notifier": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", - "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", - "dev": true, - "requires": { - "semver": "~7.0.0" - }, - "dependencies": { - "semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true - } - } - }, - "slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==" - }, - "smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "optional": true - }, - "socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", - "optional": true, - "requires": { - "ip": "^2.0.0", - "smart-buffer": "^4.2.0" - } - }, - "socks-proxy-agent": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", - "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", - "optional": true, - "requires": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - } - } - }, - "split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" - }, - "sqlite3": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.5.tgz", - "integrity": "sha512-7sP16i4wI+yKnGOO2q2ijze7EjQ9US+Vw7DYYwxfFtqNZDGgBcEw0oeDaDvUTq66uJOzVd/z6MkIg+c9erSJKg==", - "requires": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^4.2.0", - "node-gyp": "8.x", - "tar": "^6.1.11" - }, - "dependencies": { - "node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" - } - } - }, - "sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "optional": true, - "requires": { - "minipass": "^3.1.1" - } - }, - "standard-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/standard-error/-/standard-error-1.1.0.tgz", - "integrity": "sha512-4v7qzU7oLJfMI5EltUSHCaaOd65J6S4BqKRWgzMi4EYaE5fvNabPxmAPGdxpGXqrcWjhDGI/H09CIdEuUOUeXg==" - }, - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" - }, - "stream-transform": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-3.3.1.tgz", - "integrity": "sha512-BL8pv9QL8Ikd11oZwlRDp1qYMhGR0i50zI9ltoijKGc4ubQWal/Rc4p6SYJp1TBOGpE0uAGchwbxOZ1ycwTuqQ==" - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - }, - "tar": { - "version": "6.1.12", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", - "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, - "thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" - }, - "touch": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", - "dev": true, - "requires": { - "nopt": "~1.0.10" - }, - "dependencies": { - "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", - "dev": true, - "requires": { - "abbrev": "1" - } - } - } - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", - "devOptional": true, - "requires": { - "@cspotcode/source-map-support": "0.7.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.0", - "yn": "3.1.1" - }, - "dependencies": { - "acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", - "devOptional": true - } - } - }, - "ts-poet": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.1.0.tgz", - "integrity": "sha512-PFwbNJjGrb44wzHUGQicG2/nhjR+3+k7zYLDTa8D61NVUitl7K/JgIc9/P+8oMNenntKzLc8tjLDOkPrxIhm6A==", - "requires": { - "dprint-node": "^1.0.7" - } - }, - "ts-proto": { - "version": "1.131.2", - "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.131.2.tgz", - "integrity": "sha512-SFQMXoNrZ/Ybcc2wwS/s0Lser/aVRr6HMN1LLHIvsbx3aK1eM02CLmWbic+DblGyoua8ZzuonbnCWBhcjwPTFA==", - "requires": { - "@types/object-hash": "^1.3.0", - "dataloader": "^1.4.0", - "object-hash": "^1.3.1", - "protobufjs": "^6.11.3", - "ts-poet": "^6.1.0", - "ts-proto-descriptors": "1.7.1" - }, - "dependencies": { - "protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - } - } - }, - "ts-proto-descriptors": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz", - "integrity": "sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw==", - "requires": { - "long": "^4.0.0", - "protobufjs": "^6.8.8" - }, - "dependencies": { - "protobufjs": { - "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", - "requires": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - } - } - } - }, - "tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" - }, - "tstl": { - "version": "2.5.13", - "resolved": "https://registry.npmjs.org/tstl/-/tstl-2.5.13.tgz", - "integrity": "sha512-h9wayHHFI5+yqt8iau0vqH96cTNhezhZ/Fk/hrIdpfkiMu3lg9nzyvMfs5bIdX51IVzZO6DudLqhkL/rVXpT6g==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" - }, - "type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" - }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "typeorm": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.15.tgz", - "integrity": "sha512-R4JSw8QjDP1W+ypeRz/XrCXIqubrLSnNAzJAp9EQSQIPHTv+YmUHZis8g08lOwFpuhqL9m8jkPSz8GWEKlU/ow==", - "requires": { - "@sqltools/formatter": "^1.2.5", - "app-root-path": "^3.1.0", - "buffer": "^6.0.3", - "chalk": "^4.1.2", - "cli-highlight": "^2.1.11", - "debug": "^4.3.4", - "dotenv": "^16.0.3", - "glob": "^8.1.0", - "mkdirp": "^2.1.3", - "reflect-metadata": "^0.1.13", - "sha.js": "^2.4.11", - "tslib": "^2.5.0", - "uuid": "^9.0.0", - "yargs": "^17.6.2" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "requires": { - "balanced-match": "^1.0.0" - } - }, - "cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - } - }, - "minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "mkdirp": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", - "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==" - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" - }, - "yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", - "requires": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" - } - } - }, - "typescript": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", - "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", - "devOptional": true - }, - "undefsafe": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", - "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", - "dev": true - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "optional": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "optional": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" - }, - "untildify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "requires": { - "node-gyp-build": "^4.3.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "devOptional": true - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" - } - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "requires": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - } - }, - "websocket-polyfill": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/websocket-polyfill/-/websocket-polyfill-0.0.3.tgz", - "integrity": "sha512-pF3kR8Uaoau78MpUmFfzbIRxXj9PeQrCuPepGE6JIsfsJ/o/iXr07Q2iQNzKSSblQJ0FiGWlS64N4pVSm+O3Dg==", - "requires": { - "tstl": "^2.0.7", - "websocket": "^1.0.28" - } - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "optional": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==" - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - } - }, - "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" - }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "devOptional": true - } - } -} +{ + "name": "lightning.pub", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "lightning.pub", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@grpc/grpc-js": "^1.6.7", + "@protobuf-ts/grpc-transport": "^2.5.0", + "@protobuf-ts/plugin": "^2.5.0", + "@protobuf-ts/runtime": "^2.5.0", + "@stablelib/xchacha20": "^1.0.1", + "@types/express": "^4.17.13", + "@types/node": "^17.0.31", + "@types/secp256k1": "^4.0.3", + "axios": "^0.28.0", + "bech32": "^2.0.0", + "bitcoin-core": "^4.2.0", + "chai": "^4.3.7", + "chai-string": "^1.5.0", + "copyfiles": "^2.4.1", + "cors": "^2.8.5", + "csv": "^6.3.8", + "dotenv": "^16.0.0", + "eccrypto": "^1.1.6", + "express": "^4.19.2", + "globby": "^13.1.2", + "grpc-tools": "^1.11.2", + "jsonwebtoken": "^9.0.0", + "lodash": "^4.17.21", + "nostr-tools": "^1.9.0", + "pg": "^8.4.0", + "reflect-metadata": "^0.1.13", + "rimraf": "^3.0.2", + "rxjs": "^7.5.5", + "secp256k1": "^4.0.3", + "sqlite3": "^5.1.5", + "ts-node": "^10.7.0", + "ts-proto": "^1.131.2", + "typeorm": "0.3.15", + "typescript": "^4.6.4", + "uuid": "^8.3.2", + "websocket": "^1.0.34", + "websocket-polyfill": "^0.0.3" + }, + "devDependencies": { + "@types/chai": "^4.3.4", + "@types/chai-string": "^1.4.5", + "@types/cors": "^2.8.12", + "@types/eccrypto": "^1.1.3", + "@types/jsonwebtoken": "^8.5.9", + "@types/lodash": "^4.14.182", + "@types/node": "^16.11.10", + "@types/node-fetch": "^2.6.3", + "@types/uuid": "^8.3.4", + "@types/websocket": "^1.0.6", + "nodemon": "^2.0.20", + "ts-node": "10.7.0", + "typescript": "4.5.2" + } + }, + "node_modules/@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "devOptional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "devOptional": true, + "dependencies": { + "@cspotcode/source-map-consumer": "0.8.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "optional": true + }, + "node_modules/@grpc/grpc-js": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", + "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", + "dependencies": { + "@grpc/proto-loader": "^0.7.0", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", + "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", + "dependencies": { + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^7.0.0", + "yargs": "^16.2.0" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@noble/curves": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.0.0.tgz", + "integrity": "sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "1.3.0" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz", + "integrity": "sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@protobuf-ts/grpc-transport": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-transport/-/grpc-transport-2.8.1.tgz", + "integrity": "sha512-SgXCskzPRPN/6Ns5ohuC64Qkwchb9I758n2/2RpnAy0Kr6E5kIqav5WGkNLCD08erl8wvjuLdyxZfig4sf1yvQ==", + "dependencies": { + "@protobuf-ts/runtime": "^2.8.1", + "@protobuf-ts/runtime-rpc": "^2.8.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.6.0" + } + }, + "node_modules/@protobuf-ts/plugin": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.8.1.tgz", + "integrity": "sha512-lacRdXJ9TkTbI28U0KApsnVqnxeq1aZftOdq6LNPQJaIzBrVRxrMkqnnGWGQFYe0Tr93OKeW4A2lLjTkn32CuA==", + "dependencies": { + "@protobuf-ts/plugin-framework": "^2.8.1", + "@protobuf-ts/protoc": "^2.8.1", + "@protobuf-ts/runtime": "^2.8.1", + "@protobuf-ts/runtime-rpc": "^2.8.1", + "typescript": "^3.9" + }, + "bin": { + "protoc-gen-dump": "bin/protoc-gen-dump", + "protoc-gen-ts": "bin/protoc-gen-ts" + } + }, + "node_modules/@protobuf-ts/plugin-framework": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.8.1.tgz", + "integrity": "sha512-hfLoYIyxCI6Ro6LY1BltNBDcXWL+36SwnWR/hcF4ttPHLE3rMIpYbz4IwQsfeU2SKbBeGFhZv9rcnDJB22cXog==", + "dependencies": { + "@protobuf-ts/runtime": "^2.8.1", + "typescript": "^3.9" + } + }, + "node_modules/@protobuf-ts/plugin-framework/node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/@protobuf-ts/plugin/node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/@protobuf-ts/protoc": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.8.1.tgz", + "integrity": "sha512-6fehuL9bS22zCgPBBlESZjnoA4fxAUkOjMcaFMJSlVpN6CDN2O+c/Mo1pCXaNDO7FAidMPj5yhz48Kws4kOXEA==", + "bin": { + "protoc": "protoc.js" + } + }, + "node_modules/@protobuf-ts/runtime": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.8.1.tgz", + "integrity": "sha512-D9M5hSumYCovIfNllt7N6ODh4q+LrjiMWtNETvooaf+a2XheZJ7kgjFlsFghti0CFWwtA//of4JXQfw9hU+cCw==" + }, + "node_modules/@protobuf-ts/runtime-rpc": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.8.1.tgz", + "integrity": "sha512-hc+HJpoAu50by8aBS55UygcrzD8jAvRKWZMCRJ9XY3h9Gl2tciYysfzSH1SWtF6XOT/4b5CKnnmdMR3ad7uU5g==", + "dependencies": { + "@protobuf-ts/runtime": "^2.8.1" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@scure/bip32": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.0.tgz", + "integrity": "sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/curves": "~1.0.0", + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/@scure/bip39": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.0.tgz", + "integrity": "sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/@sqltools/formatter": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", + "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" + }, + "node_modules/@stablelib/binary": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", + "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "dependencies": { + "@stablelib/int": "^1.0.1" + } + }, + "node_modules/@stablelib/chacha": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", + "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@stablelib/int": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", + "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + }, + "node_modules/@stablelib/wipe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", + "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + }, + "node_modules/@stablelib/xchacha20": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/xchacha20/-/xchacha20-1.0.1.tgz", + "integrity": "sha512-1YkiZnFF4veUwBVhDnDYwo6EHeKzQK4FnLiO7ezCl/zu64uG0bCCAUROJaBkaLH+5BEsO3W7BTXTguMbSLlWSw==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/chacha": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "devOptional": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "devOptional": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "devOptional": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "devOptional": true + }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "dev": true + }, + "node_modules/@types/chai-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.4.5.tgz", + "integrity": "sha512-IecXRMSnpUvRnTztdpSdjcmcW7EdNme65bfDCQMi7XrSEPGmyDYYTEfc5fcactWDA6ioSm8o7NUqg9QxjBCCEw==", + "dev": true, + "dependencies": { + "@types/chai": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", + "dev": true + }, + "node_modules/@types/eccrypto": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/eccrypto/-/eccrypto-1.1.3.tgz", + "integrity": "sha512-3O0qER6JMYReqVbcQTGmXeMHdw3O+rVps63tlo5g5zoB3altJS8yzSvboSivwVWeYO9o5jSATu7P0UIqYZPgow==", + "dev": true, + "dependencies": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, + "node_modules/@types/expect": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", + "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", + "dev": true + }, + "node_modules/@types/express": { + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "node_modules/@types/jsonwebtoken": { + "version": "8.5.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", + "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.14.189", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.189.tgz", + "integrity": "sha512-kb9/98N6X8gyME9Cf7YaqIMvYGnBSWqEci6tiettE6iJWH1XdJz/PO8LB0GtLCG7x8dU3KWhZT+lA1a35127tA==", + "dev": true + }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, + "node_modules/@types/mime": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", + "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" + }, + "node_modules/@types/node": { + "version": "16.18.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.3.tgz", + "integrity": "sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==" + }, + "node_modules/@types/node-fetch": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.3.tgz", + "integrity": "sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==", + "dev": true, + "dependencies": { + "@types/node": "*", + "form-data": "^3.0.0" + } + }, + "node_modules/@types/node-fetch/node_modules/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/object-hash": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", + "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" + }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, + "node_modules/@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", + "dependencies": { + "@types/mime": "*", + "@types/node": "*" + } + }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", + "dev": true + }, + "node_modules/@types/websocket": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.6.tgz", + "integrity": "sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@uphold/request-logger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@uphold/request-logger/-/request-logger-2.0.0.tgz", + "integrity": "sha512-UvGS+v87C7VTtQDcFHDLfvfl1zaZaLSwSmAnV35Ne7CzAVvotmZqt9lAIoNpMpaoRpdjVIcnUDwPSeIeA//EoQ==", + "dependencies": { + "uuid": "^3.0.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "request": ">=2.27.0" + } + }, + "node_modules/@uphold/request-logger/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "devOptional": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "optional": true, + "dependencies": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/agentkeepalive/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agentkeepalive/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "optional": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agentkeepalive/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/are-we-there-yet/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "devOptional": true + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "engines": { + "node": "*" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + }, + "node_modules/axios": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.0.tgz", + "integrity": "sha512-Tu7NYoGY4Yoc7I+Npf9HhUMtEEpV7ZiLH9yndTCoNhcpBH0kwcvFbzYN9/u5QKI5A6uefjsNNWaz5olJVYS62Q==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", + "optional": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bitcoin-core": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/bitcoin-core/-/bitcoin-core-4.2.0.tgz", + "integrity": "sha512-QFmer//rZhyuYm0mBOVAmMhIG/EFmXDahC3a1LvNTwM8/KszxUGEAjvAT4tzm1FaDj4c7pQWMG/vOWtoKjeR3Q==", + "dependencies": { + "@uphold/request-logger": "^2.0.0", + "debugnyan": "^1.0.0", + "json-bigint": "^1.0.0", + "lodash": "^4.0.0", + "request": "^2.53.0", + "semver": "^5.1.0", + "standard-error": "^1.1.0" + }, + "engines": { + "node": ">=7" + } + }, + "node_modules/bitcoin-core/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "optional": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "node_modules/buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "optional": true + }, + "node_modules/bufferutil": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", + "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/bunyan": { + "version": "1.8.15", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", + "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", + "engines": [ + "node >=0.10.0" + ], + "bin": { + "bunyan": "bin/bunyan" + }, + "optionalDependencies": { + "dtrace-provider": "~0.8", + "moment": "^2.19.3", + "mv": "~2", + "safe-json-stringify": "~1" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, + "node_modules/chai": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", + "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^4.1.2", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chai-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz", + "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==", + "peerDependencies": { + "chai": "^4.1.2" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "optional": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "dependencies": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + }, + "bin": { + "highlight": "bin/highlight" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "dependencies": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + }, + "bin": { + "copyfiles": "copyfiles", + "copyup": "copyfiles" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "optional": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "optional": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "devOptional": true + }, + "node_modules/csv": { + "version": "6.3.8", + "resolved": "https://registry.npmjs.org/csv/-/csv-6.3.8.tgz", + "integrity": "sha512-gRh3yiT9bHBA5ka2yOpyFqAVu/ZpwWzajMUR/es0ljevAE88WyHBuMUy7jzd2o5j6LYQesEO/AyhbQ9BhbDXUA==", + "dependencies": { + "csv-generate": "^4.4.0", + "csv-parse": "^5.5.5", + "csv-stringify": "^6.4.6", + "stream-transform": "^3.3.1" + }, + "engines": { + "node": ">= 0.1.90" + } + }, + "node_modules/csv-generate": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-4.4.0.tgz", + "integrity": "sha512-geM01acNPZ0wr4/9sKev5fCzFG/tsc/NbuFWrhLc47M1zQyUdEJH65+cxTLIVafEwhBjIYwQ7fdOL9roBqVltQ==" + }, + "node_modules/csv-parse": { + "version": "5.5.5", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-5.5.5.tgz", + "integrity": "sha512-erCk7tyU3yLWAhk6wvKxnyPtftuy/6Ak622gOO7BCJ05+TYffnPCJF905wmOQm+BpkX54OdAl8pveJwUdpnCXQ==" + }, + "node_modules/csv-stringify": { + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-6.4.6.tgz", + "integrity": "sha512-h2V2XZ3uOTLilF5dPIptgUfN/o2ia/80Ie0Lly18LAnw5s8Eb7kt8rfxSUy24AztJZas9f6DPZpVlzDUtFt/ag==" + }, + "node_modules/d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dependencies": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/dataloader": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", + "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/debugnyan": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/debugnyan/-/debugnyan-1.0.0.tgz", + "integrity": "sha512-dTvKxcLZCammDLFYi31NRVr5g6vjJ33uf1wcdbIPPxPxxnJ9/xj00Mh/YQkhFMw/VGavaG5KpjSC+4o9r/JjRg==", + "dependencies": { + "bunyan": "^1.8.1", + "debug": "^2.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/deep-eql": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.2.tgz", + "integrity": "sha512-gT18+YW4CcW/DBNTwAmqTtkJh7f9qqScu2qFVlx7kCoeY9tlBu9cUcr7+I+Z/noG8INehS3xQgLpTtd/QUTn4w==", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "devOptional": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/dprint-node": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.7.tgz", + "integrity": "sha512-NTZOW9A7ipb0n7z7nC3wftvsbceircwVHSgzobJsEQa+7RnOMbhrfX5IflA6CtC4GA63DSAiHYXa4JKEy9F7cA==", + "dependencies": { + "detect-libc": "^1.0.3" + } + }, + "node_modules/dprint-node/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", + "optional": true, + "dependencies": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/dtrace-provider": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", + "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "nan": "^2.14.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/eccrypto": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/eccrypto/-/eccrypto-1.1.6.tgz", + "integrity": "sha512-d78ivVEzu7Tn0ZphUUaL43+jVPKTMPFGtmgtz1D0LrFn7cY3K8CdrvibuLz2AAkHBLKZtR8DMbB2ukRYFk987A==", + "hasInstallScript": true, + "dependencies": { + "acorn": "7.1.1", + "elliptic": "6.5.4", + "es6-promise": "4.2.8", + "nan": "2.14.0" + }, + "optionalDependencies": { + "secp256k1": "3.7.1" + } + }, + "node_modules/eccrypto/node_modules/secp256k1": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", + "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.4.1", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "optional": true + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es5-ext": { + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", + "hasInstallScript": true, + "dependencies": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", + "next-tick": "^1.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "node_modules/es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "dependencies": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esniff/node_modules/type": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "dependencies": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "optional": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/ext": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "dependencies": { + "type": "^2.7.2" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", + "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "optional": true + }, + "node_modules/grpc-tools": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.11.3.tgz", + "integrity": "sha512-cRSK2uhDKHtZ9hLRM35HxaMAMxyh/L7C96Ojt58DhQBdwTOQlV1VIJHSK6X/pDeSQKhaQqWMFfebt8tIcvRfjQ==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.5" + }, + "bin": { + "grpc_tools_node_protoc": "bin/protoc.js", + "grpc_tools_node_protoc_plugin": "bin/protoc_plugin.js" + } + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash-base/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/hash-base/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "optional": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "engines": { + "node": "*" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "optional": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "optional": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "optional": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", + "optional": true + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "optional": true + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + }, + "node_modules/jsonwebtoken": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", + "dependencies": { + "jws": "^3.2.2", + "lodash": "^4.17.21", + "ms": "^2.1.1", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "node_modules/loupe": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "dependencies": { + "get-func-name": "^2.0.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "devOptional": true + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "optional": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", + "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/mv": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", + "integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==", + "optional": true, + "dependencies": { + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "rimraf": "~2.4.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/mv/node_modules/glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==", + "optional": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mv/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "optional": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mv/node_modules/rimraf": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==", + "optional": true, + "dependencies": { + "glob": "^6.0.1" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, + "node_modules/ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", + "optional": true, + "bin": { + "ncp": "bin/ncp" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-gyp-build": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-gyp/node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/node-gyp/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/node-gyp/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "optional": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/nodemon": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/nodemon/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nostr-tools": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-1.9.0.tgz", + "integrity": "sha512-ZvFf1uiBqWLWhLBHD2nY0KsdSdNWKb3PrQUmYMWxSzfT4k48cDrDJu2qgULkOhQbFX7oty8IpaKnLvixhqefqA==", + "dependencies": { + "@noble/curves": "1.0.0", + "@noble/hashes": "1.3.0", + "@scure/base": "1.1.1", + "@scure/bip32": "1.3.0", + "@scure/bip39": "1.2.0" + } + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", + "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, + "node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "dependencies": { + "parse5": "^6.0.1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "engines": { + "node": "*" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" + }, + "node_modules/pg": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", + "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", + "dependencies": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.5.0", + "pg-pool": "^3.5.2", + "pg-protocol": "^1.5.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + }, + "engines": { + "node": ">= 8.0.0" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-connection-string": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", + "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-pool": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", + "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", + "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "dependencies": { + "split2": "^4.1.0" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/protobufjs": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz", + "integrity": "sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/protobufjs/node_modules/long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" + }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "optional": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz", + "integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-json-stringify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", + "optional": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "hasInstallScript": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", + "dev": true, + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "optional": true, + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + }, + "node_modules/split2": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", + "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/sqlite3": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.5.tgz", + "integrity": "sha512-7sP16i4wI+yKnGOO2q2ijze7EjQ9US+Vw7DYYwxfFtqNZDGgBcEw0oeDaDvUTq66uJOzVd/z6MkIg+c9erSJKg==", + "hasInstallScript": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "node-addon-api": "^4.2.0", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/sqlite3/node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + }, + "node_modules/sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/standard-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/standard-error/-/standard-error-1.1.0.tgz", + "integrity": "sha512-4v7qzU7oLJfMI5EltUSHCaaOd65J6S4BqKRWgzMi4EYaE5fvNabPxmAPGdxpGXqrcWjhDGI/H09CIdEuUOUeXg==" + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-transform": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-3.3.1.tgz", + "integrity": "sha512-BL8pv9QL8Ikd11oZwlRDp1qYMhGR0i50zI9ltoijKGc4ubQWal/Rc4p6SYJp1TBOGpE0uAGchwbxOZ1ycwTuqQ==" + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "6.1.12", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", + "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/touch/node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/ts-node": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "devOptional": true, + "dependencies": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "devOptional": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ts-poet": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.1.0.tgz", + "integrity": "sha512-PFwbNJjGrb44wzHUGQicG2/nhjR+3+k7zYLDTa8D61NVUitl7K/JgIc9/P+8oMNenntKzLc8tjLDOkPrxIhm6A==", + "dependencies": { + "dprint-node": "^1.0.7" + } + }, + "node_modules/ts-proto": { + "version": "1.131.2", + "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.131.2.tgz", + "integrity": "sha512-SFQMXoNrZ/Ybcc2wwS/s0Lser/aVRr6HMN1LLHIvsbx3aK1eM02CLmWbic+DblGyoua8ZzuonbnCWBhcjwPTFA==", + "dependencies": { + "@types/object-hash": "^1.3.0", + "dataloader": "^1.4.0", + "object-hash": "^1.3.1", + "protobufjs": "^6.11.3", + "ts-poet": "^6.1.0", + "ts-proto-descriptors": "1.7.1" + }, + "bin": { + "protoc-gen-ts_proto": "protoc-gen-ts_proto" + } + }, + "node_modules/ts-proto-descriptors": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz", + "integrity": "sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw==", + "dependencies": { + "long": "^4.0.0", + "protobufjs": "^6.8.8" + } + }, + "node_modules/ts-proto-descriptors/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/ts-proto/node_modules/protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + }, + "node_modules/tstl": { + "version": "2.5.13", + "resolved": "https://registry.npmjs.org/tstl/-/tstl-2.5.13.tgz", + "integrity": "sha512-h9wayHHFI5+yqt8iau0vqH96cTNhezhZ/Fk/hrIdpfkiMu3lg9nzyvMfs5bIdX51IVzZO6DudLqhkL/rVXpT6g==" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" + }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/typeorm": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.15.tgz", + "integrity": "sha512-R4JSw8QjDP1W+ypeRz/XrCXIqubrLSnNAzJAp9EQSQIPHTv+YmUHZis8g08lOwFpuhqL9m8jkPSz8GWEKlU/ow==", + "dependencies": { + "@sqltools/formatter": "^1.2.5", + "app-root-path": "^3.1.0", + "buffer": "^6.0.3", + "chalk": "^4.1.2", + "cli-highlight": "^2.1.11", + "debug": "^4.3.4", + "dotenv": "^16.0.3", + "glob": "^8.1.0", + "mkdirp": "^2.1.3", + "reflect-metadata": "^0.1.13", + "sha.js": "^2.4.11", + "tslib": "^2.5.0", + "uuid": "^9.0.0", + "yargs": "^17.6.2" + }, + "bin": { + "typeorm": "cli.js", + "typeorm-ts-node-commonjs": "cli-ts-node-commonjs.js", + "typeorm-ts-node-esm": "cli-ts-node-esm.js" + }, + "engines": { + "node": ">= 12.9.0" + }, + "funding": { + "url": "https://opencollective.com/typeorm" + }, + "peerDependencies": { + "@google-cloud/spanner": "^5.18.0", + "@sap/hana-client": "^2.12.25", + "better-sqlite3": "^7.1.2 || ^8.0.0", + "hdb-pool": "^0.1.6", + "ioredis": "^5.0.4", + "mongodb": "^5.2.0", + "mssql": "^9.1.1", + "mysql2": "^2.2.5 || ^3.0.1", + "oracledb": "^5.1.0", + "pg": "^8.5.1", + "pg-native": "^3.0.0", + "pg-query-stream": "^4.0.0", + "redis": "^3.1.1 || ^4.0.0", + "sql.js": "^1.4.0", + "sqlite3": "^5.0.3", + "ts-node": "^10.7.0", + "typeorm-aurora-data-api-driver": "^2.0.0" + }, + "peerDependenciesMeta": { + "@google-cloud/spanner": { + "optional": true + }, + "@sap/hana-client": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "hdb-pool": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "mongodb": { + "optional": true + }, + "mssql": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-native": { + "optional": true + }, + "pg-query-stream": { + "optional": true + }, + "redis": { + "optional": true + }, + "sql.js": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "ts-node": { + "optional": true + }, + "typeorm-aurora-data-api-driver": { + "optional": true + } + } + }, + "node_modules/typeorm/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/typeorm/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/typeorm/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/typeorm/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typeorm/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/typeorm/node_modules/mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typeorm/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/typeorm/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/typeorm/node_modules/yargs": { + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/typeorm/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "devOptional": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "devOptional": true + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/verror/node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/websocket": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "dependencies": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/websocket-polyfill": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/websocket-polyfill/-/websocket-polyfill-0.0.3.tgz", + "integrity": "sha512-pF3kR8Uaoau78MpUmFfzbIRxXj9PeQrCuPepGE6JIsfsJ/o/iXr07Q2iQNzKSSblQJ0FiGWlS64N4pVSm+O3Dg==", + "dependencies": { + "tstl": "^2.0.7", + "websocket": "^1.0.28" + } + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", + "engines": { + "node": ">=0.10.32" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "devOptional": true, + "engines": { + "node": ">=6" + } + } + }, + "dependencies": { + "@cspotcode/source-map-consumer": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", + "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", + "devOptional": true + }, + "@cspotcode/source-map-support": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", + "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "devOptional": true, + "requires": { + "@cspotcode/source-map-consumer": "0.8.0" + } + }, + "@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "optional": true + }, + "@grpc/grpc-js": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", + "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", + "requires": { + "@grpc/proto-loader": "^0.7.0", + "@types/node": ">=12.12.47" + } + }, + "@grpc/proto-loader": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", + "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", + "requires": { + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^7.0.0", + "yargs": "^16.2.0" + } + }, + "@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + } + }, + "@noble/curves": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.0.0.tgz", + "integrity": "sha512-2upgEu0iLiDVDZkNLeFV2+ht0BAVgQnEmCk6JsOch9Rp8xfkMCbvbAZlA2pBHQc73dbl+vFOXfqkf4uemdn0bw==", + "requires": { + "@noble/hashes": "1.3.0" + } + }, + "@noble/hashes": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.0.tgz", + "integrity": "sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==" + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "optional": true, + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "optional": true, + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + } + }, + "@protobuf-ts/grpc-transport": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-transport/-/grpc-transport-2.8.1.tgz", + "integrity": "sha512-SgXCskzPRPN/6Ns5ohuC64Qkwchb9I758n2/2RpnAy0Kr6E5kIqav5WGkNLCD08erl8wvjuLdyxZfig4sf1yvQ==", + "requires": { + "@protobuf-ts/runtime": "^2.8.1", + "@protobuf-ts/runtime-rpc": "^2.8.1" + } + }, + "@protobuf-ts/plugin": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.8.1.tgz", + "integrity": "sha512-lacRdXJ9TkTbI28U0KApsnVqnxeq1aZftOdq6LNPQJaIzBrVRxrMkqnnGWGQFYe0Tr93OKeW4A2lLjTkn32CuA==", + "requires": { + "@protobuf-ts/plugin-framework": "^2.8.1", + "@protobuf-ts/protoc": "^2.8.1", + "@protobuf-ts/runtime": "^2.8.1", + "@protobuf-ts/runtime-rpc": "^2.8.1", + "typescript": "^3.9" + }, + "dependencies": { + "typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" + } + } + }, + "@protobuf-ts/plugin-framework": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.8.1.tgz", + "integrity": "sha512-hfLoYIyxCI6Ro6LY1BltNBDcXWL+36SwnWR/hcF4ttPHLE3rMIpYbz4IwQsfeU2SKbBeGFhZv9rcnDJB22cXog==", + "requires": { + "@protobuf-ts/runtime": "^2.8.1", + "typescript": "^3.9" + }, + "dependencies": { + "typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" + } + } + }, + "@protobuf-ts/protoc": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.8.1.tgz", + "integrity": "sha512-6fehuL9bS22zCgPBBlESZjnoA4fxAUkOjMcaFMJSlVpN6CDN2O+c/Mo1pCXaNDO7FAidMPj5yhz48Kws4kOXEA==" + }, + "@protobuf-ts/runtime": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.8.1.tgz", + "integrity": "sha512-D9M5hSumYCovIfNllt7N6ODh4q+LrjiMWtNETvooaf+a2XheZJ7kgjFlsFghti0CFWwtA//of4JXQfw9hU+cCw==" + }, + "@protobuf-ts/runtime-rpc": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.8.1.tgz", + "integrity": "sha512-hc+HJpoAu50by8aBS55UygcrzD8jAvRKWZMCRJ9XY3h9Gl2tciYysfzSH1SWtF6XOT/4b5CKnnmdMR3ad7uU5g==", + "requires": { + "@protobuf-ts/runtime": "^2.8.1" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==" + }, + "@scure/bip32": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.0.tgz", + "integrity": "sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==", + "requires": { + "@noble/curves": "~1.0.0", + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + } + }, + "@scure/bip39": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.0.tgz", + "integrity": "sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==", + "requires": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + } + }, + "@sqltools/formatter": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", + "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" + }, + "@stablelib/binary": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/binary/-/binary-1.0.1.tgz", + "integrity": "sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==", + "requires": { + "@stablelib/int": "^1.0.1" + } + }, + "@stablelib/chacha": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/chacha/-/chacha-1.0.1.tgz", + "integrity": "sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==", + "requires": { + "@stablelib/binary": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "@stablelib/int": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/int/-/int-1.0.1.tgz", + "integrity": "sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==" + }, + "@stablelib/wipe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/wipe/-/wipe-1.0.1.tgz", + "integrity": "sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==" + }, + "@stablelib/xchacha20": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/xchacha20/-/xchacha20-1.0.1.tgz", + "integrity": "sha512-1YkiZnFF4veUwBVhDnDYwo6EHeKzQK4FnLiO7ezCl/zu64uG0bCCAUROJaBkaLH+5BEsO3W7BTXTguMbSLlWSw==", + "requires": { + "@stablelib/binary": "^1.0.1", + "@stablelib/chacha": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "optional": true + }, + "@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "devOptional": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "devOptional": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "devOptional": true + }, + "@tsconfig/node16": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "devOptional": true + }, + "@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "dev": true + }, + "@types/chai-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/@types/chai-string/-/chai-string-1.4.5.tgz", + "integrity": "sha512-IecXRMSnpUvRnTztdpSdjcmcW7EdNme65bfDCQMi7XrSEPGmyDYYTEfc5fcactWDA6ioSm8o7NUqg9QxjBCCEw==", + "dev": true, + "requires": { + "@types/chai": "*" + } + }, + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", + "dev": true + }, + "@types/eccrypto": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/eccrypto/-/eccrypto-1.1.3.tgz", + "integrity": "sha512-3O0qER6JMYReqVbcQTGmXeMHdw3O+rVps63tlo5g5zoB3altJS8yzSvboSivwVWeYO9o5jSATu7P0UIqYZPgow==", + "dev": true, + "requires": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, + "@types/expect": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", + "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", + "dev": true + }, + "@types/express": { + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, + "@types/jsonwebtoken": { + "version": "8.5.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", + "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/lodash": { + "version": "4.14.189", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.189.tgz", + "integrity": "sha512-kb9/98N6X8gyME9Cf7YaqIMvYGnBSWqEci6tiettE6iJWH1XdJz/PO8LB0GtLCG7x8dU3KWhZT+lA1a35127tA==", + "dev": true + }, + "@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, + "@types/mime": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", + "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" + }, + "@types/node": { + "version": "16.18.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.3.tgz", + "integrity": "sha512-jh6m0QUhIRcZpNv7Z/rpN+ZWXOicUUQbSoWks7Htkbb9IjFQj4kzcX/xFCkjstCj5flMsN8FiSvt+q+Tcs4Llg==" + }, + "@types/node-fetch": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.3.tgz", + "integrity": "sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w==", + "dev": true, + "requires": { + "@types/node": "*", + "form-data": "^3.0.0" + }, + "dependencies": { + "form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, + "@types/object-hash": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/object-hash/-/object-hash-1.3.4.tgz", + "integrity": "sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA==" + }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, + "@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "requires": { + "@types/node": "*" + } + }, + "@types/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==", + "requires": { + "@types/mime": "*", + "@types/node": "*" + } + }, + "@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", + "dev": true + }, + "@types/websocket": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.6.tgz", + "integrity": "sha512-JXkliwz93B2cMWOI1ukElQBPN88vMg3CruvW4KVSKpflt3NyNCJImnhIuB/f97rG7kakqRJGFiwkA895Kn02Dg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@uphold/request-logger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@uphold/request-logger/-/request-logger-2.0.0.tgz", + "integrity": "sha512-UvGS+v87C7VTtQDcFHDLfvfl1zaZaLSwSmAnV35Ne7CzAVvotmZqt9lAIoNpMpaoRpdjVIcnUDwPSeIeA//EoQ==", + "requires": { + "uuid": "^3.0.1" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "requires": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + } + }, + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==" + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "devOptional": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "optional": true, + "requires": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "requires": { + "ms": "2.1.2" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "optional": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + } + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "optional": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==" + }, + "aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" + }, + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + } + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "devOptional": true + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==" + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==" + }, + "aws4": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", + "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" + }, + "axios": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.0.tgz", + "integrity": "sha512-Tu7NYoGY4Yoc7I+Npf9HhUMtEEpV7ZiLH9yndTCoNhcpBH0kwcvFbzYN9/u5QKI5A6uefjsNNWaz5olJVYS62Q==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bip66": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "bitcoin-core": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/bitcoin-core/-/bitcoin-core-4.2.0.tgz", + "integrity": "sha512-QFmer//rZhyuYm0mBOVAmMhIG/EFmXDahC3a1LvNTwM8/KszxUGEAjvAT4tzm1FaDj4c7pQWMG/vOWtoKjeR3Q==", + "requires": { + "@uphold/request-logger": "^2.0.0", + "debugnyan": "^1.0.0", + "json-bigint": "^1.0.0", + "lodash": "^4.0.0", + "request": "^2.53.0", + "semver": "^5.1.0", + "standard-error": "^1.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + } + } + }, + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, + "body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "optional": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "optional": true + }, + "bufferutil": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", + "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", + "requires": { + "node-gyp-build": "^4.3.0" + } + }, + "bunyan": { + "version": "1.8.15", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", + "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", + "requires": { + "dtrace-provider": "~0.8", + "moment": "^2.19.3", + "mv": "~2", + "safe-json-stringify": "~1" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "optional": true, + "requires": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, + "chai": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", + "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^4.1.2", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chai-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/chai-string/-/chai-string-1.5.0.tgz", + "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==", + "requires": {} + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==" + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "optional": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "optional": true + }, + "cli-highlight": { + "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "requires": { + "chalk": "^4.0.0", + "highlight.js": "^10.7.1", + "mz": "^2.4.0", + "parse5": "^5.1.1", + "parse5-htmlparser2-tree-adapter": "^6.0.0", + "yargs": "^16.0.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" + }, + "content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" + }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "requires": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + } + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "optional": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "optional": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "devOptional": true + }, + "csv": { + "version": "6.3.8", + "resolved": "https://registry.npmjs.org/csv/-/csv-6.3.8.tgz", + "integrity": "sha512-gRh3yiT9bHBA5ka2yOpyFqAVu/ZpwWzajMUR/es0ljevAE88WyHBuMUy7jzd2o5j6LYQesEO/AyhbQ9BhbDXUA==", + "requires": { + "csv-generate": "^4.4.0", + "csv-parse": "^5.5.5", + "csv-stringify": "^6.4.6", + "stream-transform": "^3.3.1" + } + }, + "csv-generate": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/csv-generate/-/csv-generate-4.4.0.tgz", + "integrity": "sha512-geM01acNPZ0wr4/9sKev5fCzFG/tsc/NbuFWrhLc47M1zQyUdEJH65+cxTLIVafEwhBjIYwQ7fdOL9roBqVltQ==" + }, + "csv-parse": { + "version": "5.5.5", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-5.5.5.tgz", + "integrity": "sha512-erCk7tyU3yLWAhk6wvKxnyPtftuy/6Ak622gOO7BCJ05+TYffnPCJF905wmOQm+BpkX54OdAl8pveJwUdpnCXQ==" + }, + "csv-stringify": { + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-6.4.6.tgz", + "integrity": "sha512-h2V2XZ3uOTLilF5dPIptgUfN/o2ia/80Ie0Lly18LAnw5s8Eb7kt8rfxSUy24AztJZas9f6DPZpVlzDUtFt/ag==" + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "dataloader": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", + "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "debugnyan": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/debugnyan/-/debugnyan-1.0.0.tgz", + "integrity": "sha512-dTvKxcLZCammDLFYi31NRVr5g6vjJ33uf1wcdbIPPxPxxnJ9/xj00Mh/YQkhFMw/VGavaG5KpjSC+4o9r/JjRg==", + "requires": { + "bunyan": "^1.8.1", + "debug": "^2.2.0" + } + }, + "deep-eql": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.2.tgz", + "integrity": "sha512-gT18+YW4CcW/DBNTwAmqTtkJh7f9qqScu2qFVlx7kCoeY9tlBu9cUcr7+I+Z/noG8INehS3xQgLpTtd/QUTn4w==", + "requires": { + "type-detect": "^4.0.0" + } + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + }, + "detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==" + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "devOptional": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "requires": { + "path-type": "^4.0.0" + } + }, + "dotenv": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" + }, + "dprint-node": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/dprint-node/-/dprint-node-1.0.7.tgz", + "integrity": "sha512-NTZOW9A7ipb0n7z7nC3wftvsbceircwVHSgzobJsEQa+7RnOMbhrfX5IflA6CtC4GA63DSAiHYXa4JKEy9F7cA==", + "requires": { + "detect-libc": "^1.0.3" + }, + "dependencies": { + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==" + } + } + }, + "drbg.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", + "optional": true, + "requires": { + "browserify-aes": "^1.0.6", + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4" + } + }, + "dtrace-provider": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", + "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", + "optional": true, + "requires": { + "nan": "^2.14.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "eccrypto": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/eccrypto/-/eccrypto-1.1.6.tgz", + "integrity": "sha512-d78ivVEzu7Tn0ZphUUaL43+jVPKTMPFGtmgtz1D0LrFn7cY3K8CdrvibuLz2AAkHBLKZtR8DMbB2ukRYFk987A==", + "requires": { + "acorn": "7.1.1", + "elliptic": "6.5.4", + "es6-promise": "4.2.8", + "nan": "2.14.0", + "secp256k1": "3.7.1" + }, + "dependencies": { + "secp256k1": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", + "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", + "optional": true, + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.4.1", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + } + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "requires": { + "iconv-lite": "^0.6.2" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": true + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "optional": true + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "es5-ext": { + "version": "0.10.64", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", + "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", + "requires": { + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.3", + "esniff": "^2.0.1", + "next-tick": "^1.1.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "esniff": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", + "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", + "requires": { + "d": "^1.0.1", + "es5-ext": "^0.10.62", + "event-emitter": "^0.3.5", + "type": "^2.7.2" + }, + "dependencies": { + "type": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" + } + } + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "optional": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "requires": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "ext": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "requires": { + "type": "^2.7.2" + }, + "dependencies": { + "type": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "requires": { + "reusify": "^1.0.4" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + } + }, + "follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==" + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "requires": { + "minipass": "^3.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==" + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "globby": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", + "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==", + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "optional": true + }, + "grpc-tools": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/grpc-tools/-/grpc-tools-1.11.3.tgz", + "integrity": "sha512-cRSK2uhDKHtZ9hLRM35HxaMAMxyh/L7C96Ojt58DhQBdwTOQlV1VIJHSK6X/pDeSQKhaQqWMFfebt8tIcvRfjQ==", + "requires": { + "@mapbox/node-pre-gyp": "^1.0.5" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==" + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "optional": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "optional": true, + "requires": { + "safe-buffer": "~5.2.0" + } + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, + "highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "optional": true + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "optional": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "optional": true, + "requires": { + "ms": "^2.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "optional": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "optional": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "optional": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz", + "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==", + "optional": true + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "optional": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" + }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + } + }, + "json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" + }, + "jsonwebtoken": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", + "requires": { + "jws": "^3.2.2", + "lodash": "^4.17.21", + "ms": "^2.1.1", + "semver": "^7.3.8" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "loupe": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", + "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "requires": { + "get-func-name": "^2.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" + } + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "devOptional": true + }, + "make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "optional": true, + "requires": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "optional": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "optional": true + }, + "minipass": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", + "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "optional": true, + "requires": { + "encoding": "^0.1.12", + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "optional": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" + }, + "moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "optional": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "mv": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", + "integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==", + "optional": true, + "requires": { + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "rimraf": "~2.4.0" + }, + "dependencies": { + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==", + "optional": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "optional": true, + "requires": { + "minimist": "^1.2.6" + } + }, + "rimraf": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==", + "optional": true, + "requires": { + "glob": "^6.0.1" + } + } + } + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, + "ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", + "optional": true + }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + }, + "next-tick": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "optional": true, + "requires": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "dependencies": { + "are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + }, + "gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "optional": true, + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + } + }, + "npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "optional": true, + "requires": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "optional": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "optional": true, + "requires": { + "safe-buffer": "~5.2.0" + } + } + } + }, + "node-gyp-build": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" + }, + "nodemon": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", + "dev": true, + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "requires": { + "abbrev": "1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "nostr-tools": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-1.9.0.tgz", + "integrity": "sha512-ZvFf1uiBqWLWhLBHD2nY0KsdSdNWKb3PrQUmYMWxSzfT4k48cDrDJu2qgULkOhQbFX7oty8IpaKnLvixhqefqA==", + "requires": { + "@noble/curves": "1.0.0", + "@noble/hashes": "1.3.0", + "@scure/base": "1.1.1", + "@scure/bip32": "1.3.0", + "@scure/bip39": "1.2.0" + } + }, + "npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "requires": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" + }, + "object-hash": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", + "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==" + }, + "object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "optional": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + }, + "parse5-htmlparser2-tree-adapter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "requires": { + "parse5": "^6.0.1" + }, + "dependencies": { + "parse5": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + } + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" + }, + "pg": { + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.8.0.tgz", + "integrity": "sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==", + "requires": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.5.0", + "pg-pool": "^3.5.2", + "pg-protocol": "^1.5.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + } + }, + "pg-connection-string": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.5.0.tgz", + "integrity": "sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==" + }, + "pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==" + }, + "pg-pool": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.5.2.tgz", + "integrity": "sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==", + "requires": {} + }, + "pg-protocol": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.5.0.tgz", + "integrity": "sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==" + }, + "pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "requires": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + } + }, + "pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "requires": { + "split2": "^4.1.0" + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==" + }, + "postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==" + }, + "postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==" + }, + "postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "requires": { + "xtend": "^4.0.0" + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": true + }, + "promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "optional": true, + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, + "protobufjs": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.2.4.tgz", + "integrity": "sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "dependencies": { + "long": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz", + "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A==" + } + } + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" + }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" + }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "optional": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "optional": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "rxjs": { + "version": "7.5.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz", + "integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==", + "requires": { + "tslib": "^2.1.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safe-json-stringify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "requires": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "requires": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", + "dev": true, + "requires": { + "semver": "~7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==" + }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "optional": true + }, + "socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "optional": true, + "requires": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + } + }, + "socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "optional": true, + "requires": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "optional": true + } + } + }, + "split2": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", + "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" + }, + "sqlite3": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.5.tgz", + "integrity": "sha512-7sP16i4wI+yKnGOO2q2ijze7EjQ9US+Vw7DYYwxfFtqNZDGgBcEw0oeDaDvUTq66uJOzVd/z6MkIg+c9erSJKg==", + "requires": { + "@mapbox/node-pre-gyp": "^1.0.0", + "node-addon-api": "^4.2.0", + "node-gyp": "8.x", + "tar": "^6.1.11" + }, + "dependencies": { + "node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + } + } + }, + "sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "optional": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "standard-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/standard-error/-/standard-error-1.1.0.tgz", + "integrity": "sha512-4v7qzU7oLJfMI5EltUSHCaaOd65J6S4BqKRWgzMi4EYaE5fvNabPxmAPGdxpGXqrcWjhDGI/H09CIdEuUOUeXg==" + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + }, + "stream-transform": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/stream-transform/-/stream-transform-3.3.1.tgz", + "integrity": "sha512-BL8pv9QL8Ikd11oZwlRDp1qYMhGR0i50zI9ltoijKGc4ubQWal/Rc4p6SYJp1TBOGpE0uAGchwbxOZ1ycwTuqQ==" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "tar": { + "version": "6.1.12", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.12.tgz", + "integrity": "sha512-jU4TdemS31uABHd+Lt5WEYJuzn+TJTCBLljvIAHZOz6M9Os5pJ4dD+vRFLxPa/n3T0iEFzpi+0x1UfuDZYbRMw==", + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + } + }, + "thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "requires": { + "any-promise": "^1.0.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "requires": { + "thenify": ">= 3.1.0 < 4" + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "requires": { + "nopt": "~1.0.10" + }, + "dependencies": { + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "requires": { + "abbrev": "1" + } + } + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "ts-node": { + "version": "10.7.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", + "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "devOptional": true, + "requires": { + "@cspotcode/source-map-support": "0.7.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", + "yn": "3.1.1" + }, + "dependencies": { + "acorn": { + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "devOptional": true + } + } + }, + "ts-poet": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-6.1.0.tgz", + "integrity": "sha512-PFwbNJjGrb44wzHUGQicG2/nhjR+3+k7zYLDTa8D61NVUitl7K/JgIc9/P+8oMNenntKzLc8tjLDOkPrxIhm6A==", + "requires": { + "dprint-node": "^1.0.7" + } + }, + "ts-proto": { + "version": "1.131.2", + "resolved": "https://registry.npmjs.org/ts-proto/-/ts-proto-1.131.2.tgz", + "integrity": "sha512-SFQMXoNrZ/Ybcc2wwS/s0Lser/aVRr6HMN1LLHIvsbx3aK1eM02CLmWbic+DblGyoua8ZzuonbnCWBhcjwPTFA==", + "requires": { + "@types/object-hash": "^1.3.0", + "dataloader": "^1.4.0", + "object-hash": "^1.3.1", + "protobufjs": "^6.11.3", + "ts-poet": "^6.1.0", + "ts-proto-descriptors": "1.7.1" + }, + "dependencies": { + "protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + } + } + } + }, + "ts-proto-descriptors": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz", + "integrity": "sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw==", + "requires": { + "long": "^4.0.0", + "protobufjs": "^6.8.8" + }, + "dependencies": { + "protobufjs": { + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + } + } + } + }, + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + }, + "tstl": { + "version": "2.5.13", + "resolved": "https://registry.npmjs.org/tstl/-/tstl-2.5.13.tgz", + "integrity": "sha512-h9wayHHFI5+yqt8iau0vqH96cTNhezhZ/Fk/hrIdpfkiMu3lg9nzyvMfs5bIdX51IVzZO6DudLqhkL/rVXpT6g==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typeorm": { + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.15.tgz", + "integrity": "sha512-R4JSw8QjDP1W+ypeRz/XrCXIqubrLSnNAzJAp9EQSQIPHTv+YmUHZis8g08lOwFpuhqL9m8jkPSz8GWEKlU/ow==", + "requires": { + "@sqltools/formatter": "^1.2.5", + "app-root-path": "^3.1.0", + "buffer": "^6.0.3", + "chalk": "^4.1.2", + "cli-highlight": "^2.1.11", + "debug": "^4.3.4", + "dotenv": "^16.0.3", + "glob": "^8.1.0", + "mkdirp": "^2.1.3", + "reflect-metadata": "^0.1.13", + "sha.js": "^2.4.11", + "tslib": "^2.5.0", + "uuid": "^9.0.0", + "yargs": "^17.6.2" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + }, + "yargs": { + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" + } + } + }, + "typescript": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.2.tgz", + "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", + "devOptional": true + }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "optional": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "optional": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + }, + "untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "utf-8-validate": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "requires": { + "node-gyp-build": "^4.3.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "devOptional": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "dependencies": { + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" + } + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "websocket": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "requires": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + } + }, + "websocket-polyfill": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/websocket-polyfill/-/websocket-polyfill-0.0.3.tgz", + "integrity": "sha512-pF3kR8Uaoau78MpUmFfzbIRxXj9PeQrCuPepGE6JIsfsJ/o/iXr07Q2iQNzKSSblQJ0FiGWlS64N4pVSm+O3Dg==", + "requires": { + "tstl": "^2.0.7", + "websocket": "^1.0.28" + } + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "optional": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "requires": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==" + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "devOptional": true + } + } +} diff --git a/package.json b/package.json index efc6e5e8..9887bf9d 100644 --- a/package.json +++ b/package.json @@ -1,81 +1,81 @@ -{ - "name": "lightning.pub", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "clean": "rimraf build", - "test": "npm run clean && tsc && node build/src/tests/testRunner.js", - "start": "npm run clean && tsc && node build/src/index.js", - "start:ci": "git reset --hard && git pull && npm run start", - "build_autogenerated": "cd proto && rimraf autogenerated && protoc -I ./service --pub_out=. service/*", - "build_lnd_client_1": "cd proto && protoc -I ./others --plugin=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_out=./lnd --ts_proto_opt=esModuleInterop=true others/* ", - "build_lnd_client": "cd proto && rimraf lnd/* && npx protoc --ts_out ./lnd --ts_opt long_type_string --proto_path others others/* ", - "typeorm": "typeorm-ts-node-commonjs" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/shocknet/Lightning.Pub.git" - }, - "author": "", - "type": "module", - "license": "ISC", - "bugs": { - "url": "https://github.com/shocknet/Lightning.Pub/issues" - }, - "homepage": "https://github.com/shocknet/Lightning.Pub#readme", - "dependencies": { - "@grpc/grpc-js": "^1.6.7", - "@protobuf-ts/grpc-transport": "^2.5.0", - "@protobuf-ts/plugin": "^2.5.0", - "@protobuf-ts/runtime": "^2.5.0", - "@stablelib/xchacha20": "^1.0.1", - "@types/express": "^4.17.13", - "@types/node": "^17.0.31", - "@types/secp256k1": "^4.0.3", - "axios": "^0.28.0", - "bech32": "^2.0.0", - "bitcoin-core": "^4.2.0", - "chai": "^4.3.7", - "chai-string": "^1.5.0", - "copyfiles": "^2.4.1", - "cors": "^2.8.5", - "csv": "^6.3.8", - "dotenv": "^16.0.0", - "eccrypto": "^1.1.6", - "express": "^4.19.2", - "globby": "^13.1.2", - "grpc-tools": "^1.11.2", - "jsonwebtoken": "^9.0.0", - "lodash": "^4.17.21", - "nostr-tools": "^1.9.0", - "pg": "^8.4.0", - "reflect-metadata": "^0.1.13", - "rimraf": "^3.0.2", - "rxjs": "^7.5.5", - "secp256k1": "^4.0.3", - "sqlite3": "^5.1.5", - "ts-node": "^10.7.0", - "ts-proto": "^1.131.2", - "typeorm": "0.3.15", - "typescript": "^4.6.4", - "uuid": "^8.3.2", - "websocket": "^1.0.34", - "websocket-polyfill": "^0.0.3" - }, - "devDependencies": { - "@types/chai": "^4.3.4", - "@types/chai-string": "^1.4.5", - "@types/cors": "^2.8.12", - "@types/eccrypto": "^1.1.3", - "@types/jsonwebtoken": "^8.5.9", - "@types/lodash": "^4.14.182", - "@types/node": "^16.11.10", - "@types/node-fetch": "^2.6.3", - "@types/uuid": "^8.3.4", - "@types/websocket": "^1.0.6", - "nodemon": "^2.0.20", - "ts-node": "10.7.0", - "typescript": "4.5.2" - } -} +{ + "name": "lightning.pub", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "clean": "rimraf build", + "test": "npm run clean && tsc && node build/src/tests/testRunner.js", + "start": "npm run clean && tsc && node build/src/index.js", + "start:ci": "git reset --hard && git pull && npm run start", + "build_autogenerated": "cd proto && rimraf autogenerated && protoc -I ./service --pub_out=. service/*", + "build_lnd_client_1": "cd proto && protoc -I ./others --plugin=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_out=./lnd --ts_proto_opt=esModuleInterop=true others/* ", + "build_lnd_client": "cd proto && rimraf lnd/* && npx protoc --ts_out ./lnd --ts_opt long_type_string --proto_path others others/* ", + "typeorm": "typeorm-ts-node-commonjs" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shocknet/Lightning.Pub.git" + }, + "author": "", + "type": "module", + "license": "ISC", + "bugs": { + "url": "https://github.com/shocknet/Lightning.Pub/issues" + }, + "homepage": "https://github.com/shocknet/Lightning.Pub#readme", + "dependencies": { + "@grpc/grpc-js": "^1.6.7", + "@protobuf-ts/grpc-transport": "^2.5.0", + "@protobuf-ts/plugin": "^2.5.0", + "@protobuf-ts/runtime": "^2.5.0", + "@stablelib/xchacha20": "^1.0.1", + "@types/express": "^4.17.13", + "@types/node": "^17.0.31", + "@types/secp256k1": "^4.0.3", + "axios": "^0.28.0", + "bech32": "^2.0.0", + "bitcoin-core": "^4.2.0", + "chai": "^4.3.7", + "chai-string": "^1.5.0", + "copyfiles": "^2.4.1", + "cors": "^2.8.5", + "csv": "^6.3.8", + "dotenv": "^16.0.0", + "eccrypto": "^1.1.6", + "express": "^4.19.2", + "globby": "^13.1.2", + "grpc-tools": "^1.11.2", + "jsonwebtoken": "^9.0.0", + "lodash": "^4.17.21", + "nostr-tools": "^1.9.0", + "pg": "^8.4.0", + "reflect-metadata": "^0.1.13", + "rimraf": "^3.0.2", + "rxjs": "^7.5.5", + "secp256k1": "^4.0.3", + "sqlite3": "^5.1.5", + "ts-node": "^10.7.0", + "ts-proto": "^1.131.2", + "typeorm": "0.3.15", + "typescript": "^4.6.4", + "uuid": "^8.3.2", + "websocket": "^1.0.34", + "websocket-polyfill": "^0.0.3" + }, + "devDependencies": { + "@types/chai": "^4.3.4", + "@types/chai-string": "^1.4.5", + "@types/cors": "^2.8.12", + "@types/eccrypto": "^1.1.3", + "@types/jsonwebtoken": "^8.5.9", + "@types/lodash": "^4.14.182", + "@types/node": "^16.11.10", + "@types/node-fetch": "^2.6.3", + "@types/uuid": "^8.3.4", + "@types/websocket": "^1.0.6", + "nodemon": "^2.0.20", + "ts-node": "10.7.0", + "typescript": "4.5.2" + } +} diff --git a/proto/CODEGEN.md b/proto/CODEGEN.md index 82f63fb1..fe66c839 100644 --- a/proto/CODEGEN.md +++ b/proto/CODEGEN.md @@ -1,2 +1,2 @@ -create lnd classes: `npx protoc -I ./others --ts_out=./lnd others/*` +create lnd classes: `npx protoc -I ./others --ts_out=./lnd others/*` create server classes: `npx protoc -I ./service --pub_out=. service/*` \ No newline at end of file diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index 89c50054..8b94cd9f 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -1,861 +1,861 @@ -# NOSTR API DEFINITION - - -A nostr request will take the same parameter and give the same response as an http request, but it will use nostr as transport, to do that it will send encrypted events to the server public key, in the event 6 thing are required: -- __rpcName__: string containing the name of the method -- __params__: a map with the all the url params for the method -- __query__: a map with the the url query for the method -- __body__: the body of the method request -- __requestId__: id of the request to be able to get a response - -The nostr server will send back a message response, and inside the body there will also be a __requestId__ to identify the request this response is answering - -## NOSTR Methods -### These are the nostr methods the client implements to communicate with the API via nostr - -- LinkNPubThroughToken - - auth type: __User__ - - input: [LinkNPubThroughTokenRequest](#LinkNPubThroughTokenRequest) - - This methods has an __empty__ __response__ body - -- UserHealth - - auth type: __User__ - - This methods has an __empty__ __request__ body - - This methods has an __empty__ __response__ body - -- GetUserInfo - - auth type: __User__ - - This methods has an __empty__ __request__ body - - output: [UserInfo](#UserInfo) - -- AddProduct - - auth type: __User__ - - input: [AddProductRequest](#AddProductRequest) - - output: [Product](#Product) - -- NewProductInvoice - - auth type: __User__ - - the request url __query__ can take the following string items: - - id - - This methods has an __empty__ __request__ body - - output: [NewInvoiceResponse](#NewInvoiceResponse) - -- GetUserOperations - - auth type: __User__ - - input: [GetUserOperationsRequest](#GetUserOperationsRequest) - - output: [GetUserOperationsResponse](#GetUserOperationsResponse) - -- NewAddress - - auth type: __User__ - - input: [NewAddressRequest](#NewAddressRequest) - - output: [NewAddressResponse](#NewAddressResponse) - -- PayAddress - - auth type: __User__ - - input: [PayAddressRequest](#PayAddressRequest) - - output: [PayAddressResponse](#PayAddressResponse) - -- NewInvoice - - auth type: __User__ - - input: [NewInvoiceRequest](#NewInvoiceRequest) - - output: [NewInvoiceResponse](#NewInvoiceResponse) - -- DecodeInvoice - - auth type: __User__ - - input: [DecodeInvoiceRequest](#DecodeInvoiceRequest) - - output: [DecodeInvoiceResponse](#DecodeInvoiceResponse) - -- PayInvoice - - auth type: __User__ - - input: [PayInvoiceRequest](#PayInvoiceRequest) - - output: [PayInvoiceResponse](#PayInvoiceResponse) - -- OpenChannel - - auth type: __User__ - - input: [OpenChannelRequest](#OpenChannelRequest) - - output: [OpenChannelResponse](#OpenChannelResponse) - -- GetLnurlWithdrawLink - - auth type: __User__ - - This methods has an __empty__ __request__ body - - output: [LnurlLinkResponse](#LnurlLinkResponse) - -- GetLnurlPayLink - - auth type: __User__ - - This methods has an __empty__ __request__ body - - output: [LnurlLinkResponse](#LnurlLinkResponse) - -- GetLNURLChannelLink - - auth type: __User__ - - This methods has an __empty__ __request__ body - - output: [LnurlLinkResponse](#LnurlLinkResponse) - -- GetLiveUserOperations - - auth type: __User__ - - This methods has an __empty__ __request__ body - - output: [LiveUserOperation](#LiveUserOperation) - -- GetMigrationUpdate - - auth type: __User__ - - This methods has an __empty__ __request__ body - - output: [MigrationUpdate](#MigrationUpdate) - -- GetHttpCreds - - auth type: __User__ - - This methods has an __empty__ __request__ body - - output: [HttpCreds](#HttpCreds) - -- BatchUser - - auth type: __User__ - - This methods has an __empty__ __request__ body - - This methods has an __empty__ __response__ body - -# HTTP API DEFINITION - -## Supported HTTP Auths -### These are the supported http auth types, to give different type of access to the API users - -- __Guest__: - - expected context content - -- __User__: - - expected context content - - __app_id__: _string_ - - __app_user_id__: _string_ - - __user_id__: _string_ - -- __Admin__: - - expected context content - - __admin_id__: _string_ - -- __Metrics__: - - expected context content - - __operator_id__: _string_ - -- __App__: - - expected context content - - __app_id__: _string_ - -## HTTP Methods -### These are the http methods the client implements to communicate with the API - -- LndGetInfo - - auth type: __Admin__ - - http method: __post__ - - http route: __/api/admin/lnd/getinfo__ - - input: [LndGetInfoRequest](#LndGetInfoRequest) - - output: [LndGetInfoResponse](#LndGetInfoResponse) - -- AddApp - - auth type: __Admin__ - - http method: __post__ - - http route: __/api/admin/app/add__ - - input: [AddAppRequest](#AddAppRequest) - - output: [AuthApp](#AuthApp) - -- AuthApp - - auth type: __Admin__ - - http method: __post__ - - http route: __/api/admin/app/auth__ - - input: [AuthAppRequest](#AuthAppRequest) - - output: [AuthApp](#AuthApp) - -- BanUser - - auth type: __Admin__ - - http method: __post__ - - http route: __/api/admin/user/ban__ - - input: [BanUserRequest](#BanUserRequest) - - output: [BanUserResponse](#BanUserResponse) - -- GetUsageMetrics - - auth type: __Metrics__ - - http method: __post__ - - http route: __/api/reports/usage__ - - This methods has an __empty__ __request__ body - - output: [UsageMetrics](#UsageMetrics) - -- GetAppsMetrics - - auth type: __Metrics__ - - http method: __post__ - - http route: __/api/reports/apps__ - - input: [AppsMetricsRequest](#AppsMetricsRequest) - - output: [AppsMetrics](#AppsMetrics) - -- GetLndMetrics - - auth type: __Metrics__ - - http method: __post__ - - http route: __/api/reports/lnd__ - - input: [LndMetricsRequest](#LndMetricsRequest) - - output: [LndMetrics](#LndMetrics) - -- Health - - auth type: __Guest__ - - http method: __get__ - - http route: __/api/health__ - - This methods has an __empty__ __request__ body - - This methods has an __empty__ __response__ body - -- EncryptionExchange - - auth type: __Guest__ - - http method: __post__ - - http route: __/api/encryption/exchange__ - - input: [EncryptionExchangeRequest](#EncryptionExchangeRequest) - - This methods has an __empty__ __response__ body - -- SetMockInvoiceAsPaid - - auth type: __Guest__ - - http method: __post__ - - http route: __/api/lnd/mock/invoice/paid__ - - input: [SetMockInvoiceAsPaidRequest](#SetMockInvoiceAsPaidRequest) - - This methods has an __empty__ __response__ body - -- GetLnurlWithdrawInfo - - auth type: __Guest__ - - http method: __get__ - - http route: __/api/guest/lnurl_withdraw/info__ - - the request url __query__ can take the following string items: - - k1 - - This methods has an __empty__ __request__ body - - output: [LnurlWithdrawInfoResponse](#LnurlWithdrawInfoResponse) - -- HandleLnurlWithdraw - - auth type: __Guest__ - - http method: __get__ - - http route: __/api/guest/lnurl_withdraw/handle__ - - the request url __query__ can take the following string items: - - k1 - - pr - - This methods has an __empty__ __request__ body - - This methods has an __empty__ __response__ body - -- GetLnurlPayInfo - - auth type: __Guest__ - - http method: __get__ - - http route: __/api/guest/lnurl_pay/info__ - - the request url __query__ can take the following string items: - - k1 - - This methods has an __empty__ __request__ body - - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) - -- HandleLnurlPay - - auth type: __Guest__ - - http method: __get__ - - http route: __/api/guest/lnurl_pay/handle__ - - the request url __query__ can take the following string items: - - k1 - - amount - - nostr - - lnurl - - This methods has an __empty__ __request__ body - - output: [HandleLnurlPayResponse](#HandleLnurlPayResponse) - -- HandleLnurlAddress - - auth type: __Guest__ - - http method: __get__ - - http route: __/.well-known/lnurlp/:address_name__ - - the request url __params__ are the following string items: - - address_name - - This methods has an __empty__ __request__ body - - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) - -- LinkNPubThroughToken - - auth type: __User__ - - http method: __post__ - - http route: __/api/guest/npub/link__ - - input: [LinkNPubThroughTokenRequest](#LinkNPubThroughTokenRequest) - - This methods has an __empty__ __response__ body - -- GetApp - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/get__ - - This methods has an __empty__ __request__ body - - output: [Application](#Application) - -- AddAppUser - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/user/add__ - - input: [AddAppUserRequest](#AddAppUserRequest) - - output: [AppUser](#AppUser) - -- AddAppInvoice - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/add/invoice__ - - input: [AddAppInvoiceRequest](#AddAppInvoiceRequest) - - output: [NewInvoiceResponse](#NewInvoiceResponse) - -- AddAppUserInvoice - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/user/add/invoice__ - - input: [AddAppUserInvoiceRequest](#AddAppUserInvoiceRequest) - - output: [NewInvoiceResponse](#NewInvoiceResponse) - -- GetAppUser - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/user/get__ - - input: [GetAppUserRequest](#GetAppUserRequest) - - output: [AppUser](#AppUser) - -- PayAppUserInvoice - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/invoice/pay__ - - input: [PayAppUserInvoiceRequest](#PayAppUserInvoiceRequest) - - output: [PayInvoiceResponse](#PayInvoiceResponse) - -- SendAppUserToAppUserPayment - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/user/internal/pay__ - - input: [SendAppUserToAppUserPaymentRequest](#SendAppUserToAppUserPaymentRequest) - - This methods has an __empty__ __response__ body - -- SendAppUserToAppPayment - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/internal/pay__ - - input: [SendAppUserToAppPaymentRequest](#SendAppUserToAppPaymentRequest) - - This methods has an __empty__ __response__ body - -- GetAppUserLNURLInfo - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/user/lnurl/pay/info__ - - input: [GetAppUserLNURLInfoRequest](#GetAppUserLNURLInfoRequest) - - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) - -- SetMockAppUserBalance - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/mock/user/blance/set__ - - input: [SetMockAppUserBalanceRequest](#SetMockAppUserBalanceRequest) - - This methods has an __empty__ __response__ body - -- SetMockAppBalance - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/mock/blance/set__ - - input: [SetMockAppBalanceRequest](#SetMockAppBalanceRequest) - - This methods has an __empty__ __response__ body - -- RequestNPubLinkingToken - - auth type: __App__ - - http method: __post__ - - http route: __/api/app/user/npub/token__ - - input: [RequestNPubLinkingTokenRequest](#RequestNPubLinkingTokenRequest) - - output: [RequestNPubLinkingTokenResponse](#RequestNPubLinkingTokenResponse) - -- UserHealth - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/health__ - - This methods has an __empty__ __request__ body - - This methods has an __empty__ __response__ body - -- GetUserInfo - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/info__ - - This methods has an __empty__ __request__ body - - output: [UserInfo](#UserInfo) - -- AddProduct - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/product/add__ - - input: [AddProductRequest](#AddProductRequest) - - output: [Product](#Product) - -- NewProductInvoice - - auth type: __User__ - - http method: __get__ - - http route: __/api/user/product/get/invoice__ - - the request url __query__ can take the following string items: - - id - - This methods has an __empty__ __request__ body - - output: [NewInvoiceResponse](#NewInvoiceResponse) - -- GetUserOperations - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/operations__ - - input: [GetUserOperationsRequest](#GetUserOperationsRequest) - - output: [GetUserOperationsResponse](#GetUserOperationsResponse) - -- NewAddress - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/chain/new__ - - input: [NewAddressRequest](#NewAddressRequest) - - output: [NewAddressResponse](#NewAddressResponse) - -- PayAddress - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/chain/pay__ - - input: [PayAddressRequest](#PayAddressRequest) - - output: [PayAddressResponse](#PayAddressResponse) - -- NewInvoice - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/invoice/new__ - - input: [NewInvoiceRequest](#NewInvoiceRequest) - - output: [NewInvoiceResponse](#NewInvoiceResponse) - -- DecodeInvoice - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/invoice/decode__ - - input: [DecodeInvoiceRequest](#DecodeInvoiceRequest) - - output: [DecodeInvoiceResponse](#DecodeInvoiceResponse) - -- PayInvoice - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/invoice/pay__ - - input: [PayInvoiceRequest](#PayInvoiceRequest) - - output: [PayInvoiceResponse](#PayInvoiceResponse) - -- OpenChannel - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/open/channel__ - - input: [OpenChannelRequest](#OpenChannelRequest) - - output: [OpenChannelResponse](#OpenChannelResponse) - -- GetLnurlWithdrawLink - - auth type: __User__ - - http method: __get__ - - http route: __/api/user/lnurl_withdraw/link__ - - This methods has an __empty__ __request__ body - - output: [LnurlLinkResponse](#LnurlLinkResponse) - -- GetLnurlPayLink - - auth type: __User__ - - http method: __get__ - - http route: __/api/user/lnurl_pay/link__ - - This methods has an __empty__ __request__ body - - output: [LnurlLinkResponse](#LnurlLinkResponse) - -- GetLNURLChannelLink - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/lnurl_channel/url__ - - This methods has an __empty__ __request__ body - - output: [LnurlLinkResponse](#LnurlLinkResponse) - -- GetLiveUserOperations - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/operations/sub__ - - This methods has an __empty__ __request__ body - - output: [LiveUserOperation](#LiveUserOperation) - -- GetMigrationUpdate - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/migrations/sub__ - - This methods has an __empty__ __request__ body - - output: [MigrationUpdate](#MigrationUpdate) - -- GetHttpCreds - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/http_creds__ - - This methods has an __empty__ __request__ body - - output: [HttpCreds](#HttpCreds) - -- BatchUser - - auth type: __User__ - - http method: __post__ - - http route: __/api/user/batch__ - - This methods has an __empty__ __request__ body - - This methods has an __empty__ __response__ body - -# INPUTS AND OUTPUTS - -## Messages -### The content of requests and response from the methods - -### BanUserRequest - - __user_id__: _string_ - -### SendAppUserToAppUserPaymentRequest - - __from_user_identifier__: _string_ - - __to_user_identifier__: _string_ - - __amount__: _number_ - -### SendAppUserToAppPaymentRequest - - __from_user_identifier__: _string_ - - __amount__: _number_ - -### GetUserOperationsRequest - - __latestIncomingInvoice__: _number_ - - __latestOutgoingInvoice__: _number_ - - __latestIncomingTx__: _number_ - - __latestOutgoingTx__: _number_ - - __latestIncomingUserToUserPayment__: _number_ - - __latestOutgoingUserToUserPayment__: _number_ - - __max_size__: _number_ - -### GetUserOperationsResponse - - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ - - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - -### ClosureMigration - - __closes_at_unix__: _number_ - -### AuthAppRequest - - __name__: _string_ - - __allow_user_creation__: _boolean_ *this field is optional - -### Application - - __name__: _string_ - - __id__: _string_ - - __balance__: _number_ - - __npub__: _string_ - -### AddAppInvoiceRequest - - __payer_identifier__: _string_ - - __http_callback_url__: _string_ - - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ - -### GetAppUserLNURLInfoRequest - - __user_identifier__: _string_ - - __base_url_override__: _string_ - -### LnurlLinkResponse - - __lnurl__: _string_ - - __k1__: _string_ - -### LnurlWithdrawInfoResponse - - __tag__: _string_ - - __callback__: _string_ - - __k1__: _string_ - - __defaultDescription__: _string_ - - __minWithdrawable__: _number_ - - __maxWithdrawable__: _number_ - - __balanceCheck__: _string_ - - __payLink__: _string_ - -### UserOperation - - __paidAtUnix__: _number_ - - __type__: _[UserOperationType](#UserOperationType)_ - - __inbound__: _boolean_ - - __amount__: _number_ - - __identifier__: _string_ - - __operationId__: _string_ - - __service_fee__: _number_ - - __network_fee__: _number_ - - __confirmed__: _boolean_ - - __tx_hash__: _string_ - - __internal__: _boolean_ - -### RelaysMigration - - __relays__: ARRAY of: _string_ - -### RequestNPubLinkingTokenRequest - - __user_identifier__: _string_ - -### EncryptionExchangeRequest - - __publicKey__: _string_ - - __deviceId__: _string_ - -### AppsMetricsRequest - - __from_unix__: _number_ *this field is optional - - __to_unix__: _number_ *this field is optional - - __include_operations__: _boolean_ *this field is optional - -### ClosedChannel - - __channel_id__: _string_ - - __capacity__: _number_ - - __closed_height__: _number_ - -### OpenChannelResponse - - __channelId__: _string_ - -### Product - - __id__: _string_ - - __name__: _string_ - - __price_sats__: _number_ - -### PayAppUserInvoiceRequest - - __user_identifier__: _string_ - - __invoice__: _string_ - - __amount__: _number_ - -### NewInvoiceRequest - - __amountSats__: _number_ - - __memo__: _string_ - -### LiveUserOperation - - __operation__: _[UserOperation](#UserOperation)_ - -### HttpCreds - - __url__: _string_ - - __token__: _string_ - -### UsageMetric - - __processed_at_ms__: _number_ - - __parsed_in_nano__: _number_ - - __auth_in_nano__: _number_ - - __validate_in_nano__: _number_ - - __handle_in_nano__: _number_ - - __rpc_name__: _string_ - - __batch__: _boolean_ - - __nostr__: _boolean_ - - __batch_size__: _number_ - -### RoutingEvent - - __incoming_channel_id__: _number_ - - __incoming_htlc_id__: _number_ - - __outgoing_channel_id__: _number_ - - __outgoing_htlc_id__: _number_ - - __timestamp_ns__: _number_ - - __event_type__: _string_ - - __incoming_amt_msat__: _number_ - - __outgoing_amt_msat__: _number_ - - __failure_string__: _string_ - - __settled__: _boolean_ - - __offchain__: _boolean_ - - __forward_fail_event__: _boolean_ - -### ChannelBalanceEvent - - __block_height__: _number_ - - __channel_id__: _string_ - - __local_balance_sats__: _number_ - - __remote_balance_sats__: _number_ - -### HandleLnurlPayResponse - - __pr__: _string_ - - __routes__: ARRAY of: _[Empty](#Empty)_ - -### UserOperations - - __fromIndex__: _number_ - - __toIndex__: _number_ - - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ - -### ChainBalanceEvent - - __block_height__: _number_ - - __confirmed_balance__: _number_ - - __unconfirmed_balance__: _number_ - - __total_balance__: _number_ - -### LndNodeMetrics - - __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_ - - __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_ - - __offline_channels__: _number_ - - __online_channels__: _number_ - - __pending_channels__: _number_ - - __closing_channels__: _number_ - - __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_ - - __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_ - - __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_ - -### SetMockInvoiceAsPaidRequest - - __invoice__: _string_ - - __amount__: _number_ - -### AddAppUserInvoiceRequest - - __receiver_identifier__: _string_ - - __payer_identifier__: _string_ - - __http_callback_url__: _string_ - - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ - -### OpenChannelRequest - - __destination__: _string_ - - __fundingAmount__: _number_ - - __pushAmount__: _number_ - - __closeAddress__: _string_ - -### UsageMetrics - - __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_ - -### OpenChannel - - __channel_id__: _string_ - - __capacity__: _number_ - - __active__: _boolean_ - - __lifetime__: _number_ - - __local_balance__: _number_ - - __remote_balance__: _number_ - -### NewAddressRequest - - __addressType__: _[AddressType](#AddressType)_ - -### LnurlPayInfoResponse - - __tag__: _string_ - - __callback__: _string_ - - __maxSendable__: _number_ - - __minSendable__: _number_ - - __metadata__: _string_ - - __allowsNostr__: _boolean_ - - __nostrPubkey__: _string_ - -### GetProductBuyLinkResponse - - __link__: _string_ - -### UsersInfo - - __total__: _number_ - - __no_balance__: _number_ - - __negative_balance__: _number_ - - __always_been_inactive__: _number_ - - __balance_avg__: _number_ - - __balance_median__: _number_ - -### AddAppRequest - - __name__: _string_ - - __allow_user_creation__: _boolean_ - -### DecodeInvoiceResponse - - __amount__: _number_ - -### LndMetrics - - __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ - -### AddProductRequest - - __name__: _string_ - - __price_sats__: _number_ - -### Empty - -### ChannelRouting - - __channel_id__: _string_ - - __send_errors__: _number_ - - __receive_errors__: _number_ - - __forward_errors_as_input__: _number_ - - __forward_errors_as_output__: _number_ - - __missed_forward_fee_as_input__: _number_ - - __missed_forward_fee_as_output__: _number_ - - __forward_fee_as_input__: _number_ - - __forward_fee_as_output__: _number_ - - __events_number__: _number_ - -### PayInvoiceResponse - - __preimage__: _string_ - - __amount_paid__: _number_ - - __operation_id__: _string_ - - __service_fee__: _number_ - - __network_fee__: _number_ - -### UserInfo - - __userId__: _string_ - - __balance__: _number_ - - __max_withdrawable__: _number_ - - __user_identifier__: _string_ - -### MigrationUpdate - - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional - - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional - -### LinkNPubThroughTokenRequest - - __token__: _string_ - - __nostr_pub__: _string_ - -### PayAddressRequest - - __address__: _string_ - - __amoutSats__: _number_ - - __satsPerVByte__: _number_ - -### PayAddressResponse - - __txId__: _string_ - - __operation_id__: _string_ - - __service_fee__: _number_ - - __network_fee__: _number_ - -### AppMetrics - - __app__: _[Application](#Application)_ - - __users__: _[UsersInfo](#UsersInfo)_ - - __received__: _number_ - - __spent__: _number_ - - __available__: _number_ - - __fees__: _number_ - - __invoices__: _number_ - - __total_fees__: _number_ - - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ - -### BanUserResponse - - __balance_sats__: _number_ - - __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_ - -### AuthApp - - __app__: _[Application](#Application)_ - - __auth_token__: _string_ - -### LndMetricsRequest - - __from_unix__: _number_ *this field is optional - - __to_unix__: _number_ *this field is optional - -### BannedAppUser - - __app_name__: _string_ - - __app_id__: _string_ - - __user_identifier__: _string_ - - __nostr_pub__: _string_ - -### GetAppUserRequest - - __user_identifier__: _string_ - -### SetMockAppBalanceRequest - - __amount__: _number_ - -### DecodeInvoiceRequest - - __invoice__: _string_ - -### RequestNPubLinkingTokenResponse - - __token__: _string_ - -### LndGetInfoRequest - - __nodeId__: _number_ - -### AppUser - - __identifier__: _string_ - - __info__: _[UserInfo](#UserInfo)_ - - __max_withdrawable__: _number_ - -### SetMockAppUserBalanceRequest - - __user_identifier__: _string_ - - __amount__: _number_ - -### PayInvoiceRequest - - __invoice__: _string_ - - __amount__: _number_ - -### AddAppUserRequest - - __identifier__: _string_ - - __fail_if_exists__: _boolean_ - - __balance__: _number_ - -### NewInvoiceResponse - - __invoice__: _string_ - -### AppsMetrics - - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ - -### LndGetInfoResponse - - __alias__: _string_ - -### NewAddressResponse - - __address__: _string_ -## Enums -### The enumerators used in the messages - -### AddressType - - __WITNESS_PUBKEY_HASH__ - - __NESTED_PUBKEY_HASH__ - - __TAPROOT_PUBKEY__ - -### UserOperationType - - __INCOMING_TX__ - - __OUTGOING_TX__ - - __INCOMING_INVOICE__ - - __OUTGOING_INVOICE__ - - __OUTGOING_USER_TO_USER__ - - __INCOMING_USER_TO_USER__ +# NOSTR API DEFINITION + + +A nostr request will take the same parameter and give the same response as an http request, but it will use nostr as transport, to do that it will send encrypted events to the server public key, in the event 6 thing are required: +- __rpcName__: string containing the name of the method +- __params__: a map with the all the url params for the method +- __query__: a map with the the url query for the method +- __body__: the body of the method request +- __requestId__: id of the request to be able to get a response + +The nostr server will send back a message response, and inside the body there will also be a __requestId__ to identify the request this response is answering + +## NOSTR Methods +### These are the nostr methods the client implements to communicate with the API via nostr + +- LinkNPubThroughToken + - auth type: __User__ + - input: [LinkNPubThroughTokenRequest](#LinkNPubThroughTokenRequest) + - This methods has an __empty__ __response__ body + +- UserHealth + - auth type: __User__ + - This methods has an __empty__ __request__ body + - This methods has an __empty__ __response__ body + +- GetUserInfo + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [UserInfo](#UserInfo) + +- AddProduct + - auth type: __User__ + - input: [AddProductRequest](#AddProductRequest) + - output: [Product](#Product) + +- NewProductInvoice + - auth type: __User__ + - the request url __query__ can take the following string items: + - id + - This methods has an __empty__ __request__ body + - output: [NewInvoiceResponse](#NewInvoiceResponse) + +- GetUserOperations + - auth type: __User__ + - input: [GetUserOperationsRequest](#GetUserOperationsRequest) + - output: [GetUserOperationsResponse](#GetUserOperationsResponse) + +- NewAddress + - auth type: __User__ + - input: [NewAddressRequest](#NewAddressRequest) + - output: [NewAddressResponse](#NewAddressResponse) + +- PayAddress + - auth type: __User__ + - input: [PayAddressRequest](#PayAddressRequest) + - output: [PayAddressResponse](#PayAddressResponse) + +- NewInvoice + - auth type: __User__ + - input: [NewInvoiceRequest](#NewInvoiceRequest) + - output: [NewInvoiceResponse](#NewInvoiceResponse) + +- DecodeInvoice + - auth type: __User__ + - input: [DecodeInvoiceRequest](#DecodeInvoiceRequest) + - output: [DecodeInvoiceResponse](#DecodeInvoiceResponse) + +- PayInvoice + - auth type: __User__ + - input: [PayInvoiceRequest](#PayInvoiceRequest) + - output: [PayInvoiceResponse](#PayInvoiceResponse) + +- OpenChannel + - auth type: __User__ + - input: [OpenChannelRequest](#OpenChannelRequest) + - output: [OpenChannelResponse](#OpenChannelResponse) + +- GetLnurlWithdrawLink + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [LnurlLinkResponse](#LnurlLinkResponse) + +- GetLnurlPayLink + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [LnurlLinkResponse](#LnurlLinkResponse) + +- GetLNURLChannelLink + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [LnurlLinkResponse](#LnurlLinkResponse) + +- GetLiveUserOperations + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [LiveUserOperation](#LiveUserOperation) + +- GetMigrationUpdate + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [MigrationUpdate](#MigrationUpdate) + +- GetHttpCreds + - auth type: __User__ + - This methods has an __empty__ __request__ body + - output: [HttpCreds](#HttpCreds) + +- BatchUser + - auth type: __User__ + - This methods has an __empty__ __request__ body + - This methods has an __empty__ __response__ body + +# HTTP API DEFINITION + +## Supported HTTP Auths +### These are the supported http auth types, to give different type of access to the API users + +- __Guest__: + - expected context content + +- __User__: + - expected context content + - __app_id__: _string_ + - __app_user_id__: _string_ + - __user_id__: _string_ + +- __Admin__: + - expected context content + - __admin_id__: _string_ + +- __Metrics__: + - expected context content + - __operator_id__: _string_ + +- __App__: + - expected context content + - __app_id__: _string_ + +## HTTP Methods +### These are the http methods the client implements to communicate with the API + +- LndGetInfo + - auth type: __Admin__ + - http method: __post__ + - http route: __/api/admin/lnd/getinfo__ + - input: [LndGetInfoRequest](#LndGetInfoRequest) + - output: [LndGetInfoResponse](#LndGetInfoResponse) + +- AddApp + - auth type: __Admin__ + - http method: __post__ + - http route: __/api/admin/app/add__ + - input: [AddAppRequest](#AddAppRequest) + - output: [AuthApp](#AuthApp) + +- AuthApp + - auth type: __Admin__ + - http method: __post__ + - http route: __/api/admin/app/auth__ + - input: [AuthAppRequest](#AuthAppRequest) + - output: [AuthApp](#AuthApp) + +- BanUser + - auth type: __Admin__ + - http method: __post__ + - http route: __/api/admin/user/ban__ + - input: [BanUserRequest](#BanUserRequest) + - output: [BanUserResponse](#BanUserResponse) + +- GetUsageMetrics + - auth type: __Metrics__ + - http method: __post__ + - http route: __/api/reports/usage__ + - This methods has an __empty__ __request__ body + - output: [UsageMetrics](#UsageMetrics) + +- GetAppsMetrics + - auth type: __Metrics__ + - http method: __post__ + - http route: __/api/reports/apps__ + - input: [AppsMetricsRequest](#AppsMetricsRequest) + - output: [AppsMetrics](#AppsMetrics) + +- GetLndMetrics + - auth type: __Metrics__ + - http method: __post__ + - http route: __/api/reports/lnd__ + - input: [LndMetricsRequest](#LndMetricsRequest) + - output: [LndMetrics](#LndMetrics) + +- Health + - auth type: __Guest__ + - http method: __get__ + - http route: __/api/health__ + - This methods has an __empty__ __request__ body + - This methods has an __empty__ __response__ body + +- EncryptionExchange + - auth type: __Guest__ + - http method: __post__ + - http route: __/api/encryption/exchange__ + - input: [EncryptionExchangeRequest](#EncryptionExchangeRequest) + - This methods has an __empty__ __response__ body + +- SetMockInvoiceAsPaid + - auth type: __Guest__ + - http method: __post__ + - http route: __/api/lnd/mock/invoice/paid__ + - input: [SetMockInvoiceAsPaidRequest](#SetMockInvoiceAsPaidRequest) + - This methods has an __empty__ __response__ body + +- GetLnurlWithdrawInfo + - auth type: __Guest__ + - http method: __get__ + - http route: __/api/guest/lnurl_withdraw/info__ + - the request url __query__ can take the following string items: + - k1 + - This methods has an __empty__ __request__ body + - output: [LnurlWithdrawInfoResponse](#LnurlWithdrawInfoResponse) + +- HandleLnurlWithdraw + - auth type: __Guest__ + - http method: __get__ + - http route: __/api/guest/lnurl_withdraw/handle__ + - the request url __query__ can take the following string items: + - k1 + - pr + - This methods has an __empty__ __request__ body + - This methods has an __empty__ __response__ body + +- GetLnurlPayInfo + - auth type: __Guest__ + - http method: __get__ + - http route: __/api/guest/lnurl_pay/info__ + - the request url __query__ can take the following string items: + - k1 + - This methods has an __empty__ __request__ body + - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) + +- HandleLnurlPay + - auth type: __Guest__ + - http method: __get__ + - http route: __/api/guest/lnurl_pay/handle__ + - the request url __query__ can take the following string items: + - k1 + - amount + - nostr + - lnurl + - This methods has an __empty__ __request__ body + - output: [HandleLnurlPayResponse](#HandleLnurlPayResponse) + +- HandleLnurlAddress + - auth type: __Guest__ + - http method: __get__ + - http route: __/.well-known/lnurlp/:address_name__ + - the request url __params__ are the following string items: + - address_name + - This methods has an __empty__ __request__ body + - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) + +- LinkNPubThroughToken + - auth type: __User__ + - http method: __post__ + - http route: __/api/guest/npub/link__ + - input: [LinkNPubThroughTokenRequest](#LinkNPubThroughTokenRequest) + - This methods has an __empty__ __response__ body + +- GetApp + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/get__ + - This methods has an __empty__ __request__ body + - output: [Application](#Application) + +- AddAppUser + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/user/add__ + - input: [AddAppUserRequest](#AddAppUserRequest) + - output: [AppUser](#AppUser) + +- AddAppInvoice + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/add/invoice__ + - input: [AddAppInvoiceRequest](#AddAppInvoiceRequest) + - output: [NewInvoiceResponse](#NewInvoiceResponse) + +- AddAppUserInvoice + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/user/add/invoice__ + - input: [AddAppUserInvoiceRequest](#AddAppUserInvoiceRequest) + - output: [NewInvoiceResponse](#NewInvoiceResponse) + +- GetAppUser + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/user/get__ + - input: [GetAppUserRequest](#GetAppUserRequest) + - output: [AppUser](#AppUser) + +- PayAppUserInvoice + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/invoice/pay__ + - input: [PayAppUserInvoiceRequest](#PayAppUserInvoiceRequest) + - output: [PayInvoiceResponse](#PayInvoiceResponse) + +- SendAppUserToAppUserPayment + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/user/internal/pay__ + - input: [SendAppUserToAppUserPaymentRequest](#SendAppUserToAppUserPaymentRequest) + - This methods has an __empty__ __response__ body + +- SendAppUserToAppPayment + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/internal/pay__ + - input: [SendAppUserToAppPaymentRequest](#SendAppUserToAppPaymentRequest) + - This methods has an __empty__ __response__ body + +- GetAppUserLNURLInfo + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/user/lnurl/pay/info__ + - input: [GetAppUserLNURLInfoRequest](#GetAppUserLNURLInfoRequest) + - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) + +- SetMockAppUserBalance + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/mock/user/blance/set__ + - input: [SetMockAppUserBalanceRequest](#SetMockAppUserBalanceRequest) + - This methods has an __empty__ __response__ body + +- SetMockAppBalance + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/mock/blance/set__ + - input: [SetMockAppBalanceRequest](#SetMockAppBalanceRequest) + - This methods has an __empty__ __response__ body + +- RequestNPubLinkingToken + - auth type: __App__ + - http method: __post__ + - http route: __/api/app/user/npub/token__ + - input: [RequestNPubLinkingTokenRequest](#RequestNPubLinkingTokenRequest) + - output: [RequestNPubLinkingTokenResponse](#RequestNPubLinkingTokenResponse) + +- UserHealth + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/health__ + - This methods has an __empty__ __request__ body + - This methods has an __empty__ __response__ body + +- GetUserInfo + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/info__ + - This methods has an __empty__ __request__ body + - output: [UserInfo](#UserInfo) + +- AddProduct + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/product/add__ + - input: [AddProductRequest](#AddProductRequest) + - output: [Product](#Product) + +- NewProductInvoice + - auth type: __User__ + - http method: __get__ + - http route: __/api/user/product/get/invoice__ + - the request url __query__ can take the following string items: + - id + - This methods has an __empty__ __request__ body + - output: [NewInvoiceResponse](#NewInvoiceResponse) + +- GetUserOperations + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/operations__ + - input: [GetUserOperationsRequest](#GetUserOperationsRequest) + - output: [GetUserOperationsResponse](#GetUserOperationsResponse) + +- NewAddress + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/chain/new__ + - input: [NewAddressRequest](#NewAddressRequest) + - output: [NewAddressResponse](#NewAddressResponse) + +- PayAddress + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/chain/pay__ + - input: [PayAddressRequest](#PayAddressRequest) + - output: [PayAddressResponse](#PayAddressResponse) + +- NewInvoice + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/invoice/new__ + - input: [NewInvoiceRequest](#NewInvoiceRequest) + - output: [NewInvoiceResponse](#NewInvoiceResponse) + +- DecodeInvoice + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/invoice/decode__ + - input: [DecodeInvoiceRequest](#DecodeInvoiceRequest) + - output: [DecodeInvoiceResponse](#DecodeInvoiceResponse) + +- PayInvoice + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/invoice/pay__ + - input: [PayInvoiceRequest](#PayInvoiceRequest) + - output: [PayInvoiceResponse](#PayInvoiceResponse) + +- OpenChannel + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/open/channel__ + - input: [OpenChannelRequest](#OpenChannelRequest) + - output: [OpenChannelResponse](#OpenChannelResponse) + +- GetLnurlWithdrawLink + - auth type: __User__ + - http method: __get__ + - http route: __/api/user/lnurl_withdraw/link__ + - This methods has an __empty__ __request__ body + - output: [LnurlLinkResponse](#LnurlLinkResponse) + +- GetLnurlPayLink + - auth type: __User__ + - http method: __get__ + - http route: __/api/user/lnurl_pay/link__ + - This methods has an __empty__ __request__ body + - output: [LnurlLinkResponse](#LnurlLinkResponse) + +- GetLNURLChannelLink + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/lnurl_channel/url__ + - This methods has an __empty__ __request__ body + - output: [LnurlLinkResponse](#LnurlLinkResponse) + +- GetLiveUserOperations + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/operations/sub__ + - This methods has an __empty__ __request__ body + - output: [LiveUserOperation](#LiveUserOperation) + +- GetMigrationUpdate + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/migrations/sub__ + - This methods has an __empty__ __request__ body + - output: [MigrationUpdate](#MigrationUpdate) + +- GetHttpCreds + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/http_creds__ + - This methods has an __empty__ __request__ body + - output: [HttpCreds](#HttpCreds) + +- BatchUser + - auth type: __User__ + - http method: __post__ + - http route: __/api/user/batch__ + - This methods has an __empty__ __request__ body + - This methods has an __empty__ __response__ body + +# INPUTS AND OUTPUTS + +## Messages +### The content of requests and response from the methods + +### BanUserRequest + - __user_id__: _string_ + +### SendAppUserToAppUserPaymentRequest + - __from_user_identifier__: _string_ + - __to_user_identifier__: _string_ + - __amount__: _number_ + +### SendAppUserToAppPaymentRequest + - __from_user_identifier__: _string_ + - __amount__: _number_ + +### GetUserOperationsRequest + - __latestIncomingInvoice__: _number_ + - __latestOutgoingInvoice__: _number_ + - __latestIncomingTx__: _number_ + - __latestOutgoingTx__: _number_ + - __latestIncomingUserToUserPayment__: _number_ + - __latestOutgoingUserToUserPayment__: _number_ + - __max_size__: _number_ + +### GetUserOperationsResponse + - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ + - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ + +### ClosureMigration + - __closes_at_unix__: _number_ + +### AuthAppRequest + - __name__: _string_ + - __allow_user_creation__: _boolean_ *this field is optional + +### Application + - __name__: _string_ + - __id__: _string_ + - __balance__: _number_ + - __npub__: _string_ + +### AddAppInvoiceRequest + - __payer_identifier__: _string_ + - __http_callback_url__: _string_ + - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ + +### GetAppUserLNURLInfoRequest + - __user_identifier__: _string_ + - __base_url_override__: _string_ + +### LnurlLinkResponse + - __lnurl__: _string_ + - __k1__: _string_ + +### LnurlWithdrawInfoResponse + - __tag__: _string_ + - __callback__: _string_ + - __k1__: _string_ + - __defaultDescription__: _string_ + - __minWithdrawable__: _number_ + - __maxWithdrawable__: _number_ + - __balanceCheck__: _string_ + - __payLink__: _string_ + +### UserOperation + - __paidAtUnix__: _number_ + - __type__: _[UserOperationType](#UserOperationType)_ + - __inbound__: _boolean_ + - __amount__: _number_ + - __identifier__: _string_ + - __operationId__: _string_ + - __service_fee__: _number_ + - __network_fee__: _number_ + - __confirmed__: _boolean_ + - __tx_hash__: _string_ + - __internal__: _boolean_ + +### RelaysMigration + - __relays__: ARRAY of: _string_ + +### RequestNPubLinkingTokenRequest + - __user_identifier__: _string_ + +### EncryptionExchangeRequest + - __publicKey__: _string_ + - __deviceId__: _string_ + +### AppsMetricsRequest + - __from_unix__: _number_ *this field is optional + - __to_unix__: _number_ *this field is optional + - __include_operations__: _boolean_ *this field is optional + +### ClosedChannel + - __channel_id__: _string_ + - __capacity__: _number_ + - __closed_height__: _number_ + +### OpenChannelResponse + - __channelId__: _string_ + +### Product + - __id__: _string_ + - __name__: _string_ + - __price_sats__: _number_ + +### PayAppUserInvoiceRequest + - __user_identifier__: _string_ + - __invoice__: _string_ + - __amount__: _number_ + +### NewInvoiceRequest + - __amountSats__: _number_ + - __memo__: _string_ + +### LiveUserOperation + - __operation__: _[UserOperation](#UserOperation)_ + +### HttpCreds + - __url__: _string_ + - __token__: _string_ + +### UsageMetric + - __processed_at_ms__: _number_ + - __parsed_in_nano__: _number_ + - __auth_in_nano__: _number_ + - __validate_in_nano__: _number_ + - __handle_in_nano__: _number_ + - __rpc_name__: _string_ + - __batch__: _boolean_ + - __nostr__: _boolean_ + - __batch_size__: _number_ + +### RoutingEvent + - __incoming_channel_id__: _number_ + - __incoming_htlc_id__: _number_ + - __outgoing_channel_id__: _number_ + - __outgoing_htlc_id__: _number_ + - __timestamp_ns__: _number_ + - __event_type__: _string_ + - __incoming_amt_msat__: _number_ + - __outgoing_amt_msat__: _number_ + - __failure_string__: _string_ + - __settled__: _boolean_ + - __offchain__: _boolean_ + - __forward_fail_event__: _boolean_ + +### ChannelBalanceEvent + - __block_height__: _number_ + - __channel_id__: _string_ + - __local_balance_sats__: _number_ + - __remote_balance_sats__: _number_ + +### HandleLnurlPayResponse + - __pr__: _string_ + - __routes__: ARRAY of: _[Empty](#Empty)_ + +### UserOperations + - __fromIndex__: _number_ + - __toIndex__: _number_ + - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ + +### ChainBalanceEvent + - __block_height__: _number_ + - __confirmed_balance__: _number_ + - __unconfirmed_balance__: _number_ + - __total_balance__: _number_ + +### LndNodeMetrics + - __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_ + - __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_ + - __offline_channels__: _number_ + - __online_channels__: _number_ + - __pending_channels__: _number_ + - __closing_channels__: _number_ + - __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_ + - __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_ + - __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_ + +### SetMockInvoiceAsPaidRequest + - __invoice__: _string_ + - __amount__: _number_ + +### AddAppUserInvoiceRequest + - __receiver_identifier__: _string_ + - __payer_identifier__: _string_ + - __http_callback_url__: _string_ + - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ + +### OpenChannelRequest + - __destination__: _string_ + - __fundingAmount__: _number_ + - __pushAmount__: _number_ + - __closeAddress__: _string_ + +### UsageMetrics + - __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_ + +### OpenChannel + - __channel_id__: _string_ + - __capacity__: _number_ + - __active__: _boolean_ + - __lifetime__: _number_ + - __local_balance__: _number_ + - __remote_balance__: _number_ + +### NewAddressRequest + - __addressType__: _[AddressType](#AddressType)_ + +### LnurlPayInfoResponse + - __tag__: _string_ + - __callback__: _string_ + - __maxSendable__: _number_ + - __minSendable__: _number_ + - __metadata__: _string_ + - __allowsNostr__: _boolean_ + - __nostrPubkey__: _string_ + +### GetProductBuyLinkResponse + - __link__: _string_ + +### UsersInfo + - __total__: _number_ + - __no_balance__: _number_ + - __negative_balance__: _number_ + - __always_been_inactive__: _number_ + - __balance_avg__: _number_ + - __balance_median__: _number_ + +### AddAppRequest + - __name__: _string_ + - __allow_user_creation__: _boolean_ + +### DecodeInvoiceResponse + - __amount__: _number_ + +### LndMetrics + - __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ + +### AddProductRequest + - __name__: _string_ + - __price_sats__: _number_ + +### Empty + +### ChannelRouting + - __channel_id__: _string_ + - __send_errors__: _number_ + - __receive_errors__: _number_ + - __forward_errors_as_input__: _number_ + - __forward_errors_as_output__: _number_ + - __missed_forward_fee_as_input__: _number_ + - __missed_forward_fee_as_output__: _number_ + - __forward_fee_as_input__: _number_ + - __forward_fee_as_output__: _number_ + - __events_number__: _number_ + +### PayInvoiceResponse + - __preimage__: _string_ + - __amount_paid__: _number_ + - __operation_id__: _string_ + - __service_fee__: _number_ + - __network_fee__: _number_ + +### UserInfo + - __userId__: _string_ + - __balance__: _number_ + - __max_withdrawable__: _number_ + - __user_identifier__: _string_ + +### MigrationUpdate + - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional + - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional + +### LinkNPubThroughTokenRequest + - __token__: _string_ + - __nostr_pub__: _string_ + +### PayAddressRequest + - __address__: _string_ + - __amoutSats__: _number_ + - __satsPerVByte__: _number_ + +### PayAddressResponse + - __txId__: _string_ + - __operation_id__: _string_ + - __service_fee__: _number_ + - __network_fee__: _number_ + +### AppMetrics + - __app__: _[Application](#Application)_ + - __users__: _[UsersInfo](#UsersInfo)_ + - __received__: _number_ + - __spent__: _number_ + - __available__: _number_ + - __fees__: _number_ + - __invoices__: _number_ + - __total_fees__: _number_ + - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ + +### BanUserResponse + - __balance_sats__: _number_ + - __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_ + +### AuthApp + - __app__: _[Application](#Application)_ + - __auth_token__: _string_ + +### LndMetricsRequest + - __from_unix__: _number_ *this field is optional + - __to_unix__: _number_ *this field is optional + +### BannedAppUser + - __app_name__: _string_ + - __app_id__: _string_ + - __user_identifier__: _string_ + - __nostr_pub__: _string_ + +### GetAppUserRequest + - __user_identifier__: _string_ + +### SetMockAppBalanceRequest + - __amount__: _number_ + +### DecodeInvoiceRequest + - __invoice__: _string_ + +### RequestNPubLinkingTokenResponse + - __token__: _string_ + +### LndGetInfoRequest + - __nodeId__: _number_ + +### AppUser + - __identifier__: _string_ + - __info__: _[UserInfo](#UserInfo)_ + - __max_withdrawable__: _number_ + +### SetMockAppUserBalanceRequest + - __user_identifier__: _string_ + - __amount__: _number_ + +### PayInvoiceRequest + - __invoice__: _string_ + - __amount__: _number_ + +### AddAppUserRequest + - __identifier__: _string_ + - __fail_if_exists__: _boolean_ + - __balance__: _number_ + +### NewInvoiceResponse + - __invoice__: _string_ + +### AppsMetrics + - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ + +### LndGetInfoResponse + - __alias__: _string_ + +### NewAddressResponse + - __address__: _string_ +## Enums +### The enumerators used in the messages + +### AddressType + - __WITNESS_PUBKEY_HASH__ + - __NESTED_PUBKEY_HASH__ + - __TAPROOT_PUBKEY__ + +### UserOperationType + - __INCOMING_TX__ + - __OUTGOING_TX__ + - __INCOMING_INVOICE__ + - __OUTGOING_INVOICE__ + - __OUTGOING_USER_TO_USER__ + - __INCOMING_USER_TO_USER__ diff --git a/proto/autogenerated/debug.txt b/proto/autogenerated/debug.txt index 2881b623..751faf33 100644 --- a/proto/autogenerated/debug.txt +++ b/proto/autogenerated/debug.txt @@ -1,3865 +1,3865 @@ -([]*main.Method) (len=46 cap=64) { - (*main.Method)(0xc00007a1e0)({ - in: (main.MethodMessage) { - name: (string) (len=17) "LndGetInfoRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "LndGetInfo", - out: (main.MethodMessage) { - name: (string) (len=18) "LndGetInfoResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc000071560)({ - authType: (*main.supportedAuth)(0xc0004ff020)({ - id: (string) (len=5) "admin", - name: (string) (len=5) "Admin", - context: (map[string]string) (len=1) { - (string) (len=8) "admin_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=22) "/api/admin/lnd/getinfo", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a280)({ - in: (main.MethodMessage) { - name: (string) (len=13) "AddAppRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=6) "AddApp", - out: (main.MethodMessage) { - name: (string) (len=7) "AuthApp", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc0000716e0)({ - authType: (*main.supportedAuth)(0xc0004ff0b0)({ - id: (string) (len=5) "admin", - name: (string) (len=5) "Admin", - context: (map[string]string) (len=1) { - (string) (len=8) "admin_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=18) "/api/admin/app/add", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a320)({ - in: (main.MethodMessage) { - name: (string) (len=14) "AuthAppRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=7) "AuthApp", - out: (main.MethodMessage) { - name: (string) (len=7) "AuthApp", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc000071860)({ - authType: (*main.supportedAuth)(0xc0004ff140)({ - id: (string) (len=5) "admin", - name: (string) (len=5) "Admin", - context: (map[string]string) (len=1) { - (string) (len=8) "admin_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=19) "/api/admin/app/auth", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a3c0)({ - in: (main.MethodMessage) { - name: (string) (len=14) "BanUserRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=7) "BanUser", - out: (main.MethodMessage) { - name: (string) (len=15) "BanUserResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc0000719e0)({ - authType: (*main.supportedAuth)(0xc0004ff1d0)({ - id: (string) (len=5) "admin", - name: (string) (len=5) "Admin", - context: (map[string]string) (len=1) { - (string) (len=8) "admin_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=19) "/api/admin/user/ban", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a410)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=15) "GetUsageMetrics", - out: (main.MethodMessage) { - name: (string) (len=12) "UsageMetrics", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc000071b60)({ - authType: (*main.supportedAuth)(0xc0004ff260)({ - id: (string) (len=7) "metrics", - name: (string) (len=7) "Metrics", - context: (map[string]string) (len=1) { - (string) (len=11) "operator_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=18) "/api/reports/usage", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a460)({ - in: (main.MethodMessage) { - name: (string) (len=18) "AppsMetricsRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=14) "GetAppsMetrics", - out: (main.MethodMessage) { - name: (string) (len=11) "AppsMetrics", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc000071ce0)({ - authType: (*main.supportedAuth)(0xc0004ff2f0)({ - id: (string) (len=7) "metrics", - name: (string) (len=7) "Metrics", - context: (map[string]string) (len=1) { - (string) (len=11) "operator_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=17) "/api/reports/apps", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a4b0)({ - in: (main.MethodMessage) { - name: (string) (len=17) "LndMetricsRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=13) "GetLndMetrics", - out: (main.MethodMessage) { - name: (string) (len=10) "LndMetrics", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc000071e60)({ - authType: (*main.supportedAuth)(0xc0004ff380)({ - id: (string) (len=7) "metrics", - name: (string) (len=7) "Metrics", - context: (map[string]string) (len=1) { - (string) (len=11) "operator_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=16) "/api/reports/lnd", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a500)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=6) "Health", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc000351800)({ - authType: (*main.supportedAuth)(0xc0004ff410)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=11) "/api/health", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a550)({ - in: (main.MethodMessage) { - name: (string) (len=25) "EncryptionExchangeRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=18) "EncryptionExchange", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc000351980)({ - authType: (*main.supportedAuth)(0xc0004ff4d0)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=24) "/api/encryption/exchange", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a5a0)({ - in: (main.MethodMessage) { - name: (string) (len=27) "SetMockInvoiceAsPaidRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=20) "SetMockInvoiceAsPaid", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc000351b60)({ - authType: (*main.supportedAuth)(0xc0004ff560)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=26) "/api/lnd/mock/invoice/paid", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a640)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=20) "GetLnurlWithdrawInfo", - out: (main.MethodMessage) { - name: (string) (len=25) "LnurlWithdrawInfoResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc000351ec0)({ - authType: (*main.supportedAuth)(0xc0004ff6b0)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=30) "/api/guest/lnurl_withdraw/info", - params: ([]string) - }, - query: ([]string) (len=1 cap=1) { - (string) (len=2) "k1" - }, - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a6e0)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=19) "HandleLnurlWithdraw", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc0000a4720)({ - authType: (*main.supportedAuth)(0xc0004ff800)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=32) "/api/guest/lnurl_withdraw/handle", - params: ([]string) - }, - query: ([]string) (len=2 cap=2) { - (string) (len=2) "k1", - (string) (len=2) "pr" - }, - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a780)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=15) "GetLnurlPayInfo", - out: (main.MethodMessage) { - name: (string) (len=20) "LnurlPayInfoResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc0000a4a80)({ - authType: (*main.supportedAuth)(0xc0004ff920)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=25) "/api/guest/lnurl_pay/info", - params: ([]string) - }, - query: ([]string) (len=1 cap=1) { - (string) (len=2) "k1" - }, - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a820)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=14) "HandleLnurlPay", - out: (main.MethodMessage) { - name: (string) (len=22) "HandleLnurlPayResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc0000a4e40)({ - authType: (*main.supportedAuth)(0xc0004ffa70)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=27) "/api/guest/lnurl_pay/handle", - params: ([]string) - }, - query: ([]string) (len=4 cap=4) { - (string) (len=2) "k1", - (string) (len=6) "amount", - (string) (len=5) "nostr", - (string) (len=5) "lnurl" - }, - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a870)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=18) "HandleLnurlAddress", - out: (main.MethodMessage) { - name: (string) (len=20) "LnurlPayInfoResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc0000a5080)({ - authType: (*main.supportedAuth)(0xc0004ffb00)({ - id: (string) (len=5) "guest", - name: (string) (len=5) "Guest", - context: (map[string]string) { - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=33) "/.well-known/lnurlp/:address_name", - params: ([]string) (len=1 cap=1) { - (string) (len=12) "address_name" - } - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a910)({ - in: (main.MethodMessage) { - name: (string) (len=27) "LinkNPubThroughTokenRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=20) "LinkNPubThroughToken", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc0000a5260)({ - authType: (*main.supportedAuth)(0xc0004ffbc0)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=20) "/api/guest/npub/link", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007a960)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=6) "GetApp", - out: (main.MethodMessage) { - name: (string) (len=11) "Application", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc0000a5440)({ - authType: (*main.supportedAuth)(0xc0004ffc50)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=12) "/api/app/get", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007aa00)({ - in: (main.MethodMessage) { - name: (string) (len=17) "AddAppUserRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "AddAppUser", - out: (main.MethodMessage) { - name: (string) (len=7) "AppUser", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008a0c0)({ - authType: (*main.supportedAuth)(0xc0004ffce0)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=17) "/api/app/user/add", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007aaa0)({ - in: (main.MethodMessage) { - name: (string) (len=20) "AddAppInvoiceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=13) "AddAppInvoice", - out: (main.MethodMessage) { - name: (string) (len=18) "NewInvoiceResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008a240)({ - authType: (*main.supportedAuth)(0xc0004ffd70)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=20) "/api/app/add/invoice", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007aaf0)({ - in: (main.MethodMessage) { - name: (string) (len=24) "AddAppUserInvoiceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=17) "AddAppUserInvoice", - out: (main.MethodMessage) { - name: (string) (len=18) "NewInvoiceResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008a420)({ - authType: (*main.supportedAuth)(0xc0004ffe00)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=25) "/api/app/user/add/invoice", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007ab90)({ - in: (main.MethodMessage) { - name: (string) (len=17) "GetAppUserRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "GetAppUser", - out: (main.MethodMessage) { - name: (string) (len=7) "AppUser", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008a5a0)({ - authType: (*main.supportedAuth)(0xc0004ffe90)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=17) "/api/app/user/get", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007ac30)({ - in: (main.MethodMessage) { - name: (string) (len=24) "PayAppUserInvoiceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=17) "PayAppUserInvoice", - out: (main.MethodMessage) { - name: (string) (len=18) "PayInvoiceResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008a720)({ - authType: (*main.supportedAuth)(0xc0004fff20)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=20) "/api/app/invoice/pay", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007ac80)({ - in: (main.MethodMessage) { - name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=27) "SendAppUserToAppUserPayment", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc00008a900)({ - authType: (*main.supportedAuth)(0xc0004fffb0)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=26) "/api/app/user/internal/pay", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007ad20)({ - in: (main.MethodMessage) { - name: (string) (len=30) "SendAppUserToAppPaymentRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=23) "SendAppUserToAppPayment", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc00008aa80)({ - authType: (*main.supportedAuth)(0xc000090060)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=21) "/api/app/internal/pay", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007ad70)({ - in: (main.MethodMessage) { - name: (string) (len=26) "GetAppUserLNURLInfoRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=19) "GetAppUserLNURLInfo", - out: (main.MethodMessage) { - name: (string) (len=20) "LnurlPayInfoResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008ac00)({ - authType: (*main.supportedAuth)(0xc0000900f0)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=28) "/api/app/user/lnurl/pay/info", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007adc0)({ - in: (main.MethodMessage) { - name: (string) (len=28) "SetMockAppUserBalanceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=21) "SetMockAppUserBalance", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc00008ad80)({ - authType: (*main.supportedAuth)(0xc000090180)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=29) "/api/app/mock/user/blance/set", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007ae10)({ - in: (main.MethodMessage) { - name: (string) (len=24) "SetMockAppBalanceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=17) "SetMockAppBalance", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc00008af60)({ - authType: (*main.supportedAuth)(0xc000090210)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=24) "/api/app/mock/blance/set", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007ae60)({ - in: (main.MethodMessage) { - name: (string) (len=30) "RequestNPubLinkingTokenRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=23) "RequestNPubLinkingToken", - out: (main.MethodMessage) { - name: (string) (len=31) "RequestNPubLinkingTokenResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008b140)({ - authType: (*main.supportedAuth)(0xc0000902a0)({ - id: (string) (len=3) "app", - name: (string) (len=3) "App", - context: (map[string]string) (len=1) { - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=24) "/api/app/user/npub/token", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) false, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007aeb0)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=10) "UserHealth", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc00008b320)({ - authType: (*main.supportedAuth)(0xc000090330)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=16) "/api/user/health", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007af00)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=11) "GetUserInfo", - out: (main.MethodMessage) { - name: (string) (len=8) "UserInfo", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008b500)({ - authType: (*main.supportedAuth)(0xc0000903c0)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=14) "/api/user/info", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007afa0)({ - in: (main.MethodMessage) { - name: (string) (len=17) "AddProductRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "AddProduct", - out: (main.MethodMessage) { - name: (string) (len=7) "Product", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008b6e0)({ - authType: (*main.supportedAuth)(0xc000090450)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=21) "/api/user/product/add", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007aff0)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=17) "NewProductInvoice", - out: (main.MethodMessage) { - name: (string) (len=18) "NewInvoiceResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008bb60)({ - authType: (*main.supportedAuth)(0xc000090570)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=29) "/api/user/product/get/invoice", - params: ([]string) - }, - query: ([]string) (len=1 cap=1) { - (string) (len=2) "id" - }, - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b040)({ - in: (main.MethodMessage) { - name: (string) (len=24) "GetUserOperationsRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=17) "GetUserOperations", - out: (main.MethodMessage) { - name: (string) (len=25) "GetUserOperationsResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008bd40)({ - authType: (*main.supportedAuth)(0xc000090600)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=20) "/api/user/operations", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b0e0)({ - in: (main.MethodMessage) { - name: (string) (len=17) "NewAddressRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "NewAddress", - out: (main.MethodMessage) { - name: (string) (len=18) "NewAddressResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00008bf20)({ - authType: (*main.supportedAuth)(0xc000090690)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=19) "/api/user/chain/new", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b180)({ - in: (main.MethodMessage) { - name: (string) (len=17) "PayAddressRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "PayAddress", - out: (main.MethodMessage) { - name: (string) (len=18) "PayAddressResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013a120)({ - authType: (*main.supportedAuth)(0xc000090720)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=19) "/api/user/chain/pay", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b220)({ - in: (main.MethodMessage) { - name: (string) (len=17) "NewInvoiceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "NewInvoice", - out: (main.MethodMessage) { - name: (string) (len=18) "NewInvoiceResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013a300)({ - authType: (*main.supportedAuth)(0xc0000907b0)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=21) "/api/user/invoice/new", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b2c0)({ - in: (main.MethodMessage) { - name: (string) (len=20) "DecodeInvoiceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=13) "DecodeInvoice", - out: (main.MethodMessage) { - name: (string) (len=21) "DecodeInvoiceResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013a4e0)({ - authType: (*main.supportedAuth)(0xc000090840)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=24) "/api/user/invoice/decode", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b360)({ - in: (main.MethodMessage) { - name: (string) (len=17) "PayInvoiceRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=10) "PayInvoice", - out: (main.MethodMessage) { - name: (string) (len=18) "PayInvoiceResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013a6c0)({ - authType: (*main.supportedAuth)(0xc0000908d0)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=21) "/api/user/invoice/pay", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b400)({ - in: (main.MethodMessage) { - name: (string) (len=18) "OpenChannelRequest", - hasZeroFields: (bool) false - }, - name: (string) (len=11) "OpenChannel", - out: (main.MethodMessage) { - name: (string) (len=19) "OpenChannelResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013a8a0)({ - authType: (*main.supportedAuth)(0xc000090960)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=22) "/api/user/open/channel", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b4a0)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=20) "GetLnurlWithdrawLink", - out: (main.MethodMessage) { - name: (string) (len=17) "LnurlLinkResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013aa80)({ - authType: (*main.supportedAuth)(0xc0000909f0)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=29) "/api/user/lnurl_withdraw/link", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b540)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=15) "GetLnurlPayLink", - out: (main.MethodMessage) { - name: (string) (len=17) "LnurlLinkResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013ac60)({ - authType: (*main.supportedAuth)(0xc000090a80)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=3) "get", - route: (main.decodedRoute) { - route: (string) (len=24) "/api/user/lnurl_pay/link", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b5e0)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=19) "GetLNURLChannelLink", - out: (main.MethodMessage) { - name: (string) (len=17) "LnurlLinkResponse", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013ae40)({ - authType: (*main.supportedAuth)(0xc000090b10)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=27) "/api/user/lnurl_channel/url", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) false - }), - (*main.Method)(0xc00007b680)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=21) "GetLiveUserOperations", - out: (main.MethodMessage) { - name: (string) (len=17) "LiveUserOperation", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013b020)({ - authType: (*main.supportedAuth)(0xc000090ba0)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=24) "/api/user/operations/sub", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) true - }), - (*main.Method)(0xc00007b720)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=18) "GetMigrationUpdate", - out: (main.MethodMessage) { - name: (string) (len=15) "MigrationUpdate", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013b200)({ - authType: (*main.supportedAuth)(0xc000090c30)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=24) "/api/user/migrations/sub", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) true - }), - (*main.Method)(0xc00007b770)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=12) "GetHttpCreds", - out: (main.MethodMessage) { - name: (string) (len=9) "HttpCreds", - hasZeroFields: (bool) false - }, - opts: (*main.methodOptions)(0xc00013b3e0)({ - authType: (*main.supportedAuth)(0xc000090cc0)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=20) "/api/user/http_creds", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) false - }), - serverStream: (bool) true - }), - (*main.Method)(0xc00007b7c0)({ - in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - name: (string) (len=9) "BatchUser", - out: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true - }, - opts: (*main.methodOptions)(0xc00013b620)({ - authType: (*main.supportedAuth)(0xc000090d80)({ - id: (string) (len=4) "user", - name: (string) (len=4) "User", - context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" - } - }), - method: (string) (len=4) "post", - route: (main.decodedRoute) { - route: (string) (len=15) "/api/user/batch", - params: ([]string) - }, - query: ([]string) , - nostr: (bool) true, - batch: (bool) true - }), - serverStream: (bool) false - }) -} - -([]*main.Enum) (len=2 cap=2) { - (*main.Enum)(0xc0004fe6f0)({ - name: (string) (len=11) "AddressType", - values: ([]main.EnumValue) (len=3 cap=4) { - (main.EnumValue) { - number: (int64) 0, - name: (string) (len=19) "WITNESS_PUBKEY_HASH" - }, - (main.EnumValue) { - number: (int64) 1, - name: (string) (len=18) "NESTED_PUBKEY_HASH" - }, - (main.EnumValue) { - number: (int64) 2, - name: (string) (len=14) "TAPROOT_PUBKEY" - } - } - }), - (*main.Enum)(0xc0004fe750)({ - name: (string) (len=17) "UserOperationType", - values: ([]main.EnumValue) (len=6 cap=8) { - (main.EnumValue) { - number: (int64) 0, - name: (string) (len=11) "INCOMING_TX" - }, - (main.EnumValue) { - number: (int64) 1, - name: (string) (len=11) "OUTGOING_TX" - }, - (main.EnumValue) { - number: (int64) 2, - name: (string) (len=16) "INCOMING_INVOICE" - }, - (main.EnumValue) { - number: (int64) 3, - name: (string) (len=16) "OUTGOING_INVOICE" - }, - (main.EnumValue) { - number: (int64) 4, - name: (string) (len=21) "OUTGOING_USER_TO_USER" - }, - (main.EnumValue) { - number: (int64) 5, - name: (string) (len=21) "INCOMING_USER_TO_USER" - } - } - }) -} - -(map[string]*main.Message) (len=70) { - (string) (len=12) "UsageMetrics": (*main.Message)(0xc000348580)({ - fullName: (string) (len=12) "UsageMetrics", - name: (string) (len=12) "UsageMetrics", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc000207f80)({ - name: (string) (len=7) "metrics", - kind: (string) (len=11) "UsageMetric", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=11) "OpenChannel": (*main.Message)(0xc000348d00)({ - fullName: (string) (len=11) "OpenChannel", - name: (string) (len=11) "OpenChannel", - fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc0004fc6c0)({ - name: (string) (len=10) "channel_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc6f0)({ - name: (string) (len=8) "capacity", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc720)({ - name: (string) (len=6) "active", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc750)({ - name: (string) (len=8) "lifetime", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc780)({ - name: (string) (len=13) "local_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc7b0)({ - name: (string) (len=14) "remote_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000349400)({ - fullName: (string) (len=17) "NewAddressRequest", - name: (string) (len=17) "NewAddressRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd530)({ - name: (string) (len=11) "addressType", - kind: (string) (len=11) "AddressType", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) true, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000349840)({ - fullName: (string) (len=20) "LnurlPayInfoResponse", - name: (string) (len=20) "LnurlPayInfoResponse", - fields: ([]*main.Field) (len=7 cap=8) { - (*main.Field)(0xc0004fdbf0)({ - name: (string) (len=3) "tag", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdc20)({ - name: (string) (len=8) "callback", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdc50)({ - name: (string) (len=11) "maxSendable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdc80)({ - name: (string) (len=11) "minSendable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdcb0)({ - name: (string) (len=8) "metadata", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdce0)({ - name: (string) (len=11) "allowsNostr", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdd10)({ - name: (string) (len=11) "nostrPubkey", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc000349b40)({ - fullName: (string) (len=25) "GetProductBuyLinkResponse", - name: (string) (len=25) "GetProductBuyLinkResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fe480)({ - name: (string) (len=4) "link", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=9) "UsersInfo": (*main.Message)(0xc000348840)({ - fullName: (string) (len=9) "UsersInfo", - name: (string) (len=9) "UsersInfo", - fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc00024ac60)({ - name: (string) (len=5) "total", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc00024ac90)({ - name: (string) (len=10) "no_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc000)({ - name: (string) (len=16) "negative_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc030)({ - name: (string) (len=20) "always_been_inactive", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc060)({ - name: (string) (len=11) "balance_avg", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc090)({ - name: (string) (len=14) "balance_median", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=13) "AddAppRequest": (*main.Message)(0xc000349040)({ - fullName: (string) (len=13) "AddAppRequest", - name: (string) (len=13) "AddAppRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fce40)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fce70)({ - name: (string) (len=19) "allow_user_creation", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=21) "DecodeInvoiceResponse": (*main.Message)(0xc0003495c0)({ - fullName: (string) (len=21) "DecodeInvoiceResponse", - name: (string) (len=21) "DecodeInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd7a0)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=10) "LndMetrics": (*main.Message)(0xc000348e80)({ - fullName: (string) (len=10) "LndMetrics", - name: (string) (len=10) "LndMetrics", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fcc00)({ - name: (string) (len=5) "nodes", - kind: (string) (len=14) "LndNodeMetrics", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "AddProductRequest": (*main.Message)(0xc000349ac0)({ - fullName: (string) (len=17) "AddProductRequest", - name: (string) (len=17) "AddProductRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fe390)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe3c0)({ - name: (string) (len=10) "price_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=5) "Empty": (*main.Message)(0xc000348080)({ - fullName: (string) (len=5) "Empty", - name: (string) (len=5) "Empty", - fields: ([]*main.Field) - }), - (string) (len=14) "ChannelRouting": (*main.Message)(0xc000348dc0)({ - fullName: (string) (len=14) "ChannelRouting", - name: (string) (len=14) "ChannelRouting", - fields: ([]*main.Field) (len=10 cap=16) { - (*main.Field)(0xc0004fc870)({ - name: (string) (len=10) "channel_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc8a0)({ - name: (string) (len=11) "send_errors", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc8d0)({ - name: (string) (len=14) "receive_errors", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc900)({ - name: (string) (len=23) "forward_errors_as_input", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc930)({ - name: (string) (len=24) "forward_errors_as_output", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc960)({ - name: (string) (len=27) "missed_forward_fee_as_input", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc990)({ - name: (string) (len=28) "missed_forward_fee_as_output", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc9c0)({ - name: (string) (len=20) "forward_fee_as_input", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc9f0)({ - name: (string) (len=21) "forward_fee_as_output", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fca20)({ - name: (string) (len=13) "events_number", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc000349680)({ - fullName: (string) (len=18) "PayInvoiceResponse", - name: (string) (len=18) "PayInvoiceResponse", - fields: ([]*main.Field) (len=5 cap=8) { - (*main.Field)(0xc0004fd830)({ - name: (string) (len=8) "preimage", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd860)({ - name: (string) (len=11) "amount_paid", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd890)({ - name: (string) (len=12) "operation_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd8c0)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd8f0)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=8) "UserInfo": (*main.Message)(0xc0003498c0)({ - fullName: (string) (len=8) "UserInfo", - name: (string) (len=8) "UserInfo", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fdda0)({ - name: (string) (len=6) "userId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fddd0)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fde00)({ - name: (string) (len=16) "max_withdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fde30)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=15) "MigrationUpdate": (*main.Message)(0xc000349bc0)({ - fullName: (string) (len=15) "MigrationUpdate", - name: (string) (len=15) "MigrationUpdate", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fe4e0)({ - name: (string) (len=7) "closure", - kind: (string) (len=16) "ClosureMigration", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) true - }), - (*main.Field)(0xc0004fe510)({ - name: (string) (len=6) "relays", - kind: (string) (len=15) "RelaysMigration", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) true - }) - } - }), - (string) (len=27) "LinkNPubThroughTokenRequest": (*main.Message)(0xc000349d00)({ - fullName: (string) (len=27) "LinkNPubThroughTokenRequest", - name: (string) (len=27) "LinkNPubThroughTokenRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fe600)({ - name: (string) (len=5) "token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe630)({ - name: (string) (len=9) "nostr_pub", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000349480)({ - fullName: (string) (len=17) "PayAddressRequest", - name: (string) (len=17) "PayAddressRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fd590)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd5c0)({ - name: (string) (len=9) "amoutSats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd5f0)({ - name: (string) (len=12) "satsPerVByte", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "PayAddressResponse": (*main.Message)(0xc0003494c0)({ - fullName: (string) (len=18) "PayAddressResponse", - name: (string) (len=18) "PayAddressResponse", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fd620)({ - name: (string) (len=4) "txId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd650)({ - name: (string) (len=12) "operation_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd680)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd6b0)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=10) "AppMetrics": (*main.Message)(0xc000348900)({ - fullName: (string) (len=10) "AppMetrics", - name: (string) (len=10) "AppMetrics", - fields: ([]*main.Field) (len=9 cap=16) { - (*main.Field)(0xc0004fc0c0)({ - name: (string) (len=3) "app", - kind: (string) (len=11) "Application", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc0f0)({ - name: (string) (len=5) "users", - kind: (string) (len=9) "UsersInfo", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc120)({ - name: (string) (len=8) "received", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc150)({ - name: (string) (len=5) "spent", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc180)({ - name: (string) (len=9) "available", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc1b0)({ - name: (string) (len=4) "fees", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc1e0)({ - name: (string) (len=8) "invoices", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc210)({ - name: (string) (len=10) "total_fees", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc240)({ - name: (string) (len=10) "operations", - kind: (string) (len=13) "UserOperation", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=15) "BanUserResponse": (*main.Message)(0xc000349000)({ - fullName: (string) (len=15) "BanUserResponse", - name: (string) (len=15) "BanUserResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fcde0)({ - name: (string) (len=12) "balance_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fce10)({ - name: (string) (len=16) "banned_app_users", - kind: (string) (len=13) "BannedAppUser", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=7) "AuthApp": (*main.Message)(0xc000349100)({ - fullName: (string) (len=7) "AuthApp", - name: (string) (len=7) "AuthApp", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fcfc0)({ - name: (string) (len=3) "app", - kind: (string) (len=11) "Application", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcff0)({ - name: (string) (len=10) "auth_token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LndMetricsRequest": (*main.Message)(0xc0003489c0)({ - fullName: (string) (len=17) "LndMetricsRequest", - name: (string) (len=17) "LndMetricsRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fc2a0)({ - name: (string) (len=9) "from_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }), - (*main.Field)(0xc0004fc2d0)({ - name: (string) (len=7) "to_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }) - } - }), - (string) (len=13) "BannedAppUser": (*main.Message)(0xc000348fc0)({ - fullName: (string) (len=13) "BannedAppUser", - name: (string) (len=13) "BannedAppUser", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fcd20)({ - name: (string) (len=8) "app_name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcd50)({ - name: (string) (len=6) "app_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcd80)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcdb0)({ - name: (string) (len=9) "nostr_pub", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "GetAppUserRequest": (*main.Message)(0xc000349240)({ - fullName: (string) (len=17) "GetAppUserRequest", - name: (string) (len=17) "GetAppUserRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd290)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc0003493c0)({ - fullName: (string) (len=24) "SetMockAppBalanceRequest", - name: (string) (len=24) "SetMockAppBalanceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd500)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc000349580)({ - fullName: (string) (len=20) "DecodeInvoiceRequest", - name: (string) (len=20) "DecodeInvoiceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd770)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=31) "RequestNPubLinkingTokenResponse": (*main.Message)(0xc000349cc0)({ - fullName: (string) (len=31) "RequestNPubLinkingTokenResponse", - name: (string) (len=31) "RequestNPubLinkingTokenResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fe5d0)({ - name: (string) (len=5) "token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000348ec0)({ - fullName: (string) (len=17) "LndGetInfoRequest", - name: (string) (len=17) "LndGetInfoRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fcc30)({ - name: (string) (len=6) "nodeId", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=7) "AppUser": (*main.Message)(0xc000349180)({ - fullName: (string) (len=7) "AppUser", - name: (string) (len=7) "AppUser", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fd0b0)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd0e0)({ - name: (string) (len=4) "info", - kind: (string) (len=8) "UserInfo", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd110)({ - name: (string) (len=16) "max_withdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc000349380)({ - fullName: (string) (len=28) "SetMockAppUserBalanceRequest", - name: (string) (len=28) "SetMockAppUserBalanceRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fd4a0)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd4d0)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000349600)({ - fullName: (string) (len=17) "PayInvoiceRequest", - name: (string) (len=17) "PayInvoiceRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fd7d0)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd800)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc000349140)({ - fullName: (string) (len=17) "AddAppUserRequest", - name: (string) (len=17) "AddAppUserRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fd020)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd050)({ - name: (string) (len=14) "fail_if_exists", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd080)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000349540)({ - fullName: (string) (len=18) "NewInvoiceResponse", - name: (string) (len=18) "NewInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd740)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=11) "AppsMetrics": (*main.Message)(0xc000348940)({ - fullName: (string) (len=11) "AppsMetrics", - name: (string) (len=11) "AppsMetrics", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fc270)({ - name: (string) (len=4) "apps", - kind: (string) (len=10) "AppMetrics", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000348f40)({ - fullName: (string) (len=18) "LndGetInfoResponse", - name: (string) (len=18) "LndGetInfoResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fccc0)({ - name: (string) (len=5) "alias", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000349440)({ - fullName: (string) (len=18) "NewAddressResponse", - name: (string) (len=18) "NewAddressResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd560)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "BanUserRequest": (*main.Message)(0xc000348f80)({ - fullName: (string) (len=14) "BanUserRequest", - name: (string) (len=14) "BanUserRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fccf0)({ - name: (string) (len=7) "user_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc0003492c0)({ - fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fd350)({ - name: (string) (len=20) "from_user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd380)({ - name: (string) (len=18) "to_user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd3b0)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc000349300)({ - fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", - name: (string) (len=30) "SendAppUserToAppPaymentRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fd3e0)({ - name: (string) (len=20) "from_user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd410)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc000349940)({ - fullName: (string) (len=24) "GetUserOperationsRequest", - name: (string) (len=24) "GetUserOperationsRequest", - fields: ([]*main.Field) (len=7 cap=8) { - (*main.Field)(0xc0004fde60)({ - name: (string) (len=21) "latestIncomingInvoice", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fde90)({ - name: (string) (len=21) "latestOutgoingInvoice", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdec0)({ - name: (string) (len=16) "latestIncomingTx", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdef0)({ - name: (string) (len=16) "latestOutgoingTx", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdf20)({ - name: (string) (len=31) "latestIncomingUserToUserPayment", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdf50)({ - name: (string) (len=31) "latestOutgoingUserToUserPayment", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdf80)({ - name: (string) (len=8) "max_size", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc000349a80)({ - fullName: (string) (len=25) "GetUserOperationsResponse", - name: (string) (len=25) "GetUserOperationsResponse", - fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc0004fe270)({ - name: (string) (len=31) "latestOutgoingInvoiceOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe2a0)({ - name: (string) (len=31) "latestIncomingInvoiceOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe2d0)({ - name: (string) (len=26) "latestOutgoingTxOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe300)({ - name: (string) (len=26) "latestIncomingTxOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe330)({ - name: (string) (len=32) "latestOutgoingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe360)({ - name: (string) (len=32) "latestIncomingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=16) "ClosureMigration": (*main.Message)(0xc000349c00)({ - fullName: (string) (len=16) "ClosureMigration", - name: (string) (len=16) "ClosureMigration", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fe540)({ - name: (string) (len=14) "closes_at_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "AuthAppRequest": (*main.Message)(0xc000349080)({ - fullName: (string) (len=14) "AuthAppRequest", - name: (string) (len=14) "AuthAppRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fcea0)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fced0)({ - name: (string) (len=19) "allow_user_creation", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }) - } - }), - (string) (len=11) "Application": (*main.Message)(0xc0003490c0)({ - fullName: (string) (len=11) "Application", - name: (string) (len=11) "Application", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fcf00)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcf30)({ - name: (string) (len=2) "id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcf60)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcf90)({ - name: (string) (len=4) "npub", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "AddAppInvoiceRequest": (*main.Message)(0xc0003491c0)({ - fullName: (string) (len=20) "AddAppInvoiceRequest", - name: (string) (len=20) "AddAppInvoiceRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fd140)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd170)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd1a0)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc000349340)({ - fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", - name: (string) (len=26) "GetAppUserLNURLInfoRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fd440)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd470)({ - name: (string) (len=17) "base_url_override", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000349740)({ - fullName: (string) (len=17) "LnurlLinkResponse", - name: (string) (len=17) "LnurlLinkResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fda10)({ - name: (string) (len=5) "lnurl", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fda40)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc0003497c0)({ - fullName: (string) (len=25) "LnurlWithdrawInfoResponse", - name: (string) (len=25) "LnurlWithdrawInfoResponse", - fields: ([]*main.Field) (len=8 cap=8) { - (*main.Field)(0xc0004fda70)({ - name: (string) (len=3) "tag", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdaa0)({ - name: (string) (len=8) "callback", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdad0)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdb00)({ - name: (string) (len=18) "defaultDescription", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdb30)({ - name: (string) (len=15) "minWithdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdb60)({ - name: (string) (len=15) "maxWithdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdb90)({ - name: (string) (len=12) "balanceCheck", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdbc0)({ - name: (string) (len=7) "payLink", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=13) "UserOperation": (*main.Message)(0xc0003499c0)({ - fullName: (string) (len=13) "UserOperation", - name: (string) (len=13) "UserOperation", - fields: ([]*main.Field) (len=11 cap=16) { - (*main.Field)(0xc0004fdfb0)({ - name: (string) (len=10) "paidAtUnix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe000)({ - name: (string) (len=4) "type", - kind: (string) (len=17) "UserOperationType", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) true, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe030)({ - name: (string) (len=7) "inbound", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe060)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe090)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe0c0)({ - name: (string) (len=11) "operationId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe0f0)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe120)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe150)({ - name: (string) (len=9) "confirmed", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe180)({ - name: (string) (len=7) "tx_hash", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe1b0)({ - name: (string) (len=8) "internal", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=15) "RelaysMigration": (*main.Message)(0xc000349c40)({ - fullName: (string) (len=15) "RelaysMigration", - name: (string) (len=15) "RelaysMigration", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fe570)({ - name: (string) (len=6) "relays", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=30) "RequestNPubLinkingTokenRequest": (*main.Message)(0xc000349c80)({ - fullName: (string) (len=30) "RequestNPubLinkingTokenRequest", - name: (string) (len=30) "RequestNPubLinkingTokenRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fe5a0)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000348180)({ - fullName: (string) (len=25) "EncryptionExchangeRequest", - name: (string) (len=25) "EncryptionExchangeRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc000207d70)({ - name: (string) (len=9) "publicKey", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207da0)({ - name: (string) (len=8) "deviceId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "AppsMetricsRequest": (*main.Message)(0xc000348600)({ - fullName: (string) (len=18) "AppsMetricsRequest", - name: (string) (len=18) "AppsMetricsRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc000207fb0)({ - name: (string) (len=9) "from_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }), - (*main.Field)(0xc00034ec90)({ - name: (string) (len=7) "to_unix", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }), - (*main.Field)(0xc00034ecc0)({ - name: (string) (len=18) "include_operations", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) true - }) - } - }), - (string) (len=13) "ClosedChannel": (*main.Message)(0xc000348d40)({ - fullName: (string) (len=13) "ClosedChannel", - name: (string) (len=13) "ClosedChannel", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fc7e0)({ - name: (string) (len=10) "channel_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc810)({ - name: (string) (len=8) "capacity", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc840)({ - name: (string) (len=13) "closed_height", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000349700)({ - fullName: (string) (len=19) "OpenChannelResponse", - name: (string) (len=19) "OpenChannelResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fd9e0)({ - name: (string) (len=9) "channelId", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=7) "Product": (*main.Message)(0xc000349b00)({ - fullName: (string) (len=7) "Product", - name: (string) (len=7) "Product", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fe3f0)({ - name: (string) (len=2) "id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe420)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe450)({ - name: (string) (len=10) "price_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc000349280)({ - fullName: (string) (len=24) "PayAppUserInvoiceRequest", - name: (string) (len=24) "PayAppUserInvoiceRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fd2c0)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd2f0)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd320)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000349500)({ - fullName: (string) (len=17) "NewInvoiceRequest", - name: (string) (len=17) "NewInvoiceRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fd6e0)({ - name: (string) (len=10) "amountSats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd710)({ - name: (string) (len=4) "memo", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LiveUserOperation": (*main.Message)(0xc000349b80)({ - fullName: (string) (len=17) "LiveUserOperation", - name: (string) (len=17) "LiveUserOperation", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0004fe4b0)({ - name: (string) (len=9) "operation", - kind: (string) (len=13) "UserOperation", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=9) "HttpCreds": (*main.Message)(0xc000349d40)({ - fullName: (string) (len=9) "HttpCreds", - name: (string) (len=9) "HttpCreds", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fe660)({ - name: (string) (len=3) "url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe690)({ - name: (string) (len=5) "token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=11) "UsageMetric": (*main.Message)(0xc0003482c0)({ - fullName: (string) (len=11) "UsageMetric", - name: (string) (len=11) "UsageMetric", - fields: ([]*main.Field) (len=9 cap=16) { - (*main.Field)(0xc000207dd0)({ - name: (string) (len=15) "processed_at_ms", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207e00)({ - name: (string) (len=14) "parsed_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207e30)({ - name: (string) (len=12) "auth_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207e60)({ - name: (string) (len=16) "validate_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207e90)({ - name: (string) (len=14) "handle_in_nano", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207ec0)({ - name: (string) (len=8) "rpc_name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207ef0)({ - name: (string) (len=5) "batch", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207f20)({ - name: (string) (len=5) "nostr", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc000207f50)({ - name: (string) (len=10) "batch_size", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=12) "RoutingEvent": (*main.Message)(0xc000348b40)({ - fullName: (string) (len=12) "RoutingEvent", - name: (string) (len=12) "RoutingEvent", - fields: ([]*main.Field) (len=12 cap=16) { - (*main.Field)(0xc0004fc300)({ - name: (string) (len=19) "incoming_channel_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc330)({ - name: (string) (len=16) "incoming_htlc_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc360)({ - name: (string) (len=19) "outgoing_channel_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc390)({ - name: (string) (len=16) "outgoing_htlc_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc3c0)({ - name: (string) (len=12) "timestamp_ns", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc3f0)({ - name: (string) (len=10) "event_type", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc420)({ - name: (string) (len=17) "incoming_amt_msat", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc450)({ - name: (string) (len=17) "outgoing_amt_msat", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc480)({ - name: (string) (len=14) "failure_string", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc4b0)({ - name: (string) (len=7) "settled", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc4e0)({ - name: (string) (len=8) "offchain", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc510)({ - name: (string) (len=18) "forward_fail_event", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=19) "ChannelBalanceEvent": (*main.Message)(0xc000348c40)({ - fullName: (string) (len=19) "ChannelBalanceEvent", - name: (string) (len=19) "ChannelBalanceEvent", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fc540)({ - name: (string) (len=12) "block_height", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc570)({ - name: (string) (len=10) "channel_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc5a0)({ - name: (string) (len=18) "local_balance_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc5d0)({ - name: (string) (len=19) "remote_balance_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc000349880)({ - fullName: (string) (len=22) "HandleLnurlPayResponse", - name: (string) (len=22) "HandleLnurlPayResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fdd40)({ - name: (string) (len=2) "pr", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fdd70)({ - name: (string) (len=6) "routes", - kind: (string) (len=5) "Empty", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "UserOperations": (*main.Message)(0xc000349a00)({ - fullName: (string) (len=14) "UserOperations", - name: (string) (len=14) "UserOperations", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0004fe1e0)({ - name: (string) (len=9) "fromIndex", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe210)({ - name: (string) (len=7) "toIndex", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fe240)({ - name: (string) (len=10) "operations", - kind: (string) (len=13) "UserOperation", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "ChainBalanceEvent": (*main.Message)(0xc000348c80)({ - fullName: (string) (len=17) "ChainBalanceEvent", - name: (string) (len=17) "ChainBalanceEvent", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fc600)({ - name: (string) (len=12) "block_height", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc630)({ - name: (string) (len=17) "confirmed_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc660)({ - name: (string) (len=19) "unconfirmed_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fc690)({ - name: (string) (len=13) "total_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "LndNodeMetrics": (*main.Message)(0xc000348e40)({ - fullName: (string) (len=14) "LndNodeMetrics", - name: (string) (len=14) "LndNodeMetrics", - fields: ([]*main.Field) (len=9 cap=16) { - (*main.Field)(0xc0004fca50)({ - name: (string) (len=23) "channels_balance_events", - kind: (string) (len=19) "ChannelBalanceEvent", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fca80)({ - name: (string) (len=20) "chain_balance_events", - kind: (string) (len=17) "ChainBalanceEvent", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcab0)({ - name: (string) (len=16) "offline_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcae0)({ - name: (string) (len=15) "online_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcb10)({ - name: (string) (len=16) "pending_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcb40)({ - name: (string) (len=16) "closing_channels", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcb70)({ - name: (string) (len=13) "open_channels", - kind: (string) (len=11) "OpenChannel", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcba0)({ - name: (string) (len=15) "closed_channels", - kind: (string) (len=13) "ClosedChannel", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcbd0)({ - name: (string) (len=15) "channel_routing", - kind: (string) (len=14) "ChannelRouting", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc000348f00)({ - fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", - name: (string) (len=27) "SetMockInvoiceAsPaidRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0004fcc60)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fcc90)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc000349200)({ - fullName: (string) (len=24) "AddAppUserInvoiceRequest", - name: (string) (len=24) "AddAppUserInvoiceRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fd1d0)({ - name: (string) (len=19) "receiver_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd200)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd230)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd260)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0003496c0)({ - fullName: (string) (len=18) "OpenChannelRequest", - name: (string) (len=18) "OpenChannelRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0004fd920)({ - name: (string) (len=11) "destination", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd950)({ - name: (string) (len=13) "fundingAmount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd980)({ - name: (string) (len=10) "pushAmount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0004fd9b0)({ - name: (string) (len=12) "closeAddress", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }) -} - -parsing file: structs 70 -parsing file: methods 2 --> [{guest Guest map[]} {user User map[app_id:string app_user_id:string user_id:string]} {admin Admin map[admin_id:string]} {metrics Metrics map[operator_id:string]} {app App map[app_id:string]}] - +([]*main.Method) (len=46 cap=64) { + (*main.Method)(0xc00007a1e0)({ + in: (main.MethodMessage) { + name: (string) (len=17) "LndGetInfoRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "LndGetInfo", + out: (main.MethodMessage) { + name: (string) (len=18) "LndGetInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc000071560)({ + authType: (*main.supportedAuth)(0xc0004ff020)({ + id: (string) (len=5) "admin", + name: (string) (len=5) "Admin", + context: (map[string]string) (len=1) { + (string) (len=8) "admin_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=22) "/api/admin/lnd/getinfo", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a280)({ + in: (main.MethodMessage) { + name: (string) (len=13) "AddAppRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=6) "AddApp", + out: (main.MethodMessage) { + name: (string) (len=7) "AuthApp", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc0000716e0)({ + authType: (*main.supportedAuth)(0xc0004ff0b0)({ + id: (string) (len=5) "admin", + name: (string) (len=5) "Admin", + context: (map[string]string) (len=1) { + (string) (len=8) "admin_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=18) "/api/admin/app/add", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a320)({ + in: (main.MethodMessage) { + name: (string) (len=14) "AuthAppRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=7) "AuthApp", + out: (main.MethodMessage) { + name: (string) (len=7) "AuthApp", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc000071860)({ + authType: (*main.supportedAuth)(0xc0004ff140)({ + id: (string) (len=5) "admin", + name: (string) (len=5) "Admin", + context: (map[string]string) (len=1) { + (string) (len=8) "admin_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=19) "/api/admin/app/auth", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a3c0)({ + in: (main.MethodMessage) { + name: (string) (len=14) "BanUserRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=7) "BanUser", + out: (main.MethodMessage) { + name: (string) (len=15) "BanUserResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc0000719e0)({ + authType: (*main.supportedAuth)(0xc0004ff1d0)({ + id: (string) (len=5) "admin", + name: (string) (len=5) "Admin", + context: (map[string]string) (len=1) { + (string) (len=8) "admin_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=19) "/api/admin/user/ban", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a410)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=15) "GetUsageMetrics", + out: (main.MethodMessage) { + name: (string) (len=12) "UsageMetrics", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc000071b60)({ + authType: (*main.supportedAuth)(0xc0004ff260)({ + id: (string) (len=7) "metrics", + name: (string) (len=7) "Metrics", + context: (map[string]string) (len=1) { + (string) (len=11) "operator_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=18) "/api/reports/usage", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a460)({ + in: (main.MethodMessage) { + name: (string) (len=18) "AppsMetricsRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=14) "GetAppsMetrics", + out: (main.MethodMessage) { + name: (string) (len=11) "AppsMetrics", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc000071ce0)({ + authType: (*main.supportedAuth)(0xc0004ff2f0)({ + id: (string) (len=7) "metrics", + name: (string) (len=7) "Metrics", + context: (map[string]string) (len=1) { + (string) (len=11) "operator_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=17) "/api/reports/apps", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a4b0)({ + in: (main.MethodMessage) { + name: (string) (len=17) "LndMetricsRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=13) "GetLndMetrics", + out: (main.MethodMessage) { + name: (string) (len=10) "LndMetrics", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc000071e60)({ + authType: (*main.supportedAuth)(0xc0004ff380)({ + id: (string) (len=7) "metrics", + name: (string) (len=7) "Metrics", + context: (map[string]string) (len=1) { + (string) (len=11) "operator_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=16) "/api/reports/lnd", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a500)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=6) "Health", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc000351800)({ + authType: (*main.supportedAuth)(0xc0004ff410)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=11) "/api/health", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a550)({ + in: (main.MethodMessage) { + name: (string) (len=25) "EncryptionExchangeRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=18) "EncryptionExchange", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc000351980)({ + authType: (*main.supportedAuth)(0xc0004ff4d0)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=24) "/api/encryption/exchange", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a5a0)({ + in: (main.MethodMessage) { + name: (string) (len=27) "SetMockInvoiceAsPaidRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=20) "SetMockInvoiceAsPaid", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc000351b60)({ + authType: (*main.supportedAuth)(0xc0004ff560)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=26) "/api/lnd/mock/invoice/paid", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a640)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=20) "GetLnurlWithdrawInfo", + out: (main.MethodMessage) { + name: (string) (len=25) "LnurlWithdrawInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc000351ec0)({ + authType: (*main.supportedAuth)(0xc0004ff6b0)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=30) "/api/guest/lnurl_withdraw/info", + params: ([]string) + }, + query: ([]string) (len=1 cap=1) { + (string) (len=2) "k1" + }, + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a6e0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=19) "HandleLnurlWithdraw", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc0000a4720)({ + authType: (*main.supportedAuth)(0xc0004ff800)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=32) "/api/guest/lnurl_withdraw/handle", + params: ([]string) + }, + query: ([]string) (len=2 cap=2) { + (string) (len=2) "k1", + (string) (len=2) "pr" + }, + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a780)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=15) "GetLnurlPayInfo", + out: (main.MethodMessage) { + name: (string) (len=20) "LnurlPayInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc0000a4a80)({ + authType: (*main.supportedAuth)(0xc0004ff920)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=25) "/api/guest/lnurl_pay/info", + params: ([]string) + }, + query: ([]string) (len=1 cap=1) { + (string) (len=2) "k1" + }, + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a820)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=14) "HandleLnurlPay", + out: (main.MethodMessage) { + name: (string) (len=22) "HandleLnurlPayResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc0000a4e40)({ + authType: (*main.supportedAuth)(0xc0004ffa70)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=27) "/api/guest/lnurl_pay/handle", + params: ([]string) + }, + query: ([]string) (len=4 cap=4) { + (string) (len=2) "k1", + (string) (len=6) "amount", + (string) (len=5) "nostr", + (string) (len=5) "lnurl" + }, + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a870)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=18) "HandleLnurlAddress", + out: (main.MethodMessage) { + name: (string) (len=20) "LnurlPayInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc0000a5080)({ + authType: (*main.supportedAuth)(0xc0004ffb00)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=33) "/.well-known/lnurlp/:address_name", + params: ([]string) (len=1 cap=1) { + (string) (len=12) "address_name" + } + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a910)({ + in: (main.MethodMessage) { + name: (string) (len=27) "LinkNPubThroughTokenRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=20) "LinkNPubThroughToken", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc0000a5260)({ + authType: (*main.supportedAuth)(0xc0004ffbc0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=20) "/api/guest/npub/link", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007a960)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=6) "GetApp", + out: (main.MethodMessage) { + name: (string) (len=11) "Application", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc0000a5440)({ + authType: (*main.supportedAuth)(0xc0004ffc50)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=12) "/api/app/get", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007aa00)({ + in: (main.MethodMessage) { + name: (string) (len=17) "AddAppUserRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "AddAppUser", + out: (main.MethodMessage) { + name: (string) (len=7) "AppUser", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008a0c0)({ + authType: (*main.supportedAuth)(0xc0004ffce0)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=17) "/api/app/user/add", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007aaa0)({ + in: (main.MethodMessage) { + name: (string) (len=20) "AddAppInvoiceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=13) "AddAppInvoice", + out: (main.MethodMessage) { + name: (string) (len=18) "NewInvoiceResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008a240)({ + authType: (*main.supportedAuth)(0xc0004ffd70)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=20) "/api/app/add/invoice", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007aaf0)({ + in: (main.MethodMessage) { + name: (string) (len=24) "AddAppUserInvoiceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=17) "AddAppUserInvoice", + out: (main.MethodMessage) { + name: (string) (len=18) "NewInvoiceResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008a420)({ + authType: (*main.supportedAuth)(0xc0004ffe00)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=25) "/api/app/user/add/invoice", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007ab90)({ + in: (main.MethodMessage) { + name: (string) (len=17) "GetAppUserRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "GetAppUser", + out: (main.MethodMessage) { + name: (string) (len=7) "AppUser", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008a5a0)({ + authType: (*main.supportedAuth)(0xc0004ffe90)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=17) "/api/app/user/get", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007ac30)({ + in: (main.MethodMessage) { + name: (string) (len=24) "PayAppUserInvoiceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=17) "PayAppUserInvoice", + out: (main.MethodMessage) { + name: (string) (len=18) "PayInvoiceResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008a720)({ + authType: (*main.supportedAuth)(0xc0004fff20)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=20) "/api/app/invoice/pay", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007ac80)({ + in: (main.MethodMessage) { + name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=27) "SendAppUserToAppUserPayment", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc00008a900)({ + authType: (*main.supportedAuth)(0xc0004fffb0)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=26) "/api/app/user/internal/pay", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007ad20)({ + in: (main.MethodMessage) { + name: (string) (len=30) "SendAppUserToAppPaymentRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=23) "SendAppUserToAppPayment", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc00008aa80)({ + authType: (*main.supportedAuth)(0xc000090060)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=21) "/api/app/internal/pay", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007ad70)({ + in: (main.MethodMessage) { + name: (string) (len=26) "GetAppUserLNURLInfoRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=19) "GetAppUserLNURLInfo", + out: (main.MethodMessage) { + name: (string) (len=20) "LnurlPayInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008ac00)({ + authType: (*main.supportedAuth)(0xc0000900f0)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=28) "/api/app/user/lnurl/pay/info", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007adc0)({ + in: (main.MethodMessage) { + name: (string) (len=28) "SetMockAppUserBalanceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=21) "SetMockAppUserBalance", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc00008ad80)({ + authType: (*main.supportedAuth)(0xc000090180)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=29) "/api/app/mock/user/blance/set", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007ae10)({ + in: (main.MethodMessage) { + name: (string) (len=24) "SetMockAppBalanceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=17) "SetMockAppBalance", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc00008af60)({ + authType: (*main.supportedAuth)(0xc000090210)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=24) "/api/app/mock/blance/set", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007ae60)({ + in: (main.MethodMessage) { + name: (string) (len=30) "RequestNPubLinkingTokenRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=23) "RequestNPubLinkingToken", + out: (main.MethodMessage) { + name: (string) (len=31) "RequestNPubLinkingTokenResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008b140)({ + authType: (*main.supportedAuth)(0xc0000902a0)({ + id: (string) (len=3) "app", + name: (string) (len=3) "App", + context: (map[string]string) (len=1) { + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=24) "/api/app/user/npub/token", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) false, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007aeb0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=10) "UserHealth", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc00008b320)({ + authType: (*main.supportedAuth)(0xc000090330)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=16) "/api/user/health", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007af00)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=11) "GetUserInfo", + out: (main.MethodMessage) { + name: (string) (len=8) "UserInfo", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008b500)({ + authType: (*main.supportedAuth)(0xc0000903c0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=14) "/api/user/info", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007afa0)({ + in: (main.MethodMessage) { + name: (string) (len=17) "AddProductRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "AddProduct", + out: (main.MethodMessage) { + name: (string) (len=7) "Product", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008b6e0)({ + authType: (*main.supportedAuth)(0xc000090450)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=21) "/api/user/product/add", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007aff0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=17) "NewProductInvoice", + out: (main.MethodMessage) { + name: (string) (len=18) "NewInvoiceResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008bb60)({ + authType: (*main.supportedAuth)(0xc000090570)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=29) "/api/user/product/get/invoice", + params: ([]string) + }, + query: ([]string) (len=1 cap=1) { + (string) (len=2) "id" + }, + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b040)({ + in: (main.MethodMessage) { + name: (string) (len=24) "GetUserOperationsRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=17) "GetUserOperations", + out: (main.MethodMessage) { + name: (string) (len=25) "GetUserOperationsResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008bd40)({ + authType: (*main.supportedAuth)(0xc000090600)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=20) "/api/user/operations", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b0e0)({ + in: (main.MethodMessage) { + name: (string) (len=17) "NewAddressRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "NewAddress", + out: (main.MethodMessage) { + name: (string) (len=18) "NewAddressResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00008bf20)({ + authType: (*main.supportedAuth)(0xc000090690)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=19) "/api/user/chain/new", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b180)({ + in: (main.MethodMessage) { + name: (string) (len=17) "PayAddressRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "PayAddress", + out: (main.MethodMessage) { + name: (string) (len=18) "PayAddressResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013a120)({ + authType: (*main.supportedAuth)(0xc000090720)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=19) "/api/user/chain/pay", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b220)({ + in: (main.MethodMessage) { + name: (string) (len=17) "NewInvoiceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "NewInvoice", + out: (main.MethodMessage) { + name: (string) (len=18) "NewInvoiceResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013a300)({ + authType: (*main.supportedAuth)(0xc0000907b0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=21) "/api/user/invoice/new", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b2c0)({ + in: (main.MethodMessage) { + name: (string) (len=20) "DecodeInvoiceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=13) "DecodeInvoice", + out: (main.MethodMessage) { + name: (string) (len=21) "DecodeInvoiceResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013a4e0)({ + authType: (*main.supportedAuth)(0xc000090840)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=24) "/api/user/invoice/decode", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b360)({ + in: (main.MethodMessage) { + name: (string) (len=17) "PayInvoiceRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=10) "PayInvoice", + out: (main.MethodMessage) { + name: (string) (len=18) "PayInvoiceResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013a6c0)({ + authType: (*main.supportedAuth)(0xc0000908d0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=21) "/api/user/invoice/pay", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b400)({ + in: (main.MethodMessage) { + name: (string) (len=18) "OpenChannelRequest", + hasZeroFields: (bool) false + }, + name: (string) (len=11) "OpenChannel", + out: (main.MethodMessage) { + name: (string) (len=19) "OpenChannelResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013a8a0)({ + authType: (*main.supportedAuth)(0xc000090960)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=22) "/api/user/open/channel", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b4a0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=20) "GetLnurlWithdrawLink", + out: (main.MethodMessage) { + name: (string) (len=17) "LnurlLinkResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013aa80)({ + authType: (*main.supportedAuth)(0xc0000909f0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=29) "/api/user/lnurl_withdraw/link", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b540)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=15) "GetLnurlPayLink", + out: (main.MethodMessage) { + name: (string) (len=17) "LnurlLinkResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013ac60)({ + authType: (*main.supportedAuth)(0xc000090a80)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=24) "/api/user/lnurl_pay/link", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b5e0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=19) "GetLNURLChannelLink", + out: (main.MethodMessage) { + name: (string) (len=17) "LnurlLinkResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013ae40)({ + authType: (*main.supportedAuth)(0xc000090b10)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=27) "/api/user/lnurl_channel/url", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc00007b680)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=21) "GetLiveUserOperations", + out: (main.MethodMessage) { + name: (string) (len=17) "LiveUserOperation", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013b020)({ + authType: (*main.supportedAuth)(0xc000090ba0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=24) "/api/user/operations/sub", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) true + }), + (*main.Method)(0xc00007b720)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=18) "GetMigrationUpdate", + out: (main.MethodMessage) { + name: (string) (len=15) "MigrationUpdate", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013b200)({ + authType: (*main.supportedAuth)(0xc000090c30)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=24) "/api/user/migrations/sub", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) true + }), + (*main.Method)(0xc00007b770)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=12) "GetHttpCreds", + out: (main.MethodMessage) { + name: (string) (len=9) "HttpCreds", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00013b3e0)({ + authType: (*main.supportedAuth)(0xc000090cc0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=20) "/api/user/http_creds", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) false + }), + serverStream: (bool) true + }), + (*main.Method)(0xc00007b7c0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=9) "BatchUser", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc00013b620)({ + authType: (*main.supportedAuth)(0xc000090d80)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + context: (map[string]string) (len=3) { + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" + } + }), + method: (string) (len=4) "post", + route: (main.decodedRoute) { + route: (string) (len=15) "/api/user/batch", + params: ([]string) + }, + query: ([]string) , + nostr: (bool) true, + batch: (bool) true + }), + serverStream: (bool) false + }) +} + +([]*main.Enum) (len=2 cap=2) { + (*main.Enum)(0xc0004fe6f0)({ + name: (string) (len=11) "AddressType", + values: ([]main.EnumValue) (len=3 cap=4) { + (main.EnumValue) { + number: (int64) 0, + name: (string) (len=19) "WITNESS_PUBKEY_HASH" + }, + (main.EnumValue) { + number: (int64) 1, + name: (string) (len=18) "NESTED_PUBKEY_HASH" + }, + (main.EnumValue) { + number: (int64) 2, + name: (string) (len=14) "TAPROOT_PUBKEY" + } + } + }), + (*main.Enum)(0xc0004fe750)({ + name: (string) (len=17) "UserOperationType", + values: ([]main.EnumValue) (len=6 cap=8) { + (main.EnumValue) { + number: (int64) 0, + name: (string) (len=11) "INCOMING_TX" + }, + (main.EnumValue) { + number: (int64) 1, + name: (string) (len=11) "OUTGOING_TX" + }, + (main.EnumValue) { + number: (int64) 2, + name: (string) (len=16) "INCOMING_INVOICE" + }, + (main.EnumValue) { + number: (int64) 3, + name: (string) (len=16) "OUTGOING_INVOICE" + }, + (main.EnumValue) { + number: (int64) 4, + name: (string) (len=21) "OUTGOING_USER_TO_USER" + }, + (main.EnumValue) { + number: (int64) 5, + name: (string) (len=21) "INCOMING_USER_TO_USER" + } + } + }) +} + +(map[string]*main.Message) (len=70) { + (string) (len=12) "UsageMetrics": (*main.Message)(0xc000348580)({ + fullName: (string) (len=12) "UsageMetrics", + name: (string) (len=12) "UsageMetrics", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc000207f80)({ + name: (string) (len=7) "metrics", + kind: (string) (len=11) "UsageMetric", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=11) "OpenChannel": (*main.Message)(0xc000348d00)({ + fullName: (string) (len=11) "OpenChannel", + name: (string) (len=11) "OpenChannel", + fields: ([]*main.Field) (len=6 cap=8) { + (*main.Field)(0xc0004fc6c0)({ + name: (string) (len=10) "channel_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc6f0)({ + name: (string) (len=8) "capacity", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc720)({ + name: (string) (len=6) "active", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc750)({ + name: (string) (len=8) "lifetime", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc780)({ + name: (string) (len=13) "local_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc7b0)({ + name: (string) (len=14) "remote_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000349400)({ + fullName: (string) (len=17) "NewAddressRequest", + name: (string) (len=17) "NewAddressRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd530)({ + name: (string) (len=11) "addressType", + kind: (string) (len=11) "AddressType", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000349840)({ + fullName: (string) (len=20) "LnurlPayInfoResponse", + name: (string) (len=20) "LnurlPayInfoResponse", + fields: ([]*main.Field) (len=7 cap=8) { + (*main.Field)(0xc0004fdbf0)({ + name: (string) (len=3) "tag", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdc20)({ + name: (string) (len=8) "callback", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdc50)({ + name: (string) (len=11) "maxSendable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdc80)({ + name: (string) (len=11) "minSendable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdcb0)({ + name: (string) (len=8) "metadata", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdce0)({ + name: (string) (len=11) "allowsNostr", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdd10)({ + name: (string) (len=11) "nostrPubkey", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc000349b40)({ + fullName: (string) (len=25) "GetProductBuyLinkResponse", + name: (string) (len=25) "GetProductBuyLinkResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe480)({ + name: (string) (len=4) "link", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=9) "UsersInfo": (*main.Message)(0xc000348840)({ + fullName: (string) (len=9) "UsersInfo", + name: (string) (len=9) "UsersInfo", + fields: ([]*main.Field) (len=6 cap=8) { + (*main.Field)(0xc00024ac60)({ + name: (string) (len=5) "total", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00024ac90)({ + name: (string) (len=10) "no_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc000)({ + name: (string) (len=16) "negative_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc030)({ + name: (string) (len=20) "always_been_inactive", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc060)({ + name: (string) (len=11) "balance_avg", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc090)({ + name: (string) (len=14) "balance_median", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=13) "AddAppRequest": (*main.Message)(0xc000349040)({ + fullName: (string) (len=13) "AddAppRequest", + name: (string) (len=13) "AddAppRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fce40)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fce70)({ + name: (string) (len=19) "allow_user_creation", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=21) "DecodeInvoiceResponse": (*main.Message)(0xc0003495c0)({ + fullName: (string) (len=21) "DecodeInvoiceResponse", + name: (string) (len=21) "DecodeInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd7a0)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=10) "LndMetrics": (*main.Message)(0xc000348e80)({ + fullName: (string) (len=10) "LndMetrics", + name: (string) (len=10) "LndMetrics", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fcc00)({ + name: (string) (len=5) "nodes", + kind: (string) (len=14) "LndNodeMetrics", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "AddProductRequest": (*main.Message)(0xc000349ac0)({ + fullName: (string) (len=17) "AddProductRequest", + name: (string) (len=17) "AddProductRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe390)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe3c0)({ + name: (string) (len=10) "price_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=5) "Empty": (*main.Message)(0xc000348080)({ + fullName: (string) (len=5) "Empty", + name: (string) (len=5) "Empty", + fields: ([]*main.Field) + }), + (string) (len=14) "ChannelRouting": (*main.Message)(0xc000348dc0)({ + fullName: (string) (len=14) "ChannelRouting", + name: (string) (len=14) "ChannelRouting", + fields: ([]*main.Field) (len=10 cap=16) { + (*main.Field)(0xc0004fc870)({ + name: (string) (len=10) "channel_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc8a0)({ + name: (string) (len=11) "send_errors", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc8d0)({ + name: (string) (len=14) "receive_errors", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc900)({ + name: (string) (len=23) "forward_errors_as_input", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc930)({ + name: (string) (len=24) "forward_errors_as_output", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc960)({ + name: (string) (len=27) "missed_forward_fee_as_input", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc990)({ + name: (string) (len=28) "missed_forward_fee_as_output", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc9c0)({ + name: (string) (len=20) "forward_fee_as_input", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc9f0)({ + name: (string) (len=21) "forward_fee_as_output", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fca20)({ + name: (string) (len=13) "events_number", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc000349680)({ + fullName: (string) (len=18) "PayInvoiceResponse", + name: (string) (len=18) "PayInvoiceResponse", + fields: ([]*main.Field) (len=5 cap=8) { + (*main.Field)(0xc0004fd830)({ + name: (string) (len=8) "preimage", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd860)({ + name: (string) (len=11) "amount_paid", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd890)({ + name: (string) (len=12) "operation_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd8c0)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd8f0)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=8) "UserInfo": (*main.Message)(0xc0003498c0)({ + fullName: (string) (len=8) "UserInfo", + name: (string) (len=8) "UserInfo", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fdda0)({ + name: (string) (len=6) "userId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fddd0)({ + name: (string) (len=7) "balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fde00)({ + name: (string) (len=16) "max_withdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fde30)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "MigrationUpdate": (*main.Message)(0xc000349bc0)({ + fullName: (string) (len=15) "MigrationUpdate", + name: (string) (len=15) "MigrationUpdate", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe4e0)({ + name: (string) (len=7) "closure", + kind: (string) (len=16) "ClosureMigration", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) true + }), + (*main.Field)(0xc0004fe510)({ + name: (string) (len=6) "relays", + kind: (string) (len=15) "RelaysMigration", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) true + }) + } + }), + (string) (len=27) "LinkNPubThroughTokenRequest": (*main.Message)(0xc000349d00)({ + fullName: (string) (len=27) "LinkNPubThroughTokenRequest", + name: (string) (len=27) "LinkNPubThroughTokenRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe600)({ + name: (string) (len=5) "token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe630)({ + name: (string) (len=9) "nostr_pub", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000349480)({ + fullName: (string) (len=17) "PayAddressRequest", + name: (string) (len=17) "PayAddressRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd590)({ + name: (string) (len=7) "address", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd5c0)({ + name: (string) (len=9) "amoutSats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd5f0)({ + name: (string) (len=12) "satsPerVByte", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "PayAddressResponse": (*main.Message)(0xc0003494c0)({ + fullName: (string) (len=18) "PayAddressResponse", + name: (string) (len=18) "PayAddressResponse", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fd620)({ + name: (string) (len=4) "txId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd650)({ + name: (string) (len=12) "operation_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd680)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd6b0)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=10) "AppMetrics": (*main.Message)(0xc000348900)({ + fullName: (string) (len=10) "AppMetrics", + name: (string) (len=10) "AppMetrics", + fields: ([]*main.Field) (len=9 cap=16) { + (*main.Field)(0xc0004fc0c0)({ + name: (string) (len=3) "app", + kind: (string) (len=11) "Application", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc0f0)({ + name: (string) (len=5) "users", + kind: (string) (len=9) "UsersInfo", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc120)({ + name: (string) (len=8) "received", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc150)({ + name: (string) (len=5) "spent", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc180)({ + name: (string) (len=9) "available", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc1b0)({ + name: (string) (len=4) "fees", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc1e0)({ + name: (string) (len=8) "invoices", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc210)({ + name: (string) (len=10) "total_fees", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc240)({ + name: (string) (len=10) "operations", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "BanUserResponse": (*main.Message)(0xc000349000)({ + fullName: (string) (len=15) "BanUserResponse", + name: (string) (len=15) "BanUserResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fcde0)({ + name: (string) (len=12) "balance_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fce10)({ + name: (string) (len=16) "banned_app_users", + kind: (string) (len=13) "BannedAppUser", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=7) "AuthApp": (*main.Message)(0xc000349100)({ + fullName: (string) (len=7) "AuthApp", + name: (string) (len=7) "AuthApp", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fcfc0)({ + name: (string) (len=3) "app", + kind: (string) (len=11) "Application", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcff0)({ + name: (string) (len=10) "auth_token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LndMetricsRequest": (*main.Message)(0xc0003489c0)({ + fullName: (string) (len=17) "LndMetricsRequest", + name: (string) (len=17) "LndMetricsRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fc2a0)({ + name: (string) (len=9) "from_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }), + (*main.Field)(0xc0004fc2d0)({ + name: (string) (len=7) "to_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }) + } + }), + (string) (len=13) "BannedAppUser": (*main.Message)(0xc000348fc0)({ + fullName: (string) (len=13) "BannedAppUser", + name: (string) (len=13) "BannedAppUser", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fcd20)({ + name: (string) (len=8) "app_name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcd50)({ + name: (string) (len=6) "app_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcd80)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcdb0)({ + name: (string) (len=9) "nostr_pub", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "GetAppUserRequest": (*main.Message)(0xc000349240)({ + fullName: (string) (len=17) "GetAppUserRequest", + name: (string) (len=17) "GetAppUserRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd290)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc0003493c0)({ + fullName: (string) (len=24) "SetMockAppBalanceRequest", + name: (string) (len=24) "SetMockAppBalanceRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd500)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc000349580)({ + fullName: (string) (len=20) "DecodeInvoiceRequest", + name: (string) (len=20) "DecodeInvoiceRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd770)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=31) "RequestNPubLinkingTokenResponse": (*main.Message)(0xc000349cc0)({ + fullName: (string) (len=31) "RequestNPubLinkingTokenResponse", + name: (string) (len=31) "RequestNPubLinkingTokenResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe5d0)({ + name: (string) (len=5) "token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000348ec0)({ + fullName: (string) (len=17) "LndGetInfoRequest", + name: (string) (len=17) "LndGetInfoRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fcc30)({ + name: (string) (len=6) "nodeId", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=7) "AppUser": (*main.Message)(0xc000349180)({ + fullName: (string) (len=7) "AppUser", + name: (string) (len=7) "AppUser", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd0b0)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd0e0)({ + name: (string) (len=4) "info", + kind: (string) (len=8) "UserInfo", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd110)({ + name: (string) (len=16) "max_withdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc000349380)({ + fullName: (string) (len=28) "SetMockAppUserBalanceRequest", + name: (string) (len=28) "SetMockAppUserBalanceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd4a0)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd4d0)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000349600)({ + fullName: (string) (len=17) "PayInvoiceRequest", + name: (string) (len=17) "PayInvoiceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd7d0)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd800)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc000349140)({ + fullName: (string) (len=17) "AddAppUserRequest", + name: (string) (len=17) "AddAppUserRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd020)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd050)({ + name: (string) (len=14) "fail_if_exists", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd080)({ + name: (string) (len=7) "balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000349540)({ + fullName: (string) (len=18) "NewInvoiceResponse", + name: (string) (len=18) "NewInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd740)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=11) "AppsMetrics": (*main.Message)(0xc000348940)({ + fullName: (string) (len=11) "AppsMetrics", + name: (string) (len=11) "AppsMetrics", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fc270)({ + name: (string) (len=4) "apps", + kind: (string) (len=10) "AppMetrics", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000348f40)({ + fullName: (string) (len=18) "LndGetInfoResponse", + name: (string) (len=18) "LndGetInfoResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fccc0)({ + name: (string) (len=5) "alias", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000349440)({ + fullName: (string) (len=18) "NewAddressResponse", + name: (string) (len=18) "NewAddressResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd560)({ + name: (string) (len=7) "address", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "BanUserRequest": (*main.Message)(0xc000348f80)({ + fullName: (string) (len=14) "BanUserRequest", + name: (string) (len=14) "BanUserRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fccf0)({ + name: (string) (len=7) "user_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc0003492c0)({ + fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd350)({ + name: (string) (len=20) "from_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd380)({ + name: (string) (len=18) "to_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd3b0)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc000349300)({ + fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", + name: (string) (len=30) "SendAppUserToAppPaymentRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd3e0)({ + name: (string) (len=20) "from_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd410)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc000349940)({ + fullName: (string) (len=24) "GetUserOperationsRequest", + name: (string) (len=24) "GetUserOperationsRequest", + fields: ([]*main.Field) (len=7 cap=8) { + (*main.Field)(0xc0004fde60)({ + name: (string) (len=21) "latestIncomingInvoice", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fde90)({ + name: (string) (len=21) "latestOutgoingInvoice", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdec0)({ + name: (string) (len=16) "latestIncomingTx", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdef0)({ + name: (string) (len=16) "latestOutgoingTx", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdf20)({ + name: (string) (len=31) "latestIncomingUserToUserPayment", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdf50)({ + name: (string) (len=31) "latestOutgoingUserToUserPayment", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdf80)({ + name: (string) (len=8) "max_size", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc000349a80)({ + fullName: (string) (len=25) "GetUserOperationsResponse", + name: (string) (len=25) "GetUserOperationsResponse", + fields: ([]*main.Field) (len=6 cap=8) { + (*main.Field)(0xc0004fe270)({ + name: (string) (len=31) "latestOutgoingInvoiceOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe2a0)({ + name: (string) (len=31) "latestIncomingInvoiceOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe2d0)({ + name: (string) (len=26) "latestOutgoingTxOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe300)({ + name: (string) (len=26) "latestIncomingTxOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe330)({ + name: (string) (len=32) "latestOutgoingUserToUserPayemnts", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe360)({ + name: (string) (len=32) "latestIncomingUserToUserPayemnts", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=16) "ClosureMigration": (*main.Message)(0xc000349c00)({ + fullName: (string) (len=16) "ClosureMigration", + name: (string) (len=16) "ClosureMigration", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe540)({ + name: (string) (len=14) "closes_at_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "AuthAppRequest": (*main.Message)(0xc000349080)({ + fullName: (string) (len=14) "AuthAppRequest", + name: (string) (len=14) "AuthAppRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fcea0)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fced0)({ + name: (string) (len=19) "allow_user_creation", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }) + } + }), + (string) (len=11) "Application": (*main.Message)(0xc0003490c0)({ + fullName: (string) (len=11) "Application", + name: (string) (len=11) "Application", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fcf00)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcf30)({ + name: (string) (len=2) "id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcf60)({ + name: (string) (len=7) "balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcf90)({ + name: (string) (len=4) "npub", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=20) "AddAppInvoiceRequest": (*main.Message)(0xc0003491c0)({ + fullName: (string) (len=20) "AddAppInvoiceRequest", + name: (string) (len=20) "AddAppInvoiceRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd140)({ + name: (string) (len=16) "payer_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd170)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd1a0)({ + name: (string) (len=11) "invoice_req", + kind: (string) (len=17) "NewInvoiceRequest", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc000349340)({ + fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", + name: (string) (len=26) "GetAppUserLNURLInfoRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd440)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd470)({ + name: (string) (len=17) "base_url_override", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000349740)({ + fullName: (string) (len=17) "LnurlLinkResponse", + name: (string) (len=17) "LnurlLinkResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fda10)({ + name: (string) (len=5) "lnurl", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fda40)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc0003497c0)({ + fullName: (string) (len=25) "LnurlWithdrawInfoResponse", + name: (string) (len=25) "LnurlWithdrawInfoResponse", + fields: ([]*main.Field) (len=8 cap=8) { + (*main.Field)(0xc0004fda70)({ + name: (string) (len=3) "tag", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdaa0)({ + name: (string) (len=8) "callback", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdad0)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb00)({ + name: (string) (len=18) "defaultDescription", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb30)({ + name: (string) (len=15) "minWithdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb60)({ + name: (string) (len=15) "maxWithdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdb90)({ + name: (string) (len=12) "balanceCheck", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdbc0)({ + name: (string) (len=7) "payLink", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=13) "UserOperation": (*main.Message)(0xc0003499c0)({ + fullName: (string) (len=13) "UserOperation", + name: (string) (len=13) "UserOperation", + fields: ([]*main.Field) (len=11 cap=16) { + (*main.Field)(0xc0004fdfb0)({ + name: (string) (len=10) "paidAtUnix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe000)({ + name: (string) (len=4) "type", + kind: (string) (len=17) "UserOperationType", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe030)({ + name: (string) (len=7) "inbound", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe060)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe090)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe0c0)({ + name: (string) (len=11) "operationId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe0f0)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe120)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe150)({ + name: (string) (len=9) "confirmed", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe180)({ + name: (string) (len=7) "tx_hash", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe1b0)({ + name: (string) (len=8) "internal", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "RelaysMigration": (*main.Message)(0xc000349c40)({ + fullName: (string) (len=15) "RelaysMigration", + name: (string) (len=15) "RelaysMigration", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe570)({ + name: (string) (len=6) "relays", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=30) "RequestNPubLinkingTokenRequest": (*main.Message)(0xc000349c80)({ + fullName: (string) (len=30) "RequestNPubLinkingTokenRequest", + name: (string) (len=30) "RequestNPubLinkingTokenRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe5a0)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000348180)({ + fullName: (string) (len=25) "EncryptionExchangeRequest", + name: (string) (len=25) "EncryptionExchangeRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc000207d70)({ + name: (string) (len=9) "publicKey", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207da0)({ + name: (string) (len=8) "deviceId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "AppsMetricsRequest": (*main.Message)(0xc000348600)({ + fullName: (string) (len=18) "AppsMetricsRequest", + name: (string) (len=18) "AppsMetricsRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc000207fb0)({ + name: (string) (len=9) "from_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }), + (*main.Field)(0xc00034ec90)({ + name: (string) (len=7) "to_unix", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }), + (*main.Field)(0xc00034ecc0)({ + name: (string) (len=18) "include_operations", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) true + }) + } + }), + (string) (len=13) "ClosedChannel": (*main.Message)(0xc000348d40)({ + fullName: (string) (len=13) "ClosedChannel", + name: (string) (len=13) "ClosedChannel", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fc7e0)({ + name: (string) (len=10) "channel_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc810)({ + name: (string) (len=8) "capacity", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc840)({ + name: (string) (len=13) "closed_height", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000349700)({ + fullName: (string) (len=19) "OpenChannelResponse", + name: (string) (len=19) "OpenChannelResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fd9e0)({ + name: (string) (len=9) "channelId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=7) "Product": (*main.Message)(0xc000349b00)({ + fullName: (string) (len=7) "Product", + name: (string) (len=7) "Product", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fe3f0)({ + name: (string) (len=2) "id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe420)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe450)({ + name: (string) (len=10) "price_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc000349280)({ + fullName: (string) (len=24) "PayAppUserInvoiceRequest", + name: (string) (len=24) "PayAppUserInvoiceRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fd2c0)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd2f0)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd320)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000349500)({ + fullName: (string) (len=17) "NewInvoiceRequest", + name: (string) (len=17) "NewInvoiceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fd6e0)({ + name: (string) (len=10) "amountSats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd710)({ + name: (string) (len=4) "memo", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LiveUserOperation": (*main.Message)(0xc000349b80)({ + fullName: (string) (len=17) "LiveUserOperation", + name: (string) (len=17) "LiveUserOperation", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0004fe4b0)({ + name: (string) (len=9) "operation", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=9) "HttpCreds": (*main.Message)(0xc000349d40)({ + fullName: (string) (len=9) "HttpCreds", + name: (string) (len=9) "HttpCreds", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fe660)({ + name: (string) (len=3) "url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe690)({ + name: (string) (len=5) "token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=11) "UsageMetric": (*main.Message)(0xc0003482c0)({ + fullName: (string) (len=11) "UsageMetric", + name: (string) (len=11) "UsageMetric", + fields: ([]*main.Field) (len=9 cap=16) { + (*main.Field)(0xc000207dd0)({ + name: (string) (len=15) "processed_at_ms", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e00)({ + name: (string) (len=14) "parsed_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e30)({ + name: (string) (len=12) "auth_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e60)({ + name: (string) (len=16) "validate_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207e90)({ + name: (string) (len=14) "handle_in_nano", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207ec0)({ + name: (string) (len=8) "rpc_name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207ef0)({ + name: (string) (len=5) "batch", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207f20)({ + name: (string) (len=5) "nostr", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000207f50)({ + name: (string) (len=10) "batch_size", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=12) "RoutingEvent": (*main.Message)(0xc000348b40)({ + fullName: (string) (len=12) "RoutingEvent", + name: (string) (len=12) "RoutingEvent", + fields: ([]*main.Field) (len=12 cap=16) { + (*main.Field)(0xc0004fc300)({ + name: (string) (len=19) "incoming_channel_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc330)({ + name: (string) (len=16) "incoming_htlc_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc360)({ + name: (string) (len=19) "outgoing_channel_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc390)({ + name: (string) (len=16) "outgoing_htlc_id", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc3c0)({ + name: (string) (len=12) "timestamp_ns", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc3f0)({ + name: (string) (len=10) "event_type", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc420)({ + name: (string) (len=17) "incoming_amt_msat", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc450)({ + name: (string) (len=17) "outgoing_amt_msat", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc480)({ + name: (string) (len=14) "failure_string", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc4b0)({ + name: (string) (len=7) "settled", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc4e0)({ + name: (string) (len=8) "offchain", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc510)({ + name: (string) (len=18) "forward_fail_event", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=19) "ChannelBalanceEvent": (*main.Message)(0xc000348c40)({ + fullName: (string) (len=19) "ChannelBalanceEvent", + name: (string) (len=19) "ChannelBalanceEvent", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fc540)({ + name: (string) (len=12) "block_height", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc570)({ + name: (string) (len=10) "channel_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc5a0)({ + name: (string) (len=18) "local_balance_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc5d0)({ + name: (string) (len=19) "remote_balance_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc000349880)({ + fullName: (string) (len=22) "HandleLnurlPayResponse", + name: (string) (len=22) "HandleLnurlPayResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fdd40)({ + name: (string) (len=2) "pr", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fdd70)({ + name: (string) (len=6) "routes", + kind: (string) (len=5) "Empty", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "UserOperations": (*main.Message)(0xc000349a00)({ + fullName: (string) (len=14) "UserOperations", + name: (string) (len=14) "UserOperations", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0004fe1e0)({ + name: (string) (len=9) "fromIndex", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe210)({ + name: (string) (len=7) "toIndex", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fe240)({ + name: (string) (len=10) "operations", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "ChainBalanceEvent": (*main.Message)(0xc000348c80)({ + fullName: (string) (len=17) "ChainBalanceEvent", + name: (string) (len=17) "ChainBalanceEvent", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fc600)({ + name: (string) (len=12) "block_height", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc630)({ + name: (string) (len=17) "confirmed_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc660)({ + name: (string) (len=19) "unconfirmed_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fc690)({ + name: (string) (len=13) "total_balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "LndNodeMetrics": (*main.Message)(0xc000348e40)({ + fullName: (string) (len=14) "LndNodeMetrics", + name: (string) (len=14) "LndNodeMetrics", + fields: ([]*main.Field) (len=9 cap=16) { + (*main.Field)(0xc0004fca50)({ + name: (string) (len=23) "channels_balance_events", + kind: (string) (len=19) "ChannelBalanceEvent", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fca80)({ + name: (string) (len=20) "chain_balance_events", + kind: (string) (len=17) "ChainBalanceEvent", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcab0)({ + name: (string) (len=16) "offline_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcae0)({ + name: (string) (len=15) "online_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcb10)({ + name: (string) (len=16) "pending_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcb40)({ + name: (string) (len=16) "closing_channels", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcb70)({ + name: (string) (len=13) "open_channels", + kind: (string) (len=11) "OpenChannel", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcba0)({ + name: (string) (len=15) "closed_channels", + kind: (string) (len=13) "ClosedChannel", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcbd0)({ + name: (string) (len=15) "channel_routing", + kind: (string) (len=14) "ChannelRouting", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc000348f00)({ + fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", + name: (string) (len=27) "SetMockInvoiceAsPaidRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0004fcc60)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fcc90)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc000349200)({ + fullName: (string) (len=24) "AddAppUserInvoiceRequest", + name: (string) (len=24) "AddAppUserInvoiceRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fd1d0)({ + name: (string) (len=19) "receiver_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd200)({ + name: (string) (len=16) "payer_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd230)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd260)({ + name: (string) (len=11) "invoice_req", + kind: (string) (len=17) "NewInvoiceRequest", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0003496c0)({ + fullName: (string) (len=18) "OpenChannelRequest", + name: (string) (len=18) "OpenChannelRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0004fd920)({ + name: (string) (len=11) "destination", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd950)({ + name: (string) (len=13) "fundingAmount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd980)({ + name: (string) (len=10) "pushAmount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0004fd9b0)({ + name: (string) (len=12) "closeAddress", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }) +} + +parsing file: structs 70 +parsing file: methods 2 +-> [{guest Guest map[]} {user User map[app_id:string app_user_id:string user_id:string]} {admin Admin map[admin_id:string]} {metrics Metrics map[operator_id:string]} {app App map[app_id:string]}] + diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index 908c1ed2..0b7efbce 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -1,1126 +1,1126 @@ -// This file was autogenerated from a .proto file, DO NOT EDIT! - -import express, { Response, json, urlencoded } from 'express' -import cors from 'cors' -import * as Types from './types.js' -export type Logger = { log: (v: any) => void, error: (v: any) => void } -export type ServerOptions = { - allowCors?: true - staticFiles?: string - allowNotImplementedMethods?: true - logger?: Logger - throwErrors?: true - logMethod?: true - logBody?: true - metricsCallback: (metrics: Types.RequestMetric[]) => void - GuestAuthGuard: (authorizationHeader?: string) => Promise - UserAuthGuard: (authorizationHeader?: string) => Promise - AdminAuthGuard: (authorizationHeader?: string) => Promise - MetricsAuthGuard: (authorizationHeader?: string) => Promise - AppAuthGuard: (authorizationHeader?: string) => Promise -} -declare module 'express-serve-static-core' { interface Request { startTime?: bigint, bodySize?: number, startTimeMs: number } } -const logErrorAndReturnResponse = (error: Error, response: string, res: Response, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { - logger.error(error.message || error); metricsCallback([{ ...metric, error: response }]); res.json({ status: 'ERROR', reason: response }) -} -export default (methods: Types.ServerMethods, opts: ServerOptions) => { - const logger = opts.logger || { log: console.log, error: console.error } - const app = express() - if (opts.allowCors) { - app.use(cors()) - } - app.use((req, _, next) => { req.startTime = process.hrtime.bigint(); req.startTimeMs = Date.now(); next() }) - app.use(json()) - app.use(urlencoded({ extended: true })) - if (opts.logMethod) app.use((req, _, next) => { console.log(req.method, req.path); if (opts.logBody) console.log(req.body); next() }) - if (!opts.allowNotImplementedMethods && !methods.LndGetInfo) throw new Error('method: LndGetInfo is not implemented') - app.post('/api/admin/lnd/getinfo', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'LndGetInfo', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.LndGetInfo) throw new Error('method: LndGetInfo is not implemented') - const authContext = await opts.AdminAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.LndGetInfoRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.LndGetInfo({rpcName:'LndGetInfo', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.AddApp) throw new Error('method: AddApp is not implemented') - app.post('/api/admin/app/add', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'AddApp', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.AddApp) throw new Error('method: AddApp is not implemented') - const authContext = await opts.AdminAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.AddAppRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.AddApp({rpcName:'AddApp', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.AuthApp) throw new Error('method: AuthApp is not implemented') - app.post('/api/admin/app/auth', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'AuthApp', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.AuthApp) throw new Error('method: AuthApp is not implemented') - const authContext = await opts.AdminAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.AuthAppRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.AuthApp({rpcName:'AuthApp', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.BanUser) throw new Error('method: BanUser is not implemented') - app.post('/api/admin/user/ban', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'BanUser', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.BanUser) throw new Error('method: BanUser is not implemented') - const authContext = await opts.AdminAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.BanUserRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.BanUser({rpcName:'BanUser', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented') - app.post('/api/reports/usage', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetUsageMetrics', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented') - const authContext = await opts.MetricsAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetUsageMetrics({rpcName:'GetUsageMetrics', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetAppsMetrics) throw new Error('method: GetAppsMetrics is not implemented') - app.post('/api/reports/apps', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetAppsMetrics', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetAppsMetrics) throw new Error('method: GetAppsMetrics is not implemented') - const authContext = await opts.MetricsAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.AppsMetricsRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.GetAppsMetrics({rpcName:'GetAppsMetrics', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetLndMetrics) throw new Error('method: GetLndMetrics is not implemented') - app.post('/api/reports/lnd', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetLndMetrics', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetLndMetrics) throw new Error('method: GetLndMetrics is not implemented') - const authContext = await opts.MetricsAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.LndMetricsRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.GetLndMetrics({rpcName:'GetLndMetrics', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.Health) throw new Error('method: Health is not implemented') - app.get('/api/health', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'Health', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.Health) throw new Error('method: Health is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - await methods.Health({rpcName:'Health', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.EncryptionExchange) throw new Error('method: EncryptionExchange is not implemented') - app.post('/api/encryption/exchange', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'EncryptionExchange', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.EncryptionExchange) throw new Error('method: EncryptionExchange is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.EncryptionExchangeRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - await methods.EncryptionExchange({rpcName:'EncryptionExchange', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.SetMockInvoiceAsPaid) throw new Error('method: SetMockInvoiceAsPaid is not implemented') - app.post('/api/lnd/mock/invoice/paid', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'SetMockInvoiceAsPaid', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.SetMockInvoiceAsPaid) throw new Error('method: SetMockInvoiceAsPaid is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.SetMockInvoiceAsPaidRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - await methods.SetMockInvoiceAsPaid({rpcName:'SetMockInvoiceAsPaid', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented') - app.get('/api/guest/lnurl_withdraw/info', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetLnurlWithdrawInfo', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetLnurlWithdrawInfo({rpcName:'GetLnurlWithdrawInfo', ctx:authContext ,query: req.query}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented') - app.get('/api/guest/lnurl_withdraw/handle', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'HandleLnurlWithdraw', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - await methods.HandleLnurlWithdraw({rpcName:'HandleLnurlWithdraw', ctx:authContext ,query: req.query}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented') - app.get('/api/guest/lnurl_pay/info', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetLnurlPayInfo', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetLnurlPayInfo({rpcName:'GetLnurlPayInfo', ctx:authContext ,query: req.query}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented') - app.get('/api/guest/lnurl_pay/handle', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'HandleLnurlPay', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.HandleLnurlPay({rpcName:'HandleLnurlPay', ctx:authContext ,query: req.query}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.HandleLnurlAddress) throw new Error('method: HandleLnurlAddress is not implemented') - app.get('/.well-known/lnurlp/:address_name', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'HandleLnurlAddress', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.HandleLnurlAddress) throw new Error('method: HandleLnurlAddress is not implemented') - const authContext = await opts.GuestAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.HandleLnurlAddress({rpcName:'HandleLnurlAddress', ctx:authContext ,params: req.params}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') - app.post('/api/guest/npub/link', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'LinkNPubThroughToken', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.LinkNPubThroughTokenRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - await methods.LinkNPubThroughToken({rpcName:'LinkNPubThroughToken', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetApp) throw new Error('method: GetApp is not implemented') - app.post('/api/app/get', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetApp', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetApp) throw new Error('method: GetApp is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetApp({rpcName:'GetApp', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.AddAppUser) throw new Error('method: AddAppUser is not implemented') - app.post('/api/app/user/add', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'AddAppUser', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.AddAppUser) throw new Error('method: AddAppUser is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.AddAppUserRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.AddAppUser({rpcName:'AddAppUser', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.AddAppInvoice) throw new Error('method: AddAppInvoice is not implemented') - app.post('/api/app/add/invoice', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'AddAppInvoice', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.AddAppInvoice) throw new Error('method: AddAppInvoice is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.AddAppInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.AddAppInvoice({rpcName:'AddAppInvoice', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.AddAppUserInvoice) throw new Error('method: AddAppUserInvoice is not implemented') - app.post('/api/app/user/add/invoice', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'AddAppUserInvoice', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.AddAppUserInvoice) throw new Error('method: AddAppUserInvoice is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.AddAppUserInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.AddAppUserInvoice({rpcName:'AddAppUserInvoice', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetAppUser) throw new Error('method: GetAppUser is not implemented') - app.post('/api/app/user/get', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetAppUser', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetAppUser) throw new Error('method: GetAppUser is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.GetAppUserRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.GetAppUser({rpcName:'GetAppUser', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.PayAppUserInvoice) throw new Error('method: PayAppUserInvoice is not implemented') - app.post('/api/app/invoice/pay', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'PayAppUserInvoice', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.PayAppUserInvoice) throw new Error('method: PayAppUserInvoice is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.PayAppUserInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.PayAppUserInvoice({rpcName:'PayAppUserInvoice', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.SendAppUserToAppUserPayment) throw new Error('method: SendAppUserToAppUserPayment is not implemented') - app.post('/api/app/user/internal/pay', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'SendAppUserToAppUserPayment', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.SendAppUserToAppUserPayment) throw new Error('method: SendAppUserToAppUserPayment is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.SendAppUserToAppUserPaymentRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - await methods.SendAppUserToAppUserPayment({rpcName:'SendAppUserToAppUserPayment', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.SendAppUserToAppPayment) throw new Error('method: SendAppUserToAppPayment is not implemented') - app.post('/api/app/internal/pay', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'SendAppUserToAppPayment', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.SendAppUserToAppPayment) throw new Error('method: SendAppUserToAppPayment is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.SendAppUserToAppPaymentRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - await methods.SendAppUserToAppPayment({rpcName:'SendAppUserToAppPayment', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetAppUserLNURLInfo) throw new Error('method: GetAppUserLNURLInfo is not implemented') - app.post('/api/app/user/lnurl/pay/info', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetAppUserLNURLInfo', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetAppUserLNURLInfo) throw new Error('method: GetAppUserLNURLInfo is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.GetAppUserLNURLInfoRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.GetAppUserLNURLInfo({rpcName:'GetAppUserLNURLInfo', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.SetMockAppUserBalance) throw new Error('method: SetMockAppUserBalance is not implemented') - app.post('/api/app/mock/user/blance/set', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'SetMockAppUserBalance', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.SetMockAppUserBalance) throw new Error('method: SetMockAppUserBalance is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.SetMockAppUserBalanceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - await methods.SetMockAppUserBalance({rpcName:'SetMockAppUserBalance', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.SetMockAppBalance) throw new Error('method: SetMockAppBalance is not implemented') - app.post('/api/app/mock/blance/set', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'SetMockAppBalance', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.SetMockAppBalance) throw new Error('method: SetMockAppBalance is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.SetMockAppBalanceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - await methods.SetMockAppBalance({rpcName:'SetMockAppBalance', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.RequestNPubLinkingToken) throw new Error('method: RequestNPubLinkingToken is not implemented') - app.post('/api/app/user/npub/token', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'RequestNPubLinkingToken', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.RequestNPubLinkingToken) throw new Error('method: RequestNPubLinkingToken is not implemented') - const authContext = await opts.AppAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.RequestNPubLinkingTokenRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.RequestNPubLinkingToken({rpcName:'RequestNPubLinkingToken', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.UserHealth) throw new Error('method: UserHealth is not implemented') - app.post('/api/user/health', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'UserHealth', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.UserHealth) throw new Error('method: UserHealth is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - await methods.UserHealth({rpcName:'UserHealth', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK'}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') - app.post('/api/user/info', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetUserInfo', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetUserInfo({rpcName:'GetUserInfo', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.AddProduct) throw new Error('method: AddProduct is not implemented') - app.post('/api/user/product/add', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'AddProduct', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.AddProduct) throw new Error('method: AddProduct is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.AddProductRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.AddProduct({rpcName:'AddProduct', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.NewProductInvoice) throw new Error('method: NewProductInvoice is not implemented') - app.get('/api/user/product/get/invoice', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'NewProductInvoice', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.NewProductInvoice) throw new Error('method: NewProductInvoice is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.NewProductInvoice({rpcName:'NewProductInvoice', ctx:authContext ,query: req.query}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetUserOperations) throw new Error('method: GetUserOperations is not implemented') - app.post('/api/user/operations', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetUserOperations', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetUserOperations) throw new Error('method: GetUserOperations is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.GetUserOperationsRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.GetUserOperations({rpcName:'GetUserOperations', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.NewAddress) throw new Error('method: NewAddress is not implemented') - app.post('/api/user/chain/new', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'NewAddress', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.NewAddress) throw new Error('method: NewAddress is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.NewAddressRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.NewAddress({rpcName:'NewAddress', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.PayAddress) throw new Error('method: PayAddress is not implemented') - app.post('/api/user/chain/pay', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'PayAddress', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.PayAddress) throw new Error('method: PayAddress is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.PayAddressRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.PayAddress({rpcName:'PayAddress', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.NewInvoice) throw new Error('method: NewInvoice is not implemented') - app.post('/api/user/invoice/new', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'NewInvoice', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.NewInvoice) throw new Error('method: NewInvoice is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.NewInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.NewInvoice({rpcName:'NewInvoice', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.DecodeInvoice) throw new Error('method: DecodeInvoice is not implemented') - app.post('/api/user/invoice/decode', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'DecodeInvoice', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.DecodeInvoice) throw new Error('method: DecodeInvoice is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.DecodeInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.DecodeInvoice({rpcName:'DecodeInvoice', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.PayInvoice) throw new Error('method: PayInvoice is not implemented') - app.post('/api/user/invoice/pay', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'PayInvoice', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.PayInvoice) throw new Error('method: PayInvoice is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.PayInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.PayInvoice({rpcName:'PayInvoice', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.OpenChannel) throw new Error('method: OpenChannel is not implemented') - app.post('/api/user/open/channel', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'OpenChannel', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.OpenChannel) throw new Error('method: OpenChannel is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - const request = req.body - const error = Types.OpenChannelRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) - const query = req.query - const params = req.params - const response = await methods.OpenChannel({rpcName:'OpenChannel', ctx:authContext , req: request}) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') - app.get('/api/user/lnurl_withdraw/link', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetLnurlWithdrawLink', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetLnurlWithdrawLink({rpcName:'GetLnurlWithdrawLink', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetLnurlPayLink) throw new Error('method: GetLnurlPayLink is not implemented') - app.get('/api/user/lnurl_pay/link', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetLnurlPayLink', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetLnurlPayLink) throw new Error('method: GetLnurlPayLink is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetLnurlPayLink({rpcName:'GetLnurlPayLink', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (!opts.allowNotImplementedMethods && !methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') - app.post('/api/user/lnurl_channel/url', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'GetLNURLChannelLink', batch: false, nostr: false, batchSize: 0} - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - if (!methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') - const authContext = await opts.UserAuthGuard(req.headers['authorization']) - authCtx = authContext - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - const query = req.query - const params = req.params - const response = await methods.GetLNURLChannelLink({rpcName:'GetLNURLChannelLink', ctx:authContext }) - stats.handle = process.hrtime.bigint() - res.json({status: 'OK', ...response}) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - app.post('/api/user/batch', async (req, res) => { - const info: Types.RequestInfo = { rpcName: 'BatchUser', batch: true, nostr: false, batchSize: 1 } - const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - try { - const requests = req.body.requests as Types.UserMethodInputs[] - if (!Array.isArray(requests))throw new Error('invalid body, is not an array') - info.batchSize = requests.length - if (requests.length > 10) throw new Error('too many requests in the batch') - const ctx = await opts.UserAuthGuard(req.headers['authorization']) - stats.guard = process.hrtime.bigint() - stats.validate = stats.guard - authCtx = ctx - const responses = [] - const callsMetrics: Types.RequestMetric[] = [] - for (let i = 0; i < requests.length; i++) { - const operation = requests[i] - const opInfo: Types.RequestInfo = { rpcName: operation.rpcName, batch: true, nostr: false, batchSize: 0 } - const opStats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: stats.parse, guard: stats.guard, validate: 0n, handle: 0n } - try { - switch(operation.rpcName) { - case 'LinkNPubThroughToken': - if (!methods.LinkNPubThroughToken) { - throw new Error('method LinkNPubThroughToken not found' ) - } else { - const error = Types.LinkNPubThroughTokenRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - await methods.LinkNPubThroughToken({...operation, ctx}); responses.push({ status: 'OK' }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'UserHealth': - if (!methods.UserHealth) { - throw new Error('method UserHealth not found' ) - } else { - opStats.validate = opStats.guard - await methods.UserHealth({...operation, ctx}); responses.push({ status: 'OK' }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetUserInfo': - if (!methods.GetUserInfo) { - throw new Error('method GetUserInfo not found' ) - } else { - opStats.validate = opStats.guard - const res = await methods.GetUserInfo({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'AddProduct': - if (!methods.AddProduct) { - throw new Error('method AddProduct not found' ) - } else { - const error = Types.AddProductRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.AddProduct({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'NewProductInvoice': - if (!methods.NewProductInvoice) { - throw new Error('method NewProductInvoice not found' ) - } else { - opStats.validate = opStats.guard - const res = await methods.NewProductInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetUserOperations': - if (!methods.GetUserOperations) { - throw new Error('method GetUserOperations not found' ) - } else { - const error = Types.GetUserOperationsRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.GetUserOperations({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'NewAddress': - if (!methods.NewAddress) { - throw new Error('method NewAddress not found' ) - } else { - const error = Types.NewAddressRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.NewAddress({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'PayAddress': - if (!methods.PayAddress) { - throw new Error('method PayAddress not found' ) - } else { - const error = Types.PayAddressRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.PayAddress({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'NewInvoice': - if (!methods.NewInvoice) { - throw new Error('method NewInvoice not found' ) - } else { - const error = Types.NewInvoiceRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.NewInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'DecodeInvoice': - if (!methods.DecodeInvoice) { - throw new Error('method DecodeInvoice not found' ) - } else { - const error = Types.DecodeInvoiceRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.DecodeInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'PayInvoice': - if (!methods.PayInvoice) { - throw new Error('method PayInvoice not found' ) - } else { - const error = Types.PayInvoiceRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.PayInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'OpenChannel': - if (!methods.OpenChannel) { - throw new Error('method OpenChannel not found' ) - } else { - const error = Types.OpenChannelRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.OpenChannel({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetLnurlWithdrawLink': - if (!methods.GetLnurlWithdrawLink) { - throw new Error('method GetLnurlWithdrawLink not found' ) - } else { - opStats.validate = opStats.guard - const res = await methods.GetLnurlWithdrawLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetLnurlPayLink': - if (!methods.GetLnurlPayLink) { - throw new Error('method GetLnurlPayLink not found' ) - } else { - opStats.validate = opStats.guard - const res = await methods.GetLnurlPayLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetLNURLChannelLink': - if (!methods.GetLNURLChannelLink) { - throw new Error('method GetLNURLChannelLink not found' ) - } else { - opStats.validate = opStats.guard - const res = await methods.GetLNURLChannelLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - default: - throw new Error('unkown rpcName') - } - } catch(ex) {const e = ex as any; logger.error(e.message || e); callsMetrics.push({ ...opInfo, ...opStats, ...ctx, error: e.message }); responses.push({ status: 'ERROR', reason: e.message || e })} - } - stats.handle = process.hrtime.bigint() - res.json({ status: 'OK', responses }) - opts.metricsCallback([{ ...info, ...stats, ...ctx }, ...callsMetrics]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - }) - if (opts.staticFiles) { - app.use(express.static(opts.staticFiles)) - app.get('*', function (_, res) { res.sendFile('index.html', { root: opts.staticFiles })}) - } - var server: { close: () => void } | undefined - return { - Close: () => { if (!server) { throw new Error('tried closing server before starting') } else server.close() }, - Listen: (port: number) => { server = app.listen(port, () => logger.log('Example app listening on port ' + port)) } - } -} +// This file was autogenerated from a .proto file, DO NOT EDIT! + +import express, { Response, json, urlencoded } from 'express' +import cors from 'cors' +import * as Types from './types.js' +export type Logger = { log: (v: any) => void, error: (v: any) => void } +export type ServerOptions = { + allowCors?: true + staticFiles?: string + allowNotImplementedMethods?: true + logger?: Logger + throwErrors?: true + logMethod?: true + logBody?: true + metricsCallback: (metrics: Types.RequestMetric[]) => void + GuestAuthGuard: (authorizationHeader?: string) => Promise + UserAuthGuard: (authorizationHeader?: string) => Promise + AdminAuthGuard: (authorizationHeader?: string) => Promise + MetricsAuthGuard: (authorizationHeader?: string) => Promise + AppAuthGuard: (authorizationHeader?: string) => Promise +} +declare module 'express-serve-static-core' { interface Request { startTime?: bigint, bodySize?: number, startTimeMs: number } } +const logErrorAndReturnResponse = (error: Error, response: string, res: Response, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { + logger.error(error.message || error); metricsCallback([{ ...metric, error: response }]); res.json({ status: 'ERROR', reason: response }) +} +export default (methods: Types.ServerMethods, opts: ServerOptions) => { + const logger = opts.logger || { log: console.log, error: console.error } + const app = express() + if (opts.allowCors) { + app.use(cors()) + } + app.use((req, _, next) => { req.startTime = process.hrtime.bigint(); req.startTimeMs = Date.now(); next() }) + app.use(json()) + app.use(urlencoded({ extended: true })) + if (opts.logMethod) app.use((req, _, next) => { console.log(req.method, req.path); if (opts.logBody) console.log(req.body); next() }) + if (!opts.allowNotImplementedMethods && !methods.LndGetInfo) throw new Error('method: LndGetInfo is not implemented') + app.post('/api/admin/lnd/getinfo', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'LndGetInfo', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.LndGetInfo) throw new Error('method: LndGetInfo is not implemented') + const authContext = await opts.AdminAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.LndGetInfoRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.LndGetInfo({rpcName:'LndGetInfo', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.AddApp) throw new Error('method: AddApp is not implemented') + app.post('/api/admin/app/add', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'AddApp', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.AddApp) throw new Error('method: AddApp is not implemented') + const authContext = await opts.AdminAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.AddAppRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.AddApp({rpcName:'AddApp', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.AuthApp) throw new Error('method: AuthApp is not implemented') + app.post('/api/admin/app/auth', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'AuthApp', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.AuthApp) throw new Error('method: AuthApp is not implemented') + const authContext = await opts.AdminAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.AuthAppRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.AuthApp({rpcName:'AuthApp', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.BanUser) throw new Error('method: BanUser is not implemented') + app.post('/api/admin/user/ban', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'BanUser', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.BanUser) throw new Error('method: BanUser is not implemented') + const authContext = await opts.AdminAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.BanUserRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.BanUser({rpcName:'BanUser', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented') + app.post('/api/reports/usage', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetUsageMetrics', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented') + const authContext = await opts.MetricsAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetUsageMetrics({rpcName:'GetUsageMetrics', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetAppsMetrics) throw new Error('method: GetAppsMetrics is not implemented') + app.post('/api/reports/apps', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetAppsMetrics', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetAppsMetrics) throw new Error('method: GetAppsMetrics is not implemented') + const authContext = await opts.MetricsAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.AppsMetricsRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.GetAppsMetrics({rpcName:'GetAppsMetrics', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLndMetrics) throw new Error('method: GetLndMetrics is not implemented') + app.post('/api/reports/lnd', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetLndMetrics', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetLndMetrics) throw new Error('method: GetLndMetrics is not implemented') + const authContext = await opts.MetricsAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.LndMetricsRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.GetLndMetrics({rpcName:'GetLndMetrics', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.Health) throw new Error('method: Health is not implemented') + app.get('/api/health', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'Health', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.Health) throw new Error('method: Health is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + await methods.Health({rpcName:'Health', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.EncryptionExchange) throw new Error('method: EncryptionExchange is not implemented') + app.post('/api/encryption/exchange', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'EncryptionExchange', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.EncryptionExchange) throw new Error('method: EncryptionExchange is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.EncryptionExchangeRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.EncryptionExchange({rpcName:'EncryptionExchange', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.SetMockInvoiceAsPaid) throw new Error('method: SetMockInvoiceAsPaid is not implemented') + app.post('/api/lnd/mock/invoice/paid', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'SetMockInvoiceAsPaid', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.SetMockInvoiceAsPaid) throw new Error('method: SetMockInvoiceAsPaid is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.SetMockInvoiceAsPaidRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.SetMockInvoiceAsPaid({rpcName:'SetMockInvoiceAsPaid', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented') + app.get('/api/guest/lnurl_withdraw/info', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetLnurlWithdrawInfo', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetLnurlWithdrawInfo({rpcName:'GetLnurlWithdrawInfo', ctx:authContext ,query: req.query}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented') + app.get('/api/guest/lnurl_withdraw/handle', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'HandleLnurlWithdraw', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + await methods.HandleLnurlWithdraw({rpcName:'HandleLnurlWithdraw', ctx:authContext ,query: req.query}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented') + app.get('/api/guest/lnurl_pay/info', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetLnurlPayInfo', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetLnurlPayInfo({rpcName:'GetLnurlPayInfo', ctx:authContext ,query: req.query}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented') + app.get('/api/guest/lnurl_pay/handle', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'HandleLnurlPay', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.HandleLnurlPay({rpcName:'HandleLnurlPay', ctx:authContext ,query: req.query}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.HandleLnurlAddress) throw new Error('method: HandleLnurlAddress is not implemented') + app.get('/.well-known/lnurlp/:address_name', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'HandleLnurlAddress', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.HandleLnurlAddress) throw new Error('method: HandleLnurlAddress is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.HandleLnurlAddress({rpcName:'HandleLnurlAddress', ctx:authContext ,params: req.params}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') + app.post('/api/guest/npub/link', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'LinkNPubThroughToken', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.LinkNPubThroughTokenRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.LinkNPubThroughToken({rpcName:'LinkNPubThroughToken', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetApp) throw new Error('method: GetApp is not implemented') + app.post('/api/app/get', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetApp', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetApp) throw new Error('method: GetApp is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetApp({rpcName:'GetApp', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.AddAppUser) throw new Error('method: AddAppUser is not implemented') + app.post('/api/app/user/add', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'AddAppUser', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.AddAppUser) throw new Error('method: AddAppUser is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.AddAppUserRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.AddAppUser({rpcName:'AddAppUser', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.AddAppInvoice) throw new Error('method: AddAppInvoice is not implemented') + app.post('/api/app/add/invoice', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'AddAppInvoice', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.AddAppInvoice) throw new Error('method: AddAppInvoice is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.AddAppInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.AddAppInvoice({rpcName:'AddAppInvoice', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.AddAppUserInvoice) throw new Error('method: AddAppUserInvoice is not implemented') + app.post('/api/app/user/add/invoice', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'AddAppUserInvoice', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.AddAppUserInvoice) throw new Error('method: AddAppUserInvoice is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.AddAppUserInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.AddAppUserInvoice({rpcName:'AddAppUserInvoice', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetAppUser) throw new Error('method: GetAppUser is not implemented') + app.post('/api/app/user/get', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetAppUser', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetAppUser) throw new Error('method: GetAppUser is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.GetAppUserRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.GetAppUser({rpcName:'GetAppUser', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.PayAppUserInvoice) throw new Error('method: PayAppUserInvoice is not implemented') + app.post('/api/app/invoice/pay', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'PayAppUserInvoice', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.PayAppUserInvoice) throw new Error('method: PayAppUserInvoice is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.PayAppUserInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.PayAppUserInvoice({rpcName:'PayAppUserInvoice', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.SendAppUserToAppUserPayment) throw new Error('method: SendAppUserToAppUserPayment is not implemented') + app.post('/api/app/user/internal/pay', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'SendAppUserToAppUserPayment', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.SendAppUserToAppUserPayment) throw new Error('method: SendAppUserToAppUserPayment is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.SendAppUserToAppUserPaymentRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.SendAppUserToAppUserPayment({rpcName:'SendAppUserToAppUserPayment', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.SendAppUserToAppPayment) throw new Error('method: SendAppUserToAppPayment is not implemented') + app.post('/api/app/internal/pay', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'SendAppUserToAppPayment', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.SendAppUserToAppPayment) throw new Error('method: SendAppUserToAppPayment is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.SendAppUserToAppPaymentRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.SendAppUserToAppPayment({rpcName:'SendAppUserToAppPayment', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetAppUserLNURLInfo) throw new Error('method: GetAppUserLNURLInfo is not implemented') + app.post('/api/app/user/lnurl/pay/info', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetAppUserLNURLInfo', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetAppUserLNURLInfo) throw new Error('method: GetAppUserLNURLInfo is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.GetAppUserLNURLInfoRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.GetAppUserLNURLInfo({rpcName:'GetAppUserLNURLInfo', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.SetMockAppUserBalance) throw new Error('method: SetMockAppUserBalance is not implemented') + app.post('/api/app/mock/user/blance/set', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'SetMockAppUserBalance', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.SetMockAppUserBalance) throw new Error('method: SetMockAppUserBalance is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.SetMockAppUserBalanceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.SetMockAppUserBalance({rpcName:'SetMockAppUserBalance', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.SetMockAppBalance) throw new Error('method: SetMockAppBalance is not implemented') + app.post('/api/app/mock/blance/set', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'SetMockAppBalance', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.SetMockAppBalance) throw new Error('method: SetMockAppBalance is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.SetMockAppBalanceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + await methods.SetMockAppBalance({rpcName:'SetMockAppBalance', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.RequestNPubLinkingToken) throw new Error('method: RequestNPubLinkingToken is not implemented') + app.post('/api/app/user/npub/token', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'RequestNPubLinkingToken', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.RequestNPubLinkingToken) throw new Error('method: RequestNPubLinkingToken is not implemented') + const authContext = await opts.AppAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.RequestNPubLinkingTokenRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.RequestNPubLinkingToken({rpcName:'RequestNPubLinkingToken', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.UserHealth) throw new Error('method: UserHealth is not implemented') + app.post('/api/user/health', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'UserHealth', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.UserHealth) throw new Error('method: UserHealth is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + await methods.UserHealth({rpcName:'UserHealth', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK'}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') + app.post('/api/user/info', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetUserInfo', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetUserInfo({rpcName:'GetUserInfo', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.AddProduct) throw new Error('method: AddProduct is not implemented') + app.post('/api/user/product/add', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'AddProduct', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.AddProduct) throw new Error('method: AddProduct is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.AddProductRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.AddProduct({rpcName:'AddProduct', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.NewProductInvoice) throw new Error('method: NewProductInvoice is not implemented') + app.get('/api/user/product/get/invoice', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'NewProductInvoice', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.NewProductInvoice) throw new Error('method: NewProductInvoice is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.NewProductInvoice({rpcName:'NewProductInvoice', ctx:authContext ,query: req.query}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetUserOperations) throw new Error('method: GetUserOperations is not implemented') + app.post('/api/user/operations', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetUserOperations', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetUserOperations) throw new Error('method: GetUserOperations is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.GetUserOperationsRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.GetUserOperations({rpcName:'GetUserOperations', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.NewAddress) throw new Error('method: NewAddress is not implemented') + app.post('/api/user/chain/new', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'NewAddress', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.NewAddress) throw new Error('method: NewAddress is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.NewAddressRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.NewAddress({rpcName:'NewAddress', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.PayAddress) throw new Error('method: PayAddress is not implemented') + app.post('/api/user/chain/pay', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'PayAddress', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.PayAddress) throw new Error('method: PayAddress is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.PayAddressRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.PayAddress({rpcName:'PayAddress', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.NewInvoice) throw new Error('method: NewInvoice is not implemented') + app.post('/api/user/invoice/new', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'NewInvoice', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.NewInvoice) throw new Error('method: NewInvoice is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.NewInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.NewInvoice({rpcName:'NewInvoice', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.DecodeInvoice) throw new Error('method: DecodeInvoice is not implemented') + app.post('/api/user/invoice/decode', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'DecodeInvoice', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.DecodeInvoice) throw new Error('method: DecodeInvoice is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.DecodeInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.DecodeInvoice({rpcName:'DecodeInvoice', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.PayInvoice) throw new Error('method: PayInvoice is not implemented') + app.post('/api/user/invoice/pay', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'PayInvoice', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.PayInvoice) throw new Error('method: PayInvoice is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.PayInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.PayInvoice({rpcName:'PayInvoice', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.OpenChannel) throw new Error('method: OpenChannel is not implemented') + app.post('/api/user/open/channel', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'OpenChannel', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.OpenChannel) throw new Error('method: OpenChannel is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + const request = req.body + const error = Types.OpenChannelRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) + const query = req.query + const params = req.params + const response = await methods.OpenChannel({rpcName:'OpenChannel', ctx:authContext , req: request}) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') + app.get('/api/user/lnurl_withdraw/link', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetLnurlWithdrawLink', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetLnurlWithdrawLink({rpcName:'GetLnurlWithdrawLink', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLnurlPayLink) throw new Error('method: GetLnurlPayLink is not implemented') + app.get('/api/user/lnurl_pay/link', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetLnurlPayLink', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetLnurlPayLink) throw new Error('method: GetLnurlPayLink is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetLnurlPayLink({rpcName:'GetLnurlPayLink', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') + app.post('/api/user/lnurl_channel/url', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'GetLNURLChannelLink', batch: false, nostr: false, batchSize: 0} + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + if (!methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + authCtx = authContext + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + const query = req.query + const params = req.params + const response = await methods.GetLNURLChannelLink({rpcName:'GetLNURLChannelLink', ctx:authContext }) + stats.handle = process.hrtime.bigint() + res.json({status: 'OK', ...response}) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + app.post('/api/user/batch', async (req, res) => { + const info: Types.RequestInfo = { rpcName: 'BatchUser', batch: true, nostr: false, batchSize: 1 } + const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + try { + const requests = req.body.requests as Types.UserMethodInputs[] + if (!Array.isArray(requests))throw new Error('invalid body, is not an array') + info.batchSize = requests.length + if (requests.length > 10) throw new Error('too many requests in the batch') + const ctx = await opts.UserAuthGuard(req.headers['authorization']) + stats.guard = process.hrtime.bigint() + stats.validate = stats.guard + authCtx = ctx + const responses = [] + const callsMetrics: Types.RequestMetric[] = [] + for (let i = 0; i < requests.length; i++) { + const operation = requests[i] + const opInfo: Types.RequestInfo = { rpcName: operation.rpcName, batch: true, nostr: false, batchSize: 0 } + const opStats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: stats.parse, guard: stats.guard, validate: 0n, handle: 0n } + try { + switch(operation.rpcName) { + case 'LinkNPubThroughToken': + if (!methods.LinkNPubThroughToken) { + throw new Error('method LinkNPubThroughToken not found' ) + } else { + const error = Types.LinkNPubThroughTokenRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + await methods.LinkNPubThroughToken({...operation, ctx}); responses.push({ status: 'OK' }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'UserHealth': + if (!methods.UserHealth) { + throw new Error('method UserHealth not found' ) + } else { + opStats.validate = opStats.guard + await methods.UserHealth({...operation, ctx}); responses.push({ status: 'OK' }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetUserInfo': + if (!methods.GetUserInfo) { + throw new Error('method GetUserInfo not found' ) + } else { + opStats.validate = opStats.guard + const res = await methods.GetUserInfo({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'AddProduct': + if (!methods.AddProduct) { + throw new Error('method AddProduct not found' ) + } else { + const error = Types.AddProductRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.AddProduct({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'NewProductInvoice': + if (!methods.NewProductInvoice) { + throw new Error('method NewProductInvoice not found' ) + } else { + opStats.validate = opStats.guard + const res = await methods.NewProductInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetUserOperations': + if (!methods.GetUserOperations) { + throw new Error('method GetUserOperations not found' ) + } else { + const error = Types.GetUserOperationsRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.GetUserOperations({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'NewAddress': + if (!methods.NewAddress) { + throw new Error('method NewAddress not found' ) + } else { + const error = Types.NewAddressRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.NewAddress({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'PayAddress': + if (!methods.PayAddress) { + throw new Error('method PayAddress not found' ) + } else { + const error = Types.PayAddressRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.PayAddress({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'NewInvoice': + if (!methods.NewInvoice) { + throw new Error('method NewInvoice not found' ) + } else { + const error = Types.NewInvoiceRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.NewInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'DecodeInvoice': + if (!methods.DecodeInvoice) { + throw new Error('method DecodeInvoice not found' ) + } else { + const error = Types.DecodeInvoiceRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.DecodeInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'PayInvoice': + if (!methods.PayInvoice) { + throw new Error('method PayInvoice not found' ) + } else { + const error = Types.PayInvoiceRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.PayInvoice({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'OpenChannel': + if (!methods.OpenChannel) { + throw new Error('method OpenChannel not found' ) + } else { + const error = Types.OpenChannelRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.OpenChannel({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetLnurlWithdrawLink': + if (!methods.GetLnurlWithdrawLink) { + throw new Error('method GetLnurlWithdrawLink not found' ) + } else { + opStats.validate = opStats.guard + const res = await methods.GetLnurlWithdrawLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetLnurlPayLink': + if (!methods.GetLnurlPayLink) { + throw new Error('method GetLnurlPayLink not found' ) + } else { + opStats.validate = opStats.guard + const res = await methods.GetLnurlPayLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetLNURLChannelLink': + if (!methods.GetLNURLChannelLink) { + throw new Error('method GetLNURLChannelLink not found' ) + } else { + opStats.validate = opStats.guard + const res = await methods.GetLNURLChannelLink({...operation, ctx}); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + default: + throw new Error('unkown rpcName') + } + } catch(ex) {const e = ex as any; logger.error(e.message || e); callsMetrics.push({ ...opInfo, ...opStats, ...ctx, error: e.message }); responses.push({ status: 'ERROR', reason: e.message || e })} + } + stats.handle = process.hrtime.bigint() + res.json({ status: 'OK', responses }) + opts.metricsCallback([{ ...info, ...stats, ...ctx }, ...callsMetrics]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + }) + if (opts.staticFiles) { + app.use(express.static(opts.staticFiles)) + app.get('*', function (_, res) { res.sendFile('index.html', { root: opts.staticFiles })}) + } + var server: { close: () => void } | undefined + return { + Close: () => { if (!server) { throw new Error('tried closing server before starting') } else server.close() }, + Listen: (port: number) => { server = app.listen(port, () => logger.log('Example app listening on port ' + port)) } + } +} diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index cdaec8d5..87a553f1 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -1,602 +1,602 @@ -// This file was autogenerated from a .proto file, DO NOT EDIT! -import axios from 'axios' -import * as Types from './types.js' -export type ResultError = { status: 'ERROR', reason: string } - -export type ClientParams = { - baseUrl: string - retrieveGuestAuth: () => Promise - retrieveUserAuth: () => Promise - retrieveAdminAuth: () => Promise - retrieveMetricsAuth: () => Promise - retrieveAppAuth: () => Promise - encryptCallback: (plain: any) => Promise - decryptCallback: (encrypted: any) => Promise - deviceId: string - checkResult?: true -} -export default (params: ClientParams) => ({ - LndGetInfo: async (request: Types.LndGetInfoRequest): Promise => { - const auth = await params.retrieveAdminAuth() - if (auth === null) throw new Error('retrieveAdminAuth() returned null') - let finalRoute = '/api/admin/lnd/getinfo' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LndGetInfoResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - AddApp: async (request: Types.AddAppRequest): Promise => { - const auth = await params.retrieveAdminAuth() - if (auth === null) throw new Error('retrieveAdminAuth() returned null') - let finalRoute = '/api/admin/app/add' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.AuthAppValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - AuthApp: async (request: Types.AuthAppRequest): Promise => { - const auth = await params.retrieveAdminAuth() - if (auth === null) throw new Error('retrieveAdminAuth() returned null') - let finalRoute = '/api/admin/app/auth' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.AuthAppValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - BanUser: async (request: Types.BanUserRequest): Promise => { - const auth = await params.retrieveAdminAuth() - if (auth === null) throw new Error('retrieveAdminAuth() returned null') - let finalRoute = '/api/admin/user/ban' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.BanUserResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetUsageMetrics: async (): Promise => { - const auth = await params.retrieveMetricsAuth() - if (auth === null) throw new Error('retrieveMetricsAuth() returned null') - let finalRoute = '/api/reports/usage' - const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.UsageMetricsValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetAppsMetrics: async (request: Types.AppsMetricsRequest): Promise => { - const auth = await params.retrieveMetricsAuth() - if (auth === null) throw new Error('retrieveMetricsAuth() returned null') - let finalRoute = '/api/reports/apps' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.AppsMetricsValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLndMetrics: async (request: Types.LndMetricsRequest): Promise => { - const auth = await params.retrieveMetricsAuth() - if (auth === null) throw new Error('retrieveMetricsAuth() returned null') - let finalRoute = '/api/reports/lnd' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LndMetricsValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - Health: async (): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/api/health' - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - EncryptionExchange: async (request: Types.EncryptionExchangeRequest): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/api/encryption/exchange' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - SetMockInvoiceAsPaid: async (request: Types.SetMockInvoiceAsPaidRequest): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/api/lnd/mock/invoice/paid' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLnurlWithdrawInfo: async (query: Types.GetLnurlWithdrawInfo_Query): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/api/guest/lnurl_withdraw/info' - const q = (new URLSearchParams(query)).toString() - finalRoute = finalRoute + (q === '' ? '' : '?' + q) - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlWithdrawInfoResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - HandleLnurlWithdraw: async (query: Types.HandleLnurlWithdraw_Query): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/api/guest/lnurl_withdraw/handle' - const q = (new URLSearchParams(query)).toString() - finalRoute = finalRoute + (q === '' ? '' : '?' + q) - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLnurlPayInfo: async (query: Types.GetLnurlPayInfo_Query): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/api/guest/lnurl_pay/info' - const q = (new URLSearchParams(query)).toString() - finalRoute = finalRoute + (q === '' ? '' : '?' + q) - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlPayInfoResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - HandleLnurlPay: async (query: Types.HandleLnurlPay_Query): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/api/guest/lnurl_pay/handle' - const q = (new URLSearchParams(query)).toString() - finalRoute = finalRoute + (q === '' ? '' : '?' + q) - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.HandleLnurlPayResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - HandleLnurlAddress: async (routeParams: Types.HandleLnurlAddress_RouteParams): Promise => { - const auth = await params.retrieveGuestAuth() - if (auth === null) throw new Error('retrieveGuestAuth() returned null') - let finalRoute = '/.well-known/lnurlp/:address_name' - finalRoute = finalRoute.replace(':address_name', routeParams['address_name']) - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlPayInfoResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/guest/npub/link' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetApp: async (): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/get' - const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.ApplicationValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - AddAppUser: async (request: Types.AddAppUserRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/user/add' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.AppUserValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - AddAppInvoice: async (request: Types.AddAppInvoiceRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/add/invoice' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - AddAppUserInvoice: async (request: Types.AddAppUserInvoiceRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/user/add/invoice' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetAppUser: async (request: Types.GetAppUserRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/user/get' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.AppUserValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - PayAppUserInvoice: async (request: Types.PayAppUserInvoiceRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/invoice/pay' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.PayInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - SendAppUserToAppUserPayment: async (request: Types.SendAppUserToAppUserPaymentRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/user/internal/pay' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - SendAppUserToAppPayment: async (request: Types.SendAppUserToAppPaymentRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/internal/pay' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetAppUserLNURLInfo: async (request: Types.GetAppUserLNURLInfoRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/user/lnurl/pay/info' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlPayInfoResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - SetMockAppUserBalance: async (request: Types.SetMockAppUserBalanceRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/mock/user/blance/set' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - SetMockAppBalance: async (request: Types.SetMockAppBalanceRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/mock/blance/set' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - RequestNPubLinkingToken: async (request: Types.RequestNPubLinkingTokenRequest): Promise => { - const auth = await params.retrieveAppAuth() - if (auth === null) throw new Error('retrieveAppAuth() returned null') - let finalRoute = '/api/app/user/npub/token' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.RequestNPubLinkingTokenResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - UserHealth: async (): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/health' - const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetUserInfo: async (): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/info' - const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.UserInfoValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - AddProduct: async (request: Types.AddProductRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/product/add' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.ProductValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - NewProductInvoice: async (query: Types.NewProductInvoice_Query): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/product/get/invoice' - const q = (new URLSearchParams(query)).toString() - finalRoute = finalRoute + (q === '' ? '' : '?' + q) - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetUserOperations: async (request: Types.GetUserOperationsRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/operations' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.GetUserOperationsResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - NewAddress: async (request: Types.NewAddressRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/chain/new' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewAddressResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - PayAddress: async (request: Types.PayAddressRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/chain/pay' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.PayAddressResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - NewInvoice: async (request: Types.NewInvoiceRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/invoice/new' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - DecodeInvoice: async (request: Types.DecodeInvoiceRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/invoice/decode' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.DecodeInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - PayInvoice: async (request: Types.PayInvoiceRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/invoice/pay' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.PayInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - OpenChannel: async (request: Types.OpenChannelRequest): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/open/channel' - const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.OpenChannelResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLnurlWithdrawLink: async (): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/lnurl_withdraw/link' - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlLinkResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLnurlPayLink: async (): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/lnurl_pay/link' - const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlLinkResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLNURLChannelLink: async (): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/lnurl_channel/url' - const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlLinkResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLiveUserOperations: async (cb: (v:ResultError | ({ status: 'OK' }& Types.LiveUserOperation)) => void): Promise => { throw new Error('http streams are not supported')}, - GetMigrationUpdate: async (cb: (v:ResultError | ({ status: 'OK' }& Types.MigrationUpdate)) => void): Promise => { throw new Error('http streams are not supported')}, - GetHttpCreds: async (cb: (v:ResultError | ({ status: 'OK' }& Types.HttpCreds)) => void): Promise => { throw new Error('http streams are not supported')}, - BatchUser: async (requests:Types.UserMethodInputs[]): Promise => { - const auth = await params.retrieveUserAuth() - if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/batch' - const { data } = await axios.post(params.baseUrl + finalRoute, {requests}, { headers: { 'authorization': auth } }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return { status: 'OK', ...data } - } - return { status: 'ERROR', reason: 'invalid response' } - } -}) +// This file was autogenerated from a .proto file, DO NOT EDIT! +import axios from 'axios' +import * as Types from './types.js' +export type ResultError = { status: 'ERROR', reason: string } + +export type ClientParams = { + baseUrl: string + retrieveGuestAuth: () => Promise + retrieveUserAuth: () => Promise + retrieveAdminAuth: () => Promise + retrieveMetricsAuth: () => Promise + retrieveAppAuth: () => Promise + encryptCallback: (plain: any) => Promise + decryptCallback: (encrypted: any) => Promise + deviceId: string + checkResult?: true +} +export default (params: ClientParams) => ({ + LndGetInfo: async (request: Types.LndGetInfoRequest): Promise => { + const auth = await params.retrieveAdminAuth() + if (auth === null) throw new Error('retrieveAdminAuth() returned null') + let finalRoute = '/api/admin/lnd/getinfo' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LndGetInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + AddApp: async (request: Types.AddAppRequest): Promise => { + const auth = await params.retrieveAdminAuth() + if (auth === null) throw new Error('retrieveAdminAuth() returned null') + let finalRoute = '/api/admin/app/add' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.AuthAppValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + AuthApp: async (request: Types.AuthAppRequest): Promise => { + const auth = await params.retrieveAdminAuth() + if (auth === null) throw new Error('retrieveAdminAuth() returned null') + let finalRoute = '/api/admin/app/auth' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.AuthAppValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + BanUser: async (request: Types.BanUserRequest): Promise => { + const auth = await params.retrieveAdminAuth() + if (auth === null) throw new Error('retrieveAdminAuth() returned null') + let finalRoute = '/api/admin/user/ban' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.BanUserResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetUsageMetrics: async (): Promise => { + const auth = await params.retrieveMetricsAuth() + if (auth === null) throw new Error('retrieveMetricsAuth() returned null') + let finalRoute = '/api/reports/usage' + const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.UsageMetricsValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetAppsMetrics: async (request: Types.AppsMetricsRequest): Promise => { + const auth = await params.retrieveMetricsAuth() + if (auth === null) throw new Error('retrieveMetricsAuth() returned null') + let finalRoute = '/api/reports/apps' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.AppsMetricsValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLndMetrics: async (request: Types.LndMetricsRequest): Promise => { + const auth = await params.retrieveMetricsAuth() + if (auth === null) throw new Error('retrieveMetricsAuth() returned null') + let finalRoute = '/api/reports/lnd' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LndMetricsValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + Health: async (): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/health' + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + EncryptionExchange: async (request: Types.EncryptionExchangeRequest): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/encryption/exchange' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + SetMockInvoiceAsPaid: async (request: Types.SetMockInvoiceAsPaidRequest): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/lnd/mock/invoice/paid' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlWithdrawInfo: async (query: Types.GetLnurlWithdrawInfo_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_withdraw/info' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlWithdrawInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + HandleLnurlWithdraw: async (query: Types.HandleLnurlWithdraw_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_withdraw/handle' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlPayInfo: async (query: Types.GetLnurlPayInfo_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_pay/info' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlPayInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + HandleLnurlPay: async (query: Types.HandleLnurlPay_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_pay/handle' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.HandleLnurlPayResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + HandleLnurlAddress: async (routeParams: Types.HandleLnurlAddress_RouteParams): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/.well-known/lnurlp/:address_name' + finalRoute = finalRoute.replace(':address_name', routeParams['address_name']) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlPayInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/guest/npub/link' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetApp: async (): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/get' + const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.ApplicationValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + AddAppUser: async (request: Types.AddAppUserRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/user/add' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.AppUserValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + AddAppInvoice: async (request: Types.AddAppInvoiceRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/add/invoice' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + AddAppUserInvoice: async (request: Types.AddAppUserInvoiceRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/user/add/invoice' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetAppUser: async (request: Types.GetAppUserRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/user/get' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.AppUserValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + PayAppUserInvoice: async (request: Types.PayAppUserInvoiceRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/invoice/pay' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.PayInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + SendAppUserToAppUserPayment: async (request: Types.SendAppUserToAppUserPaymentRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/user/internal/pay' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + SendAppUserToAppPayment: async (request: Types.SendAppUserToAppPaymentRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/internal/pay' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetAppUserLNURLInfo: async (request: Types.GetAppUserLNURLInfoRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/user/lnurl/pay/info' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlPayInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + SetMockAppUserBalance: async (request: Types.SetMockAppUserBalanceRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/mock/user/blance/set' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + SetMockAppBalance: async (request: Types.SetMockAppBalanceRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/mock/blance/set' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + RequestNPubLinkingToken: async (request: Types.RequestNPubLinkingTokenRequest): Promise => { + const auth = await params.retrieveAppAuth() + if (auth === null) throw new Error('retrieveAppAuth() returned null') + let finalRoute = '/api/app/user/npub/token' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.RequestNPubLinkingTokenResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + UserHealth: async (): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/health' + const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetUserInfo: async (): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/info' + const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.UserInfoValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + AddProduct: async (request: Types.AddProductRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/product/add' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.ProductValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + NewProductInvoice: async (query: Types.NewProductInvoice_Query): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/product/get/invoice' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetUserOperations: async (request: Types.GetUserOperationsRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/operations' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.GetUserOperationsResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + NewAddress: async (request: Types.NewAddressRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/chain/new' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewAddressResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + PayAddress: async (request: Types.PayAddressRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/chain/pay' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.PayAddressResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + NewInvoice: async (request: Types.NewInvoiceRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/invoice/new' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + DecodeInvoice: async (request: Types.DecodeInvoiceRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/invoice/decode' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.DecodeInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + PayInvoice: async (request: Types.PayInvoiceRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/invoice/pay' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.PayInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + OpenChannel: async (request: Types.OpenChannelRequest): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/open/channel' + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.OpenChannelResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlWithdrawLink: async (): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/lnurl_withdraw/link' + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlPayLink: async (): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/lnurl_pay/link' + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLNURLChannelLink: async (): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/lnurl_channel/url' + const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLiveUserOperations: async (cb: (v:ResultError | ({ status: 'OK' }& Types.LiveUserOperation)) => void): Promise => { throw new Error('http streams are not supported')}, + GetMigrationUpdate: async (cb: (v:ResultError | ({ status: 'OK' }& Types.MigrationUpdate)) => void): Promise => { throw new Error('http streams are not supported')}, + GetHttpCreds: async (cb: (v:ResultError | ({ status: 'OK' }& Types.HttpCreds)) => void): Promise => { throw new Error('http streams are not supported')}, + BatchUser: async (requests:Types.UserMethodInputs[]): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/batch' + const { data } = await axios.post(params.baseUrl + finalRoute, {requests}, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return { status: 'OK', ...data } + } + return { status: 'ERROR', reason: 'invalid response' } + } +}) diff --git a/proto/autogenerated/ts/nostr_client.ts b/proto/autogenerated/ts/nostr_client.ts index 2c07d5ae..4a799394 100644 --- a/proto/autogenerated/ts/nostr_client.ts +++ b/proto/autogenerated/ts/nostr_client.ts @@ -1,282 +1,282 @@ -// This file was autogenerated from a .proto file, DO NOT EDIT! -import { NostrRequest } from './nostr_transport.js' -import * as Types from './types.js' -export type ResultError = { status: 'ERROR', reason: string } - -export type NostrClientParams = { - pubDestination: string - retrieveNostrUserAuth: () => Promise - checkResult?: true -} -export default (params: NostrClientParams, send: (to:string, message: NostrRequest) => Promise, subscribe: (to:string, message: NostrRequest, cb:(res:any)=> void) => void) => ({ - LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'LinkNPubThroughToken',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - UserHealth: async (): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - const data = await send(params.pubDestination, {rpcName:'UserHealth',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetUserInfo: async (): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - const data = await send(params.pubDestination, {rpcName:'GetUserInfo',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.UserInfoValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - AddProduct: async (request: Types.AddProductRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'AddProduct',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.ProductValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - NewProductInvoice: async (query: Types.NewProductInvoice_Query): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.query = query - const data = await send(params.pubDestination, {rpcName:'NewProductInvoice',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetUserOperations: async (request: Types.GetUserOperationsRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'GetUserOperations',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.GetUserOperationsResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - NewAddress: async (request: Types.NewAddressRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'NewAddress',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewAddressResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - PayAddress: async (request: Types.PayAddressRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'PayAddress',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.PayAddressResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - NewInvoice: async (request: Types.NewInvoiceRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'NewInvoice',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.NewInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - DecodeInvoice: async (request: Types.DecodeInvoiceRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'DecodeInvoice',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.DecodeInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - PayInvoice: async (request: Types.PayInvoiceRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'PayInvoice',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.PayInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - OpenChannel: async (request: Types.OpenChannelRequest): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - nostrRequest.body = request - const data = await send(params.pubDestination, {rpcName:'OpenChannel',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.OpenChannelResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLnurlWithdrawLink: async (): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - const data = await send(params.pubDestination, {rpcName:'GetLnurlWithdrawLink',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlLinkResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLnurlPayLink: async (): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - const data = await send(params.pubDestination, {rpcName:'GetLnurlPayLink',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlLinkResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLNURLChannelLink: async (): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - const data = await send(params.pubDestination, {rpcName:'GetLNURLChannelLink',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return { status: 'OK', ...result } - const error = Types.LnurlLinkResponseValidate(result) - if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } - } - return { status: 'ERROR', reason: 'invalid response' } - }, - GetLiveUserOperations: async (cb: (res:ResultError | ({ status: 'OK' }& Types.LiveUserOperation)) => void): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - subscribe(params.pubDestination, {rpcName:'GetLiveUserOperations',authIdentifier:auth, ...nostrRequest }, (data) => { - if (data.status === 'ERROR' && typeof data.reason === 'string') return cb(data) - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return cb({ status: 'OK', ...result }) - const error = Types.LiveUserOperationValidate(result) - if (error === null) { return cb({ status: 'OK', ...result }) } else return cb({ status: 'ERROR', reason: error.message }) - } - return cb({ status: 'ERROR', reason: 'invalid response' }) - }) - }, - GetMigrationUpdate: async (cb: (res:ResultError | ({ status: 'OK' }& Types.MigrationUpdate)) => void): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - subscribe(params.pubDestination, {rpcName:'GetMigrationUpdate',authIdentifier:auth, ...nostrRequest }, (data) => { - if (data.status === 'ERROR' && typeof data.reason === 'string') return cb(data) - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return cb({ status: 'OK', ...result }) - const error = Types.MigrationUpdateValidate(result) - if (error === null) { return cb({ status: 'OK', ...result }) } else return cb({ status: 'ERROR', reason: error.message }) - } - return cb({ status: 'ERROR', reason: 'invalid response' }) - }) - }, - GetHttpCreds: async (cb: (res:ResultError | ({ status: 'OK' }& Types.HttpCreds)) => void): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {} - subscribe(params.pubDestination, {rpcName:'GetHttpCreds',authIdentifier:auth, ...nostrRequest }, (data) => { - if (data.status === 'ERROR' && typeof data.reason === 'string') return cb(data) - if (data.status === 'OK') { - const result = data - if(!params.checkResult) return cb({ status: 'OK', ...result }) - const error = Types.HttpCredsValidate(result) - if (error === null) { return cb({ status: 'OK', ...result }) } else return cb({ status: 'ERROR', reason: error.message }) - } - return cb({ status: 'ERROR', reason: 'invalid response' }) - }) - }, - BatchUser: async (requests:Types.UserMethodInputs[]): Promise => { - const auth = await params.retrieveNostrUserAuth() - if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') - const nostrRequest: NostrRequest = {body:{requests}} - const data = await send(params.pubDestination, {rpcName:'BatchUser',authIdentifier:auth, ...nostrRequest }) - if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - return data - } - return { status: 'ERROR', reason: 'invalid response' } - } -}) +// This file was autogenerated from a .proto file, DO NOT EDIT! +import { NostrRequest } from './nostr_transport.js' +import * as Types from './types.js' +export type ResultError = { status: 'ERROR', reason: string } + +export type NostrClientParams = { + pubDestination: string + retrieveNostrUserAuth: () => Promise + checkResult?: true +} +export default (params: NostrClientParams, send: (to:string, message: NostrRequest) => Promise, subscribe: (to:string, message: NostrRequest, cb:(res:any)=> void) => void) => ({ + LinkNPubThroughToken: async (request: Types.LinkNPubThroughTokenRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'LinkNPubThroughToken',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + UserHealth: async (): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + const data = await send(params.pubDestination, {rpcName:'UserHealth',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetUserInfo: async (): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + const data = await send(params.pubDestination, {rpcName:'GetUserInfo',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.UserInfoValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + AddProduct: async (request: Types.AddProductRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'AddProduct',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.ProductValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + NewProductInvoice: async (query: Types.NewProductInvoice_Query): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.query = query + const data = await send(params.pubDestination, {rpcName:'NewProductInvoice',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetUserOperations: async (request: Types.GetUserOperationsRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'GetUserOperations',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.GetUserOperationsResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + NewAddress: async (request: Types.NewAddressRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'NewAddress',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewAddressResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + PayAddress: async (request: Types.PayAddressRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'PayAddress',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.PayAddressResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + NewInvoice: async (request: Types.NewInvoiceRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'NewInvoice',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.NewInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + DecodeInvoice: async (request: Types.DecodeInvoiceRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'DecodeInvoice',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.DecodeInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + PayInvoice: async (request: Types.PayInvoiceRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'PayInvoice',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.PayInvoiceResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + OpenChannel: async (request: Types.OpenChannelRequest): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + nostrRequest.body = request + const data = await send(params.pubDestination, {rpcName:'OpenChannel',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.OpenChannelResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlWithdrawLink: async (): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + const data = await send(params.pubDestination, {rpcName:'GetLnurlWithdrawLink',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlPayLink: async (): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + const data = await send(params.pubDestination, {rpcName:'GetLnurlPayLink',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLNURLChannelLink: async (): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + const data = await send(params.pubDestination, {rpcName:'GetLNURLChannelLink',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLiveUserOperations: async (cb: (res:ResultError | ({ status: 'OK' }& Types.LiveUserOperation)) => void): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + subscribe(params.pubDestination, {rpcName:'GetLiveUserOperations',authIdentifier:auth, ...nostrRequest }, (data) => { + if (data.status === 'ERROR' && typeof data.reason === 'string') return cb(data) + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return cb({ status: 'OK', ...result }) + const error = Types.LiveUserOperationValidate(result) + if (error === null) { return cb({ status: 'OK', ...result }) } else return cb({ status: 'ERROR', reason: error.message }) + } + return cb({ status: 'ERROR', reason: 'invalid response' }) + }) + }, + GetMigrationUpdate: async (cb: (res:ResultError | ({ status: 'OK' }& Types.MigrationUpdate)) => void): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + subscribe(params.pubDestination, {rpcName:'GetMigrationUpdate',authIdentifier:auth, ...nostrRequest }, (data) => { + if (data.status === 'ERROR' && typeof data.reason === 'string') return cb(data) + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return cb({ status: 'OK', ...result }) + const error = Types.MigrationUpdateValidate(result) + if (error === null) { return cb({ status: 'OK', ...result }) } else return cb({ status: 'ERROR', reason: error.message }) + } + return cb({ status: 'ERROR', reason: 'invalid response' }) + }) + }, + GetHttpCreds: async (cb: (res:ResultError | ({ status: 'OK' }& Types.HttpCreds)) => void): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {} + subscribe(params.pubDestination, {rpcName:'GetHttpCreds',authIdentifier:auth, ...nostrRequest }, (data) => { + if (data.status === 'ERROR' && typeof data.reason === 'string') return cb(data) + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return cb({ status: 'OK', ...result }) + const error = Types.HttpCredsValidate(result) + if (error === null) { return cb({ status: 'OK', ...result }) } else return cb({ status: 'ERROR', reason: error.message }) + } + return cb({ status: 'ERROR', reason: 'invalid response' }) + }) + }, + BatchUser: async (requests:Types.UserMethodInputs[]): Promise => { + const auth = await params.retrieveNostrUserAuth() + if (auth === null) throw new Error('retrieveNostrUserAuth() returned null') + const nostrRequest: NostrRequest = {body:{requests}} + const data = await send(params.pubDestination, {rpcName:'BatchUser',authIdentifier:auth, ...nostrRequest }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + } +}) diff --git a/proto/autogenerated/ts/nostr_transport.ts b/proto/autogenerated/ts/nostr_transport.ts index 323cbf3a..6efa5a43 100644 --- a/proto/autogenerated/ts/nostr_transport.ts +++ b/proto/autogenerated/ts/nostr_transport.ts @@ -1,499 +1,499 @@ -// This file was autogenerated from a .proto file, DO NOT EDIT! - -import * as Types from './types.js' -export type Logger = { log: (v: any) => void, error: (v: any) => void } -type NostrResponse = (message: object) => void -export type NostrRequest = { - rpcName?: string - params?: Record - query?: Record - body?: any - authIdentifier?: string - requestId?: string - appId?: string -} -export type NostrOptions = { - logger?: Logger - throwErrors?: true - metricsCallback: (metrics: Types.RequestMetric[]) => void - NostrUserAuthGuard: (appId?: string, identifier?: string) => Promise -} -const logErrorAndReturnResponse = (error: Error, response: string, res: NostrResponse, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { - logger.error(error.message || error); metricsCallback([{ ...metric, error: response }]); res({ status: 'ERROR', reason: response }) -} -export default (methods: Types.ServerMethods, opts: NostrOptions) => { - const logger = opts.logger || { log: console.log, error: console.error } - return async (req: NostrRequest, res: NostrResponse, startString: string, startMs: number) => { - const startTime = BigInt(startString) - const info: Types.RequestInfo = { rpcName: req.rpcName || 'unkown', batch: false, nostr: true, batchSize: 0 } - const stats: Types.RequestStats = { startMs, start: startTime, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } - let authCtx: Types.AuthContext = {} - switch (req.rpcName) { - case 'LinkNPubThroughToken': - try { - if (!methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.LinkNPubThroughTokenRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - await methods.LinkNPubThroughToken({ rpcName: 'LinkNPubThroughToken', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK' }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'UserHealth': - try { - if (!methods.UserHealth) throw new Error('method: UserHealth is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - await methods.UserHealth({ rpcName: 'UserHealth', ctx: authContext }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK' }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetUserInfo': - try { - if (!methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - const response = await methods.GetUserInfo({ rpcName: 'GetUserInfo', ctx: authContext }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'AddProduct': - try { - if (!methods.AddProduct) throw new Error('method: AddProduct is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.AddProductRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.AddProduct({ rpcName: 'AddProduct', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'NewProductInvoice': - try { - if (!methods.NewProductInvoice) throw new Error('method: NewProductInvoice is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - const response = await methods.NewProductInvoice({ rpcName: 'NewProductInvoice', ctx: authContext, query: req.query || {} }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetUserOperations': - try { - if (!methods.GetUserOperations) throw new Error('method: GetUserOperations is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.GetUserOperationsRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.GetUserOperations({ rpcName: 'GetUserOperations', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'NewAddress': - try { - if (!methods.NewAddress) throw new Error('method: NewAddress is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.NewAddressRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.NewAddress({ rpcName: 'NewAddress', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'PayAddress': - try { - if (!methods.PayAddress) throw new Error('method: PayAddress is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.PayAddressRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.PayAddress({ rpcName: 'PayAddress', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'NewInvoice': - try { - if (!methods.NewInvoice) throw new Error('method: NewInvoice is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.NewInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.NewInvoice({ rpcName: 'NewInvoice', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'DecodeInvoice': - try { - if (!methods.DecodeInvoice) throw new Error('method: DecodeInvoice is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.DecodeInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.DecodeInvoice({ rpcName: 'DecodeInvoice', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'PayInvoice': - try { - if (!methods.PayInvoice) throw new Error('method: PayInvoice is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.PayInvoiceRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.PayInvoice({ rpcName: 'PayInvoice', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'OpenChannel': - try { - if (!methods.OpenChannel) throw new Error('method: OpenChannel is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - const request = req.body - const error = Types.OpenChannelRequestValidate(request) - stats.validate = process.hrtime.bigint() - if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) - const response = await methods.OpenChannel({ rpcName: 'OpenChannel', ctx: authContext, req: request }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetLnurlWithdrawLink': - try { - if (!methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - const response = await methods.GetLnurlWithdrawLink({ rpcName: 'GetLnurlWithdrawLink', ctx: authContext }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetLnurlPayLink': - try { - if (!methods.GetLnurlPayLink) throw new Error('method: GetLnurlPayLink is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - const response = await methods.GetLnurlPayLink({ rpcName: 'GetLnurlPayLink', ctx: authContext }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetLNURLChannelLink': - try { - if (!methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - const response = await methods.GetLNURLChannelLink({ rpcName: 'GetLNURLChannelLink', ctx: authContext }) - stats.handle = process.hrtime.bigint() - res({ status: 'OK', ...response }) - opts.metricsCallback([{ ...info, ...stats, ...authContext }]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetLiveUserOperations': - try { - if (!methods.GetLiveUserOperations) throw new Error('method: GetLiveUserOperations is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - methods.GetLiveUserOperations({ - rpcName: 'GetLiveUserOperations', ctx: authContext, cb: (response, err) => { - stats.handle = process.hrtime.bigint() - if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } - } - }) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetMigrationUpdate': - try { - if (!methods.GetMigrationUpdate) throw new Error('method: GetMigrationUpdate is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - methods.GetMigrationUpdate({ - rpcName: 'GetMigrationUpdate', ctx: authContext, cb: (response, err) => { - stats.handle = process.hrtime.bigint() - if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } - } - }) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'GetHttpCreds': - try { - if (!methods.GetHttpCreds) throw new Error('method: GetHttpCreds is not implemented') - const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = authContext - stats.validate = stats.guard - methods.GetHttpCreds({ - rpcName: 'GetHttpCreds', ctx: authContext, cb: (response, err) => { - stats.handle = process.hrtime.bigint() - if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } - } - }) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - case 'BatchUser': - try { - info.batch = true - const requests = req.body.requests as Types.UserMethodInputs[] - if (!Array.isArray(requests)) throw new Error('invalid body, is not an array') - info.batchSize = requests.length - if (requests.length > 10) throw new Error('too many requests in the batch') - const ctx = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) - stats.guard = process.hrtime.bigint() - authCtx = ctx - stats.validate = stats.guard - const responses = [] - const callsMetrics: Types.RequestMetric[] = [] - for (let i = 0; i < requests.length; i++) { - const operation = requests[i] - const opInfo: Types.RequestInfo = { rpcName: operation.rpcName, batch: true, nostr: true, batchSize: 0 } - const opStats: Types.RequestStats = { startMs, start: startTime, parse: stats.parse, guard: stats.guard, validate: 0n, handle: 0n } - try { - switch (operation.rpcName) { - case 'LinkNPubThroughToken': - if (!methods.LinkNPubThroughToken) { - throw new Error('method not defined: LinkNPubThroughToken') - } else { - const error = Types.LinkNPubThroughTokenRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - await methods.LinkNPubThroughToken({ ...operation, ctx }); responses.push({ status: 'OK' }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'UserHealth': - if (!methods.UserHealth) { - throw new Error('method not defined: UserHealth') - } else { - opStats.validate = opStats.guard - await methods.UserHealth({ ...operation, ctx }); responses.push({ status: 'OK' }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetUserInfo': - if (!methods.GetUserInfo) { - throw new Error('method not defined: GetUserInfo') - } else { - opStats.validate = opStats.guard - const res = await methods.GetUserInfo({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'AddProduct': - if (!methods.AddProduct) { - throw new Error('method not defined: AddProduct') - } else { - const error = Types.AddProductRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.AddProduct({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'NewProductInvoice': - if (!methods.NewProductInvoice) { - throw new Error('method not defined: NewProductInvoice') - } else { - opStats.validate = opStats.guard - const res = await methods.NewProductInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetUserOperations': - if (!methods.GetUserOperations) { - throw new Error('method not defined: GetUserOperations') - } else { - const error = Types.GetUserOperationsRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.GetUserOperations({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'NewAddress': - if (!methods.NewAddress) { - throw new Error('method not defined: NewAddress') - } else { - const error = Types.NewAddressRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.NewAddress({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'PayAddress': - if (!methods.PayAddress) { - throw new Error('method not defined: PayAddress') - } else { - const error = Types.PayAddressRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.PayAddress({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'NewInvoice': - if (!methods.NewInvoice) { - throw new Error('method not defined: NewInvoice') - } else { - const error = Types.NewInvoiceRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.NewInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'DecodeInvoice': - if (!methods.DecodeInvoice) { - throw new Error('method not defined: DecodeInvoice') - } else { - const error = Types.DecodeInvoiceRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.DecodeInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'PayInvoice': - if (!methods.PayInvoice) { - throw new Error('method not defined: PayInvoice') - } else { - const error = Types.PayInvoiceRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.PayInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'OpenChannel': - if (!methods.OpenChannel) { - throw new Error('method not defined: OpenChannel') - } else { - const error = Types.OpenChannelRequestValidate(operation.req) - opStats.validate = process.hrtime.bigint() - if (error !== null) throw error - const res = await methods.OpenChannel({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetLnurlWithdrawLink': - if (!methods.GetLnurlWithdrawLink) { - throw new Error('method not defined: GetLnurlWithdrawLink') - } else { - opStats.validate = opStats.guard - const res = await methods.GetLnurlWithdrawLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetLnurlPayLink': - if (!methods.GetLnurlPayLink) { - throw new Error('method not defined: GetLnurlPayLink') - } else { - opStats.validate = opStats.guard - const res = await methods.GetLnurlPayLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - case 'GetLNURLChannelLink': - if (!methods.GetLNURLChannelLink) { - throw new Error('method not defined: GetLNURLChannelLink') - } else { - opStats.validate = opStats.guard - const res = await methods.GetLNURLChannelLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) - opStats.handle = process.hrtime.bigint() - callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) - } - break - default: - throw new Error('unkown rpcName') - } - } catch (ex) { const e = ex as any; logger.error(e.message || e); callsMetrics.push({ ...opInfo, ...opStats, ...ctx, error: e.message }); responses.push({ status: 'ERROR', reason: e.message || e }) } - } - stats.handle = process.hrtime.bigint() - res({ status: 'OK', responses }) - opts.metricsCallback([{ ...info, ...stats, ...ctx }, ...callsMetrics]) - } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } - break - default: logger.error('unknown rpc call name from nostr event:' + req.rpcName) - } - } -} +// This file was autogenerated from a .proto file, DO NOT EDIT! + +import * as Types from './types.js' +export type Logger = { log: (v: any) => void, error: (v: any) => void } +type NostrResponse = (message: object) => void +export type NostrRequest = { + rpcName?: string + params?: Record + query?: Record + body?: any + authIdentifier?: string + requestId?: string + appId?: string +} +export type NostrOptions = { + logger?: Logger + throwErrors?: true + metricsCallback: (metrics: Types.RequestMetric[]) => void + NostrUserAuthGuard: (appId?: string, identifier?: string) => Promise +} +const logErrorAndReturnResponse = (error: Error, response: string, res: NostrResponse, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { + logger.error(error.message || error); metricsCallback([{ ...metric, error: response }]); res({ status: 'ERROR', reason: response }) +} +export default (methods: Types.ServerMethods, opts: NostrOptions) => { + const logger = opts.logger || { log: console.log, error: console.error } + return async (req: NostrRequest, res: NostrResponse, startString: string, startMs: number) => { + const startTime = BigInt(startString) + const info: Types.RequestInfo = { rpcName: req.rpcName || 'unkown', batch: false, nostr: true, batchSize: 0 } + const stats: Types.RequestStats = { startMs, start: startTime, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n } + let authCtx: Types.AuthContext = {} + switch (req.rpcName) { + case 'LinkNPubThroughToken': + try { + if (!methods.LinkNPubThroughToken) throw new Error('method: LinkNPubThroughToken is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.LinkNPubThroughTokenRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + await methods.LinkNPubThroughToken({ rpcName: 'LinkNPubThroughToken', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK' }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'UserHealth': + try { + if (!methods.UserHealth) throw new Error('method: UserHealth is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + await methods.UserHealth({ rpcName: 'UserHealth', ctx: authContext }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK' }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetUserInfo': + try { + if (!methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + const response = await methods.GetUserInfo({ rpcName: 'GetUserInfo', ctx: authContext }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'AddProduct': + try { + if (!methods.AddProduct) throw new Error('method: AddProduct is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.AddProductRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.AddProduct({ rpcName: 'AddProduct', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'NewProductInvoice': + try { + if (!methods.NewProductInvoice) throw new Error('method: NewProductInvoice is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + const response = await methods.NewProductInvoice({ rpcName: 'NewProductInvoice', ctx: authContext, query: req.query || {} }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetUserOperations': + try { + if (!methods.GetUserOperations) throw new Error('method: GetUserOperations is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.GetUserOperationsRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.GetUserOperations({ rpcName: 'GetUserOperations', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'NewAddress': + try { + if (!methods.NewAddress) throw new Error('method: NewAddress is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.NewAddressRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.NewAddress({ rpcName: 'NewAddress', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'PayAddress': + try { + if (!methods.PayAddress) throw new Error('method: PayAddress is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.PayAddressRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.PayAddress({ rpcName: 'PayAddress', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'NewInvoice': + try { + if (!methods.NewInvoice) throw new Error('method: NewInvoice is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.NewInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.NewInvoice({ rpcName: 'NewInvoice', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'DecodeInvoice': + try { + if (!methods.DecodeInvoice) throw new Error('method: DecodeInvoice is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.DecodeInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.DecodeInvoice({ rpcName: 'DecodeInvoice', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'PayInvoice': + try { + if (!methods.PayInvoice) throw new Error('method: PayInvoice is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.PayInvoiceRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.PayInvoice({ rpcName: 'PayInvoice', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'OpenChannel': + try { + if (!methods.OpenChannel) throw new Error('method: OpenChannel is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + const request = req.body + const error = Types.OpenChannelRequestValidate(request) + stats.validate = process.hrtime.bigint() + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback) + const response = await methods.OpenChannel({ rpcName: 'OpenChannel', ctx: authContext, req: request }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetLnurlWithdrawLink': + try { + if (!methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + const response = await methods.GetLnurlWithdrawLink({ rpcName: 'GetLnurlWithdrawLink', ctx: authContext }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetLnurlPayLink': + try { + if (!methods.GetLnurlPayLink) throw new Error('method: GetLnurlPayLink is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + const response = await methods.GetLnurlPayLink({ rpcName: 'GetLnurlPayLink', ctx: authContext }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetLNURLChannelLink': + try { + if (!methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + const response = await methods.GetLNURLChannelLink({ rpcName: 'GetLNURLChannelLink', ctx: authContext }) + stats.handle = process.hrtime.bigint() + res({ status: 'OK', ...response }) + opts.metricsCallback([{ ...info, ...stats, ...authContext }]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetLiveUserOperations': + try { + if (!methods.GetLiveUserOperations) throw new Error('method: GetLiveUserOperations is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + methods.GetLiveUserOperations({ + rpcName: 'GetLiveUserOperations', ctx: authContext, cb: (response, err) => { + stats.handle = process.hrtime.bigint() + if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } + } + }) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetMigrationUpdate': + try { + if (!methods.GetMigrationUpdate) throw new Error('method: GetMigrationUpdate is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + methods.GetMigrationUpdate({ + rpcName: 'GetMigrationUpdate', ctx: authContext, cb: (response, err) => { + stats.handle = process.hrtime.bigint() + if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } + } + }) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'GetHttpCreds': + try { + if (!methods.GetHttpCreds) throw new Error('method: GetHttpCreds is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = authContext + stats.validate = stats.guard + methods.GetHttpCreds({ + rpcName: 'GetHttpCreds', ctx: authContext, cb: (response, err) => { + stats.handle = process.hrtime.bigint() + if (err) { logErrorAndReturnResponse(err, err.message, res, logger, { ...info, ...stats, ...authContext }, opts.metricsCallback) } else { res({ status: 'OK', ...response }); opts.metricsCallback([{ ...info, ...stats, ...authContext }]) } + } + }) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + case 'BatchUser': + try { + info.batch = true + const requests = req.body.requests as Types.UserMethodInputs[] + if (!Array.isArray(requests)) throw new Error('invalid body, is not an array') + info.batchSize = requests.length + if (requests.length > 10) throw new Error('too many requests in the batch') + const ctx = await opts.NostrUserAuthGuard(req.appId, req.authIdentifier) + stats.guard = process.hrtime.bigint() + authCtx = ctx + stats.validate = stats.guard + const responses = [] + const callsMetrics: Types.RequestMetric[] = [] + for (let i = 0; i < requests.length; i++) { + const operation = requests[i] + const opInfo: Types.RequestInfo = { rpcName: operation.rpcName, batch: true, nostr: true, batchSize: 0 } + const opStats: Types.RequestStats = { startMs, start: startTime, parse: stats.parse, guard: stats.guard, validate: 0n, handle: 0n } + try { + switch (operation.rpcName) { + case 'LinkNPubThroughToken': + if (!methods.LinkNPubThroughToken) { + throw new Error('method not defined: LinkNPubThroughToken') + } else { + const error = Types.LinkNPubThroughTokenRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + await methods.LinkNPubThroughToken({ ...operation, ctx }); responses.push({ status: 'OK' }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'UserHealth': + if (!methods.UserHealth) { + throw new Error('method not defined: UserHealth') + } else { + opStats.validate = opStats.guard + await methods.UserHealth({ ...operation, ctx }); responses.push({ status: 'OK' }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetUserInfo': + if (!methods.GetUserInfo) { + throw new Error('method not defined: GetUserInfo') + } else { + opStats.validate = opStats.guard + const res = await methods.GetUserInfo({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'AddProduct': + if (!methods.AddProduct) { + throw new Error('method not defined: AddProduct') + } else { + const error = Types.AddProductRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.AddProduct({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'NewProductInvoice': + if (!methods.NewProductInvoice) { + throw new Error('method not defined: NewProductInvoice') + } else { + opStats.validate = opStats.guard + const res = await methods.NewProductInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetUserOperations': + if (!methods.GetUserOperations) { + throw new Error('method not defined: GetUserOperations') + } else { + const error = Types.GetUserOperationsRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.GetUserOperations({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'NewAddress': + if (!methods.NewAddress) { + throw new Error('method not defined: NewAddress') + } else { + const error = Types.NewAddressRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.NewAddress({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'PayAddress': + if (!methods.PayAddress) { + throw new Error('method not defined: PayAddress') + } else { + const error = Types.PayAddressRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.PayAddress({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'NewInvoice': + if (!methods.NewInvoice) { + throw new Error('method not defined: NewInvoice') + } else { + const error = Types.NewInvoiceRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.NewInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'DecodeInvoice': + if (!methods.DecodeInvoice) { + throw new Error('method not defined: DecodeInvoice') + } else { + const error = Types.DecodeInvoiceRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.DecodeInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'PayInvoice': + if (!methods.PayInvoice) { + throw new Error('method not defined: PayInvoice') + } else { + const error = Types.PayInvoiceRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.PayInvoice({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'OpenChannel': + if (!methods.OpenChannel) { + throw new Error('method not defined: OpenChannel') + } else { + const error = Types.OpenChannelRequestValidate(operation.req) + opStats.validate = process.hrtime.bigint() + if (error !== null) throw error + const res = await methods.OpenChannel({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetLnurlWithdrawLink': + if (!methods.GetLnurlWithdrawLink) { + throw new Error('method not defined: GetLnurlWithdrawLink') + } else { + opStats.validate = opStats.guard + const res = await methods.GetLnurlWithdrawLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetLnurlPayLink': + if (!methods.GetLnurlPayLink) { + throw new Error('method not defined: GetLnurlPayLink') + } else { + opStats.validate = opStats.guard + const res = await methods.GetLnurlPayLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + case 'GetLNURLChannelLink': + if (!methods.GetLNURLChannelLink) { + throw new Error('method not defined: GetLNURLChannelLink') + } else { + opStats.validate = opStats.guard + const res = await methods.GetLNURLChannelLink({ ...operation, ctx }); responses.push({ status: 'OK', ...res }) + opStats.handle = process.hrtime.bigint() + callsMetrics.push({ ...opInfo, ...opStats, ...ctx }) + } + break + default: + throw new Error('unkown rpcName') + } + } catch (ex) { const e = ex as any; logger.error(e.message || e); callsMetrics.push({ ...opInfo, ...opStats, ...ctx, error: e.message }); responses.push({ status: 'ERROR', reason: e.message || e }) } + } + stats.handle = process.hrtime.bigint() + res({ status: 'OK', responses }) + opts.metricsCallback([{ ...info, ...stats, ...ctx }, ...callsMetrics]) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } + break + default: logger.error('unknown rpc call name from nostr event:' + req.rpcName) + } + } +} diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index ec90cc06..e08314e8 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -1,2379 +1,2379 @@ -// This file was autogenerated from a .proto file, DO NOT EDIT! - -export type ResultError = { status: 'ERROR', reason: string } -export type RequestInfo = { rpcName: string, batch: boolean, nostr: boolean, batchSize: number } -export type RequestStats = { startMs:number, start:bigint, parse: bigint, guard: bigint, validate: bigint, handle: bigint } -export type RequestMetric = AuthContext & RequestInfo & RequestStats & { error?: string } -export type GuestContext = { -} -export type GuestMethodInputs = Health_Input | EncryptionExchange_Input | SetMockInvoiceAsPaid_Input | GetLnurlWithdrawInfo_Input | HandleLnurlWithdraw_Input | GetLnurlPayInfo_Input | HandleLnurlPay_Input | HandleLnurlAddress_Input -export type GuestMethodOutputs = Health_Output | EncryptionExchange_Output | SetMockInvoiceAsPaid_Output | GetLnurlWithdrawInfo_Output | HandleLnurlWithdraw_Output | GetLnurlPayInfo_Output | HandleLnurlPay_Output | HandleLnurlAddress_Output -export type UserContext = { - user_id: string - app_id: string - app_user_id: string -} -export type UserMethodInputs = LinkNPubThroughToken_Input | UserHealth_Input | GetUserInfo_Input | AddProduct_Input | NewProductInvoice_Input | GetUserOperations_Input | NewAddress_Input | PayAddress_Input | NewInvoice_Input | DecodeInvoice_Input | PayInvoice_Input | OpenChannel_Input | GetLnurlWithdrawLink_Input | GetLnurlPayLink_Input | GetLNURLChannelLink_Input -export type UserMethodOutputs = LinkNPubThroughToken_Output | UserHealth_Output | GetUserInfo_Output | AddProduct_Output | NewProductInvoice_Output | GetUserOperations_Output | NewAddress_Output | PayAddress_Output | NewInvoice_Output | DecodeInvoice_Output | PayInvoice_Output | OpenChannel_Output | GetLnurlWithdrawLink_Output | GetLnurlPayLink_Output | GetLNURLChannelLink_Output -export type AdminContext = { - admin_id: string -} -export type AdminMethodInputs = LndGetInfo_Input | AddApp_Input | AuthApp_Input | BanUser_Input -export type AdminMethodOutputs = LndGetInfo_Output | AddApp_Output | AuthApp_Output | BanUser_Output -export type MetricsContext = { - operator_id: string -} -export type MetricsMethodInputs = GetUsageMetrics_Input | GetAppsMetrics_Input | GetLndMetrics_Input -export type MetricsMethodOutputs = GetUsageMetrics_Output | GetAppsMetrics_Output | GetLndMetrics_Output -export type AppContext = { - app_id: string -} -export type AppMethodInputs = GetApp_Input | AddAppUser_Input | AddAppInvoice_Input | AddAppUserInvoice_Input | GetAppUser_Input | PayAppUserInvoice_Input | SendAppUserToAppUserPayment_Input | SendAppUserToAppPayment_Input | GetAppUserLNURLInfo_Input | SetMockAppUserBalance_Input | SetMockAppBalance_Input | RequestNPubLinkingToken_Input -export type AppMethodOutputs = GetApp_Output | AddAppUser_Output | AddAppInvoice_Output | AddAppUserInvoice_Output | GetAppUser_Output | PayAppUserInvoice_Output | SendAppUserToAppUserPayment_Output | SendAppUserToAppPayment_Output | GetAppUserLNURLInfo_Output | SetMockAppUserBalance_Output | SetMockAppBalance_Output | RequestNPubLinkingToken_Output -export type AuthContext = GuestContext | UserContext | AdminContext | MetricsContext | AppContext - -export type LndGetInfo_Input = {rpcName:'LndGetInfo', req: LndGetInfoRequest} -export type LndGetInfo_Output = ResultError | ({ status: 'OK' } & LndGetInfoResponse) - -export type AddApp_Input = {rpcName:'AddApp', req: AddAppRequest} -export type AddApp_Output = ResultError | ({ status: 'OK' } & AuthApp) - -export type AuthApp_Input = {rpcName:'AuthApp', req: AuthAppRequest} -export type AuthApp_Output = ResultError | ({ status: 'OK' } & AuthApp) - -export type BanUser_Input = {rpcName:'BanUser', req: BanUserRequest} -export type BanUser_Output = ResultError | ({ status: 'OK' } & BanUserResponse) - -export type GetUsageMetrics_Input = {rpcName:'GetUsageMetrics'} -export type GetUsageMetrics_Output = ResultError | ({ status: 'OK' } & UsageMetrics) - -export type GetAppsMetrics_Input = {rpcName:'GetAppsMetrics', req: AppsMetricsRequest} -export type GetAppsMetrics_Output = ResultError | ({ status: 'OK' } & AppsMetrics) - -export type GetLndMetrics_Input = {rpcName:'GetLndMetrics', req: LndMetricsRequest} -export type GetLndMetrics_Output = ResultError | ({ status: 'OK' } & LndMetrics) - -export type Health_Input = {rpcName:'Health'} -export type Health_Output = ResultError | { status: 'OK' } - -export type EncryptionExchange_Input = {rpcName:'EncryptionExchange', req: EncryptionExchangeRequest} -export type EncryptionExchange_Output = ResultError | { status: 'OK' } - -export type SetMockInvoiceAsPaid_Input = {rpcName:'SetMockInvoiceAsPaid', req: SetMockInvoiceAsPaidRequest} -export type SetMockInvoiceAsPaid_Output = ResultError | { status: 'OK' } - -export type GetLnurlWithdrawInfo_Query = { - k1?: string -} -export type GetLnurlWithdrawInfo_Input = {rpcName:'GetLnurlWithdrawInfo', query: GetLnurlWithdrawInfo_Query} -export type GetLnurlWithdrawInfo_Output = ResultError | ({ status: 'OK' } & LnurlWithdrawInfoResponse) - -export type HandleLnurlWithdraw_Query = { - k1?: string - pr?: string -} -export type HandleLnurlWithdraw_Input = {rpcName:'HandleLnurlWithdraw', query: HandleLnurlWithdraw_Query} -export type HandleLnurlWithdraw_Output = ResultError | { status: 'OK' } - -export type GetLnurlPayInfo_Query = { - k1?: string -} -export type GetLnurlPayInfo_Input = {rpcName:'GetLnurlPayInfo', query: GetLnurlPayInfo_Query} -export type GetLnurlPayInfo_Output = ResultError | ({ status: 'OK' } & LnurlPayInfoResponse) - -export type HandleLnurlPay_Query = { - k1?: string - amount?: string - nostr?: string - lnurl?: string -} -export type HandleLnurlPay_Input = {rpcName:'HandleLnurlPay', query: HandleLnurlPay_Query} -export type HandleLnurlPay_Output = ResultError | ({ status: 'OK' } & HandleLnurlPayResponse) - -export type HandleLnurlAddress_RouteParams = { - address_name: string -} -export type HandleLnurlAddress_Input = {rpcName:'HandleLnurlAddress', params: HandleLnurlAddress_RouteParams} -export type HandleLnurlAddress_Output = ResultError | ({ status: 'OK' } & LnurlPayInfoResponse) - -export type LinkNPubThroughToken_Input = {rpcName:'LinkNPubThroughToken', req: LinkNPubThroughTokenRequest} -export type LinkNPubThroughToken_Output = ResultError | { status: 'OK' } - -export type GetApp_Input = {rpcName:'GetApp'} -export type GetApp_Output = ResultError | ({ status: 'OK' } & Application) - -export type AddAppUser_Input = {rpcName:'AddAppUser', req: AddAppUserRequest} -export type AddAppUser_Output = ResultError | ({ status: 'OK' } & AppUser) - -export type AddAppInvoice_Input = {rpcName:'AddAppInvoice', req: AddAppInvoiceRequest} -export type AddAppInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) - -export type AddAppUserInvoice_Input = {rpcName:'AddAppUserInvoice', req: AddAppUserInvoiceRequest} -export type AddAppUserInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) - -export type GetAppUser_Input = {rpcName:'GetAppUser', req: GetAppUserRequest} -export type GetAppUser_Output = ResultError | ({ status: 'OK' } & AppUser) - -export type PayAppUserInvoice_Input = {rpcName:'PayAppUserInvoice', req: PayAppUserInvoiceRequest} -export type PayAppUserInvoice_Output = ResultError | ({ status: 'OK' } & PayInvoiceResponse) - -export type SendAppUserToAppUserPayment_Input = {rpcName:'SendAppUserToAppUserPayment', req: SendAppUserToAppUserPaymentRequest} -export type SendAppUserToAppUserPayment_Output = ResultError | { status: 'OK' } - -export type SendAppUserToAppPayment_Input = {rpcName:'SendAppUserToAppPayment', req: SendAppUserToAppPaymentRequest} -export type SendAppUserToAppPayment_Output = ResultError | { status: 'OK' } - -export type GetAppUserLNURLInfo_Input = {rpcName:'GetAppUserLNURLInfo', req: GetAppUserLNURLInfoRequest} -export type GetAppUserLNURLInfo_Output = ResultError | ({ status: 'OK' } & LnurlPayInfoResponse) - -export type SetMockAppUserBalance_Input = {rpcName:'SetMockAppUserBalance', req: SetMockAppUserBalanceRequest} -export type SetMockAppUserBalance_Output = ResultError | { status: 'OK' } - -export type SetMockAppBalance_Input = {rpcName:'SetMockAppBalance', req: SetMockAppBalanceRequest} -export type SetMockAppBalance_Output = ResultError | { status: 'OK' } - -export type RequestNPubLinkingToken_Input = {rpcName:'RequestNPubLinkingToken', req: RequestNPubLinkingTokenRequest} -export type RequestNPubLinkingToken_Output = ResultError | ({ status: 'OK' } & RequestNPubLinkingTokenResponse) - -export type UserHealth_Input = {rpcName:'UserHealth'} -export type UserHealth_Output = ResultError | { status: 'OK' } - -export type GetUserInfo_Input = {rpcName:'GetUserInfo'} -export type GetUserInfo_Output = ResultError | ({ status: 'OK' } & UserInfo) - -export type AddProduct_Input = {rpcName:'AddProduct', req: AddProductRequest} -export type AddProduct_Output = ResultError | ({ status: 'OK' } & Product) - -export type NewProductInvoice_Query = { - id?: string -} -export type NewProductInvoice_Input = {rpcName:'NewProductInvoice', query: NewProductInvoice_Query} -export type NewProductInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) - -export type GetUserOperations_Input = {rpcName:'GetUserOperations', req: GetUserOperationsRequest} -export type GetUserOperations_Output = ResultError | ({ status: 'OK' } & GetUserOperationsResponse) - -export type NewAddress_Input = {rpcName:'NewAddress', req: NewAddressRequest} -export type NewAddress_Output = ResultError | ({ status: 'OK' } & NewAddressResponse) - -export type PayAddress_Input = {rpcName:'PayAddress', req: PayAddressRequest} -export type PayAddress_Output = ResultError | ({ status: 'OK' } & PayAddressResponse) - -export type NewInvoice_Input = {rpcName:'NewInvoice', req: NewInvoiceRequest} -export type NewInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) - -export type DecodeInvoice_Input = {rpcName:'DecodeInvoice', req: DecodeInvoiceRequest} -export type DecodeInvoice_Output = ResultError | ({ status: 'OK' } & DecodeInvoiceResponse) - -export type PayInvoice_Input = {rpcName:'PayInvoice', req: PayInvoiceRequest} -export type PayInvoice_Output = ResultError | ({ status: 'OK' } & PayInvoiceResponse) - -export type OpenChannel_Input = {rpcName:'OpenChannel', req: OpenChannelRequest} -export type OpenChannel_Output = ResultError | ({ status: 'OK' } & OpenChannelResponse) - -export type GetLnurlWithdrawLink_Input = {rpcName:'GetLnurlWithdrawLink'} -export type GetLnurlWithdrawLink_Output = ResultError | ({ status: 'OK' } & LnurlLinkResponse) - -export type GetLnurlPayLink_Input = {rpcName:'GetLnurlPayLink'} -export type GetLnurlPayLink_Output = ResultError | ({ status: 'OK' } & LnurlLinkResponse) - -export type GetLNURLChannelLink_Input = {rpcName:'GetLNURLChannelLink'} -export type GetLNURLChannelLink_Output = ResultError | ({ status: 'OK' } & LnurlLinkResponse) - -export type GetLiveUserOperations_Input = {rpcName:'GetLiveUserOperations', cb:(res: LiveUserOperation, err:Error|null)=> void} -export type GetLiveUserOperations_Output = ResultError | { status: 'OK' } - -export type GetMigrationUpdate_Input = {rpcName:'GetMigrationUpdate', cb:(res: MigrationUpdate, err:Error|null)=> void} -export type GetMigrationUpdate_Output = ResultError | { status: 'OK' } - -export type GetHttpCreds_Input = {rpcName:'GetHttpCreds', cb:(res: HttpCreds, err:Error|null)=> void} -export type GetHttpCreds_Output = ResultError | { status: 'OK' } - -export type BatchUser_Input = UserMethodInputs -export type BatchUser_Output = UserMethodOutputs - -export type ServerMethods = { - LndGetInfo?: (req: LndGetInfo_Input & {ctx: AdminContext }) => Promise - AddApp?: (req: AddApp_Input & {ctx: AdminContext }) => Promise - AuthApp?: (req: AuthApp_Input & {ctx: AdminContext }) => Promise - BanUser?: (req: BanUser_Input & {ctx: AdminContext }) => Promise - GetUsageMetrics?: (req: GetUsageMetrics_Input & {ctx: MetricsContext }) => Promise - GetAppsMetrics?: (req: GetAppsMetrics_Input & {ctx: MetricsContext }) => Promise - GetLndMetrics?: (req: GetLndMetrics_Input & {ctx: MetricsContext }) => Promise - Health?: (req: Health_Input & {ctx: GuestContext }) => Promise - EncryptionExchange?: (req: EncryptionExchange_Input & {ctx: GuestContext }) => Promise - SetMockInvoiceAsPaid?: (req: SetMockInvoiceAsPaid_Input & {ctx: GuestContext }) => Promise - GetLnurlWithdrawInfo?: (req: GetLnurlWithdrawInfo_Input & {ctx: GuestContext }) => Promise - HandleLnurlWithdraw?: (req: HandleLnurlWithdraw_Input & {ctx: GuestContext }) => Promise - GetLnurlPayInfo?: (req: GetLnurlPayInfo_Input & {ctx: GuestContext }) => Promise - HandleLnurlPay?: (req: HandleLnurlPay_Input & {ctx: GuestContext }) => Promise - HandleLnurlAddress?: (req: HandleLnurlAddress_Input & {ctx: GuestContext }) => Promise - LinkNPubThroughToken?: (req: LinkNPubThroughToken_Input & {ctx: UserContext }) => Promise - GetApp?: (req: GetApp_Input & {ctx: AppContext }) => Promise - AddAppUser?: (req: AddAppUser_Input & {ctx: AppContext }) => Promise - AddAppInvoice?: (req: AddAppInvoice_Input & {ctx: AppContext }) => Promise - AddAppUserInvoice?: (req: AddAppUserInvoice_Input & {ctx: AppContext }) => Promise - GetAppUser?: (req: GetAppUser_Input & {ctx: AppContext }) => Promise - PayAppUserInvoice?: (req: PayAppUserInvoice_Input & {ctx: AppContext }) => Promise - SendAppUserToAppUserPayment?: (req: SendAppUserToAppUserPayment_Input & {ctx: AppContext }) => Promise - SendAppUserToAppPayment?: (req: SendAppUserToAppPayment_Input & {ctx: AppContext }) => Promise - GetAppUserLNURLInfo?: (req: GetAppUserLNURLInfo_Input & {ctx: AppContext }) => Promise - SetMockAppUserBalance?: (req: SetMockAppUserBalance_Input & {ctx: AppContext }) => Promise - SetMockAppBalance?: (req: SetMockAppBalance_Input & {ctx: AppContext }) => Promise - RequestNPubLinkingToken?: (req: RequestNPubLinkingToken_Input & {ctx: AppContext }) => Promise - UserHealth?: (req: UserHealth_Input & {ctx: UserContext }) => Promise - GetUserInfo?: (req: GetUserInfo_Input & {ctx: UserContext }) => Promise - AddProduct?: (req: AddProduct_Input & {ctx: UserContext }) => Promise - NewProductInvoice?: (req: NewProductInvoice_Input & {ctx: UserContext }) => Promise - GetUserOperations?: (req: GetUserOperations_Input & {ctx: UserContext }) => Promise - NewAddress?: (req: NewAddress_Input & {ctx: UserContext }) => Promise - PayAddress?: (req: PayAddress_Input & {ctx: UserContext }) => Promise - NewInvoice?: (req: NewInvoice_Input & {ctx: UserContext }) => Promise - DecodeInvoice?: (req: DecodeInvoice_Input & {ctx: UserContext }) => Promise - PayInvoice?: (req: PayInvoice_Input & {ctx: UserContext }) => Promise - OpenChannel?: (req: OpenChannel_Input & {ctx: UserContext }) => Promise - GetLnurlWithdrawLink?: (req: GetLnurlWithdrawLink_Input & {ctx: UserContext }) => Promise - GetLnurlPayLink?: (req: GetLnurlPayLink_Input & {ctx: UserContext }) => Promise - GetLNURLChannelLink?: (req: GetLNURLChannelLink_Input & {ctx: UserContext }) => Promise - GetLiveUserOperations?: (req: GetLiveUserOperations_Input & {ctx: UserContext }) => Promise - GetMigrationUpdate?: (req: GetMigrationUpdate_Input & {ctx: UserContext }) => Promise - GetHttpCreds?: (req: GetHttpCreds_Input & {ctx: UserContext }) => Promise -} - -export enum AddressType { - WITNESS_PUBKEY_HASH = 'WITNESS_PUBKEY_HASH', - NESTED_PUBKEY_HASH = 'NESTED_PUBKEY_HASH', - TAPROOT_PUBKEY = 'TAPROOT_PUBKEY', -} -const enumCheckAddressType = (e?: AddressType): boolean => { - for (const v in AddressType) if (e === v) return true - return false -} -export enum UserOperationType { - INCOMING_TX = 'INCOMING_TX', - OUTGOING_TX = 'OUTGOING_TX', - INCOMING_INVOICE = 'INCOMING_INVOICE', - OUTGOING_INVOICE = 'OUTGOING_INVOICE', - OUTGOING_USER_TO_USER = 'OUTGOING_USER_TO_USER', - INCOMING_USER_TO_USER = 'INCOMING_USER_TO_USER', -} -const enumCheckUserOperationType = (e?: UserOperationType): boolean => { - for (const v in UserOperationType) if (e === v) return true - return false -} - -export type OptionsBaseMessage = { - allOptionalsAreSet?: true -} - -export type NewAddressRequest = { - addressType: AddressType -} -export const NewAddressRequestOptionalFields: [] = [] -export type NewAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - addressType_CustomCheck?: (v: AddressType) => boolean -} -export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`) - if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`) - - return null -} - -export type LnurlPayInfoResponse = { - tag: string - callback: string - maxSendable: number - minSendable: number - metadata: string - allowsNostr: boolean - nostrPubkey: string -} -export const LnurlPayInfoResponseOptionalFields: [] = [] -export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - tag_CustomCheck?: (v: string) => boolean - callback_CustomCheck?: (v: string) => boolean - maxSendable_CustomCheck?: (v: number) => boolean - minSendable_CustomCheck?: (v: number) => boolean - metadata_CustomCheck?: (v: string) => boolean - allowsNostr_CustomCheck?: (v: boolean) => boolean - nostrPubkey_CustomCheck?: (v: string) => boolean -} -export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) - if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) - - if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) - if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) - - if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`) - if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`) - - if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`) - if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`) - - if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`) - if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`) - - if (typeof o.allowsNostr !== 'boolean') return new Error(`${path}.allowsNostr: is not a boolean`) - if (opts.allowsNostr_CustomCheck && !opts.allowsNostr_CustomCheck(o.allowsNostr)) return new Error(`${path}.allowsNostr: custom check failed`) - - if (typeof o.nostrPubkey !== 'string') return new Error(`${path}.nostrPubkey: is not a string`) - if (opts.nostrPubkey_CustomCheck && !opts.nostrPubkey_CustomCheck(o.nostrPubkey)) return new Error(`${path}.nostrPubkey: custom check failed`) - - return null -} - -export type GetProductBuyLinkResponse = { - link: string -} -export const GetProductBuyLinkResponseOptionalFields: [] = [] -export type GetProductBuyLinkResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - link_CustomCheck?: (v: string) => boolean -} -export const GetProductBuyLinkResponseValidate = (o?: GetProductBuyLinkResponse, opts: GetProductBuyLinkResponseOptions = {}, path: string = 'GetProductBuyLinkResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.link !== 'string') return new Error(`${path}.link: is not a string`) - if (opts.link_CustomCheck && !opts.link_CustomCheck(o.link)) return new Error(`${path}.link: custom check failed`) - - return null -} - -export type UsageMetrics = { - metrics: UsageMetric[] -} -export const UsageMetricsOptionalFields: [] = [] -export type UsageMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - metrics_ItemOptions?: UsageMetricOptions - metrics_CustomCheck?: (v: UsageMetric[]) => boolean -} -export const UsageMetricsValidate = (o?: UsageMetrics, opts: UsageMetricsOptions = {}, path: string = 'UsageMetrics::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!Array.isArray(o.metrics)) return new Error(`${path}.metrics: is not an array`) - for (let index = 0; index < o.metrics.length; index++) { - const metricsErr = UsageMetricValidate(o.metrics[index], opts.metrics_ItemOptions, `${path}.metrics[${index}]`) - if (metricsErr !== null) return metricsErr - } - if (opts.metrics_CustomCheck && !opts.metrics_CustomCheck(o.metrics)) return new Error(`${path}.metrics: custom check failed`) - - return null -} - -export type OpenChannel = { - channel_id: string - capacity: number - active: boolean - lifetime: number - local_balance: number - remote_balance: number -} -export const OpenChannelOptionalFields: [] = [] -export type OpenChannelOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean - capacity_CustomCheck?: (v: number) => boolean - active_CustomCheck?: (v: boolean) => boolean - lifetime_CustomCheck?: (v: number) => boolean - local_balance_CustomCheck?: (v: number) => boolean - remote_balance_CustomCheck?: (v: number) => boolean -} -export const OpenChannelValidate = (o?: OpenChannel, opts: OpenChannelOptions = {}, path: string = 'OpenChannel::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) - if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) - - if (typeof o.active !== 'boolean') return new Error(`${path}.active: is not a boolean`) - if (opts.active_CustomCheck && !opts.active_CustomCheck(o.active)) return new Error(`${path}.active: custom check failed`) - - if (typeof o.lifetime !== 'number') return new Error(`${path}.lifetime: is not a number`) - if (opts.lifetime_CustomCheck && !opts.lifetime_CustomCheck(o.lifetime)) return new Error(`${path}.lifetime: custom check failed`) - - if (typeof o.local_balance !== 'number') return new Error(`${path}.local_balance: is not a number`) - if (opts.local_balance_CustomCheck && !opts.local_balance_CustomCheck(o.local_balance)) return new Error(`${path}.local_balance: custom check failed`) - - if (typeof o.remote_balance !== 'number') return new Error(`${path}.remote_balance: is not a number`) - if (opts.remote_balance_CustomCheck && !opts.remote_balance_CustomCheck(o.remote_balance)) return new Error(`${path}.remote_balance: custom check failed`) - - return null -} - -export type DecodeInvoiceResponse = { - amount: number -} -export const DecodeInvoiceResponseOptionalFields: [] = [] -export type DecodeInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean -} -export const DecodeInvoiceResponseValidate = (o?: DecodeInvoiceResponse, opts: DecodeInvoiceResponseOptions = {}, path: string = 'DecodeInvoiceResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type UsersInfo = { - total: number - no_balance: number - negative_balance: number - always_been_inactive: number - balance_avg: number - balance_median: number -} -export const UsersInfoOptionalFields: [] = [] -export type UsersInfoOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - total_CustomCheck?: (v: number) => boolean - no_balance_CustomCheck?: (v: number) => boolean - negative_balance_CustomCheck?: (v: number) => boolean - always_been_inactive_CustomCheck?: (v: number) => boolean - balance_avg_CustomCheck?: (v: number) => boolean - balance_median_CustomCheck?: (v: number) => boolean -} -export const UsersInfoValidate = (o?: UsersInfo, opts: UsersInfoOptions = {}, path: string = 'UsersInfo::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.total !== 'number') return new Error(`${path}.total: is not a number`) - if (opts.total_CustomCheck && !opts.total_CustomCheck(o.total)) return new Error(`${path}.total: custom check failed`) - - if (typeof o.no_balance !== 'number') return new Error(`${path}.no_balance: is not a number`) - if (opts.no_balance_CustomCheck && !opts.no_balance_CustomCheck(o.no_balance)) return new Error(`${path}.no_balance: custom check failed`) - - if (typeof o.negative_balance !== 'number') return new Error(`${path}.negative_balance: is not a number`) - if (opts.negative_balance_CustomCheck && !opts.negative_balance_CustomCheck(o.negative_balance)) return new Error(`${path}.negative_balance: custom check failed`) - - if (typeof o.always_been_inactive !== 'number') return new Error(`${path}.always_been_inactive: is not a number`) - if (opts.always_been_inactive_CustomCheck && !opts.always_been_inactive_CustomCheck(o.always_been_inactive)) return new Error(`${path}.always_been_inactive: custom check failed`) - - if (typeof o.balance_avg !== 'number') return new Error(`${path}.balance_avg: is not a number`) - if (opts.balance_avg_CustomCheck && !opts.balance_avg_CustomCheck(o.balance_avg)) return new Error(`${path}.balance_avg: custom check failed`) - - if (typeof o.balance_median !== 'number') return new Error(`${path}.balance_median: is not a number`) - if (opts.balance_median_CustomCheck && !opts.balance_median_CustomCheck(o.balance_median)) return new Error(`${path}.balance_median: custom check failed`) - - return null -} - -export type AddAppRequest = { - name: string - allow_user_creation: boolean -} -export const AddAppRequestOptionalFields: [] = [] -export type AddAppRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - allow_user_creation_CustomCheck?: (v: boolean) => boolean -} -export const AddAppRequestValidate = (o?: AddAppRequest, opts: AddAppRequestOptions = {}, path: string = 'AddAppRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) - if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) - - return null -} - -export type LndMetrics = { - nodes: LndNodeMetrics[] -} -export const LndMetricsOptionalFields: [] = [] -export type LndMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - nodes_ItemOptions?: LndNodeMetricsOptions - nodes_CustomCheck?: (v: LndNodeMetrics[]) => boolean -} -export const LndMetricsValidate = (o?: LndMetrics, opts: LndMetricsOptions = {}, path: string = 'LndMetrics::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!Array.isArray(o.nodes)) return new Error(`${path}.nodes: is not an array`) - for (let index = 0; index < o.nodes.length; index++) { - const nodesErr = LndNodeMetricsValidate(o.nodes[index], opts.nodes_ItemOptions, `${path}.nodes[${index}]`) - if (nodesErr !== null) return nodesErr - } - if (opts.nodes_CustomCheck && !opts.nodes_CustomCheck(o.nodes)) return new Error(`${path}.nodes: custom check failed`) - - return null -} - -export type AddProductRequest = { - name: string - price_sats: number -} -export const AddProductRequestOptionalFields: [] = [] -export type AddProductRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - price_sats_CustomCheck?: (v: number) => boolean -} -export const AddProductRequestValidate = (o?: AddProductRequest, opts: AddProductRequestOptions = {}, path: string = 'AddProductRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) - if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) - - return null -} - -export type PayInvoiceResponse = { - preimage: string - amount_paid: number - operation_id: string - service_fee: number - network_fee: number -} -export const PayInvoiceResponseOptionalFields: [] = [] -export type PayInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - preimage_CustomCheck?: (v: string) => boolean - amount_paid_CustomCheck?: (v: number) => boolean - operation_id_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean -} -export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) - if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) - - if (typeof o.amount_paid !== 'number') return new Error(`${path}.amount_paid: is not a number`) - if (opts.amount_paid_CustomCheck && !opts.amount_paid_CustomCheck(o.amount_paid)) return new Error(`${path}.amount_paid: custom check failed`) - - if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) - if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - return null -} - -export type UserInfo = { - userId: string - balance: number - max_withdrawable: number - user_identifier: string -} -export const UserInfoOptionalFields: [] = [] -export type UserInfoOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - userId_CustomCheck?: (v: string) => boolean - balance_CustomCheck?: (v: number) => boolean - max_withdrawable_CustomCheck?: (v: number) => boolean - user_identifier_CustomCheck?: (v: string) => boolean -} -export const UserInfoValidate = (o?: UserInfo, opts: UserInfoOptions = {}, path: string = 'UserInfo::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.userId !== 'string') return new Error(`${path}.userId: is not a string`) - if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: custom check failed`) - - if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) - if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - - if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) - if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - return null -} - -export type MigrationUpdate = { - closure?: ClosureMigration - relays?: RelaysMigration -} -export type MigrationUpdateOptionalField = 'closure' | 'relays' -export const MigrationUpdateOptionalFields: MigrationUpdateOptionalField[] = ['closure', 'relays'] -export type MigrationUpdateOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: MigrationUpdateOptionalField[] - closure_Options?: ClosureMigrationOptions - relays_Options?: RelaysMigrationOptions -} -export const MigrationUpdateValidate = (o?: MigrationUpdate, opts: MigrationUpdateOptions = {}, path: string = 'MigrationUpdate::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.closure === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('closure')) { - const closureErr = ClosureMigrationValidate(o.closure, opts.closure_Options, `${path}.closure`) - if (closureErr !== null) return closureErr - } - - - if (typeof o.relays === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('relays')) { - const relaysErr = RelaysMigrationValidate(o.relays, opts.relays_Options, `${path}.relays`) - if (relaysErr !== null) return relaysErr - } - - - return null -} - -export type LinkNPubThroughTokenRequest = { - token: string - nostr_pub: string -} -export const LinkNPubThroughTokenRequestOptionalFields: [] = [] -export type LinkNPubThroughTokenRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - token_CustomCheck?: (v: string) => boolean - nostr_pub_CustomCheck?: (v: string) => boolean -} -export const LinkNPubThroughTokenRequestValidate = (o?: LinkNPubThroughTokenRequest, opts: LinkNPubThroughTokenRequestOptions = {}, path: string = 'LinkNPubThroughTokenRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.token !== 'string') return new Error(`${path}.token: is not a string`) - if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) - - if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) - if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) - - return null -} - -export type Empty = { -} -export const EmptyOptionalFields: [] = [] -export type EmptyOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] -} -export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - return null -} - -export type ChannelRouting = { - channel_id: string - send_errors: number - receive_errors: number - forward_errors_as_input: number - forward_errors_as_output: number - missed_forward_fee_as_input: number - missed_forward_fee_as_output: number - forward_fee_as_input: number - forward_fee_as_output: number - events_number: number -} -export const ChannelRoutingOptionalFields: [] = [] -export type ChannelRoutingOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean - send_errors_CustomCheck?: (v: number) => boolean - receive_errors_CustomCheck?: (v: number) => boolean - forward_errors_as_input_CustomCheck?: (v: number) => boolean - forward_errors_as_output_CustomCheck?: (v: number) => boolean - missed_forward_fee_as_input_CustomCheck?: (v: number) => boolean - missed_forward_fee_as_output_CustomCheck?: (v: number) => boolean - forward_fee_as_input_CustomCheck?: (v: number) => boolean - forward_fee_as_output_CustomCheck?: (v: number) => boolean - events_number_CustomCheck?: (v: number) => boolean -} -export const ChannelRoutingValidate = (o?: ChannelRouting, opts: ChannelRoutingOptions = {}, path: string = 'ChannelRouting::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.send_errors !== 'number') return new Error(`${path}.send_errors: is not a number`) - if (opts.send_errors_CustomCheck && !opts.send_errors_CustomCheck(o.send_errors)) return new Error(`${path}.send_errors: custom check failed`) - - if (typeof o.receive_errors !== 'number') return new Error(`${path}.receive_errors: is not a number`) - if (opts.receive_errors_CustomCheck && !opts.receive_errors_CustomCheck(o.receive_errors)) return new Error(`${path}.receive_errors: custom check failed`) - - if (typeof o.forward_errors_as_input !== 'number') return new Error(`${path}.forward_errors_as_input: is not a number`) - if (opts.forward_errors_as_input_CustomCheck && !opts.forward_errors_as_input_CustomCheck(o.forward_errors_as_input)) return new Error(`${path}.forward_errors_as_input: custom check failed`) - - if (typeof o.forward_errors_as_output !== 'number') return new Error(`${path}.forward_errors_as_output: is not a number`) - if (opts.forward_errors_as_output_CustomCheck && !opts.forward_errors_as_output_CustomCheck(o.forward_errors_as_output)) return new Error(`${path}.forward_errors_as_output: custom check failed`) - - if (typeof o.missed_forward_fee_as_input !== 'number') return new Error(`${path}.missed_forward_fee_as_input: is not a number`) - if (opts.missed_forward_fee_as_input_CustomCheck && !opts.missed_forward_fee_as_input_CustomCheck(o.missed_forward_fee_as_input)) return new Error(`${path}.missed_forward_fee_as_input: custom check failed`) - - if (typeof o.missed_forward_fee_as_output !== 'number') return new Error(`${path}.missed_forward_fee_as_output: is not a number`) - if (opts.missed_forward_fee_as_output_CustomCheck && !opts.missed_forward_fee_as_output_CustomCheck(o.missed_forward_fee_as_output)) return new Error(`${path}.missed_forward_fee_as_output: custom check failed`) - - if (typeof o.forward_fee_as_input !== 'number') return new Error(`${path}.forward_fee_as_input: is not a number`) - if (opts.forward_fee_as_input_CustomCheck && !opts.forward_fee_as_input_CustomCheck(o.forward_fee_as_input)) return new Error(`${path}.forward_fee_as_input: custom check failed`) - - if (typeof o.forward_fee_as_output !== 'number') return new Error(`${path}.forward_fee_as_output: is not a number`) - if (opts.forward_fee_as_output_CustomCheck && !opts.forward_fee_as_output_CustomCheck(o.forward_fee_as_output)) return new Error(`${path}.forward_fee_as_output: custom check failed`) - - if (typeof o.events_number !== 'number') return new Error(`${path}.events_number: is not a number`) - if (opts.events_number_CustomCheck && !opts.events_number_CustomCheck(o.events_number)) return new Error(`${path}.events_number: custom check failed`) - - return null -} - -export type PayAddressRequest = { - address: string - amoutSats: number - satsPerVByte: number -} -export const PayAddressRequestOptionalFields: [] = [] -export type PayAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean - amoutSats_CustomCheck?: (v: number) => boolean - satsPerVByte_CustomCheck?: (v: number) => boolean -} -export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) - if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) - - if (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`) - if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`) - - if (typeof o.satsPerVByte !== 'number') return new Error(`${path}.satsPerVByte: is not a number`) - if (opts.satsPerVByte_CustomCheck && !opts.satsPerVByte_CustomCheck(o.satsPerVByte)) return new Error(`${path}.satsPerVByte: custom check failed`) - - return null -} - -export type PayAddressResponse = { - txId: string - operation_id: string - service_fee: number - network_fee: number -} -export const PayAddressResponseOptionalFields: [] = [] -export type PayAddressResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - txId_CustomCheck?: (v: string) => boolean - operation_id_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean -} -export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.txId !== 'string') return new Error(`${path}.txId: is not a string`) - if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`) - - if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) - if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - return null -} - -export type AuthApp = { - app: Application - auth_token: string -} -export const AuthAppOptionalFields: [] = [] -export type AuthAppOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - app_Options?: ApplicationOptions - auth_token_CustomCheck?: (v: string) => boolean -} -export const AuthAppValidate = (o?: AuthApp, opts: AuthAppOptions = {}, path: string = 'AuthApp::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) - if (appErr !== null) return appErr - - - if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) - if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) - - return null -} - -export type AppMetrics = { - app: Application - users: UsersInfo - received: number - spent: number - available: number - fees: number - invoices: number - total_fees: number - operations: UserOperation[] -} -export const AppMetricsOptionalFields: [] = [] -export type AppMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - app_Options?: ApplicationOptions - users_Options?: UsersInfoOptions - received_CustomCheck?: (v: number) => boolean - spent_CustomCheck?: (v: number) => boolean - available_CustomCheck?: (v: number) => boolean - fees_CustomCheck?: (v: number) => boolean - invoices_CustomCheck?: (v: number) => boolean - total_fees_CustomCheck?: (v: number) => boolean - operations_ItemOptions?: UserOperationOptions - operations_CustomCheck?: (v: UserOperation[]) => boolean -} -export const AppMetricsValidate = (o?: AppMetrics, opts: AppMetricsOptions = {}, path: string = 'AppMetrics::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) - if (appErr !== null) return appErr - - - const usersErr = UsersInfoValidate(o.users, opts.users_Options, `${path}.users`) - if (usersErr !== null) return usersErr - - - if (typeof o.received !== 'number') return new Error(`${path}.received: is not a number`) - if (opts.received_CustomCheck && !opts.received_CustomCheck(o.received)) return new Error(`${path}.received: custom check failed`) - - if (typeof o.spent !== 'number') return new Error(`${path}.spent: is not a number`) - if (opts.spent_CustomCheck && !opts.spent_CustomCheck(o.spent)) return new Error(`${path}.spent: custom check failed`) - - if (typeof o.available !== 'number') return new Error(`${path}.available: is not a number`) - if (opts.available_CustomCheck && !opts.available_CustomCheck(o.available)) return new Error(`${path}.available: custom check failed`) - - if (typeof o.fees !== 'number') return new Error(`${path}.fees: is not a number`) - if (opts.fees_CustomCheck && !opts.fees_CustomCheck(o.fees)) return new Error(`${path}.fees: custom check failed`) - - if (typeof o.invoices !== 'number') return new Error(`${path}.invoices: is not a number`) - if (opts.invoices_CustomCheck && !opts.invoices_CustomCheck(o.invoices)) return new Error(`${path}.invoices: custom check failed`) - - if (typeof o.total_fees !== 'number') return new Error(`${path}.total_fees: is not a number`) - if (opts.total_fees_CustomCheck && !opts.total_fees_CustomCheck(o.total_fees)) return new Error(`${path}.total_fees: custom check failed`) - - if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) - for (let index = 0; index < o.operations.length; index++) { - const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) - if (operationsErr !== null) return operationsErr - } - if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) - - return null -} - -export type BanUserResponse = { - balance_sats: number - banned_app_users: BannedAppUser[] -} -export const BanUserResponseOptionalFields: [] = [] -export type BanUserResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - balance_sats_CustomCheck?: (v: number) => boolean - banned_app_users_ItemOptions?: BannedAppUserOptions - banned_app_users_CustomCheck?: (v: BannedAppUser[]) => boolean -} -export const BanUserResponseValidate = (o?: BanUserResponse, opts: BanUserResponseOptions = {}, path: string = 'BanUserResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.balance_sats !== 'number') return new Error(`${path}.balance_sats: is not a number`) - if (opts.balance_sats_CustomCheck && !opts.balance_sats_CustomCheck(o.balance_sats)) return new Error(`${path}.balance_sats: custom check failed`) - - if (!Array.isArray(o.banned_app_users)) return new Error(`${path}.banned_app_users: is not an array`) - for (let index = 0; index < o.banned_app_users.length; index++) { - const banned_app_usersErr = BannedAppUserValidate(o.banned_app_users[index], opts.banned_app_users_ItemOptions, `${path}.banned_app_users[${index}]`) - if (banned_app_usersErr !== null) return banned_app_usersErr - } - if (opts.banned_app_users_CustomCheck && !opts.banned_app_users_CustomCheck(o.banned_app_users)) return new Error(`${path}.banned_app_users: custom check failed`) - - return null -} - -export type GetAppUserRequest = { - user_identifier: string -} -export const GetAppUserRequestOptionalFields: [] = [] -export type GetAppUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean -} -export const GetAppUserRequestValidate = (o?: GetAppUserRequest, opts: GetAppUserRequestOptions = {}, path: string = 'GetAppUserRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - return null -} - -export type SetMockAppBalanceRequest = { - amount: number -} -export const SetMockAppBalanceRequestOptionalFields: [] = [] -export type SetMockAppBalanceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, opts: SetMockAppBalanceRequestOptions = {}, path: string = 'SetMockAppBalanceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type DecodeInvoiceRequest = { - invoice: string -} -export const DecodeInvoiceRequestOptionalFields: [] = [] -export type DecodeInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean -} -export const DecodeInvoiceRequestValidate = (o?: DecodeInvoiceRequest, opts: DecodeInvoiceRequestOptions = {}, path: string = 'DecodeInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - return null -} - -export type RequestNPubLinkingTokenResponse = { - token: string -} -export const RequestNPubLinkingTokenResponseOptionalFields: [] = [] -export type RequestNPubLinkingTokenResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - token_CustomCheck?: (v: string) => boolean -} -export const RequestNPubLinkingTokenResponseValidate = (o?: RequestNPubLinkingTokenResponse, opts: RequestNPubLinkingTokenResponseOptions = {}, path: string = 'RequestNPubLinkingTokenResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.token !== 'string') return new Error(`${path}.token: is not a string`) - if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) - - return null -} - -export type LndMetricsRequest = { - from_unix?: number - to_unix?: number -} -export type LndMetricsRequestOptionalField = 'from_unix' | 'to_unix' -export const LndMetricsRequestOptionalFields: LndMetricsRequestOptionalField[] = ['from_unix', 'to_unix'] -export type LndMetricsRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: LndMetricsRequestOptionalField[] - from_unix_CustomCheck?: (v?: number) => boolean - to_unix_CustomCheck?: (v?: number) => boolean -} -export const LndMetricsRequestValidate = (o?: LndMetricsRequest, opts: LndMetricsRequestOptions = {}, path: string = 'LndMetricsRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) - if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) - - if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) - if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) - - return null -} - -export type BannedAppUser = { - app_name: string - app_id: string - user_identifier: string - nostr_pub: string -} -export const BannedAppUserOptionalFields: [] = [] -export type BannedAppUserOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - app_name_CustomCheck?: (v: string) => boolean - app_id_CustomCheck?: (v: string) => boolean - user_identifier_CustomCheck?: (v: string) => boolean - nostr_pub_CustomCheck?: (v: string) => boolean -} -export const BannedAppUserValidate = (o?: BannedAppUser, opts: BannedAppUserOptions = {}, path: string = 'BannedAppUser::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.app_name !== 'string') return new Error(`${path}.app_name: is not a string`) - if (opts.app_name_CustomCheck && !opts.app_name_CustomCheck(o.app_name)) return new Error(`${path}.app_name: custom check failed`) - - if (typeof o.app_id !== 'string') return new Error(`${path}.app_id: is not a string`) - if (opts.app_id_CustomCheck && !opts.app_id_CustomCheck(o.app_id)) return new Error(`${path}.app_id: custom check failed`) - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) - if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) - - return null -} - -export type SetMockAppUserBalanceRequest = { - user_identifier: string - amount: number -} -export const SetMockAppUserBalanceRequestOptionalFields: [] = [] -export type SetMockAppUserBalanceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockAppUserBalanceRequestValidate = (o?: SetMockAppUserBalanceRequest, opts: SetMockAppUserBalanceRequestOptions = {}, path: string = 'SetMockAppUserBalanceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type PayInvoiceRequest = { - invoice: string - amount: number -} -export const PayInvoiceRequestOptionalFields: [] = [] -export type PayInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type LndGetInfoRequest = { - nodeId: number -} -export const LndGetInfoRequestOptionalFields: [] = [] -export type LndGetInfoRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - nodeId_CustomCheck?: (v: number) => boolean -} -export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.nodeId !== 'number') return new Error(`${path}.nodeId: is not a number`) - if (opts.nodeId_CustomCheck && !opts.nodeId_CustomCheck(o.nodeId)) return new Error(`${path}.nodeId: custom check failed`) - - return null -} - -export type AppUser = { - identifier: string - info: UserInfo - max_withdrawable: number -} -export const AppUserOptionalFields: [] = [] -export type AppUserOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - identifier_CustomCheck?: (v: string) => boolean - info_Options?: UserInfoOptions - max_withdrawable_CustomCheck?: (v: number) => boolean -} -export const AppUserValidate = (o?: AppUser, opts: AppUserOptions = {}, path: string = 'AppUser::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) - if (infoErr !== null) return infoErr - - - if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) - if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) - - return null -} - -export type AddAppUserRequest = { - identifier: string - fail_if_exists: boolean - balance: number -} -export const AddAppUserRequestOptionalFields: [] = [] -export type AddAppUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - identifier_CustomCheck?: (v: string) => boolean - fail_if_exists_CustomCheck?: (v: boolean) => boolean - balance_CustomCheck?: (v: number) => boolean -} -export const AddAppUserRequestValidate = (o?: AddAppUserRequest, opts: AddAppUserRequestOptions = {}, path: string = 'AddAppUserRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - if (typeof o.fail_if_exists !== 'boolean') return new Error(`${path}.fail_if_exists: is not a boolean`) - if (opts.fail_if_exists_CustomCheck && !opts.fail_if_exists_CustomCheck(o.fail_if_exists)) return new Error(`${path}.fail_if_exists: custom check failed`) - - if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) - if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - - return null -} - -export type NewInvoiceResponse = { - invoice: string -} -export const NewInvoiceResponseOptionalFields: [] = [] -export type NewInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean -} -export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - return null -} - -export type NewAddressResponse = { - address: string -} -export const NewAddressResponseOptionalFields: [] = [] -export type NewAddressResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean -} -export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) - if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) - - return null -} - -export type AppsMetrics = { - apps: AppMetrics[] -} -export const AppsMetricsOptionalFields: [] = [] -export type AppsMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - apps_ItemOptions?: AppMetricsOptions - apps_CustomCheck?: (v: AppMetrics[]) => boolean -} -export const AppsMetricsValidate = (o?: AppsMetrics, opts: AppsMetricsOptions = {}, path: string = 'AppsMetrics::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!Array.isArray(o.apps)) return new Error(`${path}.apps: is not an array`) - for (let index = 0; index < o.apps.length; index++) { - const appsErr = AppMetricsValidate(o.apps[index], opts.apps_ItemOptions, `${path}.apps[${index}]`) - if (appsErr !== null) return appsErr - } - if (opts.apps_CustomCheck && !opts.apps_CustomCheck(o.apps)) return new Error(`${path}.apps: custom check failed`) - - return null -} - -export type LndGetInfoResponse = { - alias: string -} -export const LndGetInfoResponseOptionalFields: [] = [] -export type LndGetInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - alias_CustomCheck?: (v: string) => boolean -} -export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.alias !== 'string') return new Error(`${path}.alias: is not a string`) - if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`) - - return null -} - -export type SendAppUserToAppPaymentRequest = { - from_user_identifier: string - amount: number -} -export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] -export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - from_user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SendAppUserToAppPaymentRequestValidate = (o?: SendAppUserToAppPaymentRequest, opts: SendAppUserToAppPaymentRequestOptions = {}, path: string = 'SendAppUserToAppPaymentRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) - if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type GetUserOperationsRequest = { - latestIncomingInvoice: number - latestOutgoingInvoice: number - latestIncomingTx: number - latestOutgoingTx: number - latestIncomingUserToUserPayment: number - latestOutgoingUserToUserPayment: number - max_size: number -} -export const GetUserOperationsRequestOptionalFields: [] = [] -export type GetUserOperationsRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - latestIncomingInvoice_CustomCheck?: (v: number) => boolean - latestOutgoingInvoice_CustomCheck?: (v: number) => boolean - latestIncomingTx_CustomCheck?: (v: number) => boolean - latestOutgoingTx_CustomCheck?: (v: number) => boolean - latestIncomingUserToUserPayment_CustomCheck?: (v: number) => boolean - latestOutgoingUserToUserPayment_CustomCheck?: (v: number) => boolean - max_size_CustomCheck?: (v: number) => boolean -} -export const GetUserOperationsRequestValidate = (o?: GetUserOperationsRequest, opts: GetUserOperationsRequestOptions = {}, path: string = 'GetUserOperationsRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.latestIncomingInvoice !== 'number') return new Error(`${path}.latestIncomingInvoice: is not a number`) - if (opts.latestIncomingInvoice_CustomCheck && !opts.latestIncomingInvoice_CustomCheck(o.latestIncomingInvoice)) return new Error(`${path}.latestIncomingInvoice: custom check failed`) - - if (typeof o.latestOutgoingInvoice !== 'number') return new Error(`${path}.latestOutgoingInvoice: is not a number`) - if (opts.latestOutgoingInvoice_CustomCheck && !opts.latestOutgoingInvoice_CustomCheck(o.latestOutgoingInvoice)) return new Error(`${path}.latestOutgoingInvoice: custom check failed`) - - if (typeof o.latestIncomingTx !== 'number') return new Error(`${path}.latestIncomingTx: is not a number`) - if (opts.latestIncomingTx_CustomCheck && !opts.latestIncomingTx_CustomCheck(o.latestIncomingTx)) return new Error(`${path}.latestIncomingTx: custom check failed`) - - if (typeof o.latestOutgoingTx !== 'number') return new Error(`${path}.latestOutgoingTx: is not a number`) - if (opts.latestOutgoingTx_CustomCheck && !opts.latestOutgoingTx_CustomCheck(o.latestOutgoingTx)) return new Error(`${path}.latestOutgoingTx: custom check failed`) - - if (typeof o.latestIncomingUserToUserPayment !== 'number') return new Error(`${path}.latestIncomingUserToUserPayment: is not a number`) - if (opts.latestIncomingUserToUserPayment_CustomCheck && !opts.latestIncomingUserToUserPayment_CustomCheck(o.latestIncomingUserToUserPayment)) return new Error(`${path}.latestIncomingUserToUserPayment: custom check failed`) - - if (typeof o.latestOutgoingUserToUserPayment !== 'number') return new Error(`${path}.latestOutgoingUserToUserPayment: is not a number`) - if (opts.latestOutgoingUserToUserPayment_CustomCheck && !opts.latestOutgoingUserToUserPayment_CustomCheck(o.latestOutgoingUserToUserPayment)) return new Error(`${path}.latestOutgoingUserToUserPayment: custom check failed`) - - if (typeof o.max_size !== 'number') return new Error(`${path}.max_size: is not a number`) - if (opts.max_size_CustomCheck && !opts.max_size_CustomCheck(o.max_size)) return new Error(`${path}.max_size: custom check failed`) - - return null -} - -export type GetUserOperationsResponse = { - latestOutgoingInvoiceOperations: UserOperations - latestIncomingInvoiceOperations: UserOperations - latestOutgoingTxOperations: UserOperations - latestIncomingTxOperations: UserOperations - latestOutgoingUserToUserPayemnts: UserOperations - latestIncomingUserToUserPayemnts: UserOperations -} -export const GetUserOperationsResponseOptionalFields: [] = [] -export type GetUserOperationsResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - latestOutgoingInvoiceOperations_Options?: UserOperationsOptions - latestIncomingInvoiceOperations_Options?: UserOperationsOptions - latestOutgoingTxOperations_Options?: UserOperationsOptions - latestIncomingTxOperations_Options?: UserOperationsOptions - latestOutgoingUserToUserPayemnts_Options?: UserOperationsOptions - latestIncomingUserToUserPayemnts_Options?: UserOperationsOptions -} -export const GetUserOperationsResponseValidate = (o?: GetUserOperationsResponse, opts: GetUserOperationsResponseOptions = {}, path: string = 'GetUserOperationsResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - const latestOutgoingInvoiceOperationsErr = UserOperationsValidate(o.latestOutgoingInvoiceOperations, opts.latestOutgoingInvoiceOperations_Options, `${path}.latestOutgoingInvoiceOperations`) - if (latestOutgoingInvoiceOperationsErr !== null) return latestOutgoingInvoiceOperationsErr - - - const latestIncomingInvoiceOperationsErr = UserOperationsValidate(o.latestIncomingInvoiceOperations, opts.latestIncomingInvoiceOperations_Options, `${path}.latestIncomingInvoiceOperations`) - if (latestIncomingInvoiceOperationsErr !== null) return latestIncomingInvoiceOperationsErr - - - const latestOutgoingTxOperationsErr = UserOperationsValidate(o.latestOutgoingTxOperations, opts.latestOutgoingTxOperations_Options, `${path}.latestOutgoingTxOperations`) - if (latestOutgoingTxOperationsErr !== null) return latestOutgoingTxOperationsErr - - - const latestIncomingTxOperationsErr = UserOperationsValidate(o.latestIncomingTxOperations, opts.latestIncomingTxOperations_Options, `${path}.latestIncomingTxOperations`) - if (latestIncomingTxOperationsErr !== null) return latestIncomingTxOperationsErr - - - const latestOutgoingUserToUserPayemntsErr = UserOperationsValidate(o.latestOutgoingUserToUserPayemnts, opts.latestOutgoingUserToUserPayemnts_Options, `${path}.latestOutgoingUserToUserPayemnts`) - if (latestOutgoingUserToUserPayemntsErr !== null) return latestOutgoingUserToUserPayemntsErr - - - const latestIncomingUserToUserPayemntsErr = UserOperationsValidate(o.latestIncomingUserToUserPayemnts, opts.latestIncomingUserToUserPayemnts_Options, `${path}.latestIncomingUserToUserPayemnts`) - if (latestIncomingUserToUserPayemntsErr !== null) return latestIncomingUserToUserPayemntsErr - - - return null -} - -export type BanUserRequest = { - user_id: string -} -export const BanUserRequestOptionalFields: [] = [] -export type BanUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_id_CustomCheck?: (v: string) => boolean -} -export const BanUserRequestValidate = (o?: BanUserRequest, opts: BanUserRequestOptions = {}, path: string = 'BanUserRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) - if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) - - return null -} - -export type SendAppUserToAppUserPaymentRequest = { - from_user_identifier: string - to_user_identifier: string - amount: number -} -export const SendAppUserToAppUserPaymentRequestOptionalFields: [] = [] -export type SendAppUserToAppUserPaymentRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - from_user_identifier_CustomCheck?: (v: string) => boolean - to_user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SendAppUserToAppUserPaymentRequestValidate = (o?: SendAppUserToAppUserPaymentRequest, opts: SendAppUserToAppUserPaymentRequestOptions = {}, path: string = 'SendAppUserToAppUserPaymentRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) - if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) - - if (typeof o.to_user_identifier !== 'string') return new Error(`${path}.to_user_identifier: is not a string`) - if (opts.to_user_identifier_CustomCheck && !opts.to_user_identifier_CustomCheck(o.to_user_identifier)) return new Error(`${path}.to_user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type AddAppInvoiceRequest = { - payer_identifier: string - http_callback_url: string - invoice_req: NewInvoiceRequest -} -export const AddAppInvoiceRequestOptionalFields: [] = [] -export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - payer_identifier_CustomCheck?: (v: string) => boolean - http_callback_url_CustomCheck?: (v: string) => boolean - invoice_req_Options?: NewInvoiceRequestOptions -} -export const AddAppInvoiceRequestValidate = (o?: AddAppInvoiceRequest, opts: AddAppInvoiceRequestOptions = {}, path: string = 'AddAppInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) - if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) - - if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) - if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) - - const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) - if (invoice_reqErr !== null) return invoice_reqErr - - - return null -} - -export type GetAppUserLNURLInfoRequest = { - user_identifier: string - base_url_override: string -} -export const GetAppUserLNURLInfoRequestOptionalFields: [] = [] -export type GetAppUserLNURLInfoRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - base_url_override_CustomCheck?: (v: string) => boolean -} -export const GetAppUserLNURLInfoRequestValidate = (o?: GetAppUserLNURLInfoRequest, opts: GetAppUserLNURLInfoRequestOptions = {}, path: string = 'GetAppUserLNURLInfoRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.base_url_override !== 'string') return new Error(`${path}.base_url_override: is not a string`) - if (opts.base_url_override_CustomCheck && !opts.base_url_override_CustomCheck(o.base_url_override)) return new Error(`${path}.base_url_override: custom check failed`) - - return null -} - -export type LnurlLinkResponse = { - lnurl: string - k1: string -} -export const LnurlLinkResponseOptionalFields: [] = [] -export type LnurlLinkResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - lnurl_CustomCheck?: (v: string) => boolean - k1_CustomCheck?: (v: string) => boolean -} -export const LnurlLinkResponseValidate = (o?: LnurlLinkResponse, opts: LnurlLinkResponseOptions = {}, path: string = 'LnurlLinkResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.lnurl !== 'string') return new Error(`${path}.lnurl: is not a string`) - if (opts.lnurl_CustomCheck && !opts.lnurl_CustomCheck(o.lnurl)) return new Error(`${path}.lnurl: custom check failed`) - - if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) - if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) - - return null -} - -export type LnurlWithdrawInfoResponse = { - tag: string - callback: string - k1: string - defaultDescription: string - minWithdrawable: number - maxWithdrawable: number - balanceCheck: string - payLink: string -} -export const LnurlWithdrawInfoResponseOptionalFields: [] = [] -export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - tag_CustomCheck?: (v: string) => boolean - callback_CustomCheck?: (v: string) => boolean - k1_CustomCheck?: (v: string) => boolean - defaultDescription_CustomCheck?: (v: string) => boolean - minWithdrawable_CustomCheck?: (v: number) => boolean - maxWithdrawable_CustomCheck?: (v: number) => boolean - balanceCheck_CustomCheck?: (v: string) => boolean - payLink_CustomCheck?: (v: string) => boolean -} -export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) - if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) - - if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) - if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) - - if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) - if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) - - if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`) - if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`) - - if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`) - if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`) - - if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`) - if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`) - - if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`) - if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`) - - if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`) - if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`) - - return null -} - -export type UserOperation = { - paidAtUnix: number - type: UserOperationType - inbound: boolean - amount: number - identifier: string - operationId: string - service_fee: number - network_fee: number - confirmed: boolean - tx_hash: string - internal: boolean -} -export const UserOperationOptionalFields: [] = [] -export type UserOperationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - paidAtUnix_CustomCheck?: (v: number) => boolean - type_CustomCheck?: (v: UserOperationType) => boolean - inbound_CustomCheck?: (v: boolean) => boolean - amount_CustomCheck?: (v: number) => boolean - identifier_CustomCheck?: (v: string) => boolean - operationId_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean - confirmed_CustomCheck?: (v: boolean) => boolean - tx_hash_CustomCheck?: (v: string) => boolean - internal_CustomCheck?: (v: boolean) => boolean -} -export const UserOperationValidate = (o?: UserOperation, opts: UserOperationOptions = {}, path: string = 'UserOperation::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.paidAtUnix !== 'number') return new Error(`${path}.paidAtUnix: is not a number`) - if (opts.paidAtUnix_CustomCheck && !opts.paidAtUnix_CustomCheck(o.paidAtUnix)) return new Error(`${path}.paidAtUnix: custom check failed`) - - if (!enumCheckUserOperationType(o.type)) return new Error(`${path}.type: is not a valid UserOperationType`) - if (opts.type_CustomCheck && !opts.type_CustomCheck(o.type)) return new Error(`${path}.type: custom check failed`) - - if (typeof o.inbound !== 'boolean') return new Error(`${path}.inbound: is not a boolean`) - if (opts.inbound_CustomCheck && !opts.inbound_CustomCheck(o.inbound)) return new Error(`${path}.inbound: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - if (typeof o.operationId !== 'string') return new Error(`${path}.operationId: is not a string`) - if (opts.operationId_CustomCheck && !opts.operationId_CustomCheck(o.operationId)) return new Error(`${path}.operationId: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - if (typeof o.confirmed !== 'boolean') return new Error(`${path}.confirmed: is not a boolean`) - if (opts.confirmed_CustomCheck && !opts.confirmed_CustomCheck(o.confirmed)) return new Error(`${path}.confirmed: custom check failed`) - - if (typeof o.tx_hash !== 'string') return new Error(`${path}.tx_hash: is not a string`) - if (opts.tx_hash_CustomCheck && !opts.tx_hash_CustomCheck(o.tx_hash)) return new Error(`${path}.tx_hash: custom check failed`) - - if (typeof o.internal !== 'boolean') return new Error(`${path}.internal: is not a boolean`) - if (opts.internal_CustomCheck && !opts.internal_CustomCheck(o.internal)) return new Error(`${path}.internal: custom check failed`) - - return null -} - -export type ClosureMigration = { - closes_at_unix: number -} -export const ClosureMigrationOptionalFields: [] = [] -export type ClosureMigrationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - closes_at_unix_CustomCheck?: (v: number) => boolean -} -export const ClosureMigrationValidate = (o?: ClosureMigration, opts: ClosureMigrationOptions = {}, path: string = 'ClosureMigration::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.closes_at_unix !== 'number') return new Error(`${path}.closes_at_unix: is not a number`) - if (opts.closes_at_unix_CustomCheck && !opts.closes_at_unix_CustomCheck(o.closes_at_unix)) return new Error(`${path}.closes_at_unix: custom check failed`) - - return null -} - -export type AuthAppRequest = { - name: string - allow_user_creation?: boolean -} -export type AuthAppRequestOptionalField = 'allow_user_creation' -export const AuthAppRequestOptionalFields: AuthAppRequestOptionalField[] = ['allow_user_creation'] -export type AuthAppRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: AuthAppRequestOptionalField[] - name_CustomCheck?: (v: string) => boolean - allow_user_creation_CustomCheck?: (v?: boolean) => boolean -} -export const AuthAppRequestValidate = (o?: AuthAppRequest, opts: AuthAppRequestOptions = {}, path: string = 'AuthAppRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if ((o.allow_user_creation || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('allow_user_creation')) && typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) - if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) - - return null -} - -export type Application = { - name: string - id: string - balance: number - npub: string -} -export const ApplicationOptionalFields: [] = [] -export type ApplicationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - id_CustomCheck?: (v: string) => boolean - balance_CustomCheck?: (v: number) => boolean - npub_CustomCheck?: (v: string) => boolean -} -export const ApplicationValidate = (o?: Application, opts: ApplicationOptions = {}, path: string = 'Application::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) - if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) - - if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) - if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - - if (typeof o.npub !== 'string') return new Error(`${path}.npub: is not a string`) - if (opts.npub_CustomCheck && !opts.npub_CustomCheck(o.npub)) return new Error(`${path}.npub: custom check failed`) - - return null -} - -export type RelaysMigration = { - relays: string[] -} -export const RelaysMigrationOptionalFields: [] = [] -export type RelaysMigrationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - relays_CustomCheck?: (v: string[]) => boolean -} -export const RelaysMigrationValidate = (o?: RelaysMigration, opts: RelaysMigrationOptions = {}, path: string = 'RelaysMigration::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!Array.isArray(o.relays)) return new Error(`${path}.relays: is not an array`) - for (let index = 0; index < o.relays.length; index++) { - if (typeof o.relays[index] !== 'string') return new Error(`${path}.relays[${index}]: is not a string`) - } - if (opts.relays_CustomCheck && !opts.relays_CustomCheck(o.relays)) return new Error(`${path}.relays: custom check failed`) - - return null -} - -export type RequestNPubLinkingTokenRequest = { - user_identifier: string -} -export const RequestNPubLinkingTokenRequestOptionalFields: [] = [] -export type RequestNPubLinkingTokenRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean -} -export const RequestNPubLinkingTokenRequestValidate = (o?: RequestNPubLinkingTokenRequest, opts: RequestNPubLinkingTokenRequestOptions = {}, path: string = 'RequestNPubLinkingTokenRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - return null -} - -export type ClosedChannel = { - channel_id: string - capacity: number - closed_height: number -} -export const ClosedChannelOptionalFields: [] = [] -export type ClosedChannelOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean - capacity_CustomCheck?: (v: number) => boolean - closed_height_CustomCheck?: (v: number) => boolean -} -export const ClosedChannelValidate = (o?: ClosedChannel, opts: ClosedChannelOptions = {}, path: string = 'ClosedChannel::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) - if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) - - if (typeof o.closed_height !== 'number') return new Error(`${path}.closed_height: is not a number`) - if (opts.closed_height_CustomCheck && !opts.closed_height_CustomCheck(o.closed_height)) return new Error(`${path}.closed_height: custom check failed`) - - return null -} - -export type OpenChannelResponse = { - channelId: string -} -export const OpenChannelResponseOptionalFields: [] = [] -export type OpenChannelResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channelId_CustomCheck?: (v: string) => boolean -} -export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.channelId !== 'string') return new Error(`${path}.channelId: is not a string`) - if (opts.channelId_CustomCheck && !opts.channelId_CustomCheck(o.channelId)) return new Error(`${path}.channelId: custom check failed`) - - return null -} - -export type Product = { - id: string - name: string - price_sats: number -} -export const ProductOptionalFields: [] = [] -export type ProductOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - id_CustomCheck?: (v: string) => boolean - name_CustomCheck?: (v: string) => boolean - price_sats_CustomCheck?: (v: number) => boolean -} -export const ProductValidate = (o?: Product, opts: ProductOptions = {}, path: string = 'Product::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) - if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) - if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) - - return null -} - -export type EncryptionExchangeRequest = { - publicKey: string - deviceId: string -} -export const EncryptionExchangeRequestOptionalFields: [] = [] -export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - publicKey_CustomCheck?: (v: string) => boolean - deviceId_CustomCheck?: (v: string) => boolean -} -export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.publicKey !== 'string') return new Error(`${path}.publicKey: is not a string`) - if (opts.publicKey_CustomCheck && !opts.publicKey_CustomCheck(o.publicKey)) return new Error(`${path}.publicKey: custom check failed`) - - if (typeof o.deviceId !== 'string') return new Error(`${path}.deviceId: is not a string`) - if (opts.deviceId_CustomCheck && !opts.deviceId_CustomCheck(o.deviceId)) return new Error(`${path}.deviceId: custom check failed`) - - return null -} - -export type AppsMetricsRequest = { - from_unix?: number - to_unix?: number - include_operations?: boolean -} -export type AppsMetricsRequestOptionalField = 'from_unix' | 'to_unix' | 'include_operations' -export const AppsMetricsRequestOptionalFields: AppsMetricsRequestOptionalField[] = ['from_unix', 'to_unix', 'include_operations'] -export type AppsMetricsRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: AppsMetricsRequestOptionalField[] - from_unix_CustomCheck?: (v?: number) => boolean - to_unix_CustomCheck?: (v?: number) => boolean - include_operations_CustomCheck?: (v?: boolean) => boolean -} -export const AppsMetricsRequestValidate = (o?: AppsMetricsRequest, opts: AppsMetricsRequestOptions = {}, path: string = 'AppsMetricsRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) - if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) - - if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) - if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) - - if ((o.include_operations || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('include_operations')) && typeof o.include_operations !== 'boolean') return new Error(`${path}.include_operations: is not a boolean`) - if (opts.include_operations_CustomCheck && !opts.include_operations_CustomCheck(o.include_operations)) return new Error(`${path}.include_operations: custom check failed`) - - return null -} - -export type LiveUserOperation = { - operation: UserOperation -} -export const LiveUserOperationOptionalFields: [] = [] -export type LiveUserOperationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - operation_Options?: UserOperationOptions -} -export const LiveUserOperationValidate = (o?: LiveUserOperation, opts: LiveUserOperationOptions = {}, path: string = 'LiveUserOperation::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - const operationErr = UserOperationValidate(o.operation, opts.operation_Options, `${path}.operation`) - if (operationErr !== null) return operationErr - - - return null -} - -export type HttpCreds = { - url: string - token: string -} -export const HttpCredsOptionalFields: [] = [] -export type HttpCredsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - url_CustomCheck?: (v: string) => boolean - token_CustomCheck?: (v: string) => boolean -} -export const HttpCredsValidate = (o?: HttpCreds, opts: HttpCredsOptions = {}, path: string = 'HttpCreds::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.url !== 'string') return new Error(`${path}.url: is not a string`) - if (opts.url_CustomCheck && !opts.url_CustomCheck(o.url)) return new Error(`${path}.url: custom check failed`) - - if (typeof o.token !== 'string') return new Error(`${path}.token: is not a string`) - if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) - - return null -} - -export type PayAppUserInvoiceRequest = { - user_identifier: string - invoice: string - amount: number -} -export const PayAppUserInvoiceRequestOptionalFields: [] = [] -export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const PayAppUserInvoiceRequestValidate = (o?: PayAppUserInvoiceRequest, opts: PayAppUserInvoiceRequestOptions = {}, path: string = 'PayAppUserInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type NewInvoiceRequest = { - amountSats: number - memo: string -} -export const NewInvoiceRequestOptionalFields: [] = [] -export type NewInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amountSats_CustomCheck?: (v: number) => boolean - memo_CustomCheck?: (v: string) => boolean -} -export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.amountSats !== 'number') return new Error(`${path}.amountSats: is not a number`) - if (opts.amountSats_CustomCheck && !opts.amountSats_CustomCheck(o.amountSats)) return new Error(`${path}.amountSats: custom check failed`) - - if (typeof o.memo !== 'string') return new Error(`${path}.memo: is not a string`) - if (opts.memo_CustomCheck && !opts.memo_CustomCheck(o.memo)) return new Error(`${path}.memo: custom check failed`) - - return null -} - -export type ChannelBalanceEvent = { - block_height: number - channel_id: string - local_balance_sats: number - remote_balance_sats: number -} -export const ChannelBalanceEventOptionalFields: [] = [] -export type ChannelBalanceEventOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - block_height_CustomCheck?: (v: number) => boolean - channel_id_CustomCheck?: (v: string) => boolean - local_balance_sats_CustomCheck?: (v: number) => boolean - remote_balance_sats_CustomCheck?: (v: number) => boolean -} -export const ChannelBalanceEventValidate = (o?: ChannelBalanceEvent, opts: ChannelBalanceEventOptions = {}, path: string = 'ChannelBalanceEvent::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) - if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) - - if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) - - if (typeof o.local_balance_sats !== 'number') return new Error(`${path}.local_balance_sats: is not a number`) - if (opts.local_balance_sats_CustomCheck && !opts.local_balance_sats_CustomCheck(o.local_balance_sats)) return new Error(`${path}.local_balance_sats: custom check failed`) - - if (typeof o.remote_balance_sats !== 'number') return new Error(`${path}.remote_balance_sats: is not a number`) - if (opts.remote_balance_sats_CustomCheck && !opts.remote_balance_sats_CustomCheck(o.remote_balance_sats)) return new Error(`${path}.remote_balance_sats: custom check failed`) - - return null -} - -export type HandleLnurlPayResponse = { - pr: string - routes: Empty[] -} -export const HandleLnurlPayResponseOptionalFields: [] = [] -export type HandleLnurlPayResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - pr_CustomCheck?: (v: string) => boolean - routes_ItemOptions?: EmptyOptions - routes_CustomCheck?: (v: Empty[]) => boolean -} -export const HandleLnurlPayResponseValidate = (o?: HandleLnurlPayResponse, opts: HandleLnurlPayResponseOptions = {}, path: string = 'HandleLnurlPayResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.pr !== 'string') return new Error(`${path}.pr: is not a string`) - if (opts.pr_CustomCheck && !opts.pr_CustomCheck(o.pr)) return new Error(`${path}.pr: custom check failed`) - - if (!Array.isArray(o.routes)) return new Error(`${path}.routes: is not an array`) - for (let index = 0; index < o.routes.length; index++) { - const routesErr = EmptyValidate(o.routes[index], opts.routes_ItemOptions, `${path}.routes[${index}]`) - if (routesErr !== null) return routesErr - } - if (opts.routes_CustomCheck && !opts.routes_CustomCheck(o.routes)) return new Error(`${path}.routes: custom check failed`) - - return null -} - -export type UserOperations = { - fromIndex: number - toIndex: number - operations: UserOperation[] -} -export const UserOperationsOptionalFields: [] = [] -export type UserOperationsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - fromIndex_CustomCheck?: (v: number) => boolean - toIndex_CustomCheck?: (v: number) => boolean - operations_ItemOptions?: UserOperationOptions - operations_CustomCheck?: (v: UserOperation[]) => boolean -} -export const UserOperationsValidate = (o?: UserOperations, opts: UserOperationsOptions = {}, path: string = 'UserOperations::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.fromIndex !== 'number') return new Error(`${path}.fromIndex: is not a number`) - if (opts.fromIndex_CustomCheck && !opts.fromIndex_CustomCheck(o.fromIndex)) return new Error(`${path}.fromIndex: custom check failed`) - - if (typeof o.toIndex !== 'number') return new Error(`${path}.toIndex: is not a number`) - if (opts.toIndex_CustomCheck && !opts.toIndex_CustomCheck(o.toIndex)) return new Error(`${path}.toIndex: custom check failed`) - - if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) - for (let index = 0; index < o.operations.length; index++) { - const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) - if (operationsErr !== null) return operationsErr - } - if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) - - return null -} - -export type UsageMetric = { - processed_at_ms: number - parsed_in_nano: number - auth_in_nano: number - validate_in_nano: number - handle_in_nano: number - rpc_name: string - batch: boolean - nostr: boolean - batch_size: number -} -export const UsageMetricOptionalFields: [] = [] -export type UsageMetricOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - processed_at_ms_CustomCheck?: (v: number) => boolean - parsed_in_nano_CustomCheck?: (v: number) => boolean - auth_in_nano_CustomCheck?: (v: number) => boolean - validate_in_nano_CustomCheck?: (v: number) => boolean - handle_in_nano_CustomCheck?: (v: number) => boolean - rpc_name_CustomCheck?: (v: string) => boolean - batch_CustomCheck?: (v: boolean) => boolean - nostr_CustomCheck?: (v: boolean) => boolean - batch_size_CustomCheck?: (v: number) => boolean -} -export const UsageMetricValidate = (o?: UsageMetric, opts: UsageMetricOptions = {}, path: string = 'UsageMetric::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.processed_at_ms !== 'number') return new Error(`${path}.processed_at_ms: is not a number`) - if (opts.processed_at_ms_CustomCheck && !opts.processed_at_ms_CustomCheck(o.processed_at_ms)) return new Error(`${path}.processed_at_ms: custom check failed`) - - if (typeof o.parsed_in_nano !== 'number') return new Error(`${path}.parsed_in_nano: is not a number`) - if (opts.parsed_in_nano_CustomCheck && !opts.parsed_in_nano_CustomCheck(o.parsed_in_nano)) return new Error(`${path}.parsed_in_nano: custom check failed`) - - if (typeof o.auth_in_nano !== 'number') return new Error(`${path}.auth_in_nano: is not a number`) - if (opts.auth_in_nano_CustomCheck && !opts.auth_in_nano_CustomCheck(o.auth_in_nano)) return new Error(`${path}.auth_in_nano: custom check failed`) - - if (typeof o.validate_in_nano !== 'number') return new Error(`${path}.validate_in_nano: is not a number`) - if (opts.validate_in_nano_CustomCheck && !opts.validate_in_nano_CustomCheck(o.validate_in_nano)) return new Error(`${path}.validate_in_nano: custom check failed`) - - if (typeof o.handle_in_nano !== 'number') return new Error(`${path}.handle_in_nano: is not a number`) - if (opts.handle_in_nano_CustomCheck && !opts.handle_in_nano_CustomCheck(o.handle_in_nano)) return new Error(`${path}.handle_in_nano: custom check failed`) - - if (typeof o.rpc_name !== 'string') return new Error(`${path}.rpc_name: is not a string`) - if (opts.rpc_name_CustomCheck && !opts.rpc_name_CustomCheck(o.rpc_name)) return new Error(`${path}.rpc_name: custom check failed`) - - if (typeof o.batch !== 'boolean') return new Error(`${path}.batch: is not a boolean`) - if (opts.batch_CustomCheck && !opts.batch_CustomCheck(o.batch)) return new Error(`${path}.batch: custom check failed`) - - if (typeof o.nostr !== 'boolean') return new Error(`${path}.nostr: is not a boolean`) - if (opts.nostr_CustomCheck && !opts.nostr_CustomCheck(o.nostr)) return new Error(`${path}.nostr: custom check failed`) - - if (typeof o.batch_size !== 'number') return new Error(`${path}.batch_size: is not a number`) - if (opts.batch_size_CustomCheck && !opts.batch_size_CustomCheck(o.batch_size)) return new Error(`${path}.batch_size: custom check failed`) - - return null -} - -export type RoutingEvent = { - incoming_channel_id: number - incoming_htlc_id: number - outgoing_channel_id: number - outgoing_htlc_id: number - timestamp_ns: number - event_type: string - incoming_amt_msat: number - outgoing_amt_msat: number - failure_string: string - settled: boolean - offchain: boolean - forward_fail_event: boolean -} -export const RoutingEventOptionalFields: [] = [] -export type RoutingEventOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - incoming_channel_id_CustomCheck?: (v: number) => boolean - incoming_htlc_id_CustomCheck?: (v: number) => boolean - outgoing_channel_id_CustomCheck?: (v: number) => boolean - outgoing_htlc_id_CustomCheck?: (v: number) => boolean - timestamp_ns_CustomCheck?: (v: number) => boolean - event_type_CustomCheck?: (v: string) => boolean - incoming_amt_msat_CustomCheck?: (v: number) => boolean - outgoing_amt_msat_CustomCheck?: (v: number) => boolean - failure_string_CustomCheck?: (v: string) => boolean - settled_CustomCheck?: (v: boolean) => boolean - offchain_CustomCheck?: (v: boolean) => boolean - forward_fail_event_CustomCheck?: (v: boolean) => boolean -} -export const RoutingEventValidate = (o?: RoutingEvent, opts: RoutingEventOptions = {}, path: string = 'RoutingEvent::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.incoming_channel_id !== 'number') return new Error(`${path}.incoming_channel_id: is not a number`) - if (opts.incoming_channel_id_CustomCheck && !opts.incoming_channel_id_CustomCheck(o.incoming_channel_id)) return new Error(`${path}.incoming_channel_id: custom check failed`) - - if (typeof o.incoming_htlc_id !== 'number') return new Error(`${path}.incoming_htlc_id: is not a number`) - if (opts.incoming_htlc_id_CustomCheck && !opts.incoming_htlc_id_CustomCheck(o.incoming_htlc_id)) return new Error(`${path}.incoming_htlc_id: custom check failed`) - - if (typeof o.outgoing_channel_id !== 'number') return new Error(`${path}.outgoing_channel_id: is not a number`) - if (opts.outgoing_channel_id_CustomCheck && !opts.outgoing_channel_id_CustomCheck(o.outgoing_channel_id)) return new Error(`${path}.outgoing_channel_id: custom check failed`) - - if (typeof o.outgoing_htlc_id !== 'number') return new Error(`${path}.outgoing_htlc_id: is not a number`) - if (opts.outgoing_htlc_id_CustomCheck && !opts.outgoing_htlc_id_CustomCheck(o.outgoing_htlc_id)) return new Error(`${path}.outgoing_htlc_id: custom check failed`) - - if (typeof o.timestamp_ns !== 'number') return new Error(`${path}.timestamp_ns: is not a number`) - if (opts.timestamp_ns_CustomCheck && !opts.timestamp_ns_CustomCheck(o.timestamp_ns)) return new Error(`${path}.timestamp_ns: custom check failed`) - - if (typeof o.event_type !== 'string') return new Error(`${path}.event_type: is not a string`) - if (opts.event_type_CustomCheck && !opts.event_type_CustomCheck(o.event_type)) return new Error(`${path}.event_type: custom check failed`) - - if (typeof o.incoming_amt_msat !== 'number') return new Error(`${path}.incoming_amt_msat: is not a number`) - if (opts.incoming_amt_msat_CustomCheck && !opts.incoming_amt_msat_CustomCheck(o.incoming_amt_msat)) return new Error(`${path}.incoming_amt_msat: custom check failed`) - - if (typeof o.outgoing_amt_msat !== 'number') return new Error(`${path}.outgoing_amt_msat: is not a number`) - if (opts.outgoing_amt_msat_CustomCheck && !opts.outgoing_amt_msat_CustomCheck(o.outgoing_amt_msat)) return new Error(`${path}.outgoing_amt_msat: custom check failed`) - - if (typeof o.failure_string !== 'string') return new Error(`${path}.failure_string: is not a string`) - if (opts.failure_string_CustomCheck && !opts.failure_string_CustomCheck(o.failure_string)) return new Error(`${path}.failure_string: custom check failed`) - - if (typeof o.settled !== 'boolean') return new Error(`${path}.settled: is not a boolean`) - if (opts.settled_CustomCheck && !opts.settled_CustomCheck(o.settled)) return new Error(`${path}.settled: custom check failed`) - - if (typeof o.offchain !== 'boolean') return new Error(`${path}.offchain: is not a boolean`) - if (opts.offchain_CustomCheck && !opts.offchain_CustomCheck(o.offchain)) return new Error(`${path}.offchain: custom check failed`) - - if (typeof o.forward_fail_event !== 'boolean') return new Error(`${path}.forward_fail_event: is not a boolean`) - if (opts.forward_fail_event_CustomCheck && !opts.forward_fail_event_CustomCheck(o.forward_fail_event)) return new Error(`${path}.forward_fail_event: custom check failed`) - - return null -} - -export type SetMockInvoiceAsPaidRequest = { - invoice: string - amount: number -} -export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] -export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockInvoiceAsPaidRequestValidate = (o?: SetMockInvoiceAsPaidRequest, opts: SetMockInvoiceAsPaidRequestOptions = {}, path: string = 'SetMockInvoiceAsPaidRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type AddAppUserInvoiceRequest = { - receiver_identifier: string - payer_identifier: string - http_callback_url: string - invoice_req: NewInvoiceRequest -} -export const AddAppUserInvoiceRequestOptionalFields: [] = [] -export type AddAppUserInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - receiver_identifier_CustomCheck?: (v: string) => boolean - payer_identifier_CustomCheck?: (v: string) => boolean - http_callback_url_CustomCheck?: (v: string) => boolean - invoice_req_Options?: NewInvoiceRequestOptions -} -export const AddAppUserInvoiceRequestValidate = (o?: AddAppUserInvoiceRequest, opts: AddAppUserInvoiceRequestOptions = {}, path: string = 'AddAppUserInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.receiver_identifier !== 'string') return new Error(`${path}.receiver_identifier: is not a string`) - if (opts.receiver_identifier_CustomCheck && !opts.receiver_identifier_CustomCheck(o.receiver_identifier)) return new Error(`${path}.receiver_identifier: custom check failed`) - - if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) - if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) - - if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) - if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) - - const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) - if (invoice_reqErr !== null) return invoice_reqErr - - - return null -} - -export type OpenChannelRequest = { - destination: string - fundingAmount: number - pushAmount: number - closeAddress: string -} -export const OpenChannelRequestOptionalFields: [] = [] -export type OpenChannelRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - destination_CustomCheck?: (v: string) => boolean - fundingAmount_CustomCheck?: (v: number) => boolean - pushAmount_CustomCheck?: (v: number) => boolean - closeAddress_CustomCheck?: (v: string) => boolean -} -export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.destination !== 'string') return new Error(`${path}.destination: is not a string`) - if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`) - - if (typeof o.fundingAmount !== 'number') return new Error(`${path}.fundingAmount: is not a number`) - if (opts.fundingAmount_CustomCheck && !opts.fundingAmount_CustomCheck(o.fundingAmount)) return new Error(`${path}.fundingAmount: custom check failed`) - - if (typeof o.pushAmount !== 'number') return new Error(`${path}.pushAmount: is not a number`) - if (opts.pushAmount_CustomCheck && !opts.pushAmount_CustomCheck(o.pushAmount)) return new Error(`${path}.pushAmount: custom check failed`) - - if (typeof o.closeAddress !== 'string') return new Error(`${path}.closeAddress: is not a string`) - if (opts.closeAddress_CustomCheck && !opts.closeAddress_CustomCheck(o.closeAddress)) return new Error(`${path}.closeAddress: custom check failed`) - - return null -} - -export type ChainBalanceEvent = { - block_height: number - confirmed_balance: number - unconfirmed_balance: number - total_balance: number -} -export const ChainBalanceEventOptionalFields: [] = [] -export type ChainBalanceEventOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - block_height_CustomCheck?: (v: number) => boolean - confirmed_balance_CustomCheck?: (v: number) => boolean - unconfirmed_balance_CustomCheck?: (v: number) => boolean - total_balance_CustomCheck?: (v: number) => boolean -} -export const ChainBalanceEventValidate = (o?: ChainBalanceEvent, opts: ChainBalanceEventOptions = {}, path: string = 'ChainBalanceEvent::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) - if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) - - if (typeof o.confirmed_balance !== 'number') return new Error(`${path}.confirmed_balance: is not a number`) - if (opts.confirmed_balance_CustomCheck && !opts.confirmed_balance_CustomCheck(o.confirmed_balance)) return new Error(`${path}.confirmed_balance: custom check failed`) - - if (typeof o.unconfirmed_balance !== 'number') return new Error(`${path}.unconfirmed_balance: is not a number`) - if (opts.unconfirmed_balance_CustomCheck && !opts.unconfirmed_balance_CustomCheck(o.unconfirmed_balance)) return new Error(`${path}.unconfirmed_balance: custom check failed`) - - if (typeof o.total_balance !== 'number') return new Error(`${path}.total_balance: is not a number`) - if (opts.total_balance_CustomCheck && !opts.total_balance_CustomCheck(o.total_balance)) return new Error(`${path}.total_balance: custom check failed`) - - return null -} - -export type LndNodeMetrics = { - channels_balance_events: ChannelBalanceEvent[] - chain_balance_events: ChainBalanceEvent[] - offline_channels: number - online_channels: number - pending_channels: number - closing_channels: number - open_channels: OpenChannel[] - closed_channels: ClosedChannel[] - channel_routing: ChannelRouting[] -} -export const LndNodeMetricsOptionalFields: [] = [] -export type LndNodeMetricsOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - channels_balance_events_ItemOptions?: ChannelBalanceEventOptions - channels_balance_events_CustomCheck?: (v: ChannelBalanceEvent[]) => boolean - chain_balance_events_ItemOptions?: ChainBalanceEventOptions - chain_balance_events_CustomCheck?: (v: ChainBalanceEvent[]) => boolean - offline_channels_CustomCheck?: (v: number) => boolean - online_channels_CustomCheck?: (v: number) => boolean - pending_channels_CustomCheck?: (v: number) => boolean - closing_channels_CustomCheck?: (v: number) => boolean - open_channels_ItemOptions?: OpenChannelOptions - open_channels_CustomCheck?: (v: OpenChannel[]) => boolean - closed_channels_ItemOptions?: ClosedChannelOptions - closed_channels_CustomCheck?: (v: ClosedChannel[]) => boolean - channel_routing_ItemOptions?: ChannelRoutingOptions - channel_routing_CustomCheck?: (v: ChannelRouting[]) => boolean -} -export const LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsOptions = {}, path: string = 'LndNodeMetrics::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!Array.isArray(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: is not an array`) - for (let index = 0; index < o.channels_balance_events.length; index++) { - const channels_balance_eventsErr = ChannelBalanceEventValidate(o.channels_balance_events[index], opts.channels_balance_events_ItemOptions, `${path}.channels_balance_events[${index}]`) - if (channels_balance_eventsErr !== null) return channels_balance_eventsErr - } - if (opts.channels_balance_events_CustomCheck && !opts.channels_balance_events_CustomCheck(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: custom check failed`) - - if (!Array.isArray(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: is not an array`) - for (let index = 0; index < o.chain_balance_events.length; index++) { - const chain_balance_eventsErr = ChainBalanceEventValidate(o.chain_balance_events[index], opts.chain_balance_events_ItemOptions, `${path}.chain_balance_events[${index}]`) - if (chain_balance_eventsErr !== null) return chain_balance_eventsErr - } - if (opts.chain_balance_events_CustomCheck && !opts.chain_balance_events_CustomCheck(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: custom check failed`) - - if (typeof o.offline_channels !== 'number') return new Error(`${path}.offline_channels: is not a number`) - if (opts.offline_channels_CustomCheck && !opts.offline_channels_CustomCheck(o.offline_channels)) return new Error(`${path}.offline_channels: custom check failed`) - - if (typeof o.online_channels !== 'number') return new Error(`${path}.online_channels: is not a number`) - if (opts.online_channels_CustomCheck && !opts.online_channels_CustomCheck(o.online_channels)) return new Error(`${path}.online_channels: custom check failed`) - - if (typeof o.pending_channels !== 'number') return new Error(`${path}.pending_channels: is not a number`) - if (opts.pending_channels_CustomCheck && !opts.pending_channels_CustomCheck(o.pending_channels)) return new Error(`${path}.pending_channels: custom check failed`) - - if (typeof o.closing_channels !== 'number') return new Error(`${path}.closing_channels: is not a number`) - if (opts.closing_channels_CustomCheck && !opts.closing_channels_CustomCheck(o.closing_channels)) return new Error(`${path}.closing_channels: custom check failed`) - - if (!Array.isArray(o.open_channels)) return new Error(`${path}.open_channels: is not an array`) - for (let index = 0; index < o.open_channels.length; index++) { - const open_channelsErr = OpenChannelValidate(o.open_channels[index], opts.open_channels_ItemOptions, `${path}.open_channels[${index}]`) - if (open_channelsErr !== null) return open_channelsErr - } - if (opts.open_channels_CustomCheck && !opts.open_channels_CustomCheck(o.open_channels)) return new Error(`${path}.open_channels: custom check failed`) - - if (!Array.isArray(o.closed_channels)) return new Error(`${path}.closed_channels: is not an array`) - for (let index = 0; index < o.closed_channels.length; index++) { - const closed_channelsErr = ClosedChannelValidate(o.closed_channels[index], opts.closed_channels_ItemOptions, `${path}.closed_channels[${index}]`) - if (closed_channelsErr !== null) return closed_channelsErr - } - if (opts.closed_channels_CustomCheck && !opts.closed_channels_CustomCheck(o.closed_channels)) return new Error(`${path}.closed_channels: custom check failed`) - - if (!Array.isArray(o.channel_routing)) return new Error(`${path}.channel_routing: is not an array`) - for (let index = 0; index < o.channel_routing.length; index++) { - const channel_routingErr = ChannelRoutingValidate(o.channel_routing[index], opts.channel_routing_ItemOptions, `${path}.channel_routing[${index}]`) - if (channel_routingErr !== null) return channel_routingErr - } - if (opts.channel_routing_CustomCheck && !opts.channel_routing_CustomCheck(o.channel_routing)) return new Error(`${path}.channel_routing: custom check failed`) - - return null -} - +// This file was autogenerated from a .proto file, DO NOT EDIT! + +export type ResultError = { status: 'ERROR', reason: string } +export type RequestInfo = { rpcName: string, batch: boolean, nostr: boolean, batchSize: number } +export type RequestStats = { startMs:number, start:bigint, parse: bigint, guard: bigint, validate: bigint, handle: bigint } +export type RequestMetric = AuthContext & RequestInfo & RequestStats & { error?: string } +export type GuestContext = { +} +export type GuestMethodInputs = Health_Input | EncryptionExchange_Input | SetMockInvoiceAsPaid_Input | GetLnurlWithdrawInfo_Input | HandleLnurlWithdraw_Input | GetLnurlPayInfo_Input | HandleLnurlPay_Input | HandleLnurlAddress_Input +export type GuestMethodOutputs = Health_Output | EncryptionExchange_Output | SetMockInvoiceAsPaid_Output | GetLnurlWithdrawInfo_Output | HandleLnurlWithdraw_Output | GetLnurlPayInfo_Output | HandleLnurlPay_Output | HandleLnurlAddress_Output +export type UserContext = { + user_id: string + app_id: string + app_user_id: string +} +export type UserMethodInputs = LinkNPubThroughToken_Input | UserHealth_Input | GetUserInfo_Input | AddProduct_Input | NewProductInvoice_Input | GetUserOperations_Input | NewAddress_Input | PayAddress_Input | NewInvoice_Input | DecodeInvoice_Input | PayInvoice_Input | OpenChannel_Input | GetLnurlWithdrawLink_Input | GetLnurlPayLink_Input | GetLNURLChannelLink_Input +export type UserMethodOutputs = LinkNPubThroughToken_Output | UserHealth_Output | GetUserInfo_Output | AddProduct_Output | NewProductInvoice_Output | GetUserOperations_Output | NewAddress_Output | PayAddress_Output | NewInvoice_Output | DecodeInvoice_Output | PayInvoice_Output | OpenChannel_Output | GetLnurlWithdrawLink_Output | GetLnurlPayLink_Output | GetLNURLChannelLink_Output +export type AdminContext = { + admin_id: string +} +export type AdminMethodInputs = LndGetInfo_Input | AddApp_Input | AuthApp_Input | BanUser_Input +export type AdminMethodOutputs = LndGetInfo_Output | AddApp_Output | AuthApp_Output | BanUser_Output +export type MetricsContext = { + operator_id: string +} +export type MetricsMethodInputs = GetUsageMetrics_Input | GetAppsMetrics_Input | GetLndMetrics_Input +export type MetricsMethodOutputs = GetUsageMetrics_Output | GetAppsMetrics_Output | GetLndMetrics_Output +export type AppContext = { + app_id: string +} +export type AppMethodInputs = GetApp_Input | AddAppUser_Input | AddAppInvoice_Input | AddAppUserInvoice_Input | GetAppUser_Input | PayAppUserInvoice_Input | SendAppUserToAppUserPayment_Input | SendAppUserToAppPayment_Input | GetAppUserLNURLInfo_Input | SetMockAppUserBalance_Input | SetMockAppBalance_Input | RequestNPubLinkingToken_Input +export type AppMethodOutputs = GetApp_Output | AddAppUser_Output | AddAppInvoice_Output | AddAppUserInvoice_Output | GetAppUser_Output | PayAppUserInvoice_Output | SendAppUserToAppUserPayment_Output | SendAppUserToAppPayment_Output | GetAppUserLNURLInfo_Output | SetMockAppUserBalance_Output | SetMockAppBalance_Output | RequestNPubLinkingToken_Output +export type AuthContext = GuestContext | UserContext | AdminContext | MetricsContext | AppContext + +export type LndGetInfo_Input = {rpcName:'LndGetInfo', req: LndGetInfoRequest} +export type LndGetInfo_Output = ResultError | ({ status: 'OK' } & LndGetInfoResponse) + +export type AddApp_Input = {rpcName:'AddApp', req: AddAppRequest} +export type AddApp_Output = ResultError | ({ status: 'OK' } & AuthApp) + +export type AuthApp_Input = {rpcName:'AuthApp', req: AuthAppRequest} +export type AuthApp_Output = ResultError | ({ status: 'OK' } & AuthApp) + +export type BanUser_Input = {rpcName:'BanUser', req: BanUserRequest} +export type BanUser_Output = ResultError | ({ status: 'OK' } & BanUserResponse) + +export type GetUsageMetrics_Input = {rpcName:'GetUsageMetrics'} +export type GetUsageMetrics_Output = ResultError | ({ status: 'OK' } & UsageMetrics) + +export type GetAppsMetrics_Input = {rpcName:'GetAppsMetrics', req: AppsMetricsRequest} +export type GetAppsMetrics_Output = ResultError | ({ status: 'OK' } & AppsMetrics) + +export type GetLndMetrics_Input = {rpcName:'GetLndMetrics', req: LndMetricsRequest} +export type GetLndMetrics_Output = ResultError | ({ status: 'OK' } & LndMetrics) + +export type Health_Input = {rpcName:'Health'} +export type Health_Output = ResultError | { status: 'OK' } + +export type EncryptionExchange_Input = {rpcName:'EncryptionExchange', req: EncryptionExchangeRequest} +export type EncryptionExchange_Output = ResultError | { status: 'OK' } + +export type SetMockInvoiceAsPaid_Input = {rpcName:'SetMockInvoiceAsPaid', req: SetMockInvoiceAsPaidRequest} +export type SetMockInvoiceAsPaid_Output = ResultError | { status: 'OK' } + +export type GetLnurlWithdrawInfo_Query = { + k1?: string +} +export type GetLnurlWithdrawInfo_Input = {rpcName:'GetLnurlWithdrawInfo', query: GetLnurlWithdrawInfo_Query} +export type GetLnurlWithdrawInfo_Output = ResultError | ({ status: 'OK' } & LnurlWithdrawInfoResponse) + +export type HandleLnurlWithdraw_Query = { + k1?: string + pr?: string +} +export type HandleLnurlWithdraw_Input = {rpcName:'HandleLnurlWithdraw', query: HandleLnurlWithdraw_Query} +export type HandleLnurlWithdraw_Output = ResultError | { status: 'OK' } + +export type GetLnurlPayInfo_Query = { + k1?: string +} +export type GetLnurlPayInfo_Input = {rpcName:'GetLnurlPayInfo', query: GetLnurlPayInfo_Query} +export type GetLnurlPayInfo_Output = ResultError | ({ status: 'OK' } & LnurlPayInfoResponse) + +export type HandleLnurlPay_Query = { + k1?: string + amount?: string + nostr?: string + lnurl?: string +} +export type HandleLnurlPay_Input = {rpcName:'HandleLnurlPay', query: HandleLnurlPay_Query} +export type HandleLnurlPay_Output = ResultError | ({ status: 'OK' } & HandleLnurlPayResponse) + +export type HandleLnurlAddress_RouteParams = { + address_name: string +} +export type HandleLnurlAddress_Input = {rpcName:'HandleLnurlAddress', params: HandleLnurlAddress_RouteParams} +export type HandleLnurlAddress_Output = ResultError | ({ status: 'OK' } & LnurlPayInfoResponse) + +export type LinkNPubThroughToken_Input = {rpcName:'LinkNPubThroughToken', req: LinkNPubThroughTokenRequest} +export type LinkNPubThroughToken_Output = ResultError | { status: 'OK' } + +export type GetApp_Input = {rpcName:'GetApp'} +export type GetApp_Output = ResultError | ({ status: 'OK' } & Application) + +export type AddAppUser_Input = {rpcName:'AddAppUser', req: AddAppUserRequest} +export type AddAppUser_Output = ResultError | ({ status: 'OK' } & AppUser) + +export type AddAppInvoice_Input = {rpcName:'AddAppInvoice', req: AddAppInvoiceRequest} +export type AddAppInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) + +export type AddAppUserInvoice_Input = {rpcName:'AddAppUserInvoice', req: AddAppUserInvoiceRequest} +export type AddAppUserInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) + +export type GetAppUser_Input = {rpcName:'GetAppUser', req: GetAppUserRequest} +export type GetAppUser_Output = ResultError | ({ status: 'OK' } & AppUser) + +export type PayAppUserInvoice_Input = {rpcName:'PayAppUserInvoice', req: PayAppUserInvoiceRequest} +export type PayAppUserInvoice_Output = ResultError | ({ status: 'OK' } & PayInvoiceResponse) + +export type SendAppUserToAppUserPayment_Input = {rpcName:'SendAppUserToAppUserPayment', req: SendAppUserToAppUserPaymentRequest} +export type SendAppUserToAppUserPayment_Output = ResultError | { status: 'OK' } + +export type SendAppUserToAppPayment_Input = {rpcName:'SendAppUserToAppPayment', req: SendAppUserToAppPaymentRequest} +export type SendAppUserToAppPayment_Output = ResultError | { status: 'OK' } + +export type GetAppUserLNURLInfo_Input = {rpcName:'GetAppUserLNURLInfo', req: GetAppUserLNURLInfoRequest} +export type GetAppUserLNURLInfo_Output = ResultError | ({ status: 'OK' } & LnurlPayInfoResponse) + +export type SetMockAppUserBalance_Input = {rpcName:'SetMockAppUserBalance', req: SetMockAppUserBalanceRequest} +export type SetMockAppUserBalance_Output = ResultError | { status: 'OK' } + +export type SetMockAppBalance_Input = {rpcName:'SetMockAppBalance', req: SetMockAppBalanceRequest} +export type SetMockAppBalance_Output = ResultError | { status: 'OK' } + +export type RequestNPubLinkingToken_Input = {rpcName:'RequestNPubLinkingToken', req: RequestNPubLinkingTokenRequest} +export type RequestNPubLinkingToken_Output = ResultError | ({ status: 'OK' } & RequestNPubLinkingTokenResponse) + +export type UserHealth_Input = {rpcName:'UserHealth'} +export type UserHealth_Output = ResultError | { status: 'OK' } + +export type GetUserInfo_Input = {rpcName:'GetUserInfo'} +export type GetUserInfo_Output = ResultError | ({ status: 'OK' } & UserInfo) + +export type AddProduct_Input = {rpcName:'AddProduct', req: AddProductRequest} +export type AddProduct_Output = ResultError | ({ status: 'OK' } & Product) + +export type NewProductInvoice_Query = { + id?: string +} +export type NewProductInvoice_Input = {rpcName:'NewProductInvoice', query: NewProductInvoice_Query} +export type NewProductInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) + +export type GetUserOperations_Input = {rpcName:'GetUserOperations', req: GetUserOperationsRequest} +export type GetUserOperations_Output = ResultError | ({ status: 'OK' } & GetUserOperationsResponse) + +export type NewAddress_Input = {rpcName:'NewAddress', req: NewAddressRequest} +export type NewAddress_Output = ResultError | ({ status: 'OK' } & NewAddressResponse) + +export type PayAddress_Input = {rpcName:'PayAddress', req: PayAddressRequest} +export type PayAddress_Output = ResultError | ({ status: 'OK' } & PayAddressResponse) + +export type NewInvoice_Input = {rpcName:'NewInvoice', req: NewInvoiceRequest} +export type NewInvoice_Output = ResultError | ({ status: 'OK' } & NewInvoiceResponse) + +export type DecodeInvoice_Input = {rpcName:'DecodeInvoice', req: DecodeInvoiceRequest} +export type DecodeInvoice_Output = ResultError | ({ status: 'OK' } & DecodeInvoiceResponse) + +export type PayInvoice_Input = {rpcName:'PayInvoice', req: PayInvoiceRequest} +export type PayInvoice_Output = ResultError | ({ status: 'OK' } & PayInvoiceResponse) + +export type OpenChannel_Input = {rpcName:'OpenChannel', req: OpenChannelRequest} +export type OpenChannel_Output = ResultError | ({ status: 'OK' } & OpenChannelResponse) + +export type GetLnurlWithdrawLink_Input = {rpcName:'GetLnurlWithdrawLink'} +export type GetLnurlWithdrawLink_Output = ResultError | ({ status: 'OK' } & LnurlLinkResponse) + +export type GetLnurlPayLink_Input = {rpcName:'GetLnurlPayLink'} +export type GetLnurlPayLink_Output = ResultError | ({ status: 'OK' } & LnurlLinkResponse) + +export type GetLNURLChannelLink_Input = {rpcName:'GetLNURLChannelLink'} +export type GetLNURLChannelLink_Output = ResultError | ({ status: 'OK' } & LnurlLinkResponse) + +export type GetLiveUserOperations_Input = {rpcName:'GetLiveUserOperations', cb:(res: LiveUserOperation, err:Error|null)=> void} +export type GetLiveUserOperations_Output = ResultError | { status: 'OK' } + +export type GetMigrationUpdate_Input = {rpcName:'GetMigrationUpdate', cb:(res: MigrationUpdate, err:Error|null)=> void} +export type GetMigrationUpdate_Output = ResultError | { status: 'OK' } + +export type GetHttpCreds_Input = {rpcName:'GetHttpCreds', cb:(res: HttpCreds, err:Error|null)=> void} +export type GetHttpCreds_Output = ResultError | { status: 'OK' } + +export type BatchUser_Input = UserMethodInputs +export type BatchUser_Output = UserMethodOutputs + +export type ServerMethods = { + LndGetInfo?: (req: LndGetInfo_Input & {ctx: AdminContext }) => Promise + AddApp?: (req: AddApp_Input & {ctx: AdminContext }) => Promise + AuthApp?: (req: AuthApp_Input & {ctx: AdminContext }) => Promise + BanUser?: (req: BanUser_Input & {ctx: AdminContext }) => Promise + GetUsageMetrics?: (req: GetUsageMetrics_Input & {ctx: MetricsContext }) => Promise + GetAppsMetrics?: (req: GetAppsMetrics_Input & {ctx: MetricsContext }) => Promise + GetLndMetrics?: (req: GetLndMetrics_Input & {ctx: MetricsContext }) => Promise + Health?: (req: Health_Input & {ctx: GuestContext }) => Promise + EncryptionExchange?: (req: EncryptionExchange_Input & {ctx: GuestContext }) => Promise + SetMockInvoiceAsPaid?: (req: SetMockInvoiceAsPaid_Input & {ctx: GuestContext }) => Promise + GetLnurlWithdrawInfo?: (req: GetLnurlWithdrawInfo_Input & {ctx: GuestContext }) => Promise + HandleLnurlWithdraw?: (req: HandleLnurlWithdraw_Input & {ctx: GuestContext }) => Promise + GetLnurlPayInfo?: (req: GetLnurlPayInfo_Input & {ctx: GuestContext }) => Promise + HandleLnurlPay?: (req: HandleLnurlPay_Input & {ctx: GuestContext }) => Promise + HandleLnurlAddress?: (req: HandleLnurlAddress_Input & {ctx: GuestContext }) => Promise + LinkNPubThroughToken?: (req: LinkNPubThroughToken_Input & {ctx: UserContext }) => Promise + GetApp?: (req: GetApp_Input & {ctx: AppContext }) => Promise + AddAppUser?: (req: AddAppUser_Input & {ctx: AppContext }) => Promise + AddAppInvoice?: (req: AddAppInvoice_Input & {ctx: AppContext }) => Promise + AddAppUserInvoice?: (req: AddAppUserInvoice_Input & {ctx: AppContext }) => Promise + GetAppUser?: (req: GetAppUser_Input & {ctx: AppContext }) => Promise + PayAppUserInvoice?: (req: PayAppUserInvoice_Input & {ctx: AppContext }) => Promise + SendAppUserToAppUserPayment?: (req: SendAppUserToAppUserPayment_Input & {ctx: AppContext }) => Promise + SendAppUserToAppPayment?: (req: SendAppUserToAppPayment_Input & {ctx: AppContext }) => Promise + GetAppUserLNURLInfo?: (req: GetAppUserLNURLInfo_Input & {ctx: AppContext }) => Promise + SetMockAppUserBalance?: (req: SetMockAppUserBalance_Input & {ctx: AppContext }) => Promise + SetMockAppBalance?: (req: SetMockAppBalance_Input & {ctx: AppContext }) => Promise + RequestNPubLinkingToken?: (req: RequestNPubLinkingToken_Input & {ctx: AppContext }) => Promise + UserHealth?: (req: UserHealth_Input & {ctx: UserContext }) => Promise + GetUserInfo?: (req: GetUserInfo_Input & {ctx: UserContext }) => Promise + AddProduct?: (req: AddProduct_Input & {ctx: UserContext }) => Promise + NewProductInvoice?: (req: NewProductInvoice_Input & {ctx: UserContext }) => Promise + GetUserOperations?: (req: GetUserOperations_Input & {ctx: UserContext }) => Promise + NewAddress?: (req: NewAddress_Input & {ctx: UserContext }) => Promise + PayAddress?: (req: PayAddress_Input & {ctx: UserContext }) => Promise + NewInvoice?: (req: NewInvoice_Input & {ctx: UserContext }) => Promise + DecodeInvoice?: (req: DecodeInvoice_Input & {ctx: UserContext }) => Promise + PayInvoice?: (req: PayInvoice_Input & {ctx: UserContext }) => Promise + OpenChannel?: (req: OpenChannel_Input & {ctx: UserContext }) => Promise + GetLnurlWithdrawLink?: (req: GetLnurlWithdrawLink_Input & {ctx: UserContext }) => Promise + GetLnurlPayLink?: (req: GetLnurlPayLink_Input & {ctx: UserContext }) => Promise + GetLNURLChannelLink?: (req: GetLNURLChannelLink_Input & {ctx: UserContext }) => Promise + GetLiveUserOperations?: (req: GetLiveUserOperations_Input & {ctx: UserContext }) => Promise + GetMigrationUpdate?: (req: GetMigrationUpdate_Input & {ctx: UserContext }) => Promise + GetHttpCreds?: (req: GetHttpCreds_Input & {ctx: UserContext }) => Promise +} + +export enum AddressType { + WITNESS_PUBKEY_HASH = 'WITNESS_PUBKEY_HASH', + NESTED_PUBKEY_HASH = 'NESTED_PUBKEY_HASH', + TAPROOT_PUBKEY = 'TAPROOT_PUBKEY', +} +const enumCheckAddressType = (e?: AddressType): boolean => { + for (const v in AddressType) if (e === v) return true + return false +} +export enum UserOperationType { + INCOMING_TX = 'INCOMING_TX', + OUTGOING_TX = 'OUTGOING_TX', + INCOMING_INVOICE = 'INCOMING_INVOICE', + OUTGOING_INVOICE = 'OUTGOING_INVOICE', + OUTGOING_USER_TO_USER = 'OUTGOING_USER_TO_USER', + INCOMING_USER_TO_USER = 'INCOMING_USER_TO_USER', +} +const enumCheckUserOperationType = (e?: UserOperationType): boolean => { + for (const v in UserOperationType) if (e === v) return true + return false +} + +export type OptionsBaseMessage = { + allOptionalsAreSet?: true +} + +export type NewAddressRequest = { + addressType: AddressType +} +export const NewAddressRequestOptionalFields: [] = [] +export type NewAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + addressType_CustomCheck?: (v: AddressType) => boolean +} +export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`) + if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`) + + return null +} + +export type LnurlPayInfoResponse = { + tag: string + callback: string + maxSendable: number + minSendable: number + metadata: string + allowsNostr: boolean + nostrPubkey: string +} +export const LnurlPayInfoResponseOptionalFields: [] = [] +export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + maxSendable_CustomCheck?: (v: number) => boolean + minSendable_CustomCheck?: (v: number) => boolean + metadata_CustomCheck?: (v: string) => boolean + allowsNostr_CustomCheck?: (v: boolean) => boolean + nostrPubkey_CustomCheck?: (v: string) => boolean +} +export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`) + if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`) + + if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`) + if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`) + + if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`) + if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`) + + if (typeof o.allowsNostr !== 'boolean') return new Error(`${path}.allowsNostr: is not a boolean`) + if (opts.allowsNostr_CustomCheck && !opts.allowsNostr_CustomCheck(o.allowsNostr)) return new Error(`${path}.allowsNostr: custom check failed`) + + if (typeof o.nostrPubkey !== 'string') return new Error(`${path}.nostrPubkey: is not a string`) + if (opts.nostrPubkey_CustomCheck && !opts.nostrPubkey_CustomCheck(o.nostrPubkey)) return new Error(`${path}.nostrPubkey: custom check failed`) + + return null +} + +export type GetProductBuyLinkResponse = { + link: string +} +export const GetProductBuyLinkResponseOptionalFields: [] = [] +export type GetProductBuyLinkResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + link_CustomCheck?: (v: string) => boolean +} +export const GetProductBuyLinkResponseValidate = (o?: GetProductBuyLinkResponse, opts: GetProductBuyLinkResponseOptions = {}, path: string = 'GetProductBuyLinkResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.link !== 'string') return new Error(`${path}.link: is not a string`) + if (opts.link_CustomCheck && !opts.link_CustomCheck(o.link)) return new Error(`${path}.link: custom check failed`) + + return null +} + +export type UsageMetrics = { + metrics: UsageMetric[] +} +export const UsageMetricsOptionalFields: [] = [] +export type UsageMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + metrics_ItemOptions?: UsageMetricOptions + metrics_CustomCheck?: (v: UsageMetric[]) => boolean +} +export const UsageMetricsValidate = (o?: UsageMetrics, opts: UsageMetricsOptions = {}, path: string = 'UsageMetrics::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!Array.isArray(o.metrics)) return new Error(`${path}.metrics: is not an array`) + for (let index = 0; index < o.metrics.length; index++) { + const metricsErr = UsageMetricValidate(o.metrics[index], opts.metrics_ItemOptions, `${path}.metrics[${index}]`) + if (metricsErr !== null) return metricsErr + } + if (opts.metrics_CustomCheck && !opts.metrics_CustomCheck(o.metrics)) return new Error(`${path}.metrics: custom check failed`) + + return null +} + +export type OpenChannel = { + channel_id: string + capacity: number + active: boolean + lifetime: number + local_balance: number + remote_balance: number +} +export const OpenChannelOptionalFields: [] = [] +export type OpenChannelOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channel_id_CustomCheck?: (v: string) => boolean + capacity_CustomCheck?: (v: number) => boolean + active_CustomCheck?: (v: boolean) => boolean + lifetime_CustomCheck?: (v: number) => boolean + local_balance_CustomCheck?: (v: number) => boolean + remote_balance_CustomCheck?: (v: number) => boolean +} +export const OpenChannelValidate = (o?: OpenChannel, opts: OpenChannelOptions = {}, path: string = 'OpenChannel::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) + if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) + + if (typeof o.active !== 'boolean') return new Error(`${path}.active: is not a boolean`) + if (opts.active_CustomCheck && !opts.active_CustomCheck(o.active)) return new Error(`${path}.active: custom check failed`) + + if (typeof o.lifetime !== 'number') return new Error(`${path}.lifetime: is not a number`) + if (opts.lifetime_CustomCheck && !opts.lifetime_CustomCheck(o.lifetime)) return new Error(`${path}.lifetime: custom check failed`) + + if (typeof o.local_balance !== 'number') return new Error(`${path}.local_balance: is not a number`) + if (opts.local_balance_CustomCheck && !opts.local_balance_CustomCheck(o.local_balance)) return new Error(`${path}.local_balance: custom check failed`) + + if (typeof o.remote_balance !== 'number') return new Error(`${path}.remote_balance: is not a number`) + if (opts.remote_balance_CustomCheck && !opts.remote_balance_CustomCheck(o.remote_balance)) return new Error(`${path}.remote_balance: custom check failed`) + + return null +} + +export type DecodeInvoiceResponse = { + amount: number +} +export const DecodeInvoiceResponseOptionalFields: [] = [] +export type DecodeInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amount_CustomCheck?: (v: number) => boolean +} +export const DecodeInvoiceResponseValidate = (o?: DecodeInvoiceResponse, opts: DecodeInvoiceResponseOptions = {}, path: string = 'DecodeInvoiceResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type UsersInfo = { + total: number + no_balance: number + negative_balance: number + always_been_inactive: number + balance_avg: number + balance_median: number +} +export const UsersInfoOptionalFields: [] = [] +export type UsersInfoOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + total_CustomCheck?: (v: number) => boolean + no_balance_CustomCheck?: (v: number) => boolean + negative_balance_CustomCheck?: (v: number) => boolean + always_been_inactive_CustomCheck?: (v: number) => boolean + balance_avg_CustomCheck?: (v: number) => boolean + balance_median_CustomCheck?: (v: number) => boolean +} +export const UsersInfoValidate = (o?: UsersInfo, opts: UsersInfoOptions = {}, path: string = 'UsersInfo::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.total !== 'number') return new Error(`${path}.total: is not a number`) + if (opts.total_CustomCheck && !opts.total_CustomCheck(o.total)) return new Error(`${path}.total: custom check failed`) + + if (typeof o.no_balance !== 'number') return new Error(`${path}.no_balance: is not a number`) + if (opts.no_balance_CustomCheck && !opts.no_balance_CustomCheck(o.no_balance)) return new Error(`${path}.no_balance: custom check failed`) + + if (typeof o.negative_balance !== 'number') return new Error(`${path}.negative_balance: is not a number`) + if (opts.negative_balance_CustomCheck && !opts.negative_balance_CustomCheck(o.negative_balance)) return new Error(`${path}.negative_balance: custom check failed`) + + if (typeof o.always_been_inactive !== 'number') return new Error(`${path}.always_been_inactive: is not a number`) + if (opts.always_been_inactive_CustomCheck && !opts.always_been_inactive_CustomCheck(o.always_been_inactive)) return new Error(`${path}.always_been_inactive: custom check failed`) + + if (typeof o.balance_avg !== 'number') return new Error(`${path}.balance_avg: is not a number`) + if (opts.balance_avg_CustomCheck && !opts.balance_avg_CustomCheck(o.balance_avg)) return new Error(`${path}.balance_avg: custom check failed`) + + if (typeof o.balance_median !== 'number') return new Error(`${path}.balance_median: is not a number`) + if (opts.balance_median_CustomCheck && !opts.balance_median_CustomCheck(o.balance_median)) return new Error(`${path}.balance_median: custom check failed`) + + return null +} + +export type AddAppRequest = { + name: string + allow_user_creation: boolean +} +export const AddAppRequestOptionalFields: [] = [] +export type AddAppRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + allow_user_creation_CustomCheck?: (v: boolean) => boolean +} +export const AddAppRequestValidate = (o?: AddAppRequest, opts: AddAppRequestOptions = {}, path: string = 'AddAppRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) + if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) + + return null +} + +export type LndMetrics = { + nodes: LndNodeMetrics[] +} +export const LndMetricsOptionalFields: [] = [] +export type LndMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + nodes_ItemOptions?: LndNodeMetricsOptions + nodes_CustomCheck?: (v: LndNodeMetrics[]) => boolean +} +export const LndMetricsValidate = (o?: LndMetrics, opts: LndMetricsOptions = {}, path: string = 'LndMetrics::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!Array.isArray(o.nodes)) return new Error(`${path}.nodes: is not an array`) + for (let index = 0; index < o.nodes.length; index++) { + const nodesErr = LndNodeMetricsValidate(o.nodes[index], opts.nodes_ItemOptions, `${path}.nodes[${index}]`) + if (nodesErr !== null) return nodesErr + } + if (opts.nodes_CustomCheck && !opts.nodes_CustomCheck(o.nodes)) return new Error(`${path}.nodes: custom check failed`) + + return null +} + +export type AddProductRequest = { + name: string + price_sats: number +} +export const AddProductRequestOptionalFields: [] = [] +export type AddProductRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + price_sats_CustomCheck?: (v: number) => boolean +} +export const AddProductRequestValidate = (o?: AddProductRequest, opts: AddProductRequestOptions = {}, path: string = 'AddProductRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) + if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) + + return null +} + +export type PayInvoiceResponse = { + preimage: string + amount_paid: number + operation_id: string + service_fee: number + network_fee: number +} +export const PayInvoiceResponseOptionalFields: [] = [] +export type PayInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + preimage_CustomCheck?: (v: string) => boolean + amount_paid_CustomCheck?: (v: number) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean +} +export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) + if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) + + if (typeof o.amount_paid !== 'number') return new Error(`${path}.amount_paid: is not a number`) + if (opts.amount_paid_CustomCheck && !opts.amount_paid_CustomCheck(o.amount_paid)) return new Error(`${path}.amount_paid: custom check failed`) + + if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) + if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + return null +} + +export type UserInfo = { + userId: string + balance: number + max_withdrawable: number + user_identifier: string +} +export const UserInfoOptionalFields: [] = [] +export type UserInfoOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + userId_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => boolean + max_withdrawable_CustomCheck?: (v: number) => boolean + user_identifier_CustomCheck?: (v: string) => boolean +} +export const UserInfoValidate = (o?: UserInfo, opts: UserInfoOptions = {}, path: string = 'UserInfo::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.userId !== 'string') return new Error(`${path}.userId: is not a string`) + if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: custom check failed`) + + if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) + if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) + + if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) + if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + return null +} + +export type MigrationUpdate = { + closure?: ClosureMigration + relays?: RelaysMigration +} +export type MigrationUpdateOptionalField = 'closure' | 'relays' +export const MigrationUpdateOptionalFields: MigrationUpdateOptionalField[] = ['closure', 'relays'] +export type MigrationUpdateOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: MigrationUpdateOptionalField[] + closure_Options?: ClosureMigrationOptions + relays_Options?: RelaysMigrationOptions +} +export const MigrationUpdateValidate = (o?: MigrationUpdate, opts: MigrationUpdateOptions = {}, path: string = 'MigrationUpdate::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.closure === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('closure')) { + const closureErr = ClosureMigrationValidate(o.closure, opts.closure_Options, `${path}.closure`) + if (closureErr !== null) return closureErr + } + + + if (typeof o.relays === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('relays')) { + const relaysErr = RelaysMigrationValidate(o.relays, opts.relays_Options, `${path}.relays`) + if (relaysErr !== null) return relaysErr + } + + + return null +} + +export type LinkNPubThroughTokenRequest = { + token: string + nostr_pub: string +} +export const LinkNPubThroughTokenRequestOptionalFields: [] = [] +export type LinkNPubThroughTokenRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + token_CustomCheck?: (v: string) => boolean + nostr_pub_CustomCheck?: (v: string) => boolean +} +export const LinkNPubThroughTokenRequestValidate = (o?: LinkNPubThroughTokenRequest, opts: LinkNPubThroughTokenRequestOptions = {}, path: string = 'LinkNPubThroughTokenRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.token !== 'string') return new Error(`${path}.token: is not a string`) + if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) + + if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) + if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) + + return null +} + +export type Empty = { +} +export const EmptyOptionalFields: [] = [] +export type EmptyOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] +} +export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + return null +} + +export type ChannelRouting = { + channel_id: string + send_errors: number + receive_errors: number + forward_errors_as_input: number + forward_errors_as_output: number + missed_forward_fee_as_input: number + missed_forward_fee_as_output: number + forward_fee_as_input: number + forward_fee_as_output: number + events_number: number +} +export const ChannelRoutingOptionalFields: [] = [] +export type ChannelRoutingOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channel_id_CustomCheck?: (v: string) => boolean + send_errors_CustomCheck?: (v: number) => boolean + receive_errors_CustomCheck?: (v: number) => boolean + forward_errors_as_input_CustomCheck?: (v: number) => boolean + forward_errors_as_output_CustomCheck?: (v: number) => boolean + missed_forward_fee_as_input_CustomCheck?: (v: number) => boolean + missed_forward_fee_as_output_CustomCheck?: (v: number) => boolean + forward_fee_as_input_CustomCheck?: (v: number) => boolean + forward_fee_as_output_CustomCheck?: (v: number) => boolean + events_number_CustomCheck?: (v: number) => boolean +} +export const ChannelRoutingValidate = (o?: ChannelRouting, opts: ChannelRoutingOptions = {}, path: string = 'ChannelRouting::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.send_errors !== 'number') return new Error(`${path}.send_errors: is not a number`) + if (opts.send_errors_CustomCheck && !opts.send_errors_CustomCheck(o.send_errors)) return new Error(`${path}.send_errors: custom check failed`) + + if (typeof o.receive_errors !== 'number') return new Error(`${path}.receive_errors: is not a number`) + if (opts.receive_errors_CustomCheck && !opts.receive_errors_CustomCheck(o.receive_errors)) return new Error(`${path}.receive_errors: custom check failed`) + + if (typeof o.forward_errors_as_input !== 'number') return new Error(`${path}.forward_errors_as_input: is not a number`) + if (opts.forward_errors_as_input_CustomCheck && !opts.forward_errors_as_input_CustomCheck(o.forward_errors_as_input)) return new Error(`${path}.forward_errors_as_input: custom check failed`) + + if (typeof o.forward_errors_as_output !== 'number') return new Error(`${path}.forward_errors_as_output: is not a number`) + if (opts.forward_errors_as_output_CustomCheck && !opts.forward_errors_as_output_CustomCheck(o.forward_errors_as_output)) return new Error(`${path}.forward_errors_as_output: custom check failed`) + + if (typeof o.missed_forward_fee_as_input !== 'number') return new Error(`${path}.missed_forward_fee_as_input: is not a number`) + if (opts.missed_forward_fee_as_input_CustomCheck && !opts.missed_forward_fee_as_input_CustomCheck(o.missed_forward_fee_as_input)) return new Error(`${path}.missed_forward_fee_as_input: custom check failed`) + + if (typeof o.missed_forward_fee_as_output !== 'number') return new Error(`${path}.missed_forward_fee_as_output: is not a number`) + if (opts.missed_forward_fee_as_output_CustomCheck && !opts.missed_forward_fee_as_output_CustomCheck(o.missed_forward_fee_as_output)) return new Error(`${path}.missed_forward_fee_as_output: custom check failed`) + + if (typeof o.forward_fee_as_input !== 'number') return new Error(`${path}.forward_fee_as_input: is not a number`) + if (opts.forward_fee_as_input_CustomCheck && !opts.forward_fee_as_input_CustomCheck(o.forward_fee_as_input)) return new Error(`${path}.forward_fee_as_input: custom check failed`) + + if (typeof o.forward_fee_as_output !== 'number') return new Error(`${path}.forward_fee_as_output: is not a number`) + if (opts.forward_fee_as_output_CustomCheck && !opts.forward_fee_as_output_CustomCheck(o.forward_fee_as_output)) return new Error(`${path}.forward_fee_as_output: custom check failed`) + + if (typeof o.events_number !== 'number') return new Error(`${path}.events_number: is not a number`) + if (opts.events_number_CustomCheck && !opts.events_number_CustomCheck(o.events_number)) return new Error(`${path}.events_number: custom check failed`) + + return null +} + +export type PayAddressRequest = { + address: string + amoutSats: number + satsPerVByte: number +} +export const PayAddressRequestOptionalFields: [] = [] +export type PayAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean + amoutSats_CustomCheck?: (v: number) => boolean + satsPerVByte_CustomCheck?: (v: number) => boolean +} +export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) + if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) + + if (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`) + if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`) + + if (typeof o.satsPerVByte !== 'number') return new Error(`${path}.satsPerVByte: is not a number`) + if (opts.satsPerVByte_CustomCheck && !opts.satsPerVByte_CustomCheck(o.satsPerVByte)) return new Error(`${path}.satsPerVByte: custom check failed`) + + return null +} + +export type PayAddressResponse = { + txId: string + operation_id: string + service_fee: number + network_fee: number +} +export const PayAddressResponseOptionalFields: [] = [] +export type PayAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + txId_CustomCheck?: (v: string) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean +} +export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.txId !== 'string') return new Error(`${path}.txId: is not a string`) + if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`) + + if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) + if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + return null +} + +export type AuthApp = { + app: Application + auth_token: string +} +export const AuthAppOptionalFields: [] = [] +export type AuthAppOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + app_Options?: ApplicationOptions + auth_token_CustomCheck?: (v: string) => boolean +} +export const AuthAppValidate = (o?: AuthApp, opts: AuthAppOptions = {}, path: string = 'AuthApp::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) + if (appErr !== null) return appErr + + + if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) + if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) + + return null +} + +export type AppMetrics = { + app: Application + users: UsersInfo + received: number + spent: number + available: number + fees: number + invoices: number + total_fees: number + operations: UserOperation[] +} +export const AppMetricsOptionalFields: [] = [] +export type AppMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + app_Options?: ApplicationOptions + users_Options?: UsersInfoOptions + received_CustomCheck?: (v: number) => boolean + spent_CustomCheck?: (v: number) => boolean + available_CustomCheck?: (v: number) => boolean + fees_CustomCheck?: (v: number) => boolean + invoices_CustomCheck?: (v: number) => boolean + total_fees_CustomCheck?: (v: number) => boolean + operations_ItemOptions?: UserOperationOptions + operations_CustomCheck?: (v: UserOperation[]) => boolean +} +export const AppMetricsValidate = (o?: AppMetrics, opts: AppMetricsOptions = {}, path: string = 'AppMetrics::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) + if (appErr !== null) return appErr + + + const usersErr = UsersInfoValidate(o.users, opts.users_Options, `${path}.users`) + if (usersErr !== null) return usersErr + + + if (typeof o.received !== 'number') return new Error(`${path}.received: is not a number`) + if (opts.received_CustomCheck && !opts.received_CustomCheck(o.received)) return new Error(`${path}.received: custom check failed`) + + if (typeof o.spent !== 'number') return new Error(`${path}.spent: is not a number`) + if (opts.spent_CustomCheck && !opts.spent_CustomCheck(o.spent)) return new Error(`${path}.spent: custom check failed`) + + if (typeof o.available !== 'number') return new Error(`${path}.available: is not a number`) + if (opts.available_CustomCheck && !opts.available_CustomCheck(o.available)) return new Error(`${path}.available: custom check failed`) + + if (typeof o.fees !== 'number') return new Error(`${path}.fees: is not a number`) + if (opts.fees_CustomCheck && !opts.fees_CustomCheck(o.fees)) return new Error(`${path}.fees: custom check failed`) + + if (typeof o.invoices !== 'number') return new Error(`${path}.invoices: is not a number`) + if (opts.invoices_CustomCheck && !opts.invoices_CustomCheck(o.invoices)) return new Error(`${path}.invoices: custom check failed`) + + if (typeof o.total_fees !== 'number') return new Error(`${path}.total_fees: is not a number`) + if (opts.total_fees_CustomCheck && !opts.total_fees_CustomCheck(o.total_fees)) return new Error(`${path}.total_fees: custom check failed`) + + if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) + for (let index = 0; index < o.operations.length; index++) { + const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) + if (operationsErr !== null) return operationsErr + } + if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) + + return null +} + +export type BanUserResponse = { + balance_sats: number + banned_app_users: BannedAppUser[] +} +export const BanUserResponseOptionalFields: [] = [] +export type BanUserResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + balance_sats_CustomCheck?: (v: number) => boolean + banned_app_users_ItemOptions?: BannedAppUserOptions + banned_app_users_CustomCheck?: (v: BannedAppUser[]) => boolean +} +export const BanUserResponseValidate = (o?: BanUserResponse, opts: BanUserResponseOptions = {}, path: string = 'BanUserResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.balance_sats !== 'number') return new Error(`${path}.balance_sats: is not a number`) + if (opts.balance_sats_CustomCheck && !opts.balance_sats_CustomCheck(o.balance_sats)) return new Error(`${path}.balance_sats: custom check failed`) + + if (!Array.isArray(o.banned_app_users)) return new Error(`${path}.banned_app_users: is not an array`) + for (let index = 0; index < o.banned_app_users.length; index++) { + const banned_app_usersErr = BannedAppUserValidate(o.banned_app_users[index], opts.banned_app_users_ItemOptions, `${path}.banned_app_users[${index}]`) + if (banned_app_usersErr !== null) return banned_app_usersErr + } + if (opts.banned_app_users_CustomCheck && !opts.banned_app_users_CustomCheck(o.banned_app_users)) return new Error(`${path}.banned_app_users: custom check failed`) + + return null +} + +export type GetAppUserRequest = { + user_identifier: string +} +export const GetAppUserRequestOptionalFields: [] = [] +export type GetAppUserRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean +} +export const GetAppUserRequestValidate = (o?: GetAppUserRequest, opts: GetAppUserRequestOptions = {}, path: string = 'GetAppUserRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + return null +} + +export type SetMockAppBalanceRequest = { + amount: number +} +export const SetMockAppBalanceRequestOptionalFields: [] = [] +export type SetMockAppBalanceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, opts: SetMockAppBalanceRequestOptions = {}, path: string = 'SetMockAppBalanceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type DecodeInvoiceRequest = { + invoice: string +} +export const DecodeInvoiceRequestOptionalFields: [] = [] +export type DecodeInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean +} +export const DecodeInvoiceRequestValidate = (o?: DecodeInvoiceRequest, opts: DecodeInvoiceRequestOptions = {}, path: string = 'DecodeInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + return null +} + +export type RequestNPubLinkingTokenResponse = { + token: string +} +export const RequestNPubLinkingTokenResponseOptionalFields: [] = [] +export type RequestNPubLinkingTokenResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + token_CustomCheck?: (v: string) => boolean +} +export const RequestNPubLinkingTokenResponseValidate = (o?: RequestNPubLinkingTokenResponse, opts: RequestNPubLinkingTokenResponseOptions = {}, path: string = 'RequestNPubLinkingTokenResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.token !== 'string') return new Error(`${path}.token: is not a string`) + if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) + + return null +} + +export type LndMetricsRequest = { + from_unix?: number + to_unix?: number +} +export type LndMetricsRequestOptionalField = 'from_unix' | 'to_unix' +export const LndMetricsRequestOptionalFields: LndMetricsRequestOptionalField[] = ['from_unix', 'to_unix'] +export type LndMetricsRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: LndMetricsRequestOptionalField[] + from_unix_CustomCheck?: (v?: number) => boolean + to_unix_CustomCheck?: (v?: number) => boolean +} +export const LndMetricsRequestValidate = (o?: LndMetricsRequest, opts: LndMetricsRequestOptions = {}, path: string = 'LndMetricsRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) + if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) + + if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) + if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) + + return null +} + +export type BannedAppUser = { + app_name: string + app_id: string + user_identifier: string + nostr_pub: string +} +export const BannedAppUserOptionalFields: [] = [] +export type BannedAppUserOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + app_name_CustomCheck?: (v: string) => boolean + app_id_CustomCheck?: (v: string) => boolean + user_identifier_CustomCheck?: (v: string) => boolean + nostr_pub_CustomCheck?: (v: string) => boolean +} +export const BannedAppUserValidate = (o?: BannedAppUser, opts: BannedAppUserOptions = {}, path: string = 'BannedAppUser::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.app_name !== 'string') return new Error(`${path}.app_name: is not a string`) + if (opts.app_name_CustomCheck && !opts.app_name_CustomCheck(o.app_name)) return new Error(`${path}.app_name: custom check failed`) + + if (typeof o.app_id !== 'string') return new Error(`${path}.app_id: is not a string`) + if (opts.app_id_CustomCheck && !opts.app_id_CustomCheck(o.app_id)) return new Error(`${path}.app_id: custom check failed`) + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.nostr_pub !== 'string') return new Error(`${path}.nostr_pub: is not a string`) + if (opts.nostr_pub_CustomCheck && !opts.nostr_pub_CustomCheck(o.nostr_pub)) return new Error(`${path}.nostr_pub: custom check failed`) + + return null +} + +export type SetMockAppUserBalanceRequest = { + user_identifier: string + amount: number +} +export const SetMockAppUserBalanceRequestOptionalFields: [] = [] +export type SetMockAppUserBalanceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockAppUserBalanceRequestValidate = (o?: SetMockAppUserBalanceRequest, opts: SetMockAppUserBalanceRequestOptions = {}, path: string = 'SetMockAppUserBalanceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type PayInvoiceRequest = { + invoice: string + amount: number +} +export const PayInvoiceRequestOptionalFields: [] = [] +export type PayInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type LndGetInfoRequest = { + nodeId: number +} +export const LndGetInfoRequestOptionalFields: [] = [] +export type LndGetInfoRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + nodeId_CustomCheck?: (v: number) => boolean +} +export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.nodeId !== 'number') return new Error(`${path}.nodeId: is not a number`) + if (opts.nodeId_CustomCheck && !opts.nodeId_CustomCheck(o.nodeId)) return new Error(`${path}.nodeId: custom check failed`) + + return null +} + +export type AppUser = { + identifier: string + info: UserInfo + max_withdrawable: number +} +export const AppUserOptionalFields: [] = [] +export type AppUserOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + identifier_CustomCheck?: (v: string) => boolean + info_Options?: UserInfoOptions + max_withdrawable_CustomCheck?: (v: number) => boolean +} +export const AppUserValidate = (o?: AppUser, opts: AppUserOptions = {}, path: string = 'AppUser::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) + if (infoErr !== null) return infoErr + + + if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) + if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) + + return null +} + +export type AddAppUserRequest = { + identifier: string + fail_if_exists: boolean + balance: number +} +export const AddAppUserRequestOptionalFields: [] = [] +export type AddAppUserRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + identifier_CustomCheck?: (v: string) => boolean + fail_if_exists_CustomCheck?: (v: boolean) => boolean + balance_CustomCheck?: (v: number) => boolean +} +export const AddAppUserRequestValidate = (o?: AddAppUserRequest, opts: AddAppUserRequestOptions = {}, path: string = 'AddAppUserRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + if (typeof o.fail_if_exists !== 'boolean') return new Error(`${path}.fail_if_exists: is not a boolean`) + if (opts.fail_if_exists_CustomCheck && !opts.fail_if_exists_CustomCheck(o.fail_if_exists)) return new Error(`${path}.fail_if_exists: custom check failed`) + + if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) + if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) + + return null +} + +export type NewInvoiceResponse = { + invoice: string +} +export const NewInvoiceResponseOptionalFields: [] = [] +export type NewInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean +} +export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + return null +} + +export type NewAddressResponse = { + address: string +} +export const NewAddressResponseOptionalFields: [] = [] +export type NewAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean +} +export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) + if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) + + return null +} + +export type AppsMetrics = { + apps: AppMetrics[] +} +export const AppsMetricsOptionalFields: [] = [] +export type AppsMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + apps_ItemOptions?: AppMetricsOptions + apps_CustomCheck?: (v: AppMetrics[]) => boolean +} +export const AppsMetricsValidate = (o?: AppsMetrics, opts: AppsMetricsOptions = {}, path: string = 'AppsMetrics::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!Array.isArray(o.apps)) return new Error(`${path}.apps: is not an array`) + for (let index = 0; index < o.apps.length; index++) { + const appsErr = AppMetricsValidate(o.apps[index], opts.apps_ItemOptions, `${path}.apps[${index}]`) + if (appsErr !== null) return appsErr + } + if (opts.apps_CustomCheck && !opts.apps_CustomCheck(o.apps)) return new Error(`${path}.apps: custom check failed`) + + return null +} + +export type LndGetInfoResponse = { + alias: string +} +export const LndGetInfoResponseOptionalFields: [] = [] +export type LndGetInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + alias_CustomCheck?: (v: string) => boolean +} +export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.alias !== 'string') return new Error(`${path}.alias: is not a string`) + if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`) + + return null +} + +export type SendAppUserToAppPaymentRequest = { + from_user_identifier: string + amount: number +} +export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] +export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + from_user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SendAppUserToAppPaymentRequestValidate = (o?: SendAppUserToAppPaymentRequest, opts: SendAppUserToAppPaymentRequestOptions = {}, path: string = 'SendAppUserToAppPaymentRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) + if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type GetUserOperationsRequest = { + latestIncomingInvoice: number + latestOutgoingInvoice: number + latestIncomingTx: number + latestOutgoingTx: number + latestIncomingUserToUserPayment: number + latestOutgoingUserToUserPayment: number + max_size: number +} +export const GetUserOperationsRequestOptionalFields: [] = [] +export type GetUserOperationsRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + latestIncomingInvoice_CustomCheck?: (v: number) => boolean + latestOutgoingInvoice_CustomCheck?: (v: number) => boolean + latestIncomingTx_CustomCheck?: (v: number) => boolean + latestOutgoingTx_CustomCheck?: (v: number) => boolean + latestIncomingUserToUserPayment_CustomCheck?: (v: number) => boolean + latestOutgoingUserToUserPayment_CustomCheck?: (v: number) => boolean + max_size_CustomCheck?: (v: number) => boolean +} +export const GetUserOperationsRequestValidate = (o?: GetUserOperationsRequest, opts: GetUserOperationsRequestOptions = {}, path: string = 'GetUserOperationsRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.latestIncomingInvoice !== 'number') return new Error(`${path}.latestIncomingInvoice: is not a number`) + if (opts.latestIncomingInvoice_CustomCheck && !opts.latestIncomingInvoice_CustomCheck(o.latestIncomingInvoice)) return new Error(`${path}.latestIncomingInvoice: custom check failed`) + + if (typeof o.latestOutgoingInvoice !== 'number') return new Error(`${path}.latestOutgoingInvoice: is not a number`) + if (opts.latestOutgoingInvoice_CustomCheck && !opts.latestOutgoingInvoice_CustomCheck(o.latestOutgoingInvoice)) return new Error(`${path}.latestOutgoingInvoice: custom check failed`) + + if (typeof o.latestIncomingTx !== 'number') return new Error(`${path}.latestIncomingTx: is not a number`) + if (opts.latestIncomingTx_CustomCheck && !opts.latestIncomingTx_CustomCheck(o.latestIncomingTx)) return new Error(`${path}.latestIncomingTx: custom check failed`) + + if (typeof o.latestOutgoingTx !== 'number') return new Error(`${path}.latestOutgoingTx: is not a number`) + if (opts.latestOutgoingTx_CustomCheck && !opts.latestOutgoingTx_CustomCheck(o.latestOutgoingTx)) return new Error(`${path}.latestOutgoingTx: custom check failed`) + + if (typeof o.latestIncomingUserToUserPayment !== 'number') return new Error(`${path}.latestIncomingUserToUserPayment: is not a number`) + if (opts.latestIncomingUserToUserPayment_CustomCheck && !opts.latestIncomingUserToUserPayment_CustomCheck(o.latestIncomingUserToUserPayment)) return new Error(`${path}.latestIncomingUserToUserPayment: custom check failed`) + + if (typeof o.latestOutgoingUserToUserPayment !== 'number') return new Error(`${path}.latestOutgoingUserToUserPayment: is not a number`) + if (opts.latestOutgoingUserToUserPayment_CustomCheck && !opts.latestOutgoingUserToUserPayment_CustomCheck(o.latestOutgoingUserToUserPayment)) return new Error(`${path}.latestOutgoingUserToUserPayment: custom check failed`) + + if (typeof o.max_size !== 'number') return new Error(`${path}.max_size: is not a number`) + if (opts.max_size_CustomCheck && !opts.max_size_CustomCheck(o.max_size)) return new Error(`${path}.max_size: custom check failed`) + + return null +} + +export type GetUserOperationsResponse = { + latestOutgoingInvoiceOperations: UserOperations + latestIncomingInvoiceOperations: UserOperations + latestOutgoingTxOperations: UserOperations + latestIncomingTxOperations: UserOperations + latestOutgoingUserToUserPayemnts: UserOperations + latestIncomingUserToUserPayemnts: UserOperations +} +export const GetUserOperationsResponseOptionalFields: [] = [] +export type GetUserOperationsResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + latestOutgoingInvoiceOperations_Options?: UserOperationsOptions + latestIncomingInvoiceOperations_Options?: UserOperationsOptions + latestOutgoingTxOperations_Options?: UserOperationsOptions + latestIncomingTxOperations_Options?: UserOperationsOptions + latestOutgoingUserToUserPayemnts_Options?: UserOperationsOptions + latestIncomingUserToUserPayemnts_Options?: UserOperationsOptions +} +export const GetUserOperationsResponseValidate = (o?: GetUserOperationsResponse, opts: GetUserOperationsResponseOptions = {}, path: string = 'GetUserOperationsResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + const latestOutgoingInvoiceOperationsErr = UserOperationsValidate(o.latestOutgoingInvoiceOperations, opts.latestOutgoingInvoiceOperations_Options, `${path}.latestOutgoingInvoiceOperations`) + if (latestOutgoingInvoiceOperationsErr !== null) return latestOutgoingInvoiceOperationsErr + + + const latestIncomingInvoiceOperationsErr = UserOperationsValidate(o.latestIncomingInvoiceOperations, opts.latestIncomingInvoiceOperations_Options, `${path}.latestIncomingInvoiceOperations`) + if (latestIncomingInvoiceOperationsErr !== null) return latestIncomingInvoiceOperationsErr + + + const latestOutgoingTxOperationsErr = UserOperationsValidate(o.latestOutgoingTxOperations, opts.latestOutgoingTxOperations_Options, `${path}.latestOutgoingTxOperations`) + if (latestOutgoingTxOperationsErr !== null) return latestOutgoingTxOperationsErr + + + const latestIncomingTxOperationsErr = UserOperationsValidate(o.latestIncomingTxOperations, opts.latestIncomingTxOperations_Options, `${path}.latestIncomingTxOperations`) + if (latestIncomingTxOperationsErr !== null) return latestIncomingTxOperationsErr + + + const latestOutgoingUserToUserPayemntsErr = UserOperationsValidate(o.latestOutgoingUserToUserPayemnts, opts.latestOutgoingUserToUserPayemnts_Options, `${path}.latestOutgoingUserToUserPayemnts`) + if (latestOutgoingUserToUserPayemntsErr !== null) return latestOutgoingUserToUserPayemntsErr + + + const latestIncomingUserToUserPayemntsErr = UserOperationsValidate(o.latestIncomingUserToUserPayemnts, opts.latestIncomingUserToUserPayemnts_Options, `${path}.latestIncomingUserToUserPayemnts`) + if (latestIncomingUserToUserPayemntsErr !== null) return latestIncomingUserToUserPayemntsErr + + + return null +} + +export type BanUserRequest = { + user_id: string +} +export const BanUserRequestOptionalFields: [] = [] +export type BanUserRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_id_CustomCheck?: (v: string) => boolean +} +export const BanUserRequestValidate = (o?: BanUserRequest, opts: BanUserRequestOptions = {}, path: string = 'BanUserRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) + if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) + + return null +} + +export type SendAppUserToAppUserPaymentRequest = { + from_user_identifier: string + to_user_identifier: string + amount: number +} +export const SendAppUserToAppUserPaymentRequestOptionalFields: [] = [] +export type SendAppUserToAppUserPaymentRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + from_user_identifier_CustomCheck?: (v: string) => boolean + to_user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SendAppUserToAppUserPaymentRequestValidate = (o?: SendAppUserToAppUserPaymentRequest, opts: SendAppUserToAppUserPaymentRequestOptions = {}, path: string = 'SendAppUserToAppUserPaymentRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) + if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) + + if (typeof o.to_user_identifier !== 'string') return new Error(`${path}.to_user_identifier: is not a string`) + if (opts.to_user_identifier_CustomCheck && !opts.to_user_identifier_CustomCheck(o.to_user_identifier)) return new Error(`${path}.to_user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type AddAppInvoiceRequest = { + payer_identifier: string + http_callback_url: string + invoice_req: NewInvoiceRequest +} +export const AddAppInvoiceRequestOptionalFields: [] = [] +export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + payer_identifier_CustomCheck?: (v: string) => boolean + http_callback_url_CustomCheck?: (v: string) => boolean + invoice_req_Options?: NewInvoiceRequestOptions +} +export const AddAppInvoiceRequestValidate = (o?: AddAppInvoiceRequest, opts: AddAppInvoiceRequestOptions = {}, path: string = 'AddAppInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) + if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) + + if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) + if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) + + const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) + if (invoice_reqErr !== null) return invoice_reqErr + + + return null +} + +export type GetAppUserLNURLInfoRequest = { + user_identifier: string + base_url_override: string +} +export const GetAppUserLNURLInfoRequestOptionalFields: [] = [] +export type GetAppUserLNURLInfoRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + base_url_override_CustomCheck?: (v: string) => boolean +} +export const GetAppUserLNURLInfoRequestValidate = (o?: GetAppUserLNURLInfoRequest, opts: GetAppUserLNURLInfoRequestOptions = {}, path: string = 'GetAppUserLNURLInfoRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.base_url_override !== 'string') return new Error(`${path}.base_url_override: is not a string`) + if (opts.base_url_override_CustomCheck && !opts.base_url_override_CustomCheck(o.base_url_override)) return new Error(`${path}.base_url_override: custom check failed`) + + return null +} + +export type LnurlLinkResponse = { + lnurl: string + k1: string +} +export const LnurlLinkResponseOptionalFields: [] = [] +export type LnurlLinkResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + lnurl_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean +} +export const LnurlLinkResponseValidate = (o?: LnurlLinkResponse, opts: LnurlLinkResponseOptions = {}, path: string = 'LnurlLinkResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.lnurl !== 'string') return new Error(`${path}.lnurl: is not a string`) + if (opts.lnurl_CustomCheck && !opts.lnurl_CustomCheck(o.lnurl)) return new Error(`${path}.lnurl: custom check failed`) + + if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) + if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) + + return null +} + +export type LnurlWithdrawInfoResponse = { + tag: string + callback: string + k1: string + defaultDescription: string + minWithdrawable: number + maxWithdrawable: number + balanceCheck: string + payLink: string +} +export const LnurlWithdrawInfoResponseOptionalFields: [] = [] +export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean + defaultDescription_CustomCheck?: (v: string) => boolean + minWithdrawable_CustomCheck?: (v: number) => boolean + maxWithdrawable_CustomCheck?: (v: number) => boolean + balanceCheck_CustomCheck?: (v: string) => boolean + payLink_CustomCheck?: (v: string) => boolean +} +export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) + if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) + + if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`) + if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`) + + if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`) + if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`) + + if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`) + if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`) + + if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`) + if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`) + + if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`) + if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`) + + return null +} + +export type UserOperation = { + paidAtUnix: number + type: UserOperationType + inbound: boolean + amount: number + identifier: string + operationId: string + service_fee: number + network_fee: number + confirmed: boolean + tx_hash: string + internal: boolean +} +export const UserOperationOptionalFields: [] = [] +export type UserOperationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + paidAtUnix_CustomCheck?: (v: number) => boolean + type_CustomCheck?: (v: UserOperationType) => boolean + inbound_CustomCheck?: (v: boolean) => boolean + amount_CustomCheck?: (v: number) => boolean + identifier_CustomCheck?: (v: string) => boolean + operationId_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean + confirmed_CustomCheck?: (v: boolean) => boolean + tx_hash_CustomCheck?: (v: string) => boolean + internal_CustomCheck?: (v: boolean) => boolean +} +export const UserOperationValidate = (o?: UserOperation, opts: UserOperationOptions = {}, path: string = 'UserOperation::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.paidAtUnix !== 'number') return new Error(`${path}.paidAtUnix: is not a number`) + if (opts.paidAtUnix_CustomCheck && !opts.paidAtUnix_CustomCheck(o.paidAtUnix)) return new Error(`${path}.paidAtUnix: custom check failed`) + + if (!enumCheckUserOperationType(o.type)) return new Error(`${path}.type: is not a valid UserOperationType`) + if (opts.type_CustomCheck && !opts.type_CustomCheck(o.type)) return new Error(`${path}.type: custom check failed`) + + if (typeof o.inbound !== 'boolean') return new Error(`${path}.inbound: is not a boolean`) + if (opts.inbound_CustomCheck && !opts.inbound_CustomCheck(o.inbound)) return new Error(`${path}.inbound: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + if (typeof o.operationId !== 'string') return new Error(`${path}.operationId: is not a string`) + if (opts.operationId_CustomCheck && !opts.operationId_CustomCheck(o.operationId)) return new Error(`${path}.operationId: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + if (typeof o.confirmed !== 'boolean') return new Error(`${path}.confirmed: is not a boolean`) + if (opts.confirmed_CustomCheck && !opts.confirmed_CustomCheck(o.confirmed)) return new Error(`${path}.confirmed: custom check failed`) + + if (typeof o.tx_hash !== 'string') return new Error(`${path}.tx_hash: is not a string`) + if (opts.tx_hash_CustomCheck && !opts.tx_hash_CustomCheck(o.tx_hash)) return new Error(`${path}.tx_hash: custom check failed`) + + if (typeof o.internal !== 'boolean') return new Error(`${path}.internal: is not a boolean`) + if (opts.internal_CustomCheck && !opts.internal_CustomCheck(o.internal)) return new Error(`${path}.internal: custom check failed`) + + return null +} + +export type ClosureMigration = { + closes_at_unix: number +} +export const ClosureMigrationOptionalFields: [] = [] +export type ClosureMigrationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + closes_at_unix_CustomCheck?: (v: number) => boolean +} +export const ClosureMigrationValidate = (o?: ClosureMigration, opts: ClosureMigrationOptions = {}, path: string = 'ClosureMigration::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.closes_at_unix !== 'number') return new Error(`${path}.closes_at_unix: is not a number`) + if (opts.closes_at_unix_CustomCheck && !opts.closes_at_unix_CustomCheck(o.closes_at_unix)) return new Error(`${path}.closes_at_unix: custom check failed`) + + return null +} + +export type AuthAppRequest = { + name: string + allow_user_creation?: boolean +} +export type AuthAppRequestOptionalField = 'allow_user_creation' +export const AuthAppRequestOptionalFields: AuthAppRequestOptionalField[] = ['allow_user_creation'] +export type AuthAppRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: AuthAppRequestOptionalField[] + name_CustomCheck?: (v: string) => boolean + allow_user_creation_CustomCheck?: (v?: boolean) => boolean +} +export const AuthAppRequestValidate = (o?: AuthAppRequest, opts: AuthAppRequestOptions = {}, path: string = 'AuthAppRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if ((o.allow_user_creation || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('allow_user_creation')) && typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) + if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) + + return null +} + +export type Application = { + name: string + id: string + balance: number + npub: string +} +export const ApplicationOptionalFields: [] = [] +export type ApplicationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + id_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => boolean + npub_CustomCheck?: (v: string) => boolean +} +export const ApplicationValidate = (o?: Application, opts: ApplicationOptions = {}, path: string = 'Application::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) + if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) + + if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) + if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) + + if (typeof o.npub !== 'string') return new Error(`${path}.npub: is not a string`) + if (opts.npub_CustomCheck && !opts.npub_CustomCheck(o.npub)) return new Error(`${path}.npub: custom check failed`) + + return null +} + +export type RelaysMigration = { + relays: string[] +} +export const RelaysMigrationOptionalFields: [] = [] +export type RelaysMigrationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + relays_CustomCheck?: (v: string[]) => boolean +} +export const RelaysMigrationValidate = (o?: RelaysMigration, opts: RelaysMigrationOptions = {}, path: string = 'RelaysMigration::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!Array.isArray(o.relays)) return new Error(`${path}.relays: is not an array`) + for (let index = 0; index < o.relays.length; index++) { + if (typeof o.relays[index] !== 'string') return new Error(`${path}.relays[${index}]: is not a string`) + } + if (opts.relays_CustomCheck && !opts.relays_CustomCheck(o.relays)) return new Error(`${path}.relays: custom check failed`) + + return null +} + +export type RequestNPubLinkingTokenRequest = { + user_identifier: string +} +export const RequestNPubLinkingTokenRequestOptionalFields: [] = [] +export type RequestNPubLinkingTokenRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean +} +export const RequestNPubLinkingTokenRequestValidate = (o?: RequestNPubLinkingTokenRequest, opts: RequestNPubLinkingTokenRequestOptions = {}, path: string = 'RequestNPubLinkingTokenRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + return null +} + +export type ClosedChannel = { + channel_id: string + capacity: number + closed_height: number +} +export const ClosedChannelOptionalFields: [] = [] +export type ClosedChannelOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channel_id_CustomCheck?: (v: string) => boolean + capacity_CustomCheck?: (v: number) => boolean + closed_height_CustomCheck?: (v: number) => boolean +} +export const ClosedChannelValidate = (o?: ClosedChannel, opts: ClosedChannelOptions = {}, path: string = 'ClosedChannel::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.capacity !== 'number') return new Error(`${path}.capacity: is not a number`) + if (opts.capacity_CustomCheck && !opts.capacity_CustomCheck(o.capacity)) return new Error(`${path}.capacity: custom check failed`) + + if (typeof o.closed_height !== 'number') return new Error(`${path}.closed_height: is not a number`) + if (opts.closed_height_CustomCheck && !opts.closed_height_CustomCheck(o.closed_height)) return new Error(`${path}.closed_height: custom check failed`) + + return null +} + +export type OpenChannelResponse = { + channelId: string +} +export const OpenChannelResponseOptionalFields: [] = [] +export type OpenChannelResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channelId_CustomCheck?: (v: string) => boolean +} +export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.channelId !== 'string') return new Error(`${path}.channelId: is not a string`) + if (opts.channelId_CustomCheck && !opts.channelId_CustomCheck(o.channelId)) return new Error(`${path}.channelId: custom check failed`) + + return null +} + +export type Product = { + id: string + name: string + price_sats: number +} +export const ProductOptionalFields: [] = [] +export type ProductOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + id_CustomCheck?: (v: string) => boolean + name_CustomCheck?: (v: string) => boolean + price_sats_CustomCheck?: (v: number) => boolean +} +export const ProductValidate = (o?: Product, opts: ProductOptions = {}, path: string = 'Product::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) + if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) + if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) + + return null +} + +export type EncryptionExchangeRequest = { + publicKey: string + deviceId: string +} +export const EncryptionExchangeRequestOptionalFields: [] = [] +export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + publicKey_CustomCheck?: (v: string) => boolean + deviceId_CustomCheck?: (v: string) => boolean +} +export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.publicKey !== 'string') return new Error(`${path}.publicKey: is not a string`) + if (opts.publicKey_CustomCheck && !opts.publicKey_CustomCheck(o.publicKey)) return new Error(`${path}.publicKey: custom check failed`) + + if (typeof o.deviceId !== 'string') return new Error(`${path}.deviceId: is not a string`) + if (opts.deviceId_CustomCheck && !opts.deviceId_CustomCheck(o.deviceId)) return new Error(`${path}.deviceId: custom check failed`) + + return null +} + +export type AppsMetricsRequest = { + from_unix?: number + to_unix?: number + include_operations?: boolean +} +export type AppsMetricsRequestOptionalField = 'from_unix' | 'to_unix' | 'include_operations' +export const AppsMetricsRequestOptionalFields: AppsMetricsRequestOptionalField[] = ['from_unix', 'to_unix', 'include_operations'] +export type AppsMetricsRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: AppsMetricsRequestOptionalField[] + from_unix_CustomCheck?: (v?: number) => boolean + to_unix_CustomCheck?: (v?: number) => boolean + include_operations_CustomCheck?: (v?: boolean) => boolean +} +export const AppsMetricsRequestValidate = (o?: AppsMetricsRequest, opts: AppsMetricsRequestOptions = {}, path: string = 'AppsMetricsRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if ((o.from_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('from_unix')) && typeof o.from_unix !== 'number') return new Error(`${path}.from_unix: is not a number`) + if (opts.from_unix_CustomCheck && !opts.from_unix_CustomCheck(o.from_unix)) return new Error(`${path}.from_unix: custom check failed`) + + if ((o.to_unix || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('to_unix')) && typeof o.to_unix !== 'number') return new Error(`${path}.to_unix: is not a number`) + if (opts.to_unix_CustomCheck && !opts.to_unix_CustomCheck(o.to_unix)) return new Error(`${path}.to_unix: custom check failed`) + + if ((o.include_operations || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('include_operations')) && typeof o.include_operations !== 'boolean') return new Error(`${path}.include_operations: is not a boolean`) + if (opts.include_operations_CustomCheck && !opts.include_operations_CustomCheck(o.include_operations)) return new Error(`${path}.include_operations: custom check failed`) + + return null +} + +export type LiveUserOperation = { + operation: UserOperation +} +export const LiveUserOperationOptionalFields: [] = [] +export type LiveUserOperationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + operation_Options?: UserOperationOptions +} +export const LiveUserOperationValidate = (o?: LiveUserOperation, opts: LiveUserOperationOptions = {}, path: string = 'LiveUserOperation::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + const operationErr = UserOperationValidate(o.operation, opts.operation_Options, `${path}.operation`) + if (operationErr !== null) return operationErr + + + return null +} + +export type HttpCreds = { + url: string + token: string +} +export const HttpCredsOptionalFields: [] = [] +export type HttpCredsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + url_CustomCheck?: (v: string) => boolean + token_CustomCheck?: (v: string) => boolean +} +export const HttpCredsValidate = (o?: HttpCreds, opts: HttpCredsOptions = {}, path: string = 'HttpCreds::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.url !== 'string') return new Error(`${path}.url: is not a string`) + if (opts.url_CustomCheck && !opts.url_CustomCheck(o.url)) return new Error(`${path}.url: custom check failed`) + + if (typeof o.token !== 'string') return new Error(`${path}.token: is not a string`) + if (opts.token_CustomCheck && !opts.token_CustomCheck(o.token)) return new Error(`${path}.token: custom check failed`) + + return null +} + +export type PayAppUserInvoiceRequest = { + user_identifier: string + invoice: string + amount: number +} +export const PayAppUserInvoiceRequestOptionalFields: [] = [] +export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const PayAppUserInvoiceRequestValidate = (o?: PayAppUserInvoiceRequest, opts: PayAppUserInvoiceRequestOptions = {}, path: string = 'PayAppUserInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type NewInvoiceRequest = { + amountSats: number + memo: string +} +export const NewInvoiceRequestOptionalFields: [] = [] +export type NewInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amountSats_CustomCheck?: (v: number) => boolean + memo_CustomCheck?: (v: string) => boolean +} +export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.amountSats !== 'number') return new Error(`${path}.amountSats: is not a number`) + if (opts.amountSats_CustomCheck && !opts.amountSats_CustomCheck(o.amountSats)) return new Error(`${path}.amountSats: custom check failed`) + + if (typeof o.memo !== 'string') return new Error(`${path}.memo: is not a string`) + if (opts.memo_CustomCheck && !opts.memo_CustomCheck(o.memo)) return new Error(`${path}.memo: custom check failed`) + + return null +} + +export type ChannelBalanceEvent = { + block_height: number + channel_id: string + local_balance_sats: number + remote_balance_sats: number +} +export const ChannelBalanceEventOptionalFields: [] = [] +export type ChannelBalanceEventOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + block_height_CustomCheck?: (v: number) => boolean + channel_id_CustomCheck?: (v: string) => boolean + local_balance_sats_CustomCheck?: (v: number) => boolean + remote_balance_sats_CustomCheck?: (v: number) => boolean +} +export const ChannelBalanceEventValidate = (o?: ChannelBalanceEvent, opts: ChannelBalanceEventOptions = {}, path: string = 'ChannelBalanceEvent::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) + if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) + + if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) + if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) + + if (typeof o.local_balance_sats !== 'number') return new Error(`${path}.local_balance_sats: is not a number`) + if (opts.local_balance_sats_CustomCheck && !opts.local_balance_sats_CustomCheck(o.local_balance_sats)) return new Error(`${path}.local_balance_sats: custom check failed`) + + if (typeof o.remote_balance_sats !== 'number') return new Error(`${path}.remote_balance_sats: is not a number`) + if (opts.remote_balance_sats_CustomCheck && !opts.remote_balance_sats_CustomCheck(o.remote_balance_sats)) return new Error(`${path}.remote_balance_sats: custom check failed`) + + return null +} + +export type HandleLnurlPayResponse = { + pr: string + routes: Empty[] +} +export const HandleLnurlPayResponseOptionalFields: [] = [] +export type HandleLnurlPayResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + pr_CustomCheck?: (v: string) => boolean + routes_ItemOptions?: EmptyOptions + routes_CustomCheck?: (v: Empty[]) => boolean +} +export const HandleLnurlPayResponseValidate = (o?: HandleLnurlPayResponse, opts: HandleLnurlPayResponseOptions = {}, path: string = 'HandleLnurlPayResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.pr !== 'string') return new Error(`${path}.pr: is not a string`) + if (opts.pr_CustomCheck && !opts.pr_CustomCheck(o.pr)) return new Error(`${path}.pr: custom check failed`) + + if (!Array.isArray(o.routes)) return new Error(`${path}.routes: is not an array`) + for (let index = 0; index < o.routes.length; index++) { + const routesErr = EmptyValidate(o.routes[index], opts.routes_ItemOptions, `${path}.routes[${index}]`) + if (routesErr !== null) return routesErr + } + if (opts.routes_CustomCheck && !opts.routes_CustomCheck(o.routes)) return new Error(`${path}.routes: custom check failed`) + + return null +} + +export type UserOperations = { + fromIndex: number + toIndex: number + operations: UserOperation[] +} +export const UserOperationsOptionalFields: [] = [] +export type UserOperationsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + fromIndex_CustomCheck?: (v: number) => boolean + toIndex_CustomCheck?: (v: number) => boolean + operations_ItemOptions?: UserOperationOptions + operations_CustomCheck?: (v: UserOperation[]) => boolean +} +export const UserOperationsValidate = (o?: UserOperations, opts: UserOperationsOptions = {}, path: string = 'UserOperations::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.fromIndex !== 'number') return new Error(`${path}.fromIndex: is not a number`) + if (opts.fromIndex_CustomCheck && !opts.fromIndex_CustomCheck(o.fromIndex)) return new Error(`${path}.fromIndex: custom check failed`) + + if (typeof o.toIndex !== 'number') return new Error(`${path}.toIndex: is not a number`) + if (opts.toIndex_CustomCheck && !opts.toIndex_CustomCheck(o.toIndex)) return new Error(`${path}.toIndex: custom check failed`) + + if (!Array.isArray(o.operations)) return new Error(`${path}.operations: is not an array`) + for (let index = 0; index < o.operations.length; index++) { + const operationsErr = UserOperationValidate(o.operations[index], opts.operations_ItemOptions, `${path}.operations[${index}]`) + if (operationsErr !== null) return operationsErr + } + if (opts.operations_CustomCheck && !opts.operations_CustomCheck(o.operations)) return new Error(`${path}.operations: custom check failed`) + + return null +} + +export type UsageMetric = { + processed_at_ms: number + parsed_in_nano: number + auth_in_nano: number + validate_in_nano: number + handle_in_nano: number + rpc_name: string + batch: boolean + nostr: boolean + batch_size: number +} +export const UsageMetricOptionalFields: [] = [] +export type UsageMetricOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + processed_at_ms_CustomCheck?: (v: number) => boolean + parsed_in_nano_CustomCheck?: (v: number) => boolean + auth_in_nano_CustomCheck?: (v: number) => boolean + validate_in_nano_CustomCheck?: (v: number) => boolean + handle_in_nano_CustomCheck?: (v: number) => boolean + rpc_name_CustomCheck?: (v: string) => boolean + batch_CustomCheck?: (v: boolean) => boolean + nostr_CustomCheck?: (v: boolean) => boolean + batch_size_CustomCheck?: (v: number) => boolean +} +export const UsageMetricValidate = (o?: UsageMetric, opts: UsageMetricOptions = {}, path: string = 'UsageMetric::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.processed_at_ms !== 'number') return new Error(`${path}.processed_at_ms: is not a number`) + if (opts.processed_at_ms_CustomCheck && !opts.processed_at_ms_CustomCheck(o.processed_at_ms)) return new Error(`${path}.processed_at_ms: custom check failed`) + + if (typeof o.parsed_in_nano !== 'number') return new Error(`${path}.parsed_in_nano: is not a number`) + if (opts.parsed_in_nano_CustomCheck && !opts.parsed_in_nano_CustomCheck(o.parsed_in_nano)) return new Error(`${path}.parsed_in_nano: custom check failed`) + + if (typeof o.auth_in_nano !== 'number') return new Error(`${path}.auth_in_nano: is not a number`) + if (opts.auth_in_nano_CustomCheck && !opts.auth_in_nano_CustomCheck(o.auth_in_nano)) return new Error(`${path}.auth_in_nano: custom check failed`) + + if (typeof o.validate_in_nano !== 'number') return new Error(`${path}.validate_in_nano: is not a number`) + if (opts.validate_in_nano_CustomCheck && !opts.validate_in_nano_CustomCheck(o.validate_in_nano)) return new Error(`${path}.validate_in_nano: custom check failed`) + + if (typeof o.handle_in_nano !== 'number') return new Error(`${path}.handle_in_nano: is not a number`) + if (opts.handle_in_nano_CustomCheck && !opts.handle_in_nano_CustomCheck(o.handle_in_nano)) return new Error(`${path}.handle_in_nano: custom check failed`) + + if (typeof o.rpc_name !== 'string') return new Error(`${path}.rpc_name: is not a string`) + if (opts.rpc_name_CustomCheck && !opts.rpc_name_CustomCheck(o.rpc_name)) return new Error(`${path}.rpc_name: custom check failed`) + + if (typeof o.batch !== 'boolean') return new Error(`${path}.batch: is not a boolean`) + if (opts.batch_CustomCheck && !opts.batch_CustomCheck(o.batch)) return new Error(`${path}.batch: custom check failed`) + + if (typeof o.nostr !== 'boolean') return new Error(`${path}.nostr: is not a boolean`) + if (opts.nostr_CustomCheck && !opts.nostr_CustomCheck(o.nostr)) return new Error(`${path}.nostr: custom check failed`) + + if (typeof o.batch_size !== 'number') return new Error(`${path}.batch_size: is not a number`) + if (opts.batch_size_CustomCheck && !opts.batch_size_CustomCheck(o.batch_size)) return new Error(`${path}.batch_size: custom check failed`) + + return null +} + +export type RoutingEvent = { + incoming_channel_id: number + incoming_htlc_id: number + outgoing_channel_id: number + outgoing_htlc_id: number + timestamp_ns: number + event_type: string + incoming_amt_msat: number + outgoing_amt_msat: number + failure_string: string + settled: boolean + offchain: boolean + forward_fail_event: boolean +} +export const RoutingEventOptionalFields: [] = [] +export type RoutingEventOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + incoming_channel_id_CustomCheck?: (v: number) => boolean + incoming_htlc_id_CustomCheck?: (v: number) => boolean + outgoing_channel_id_CustomCheck?: (v: number) => boolean + outgoing_htlc_id_CustomCheck?: (v: number) => boolean + timestamp_ns_CustomCheck?: (v: number) => boolean + event_type_CustomCheck?: (v: string) => boolean + incoming_amt_msat_CustomCheck?: (v: number) => boolean + outgoing_amt_msat_CustomCheck?: (v: number) => boolean + failure_string_CustomCheck?: (v: string) => boolean + settled_CustomCheck?: (v: boolean) => boolean + offchain_CustomCheck?: (v: boolean) => boolean + forward_fail_event_CustomCheck?: (v: boolean) => boolean +} +export const RoutingEventValidate = (o?: RoutingEvent, opts: RoutingEventOptions = {}, path: string = 'RoutingEvent::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.incoming_channel_id !== 'number') return new Error(`${path}.incoming_channel_id: is not a number`) + if (opts.incoming_channel_id_CustomCheck && !opts.incoming_channel_id_CustomCheck(o.incoming_channel_id)) return new Error(`${path}.incoming_channel_id: custom check failed`) + + if (typeof o.incoming_htlc_id !== 'number') return new Error(`${path}.incoming_htlc_id: is not a number`) + if (opts.incoming_htlc_id_CustomCheck && !opts.incoming_htlc_id_CustomCheck(o.incoming_htlc_id)) return new Error(`${path}.incoming_htlc_id: custom check failed`) + + if (typeof o.outgoing_channel_id !== 'number') return new Error(`${path}.outgoing_channel_id: is not a number`) + if (opts.outgoing_channel_id_CustomCheck && !opts.outgoing_channel_id_CustomCheck(o.outgoing_channel_id)) return new Error(`${path}.outgoing_channel_id: custom check failed`) + + if (typeof o.outgoing_htlc_id !== 'number') return new Error(`${path}.outgoing_htlc_id: is not a number`) + if (opts.outgoing_htlc_id_CustomCheck && !opts.outgoing_htlc_id_CustomCheck(o.outgoing_htlc_id)) return new Error(`${path}.outgoing_htlc_id: custom check failed`) + + if (typeof o.timestamp_ns !== 'number') return new Error(`${path}.timestamp_ns: is not a number`) + if (opts.timestamp_ns_CustomCheck && !opts.timestamp_ns_CustomCheck(o.timestamp_ns)) return new Error(`${path}.timestamp_ns: custom check failed`) + + if (typeof o.event_type !== 'string') return new Error(`${path}.event_type: is not a string`) + if (opts.event_type_CustomCheck && !opts.event_type_CustomCheck(o.event_type)) return new Error(`${path}.event_type: custom check failed`) + + if (typeof o.incoming_amt_msat !== 'number') return new Error(`${path}.incoming_amt_msat: is not a number`) + if (opts.incoming_amt_msat_CustomCheck && !opts.incoming_amt_msat_CustomCheck(o.incoming_amt_msat)) return new Error(`${path}.incoming_amt_msat: custom check failed`) + + if (typeof o.outgoing_amt_msat !== 'number') return new Error(`${path}.outgoing_amt_msat: is not a number`) + if (opts.outgoing_amt_msat_CustomCheck && !opts.outgoing_amt_msat_CustomCheck(o.outgoing_amt_msat)) return new Error(`${path}.outgoing_amt_msat: custom check failed`) + + if (typeof o.failure_string !== 'string') return new Error(`${path}.failure_string: is not a string`) + if (opts.failure_string_CustomCheck && !opts.failure_string_CustomCheck(o.failure_string)) return new Error(`${path}.failure_string: custom check failed`) + + if (typeof o.settled !== 'boolean') return new Error(`${path}.settled: is not a boolean`) + if (opts.settled_CustomCheck && !opts.settled_CustomCheck(o.settled)) return new Error(`${path}.settled: custom check failed`) + + if (typeof o.offchain !== 'boolean') return new Error(`${path}.offchain: is not a boolean`) + if (opts.offchain_CustomCheck && !opts.offchain_CustomCheck(o.offchain)) return new Error(`${path}.offchain: custom check failed`) + + if (typeof o.forward_fail_event !== 'boolean') return new Error(`${path}.forward_fail_event: is not a boolean`) + if (opts.forward_fail_event_CustomCheck && !opts.forward_fail_event_CustomCheck(o.forward_fail_event)) return new Error(`${path}.forward_fail_event: custom check failed`) + + return null +} + +export type SetMockInvoiceAsPaidRequest = { + invoice: string + amount: number +} +export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] +export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockInvoiceAsPaidRequestValidate = (o?: SetMockInvoiceAsPaidRequest, opts: SetMockInvoiceAsPaidRequestOptions = {}, path: string = 'SetMockInvoiceAsPaidRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type AddAppUserInvoiceRequest = { + receiver_identifier: string + payer_identifier: string + http_callback_url: string + invoice_req: NewInvoiceRequest +} +export const AddAppUserInvoiceRequestOptionalFields: [] = [] +export type AddAppUserInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + receiver_identifier_CustomCheck?: (v: string) => boolean + payer_identifier_CustomCheck?: (v: string) => boolean + http_callback_url_CustomCheck?: (v: string) => boolean + invoice_req_Options?: NewInvoiceRequestOptions +} +export const AddAppUserInvoiceRequestValidate = (o?: AddAppUserInvoiceRequest, opts: AddAppUserInvoiceRequestOptions = {}, path: string = 'AddAppUserInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.receiver_identifier !== 'string') return new Error(`${path}.receiver_identifier: is not a string`) + if (opts.receiver_identifier_CustomCheck && !opts.receiver_identifier_CustomCheck(o.receiver_identifier)) return new Error(`${path}.receiver_identifier: custom check failed`) + + if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) + if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) + + if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) + if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) + + const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) + if (invoice_reqErr !== null) return invoice_reqErr + + + return null +} + +export type OpenChannelRequest = { + destination: string + fundingAmount: number + pushAmount: number + closeAddress: string +} +export const OpenChannelRequestOptionalFields: [] = [] +export type OpenChannelRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + destination_CustomCheck?: (v: string) => boolean + fundingAmount_CustomCheck?: (v: number) => boolean + pushAmount_CustomCheck?: (v: number) => boolean + closeAddress_CustomCheck?: (v: string) => boolean +} +export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.destination !== 'string') return new Error(`${path}.destination: is not a string`) + if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`) + + if (typeof o.fundingAmount !== 'number') return new Error(`${path}.fundingAmount: is not a number`) + if (opts.fundingAmount_CustomCheck && !opts.fundingAmount_CustomCheck(o.fundingAmount)) return new Error(`${path}.fundingAmount: custom check failed`) + + if (typeof o.pushAmount !== 'number') return new Error(`${path}.pushAmount: is not a number`) + if (opts.pushAmount_CustomCheck && !opts.pushAmount_CustomCheck(o.pushAmount)) return new Error(`${path}.pushAmount: custom check failed`) + + if (typeof o.closeAddress !== 'string') return new Error(`${path}.closeAddress: is not a string`) + if (opts.closeAddress_CustomCheck && !opts.closeAddress_CustomCheck(o.closeAddress)) return new Error(`${path}.closeAddress: custom check failed`) + + return null +} + +export type ChainBalanceEvent = { + block_height: number + confirmed_balance: number + unconfirmed_balance: number + total_balance: number +} +export const ChainBalanceEventOptionalFields: [] = [] +export type ChainBalanceEventOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + block_height_CustomCheck?: (v: number) => boolean + confirmed_balance_CustomCheck?: (v: number) => boolean + unconfirmed_balance_CustomCheck?: (v: number) => boolean + total_balance_CustomCheck?: (v: number) => boolean +} +export const ChainBalanceEventValidate = (o?: ChainBalanceEvent, opts: ChainBalanceEventOptions = {}, path: string = 'ChainBalanceEvent::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.block_height !== 'number') return new Error(`${path}.block_height: is not a number`) + if (opts.block_height_CustomCheck && !opts.block_height_CustomCheck(o.block_height)) return new Error(`${path}.block_height: custom check failed`) + + if (typeof o.confirmed_balance !== 'number') return new Error(`${path}.confirmed_balance: is not a number`) + if (opts.confirmed_balance_CustomCheck && !opts.confirmed_balance_CustomCheck(o.confirmed_balance)) return new Error(`${path}.confirmed_balance: custom check failed`) + + if (typeof o.unconfirmed_balance !== 'number') return new Error(`${path}.unconfirmed_balance: is not a number`) + if (opts.unconfirmed_balance_CustomCheck && !opts.unconfirmed_balance_CustomCheck(o.unconfirmed_balance)) return new Error(`${path}.unconfirmed_balance: custom check failed`) + + if (typeof o.total_balance !== 'number') return new Error(`${path}.total_balance: is not a number`) + if (opts.total_balance_CustomCheck && !opts.total_balance_CustomCheck(o.total_balance)) return new Error(`${path}.total_balance: custom check failed`) + + return null +} + +export type LndNodeMetrics = { + channels_balance_events: ChannelBalanceEvent[] + chain_balance_events: ChainBalanceEvent[] + offline_channels: number + online_channels: number + pending_channels: number + closing_channels: number + open_channels: OpenChannel[] + closed_channels: ClosedChannel[] + channel_routing: ChannelRouting[] +} +export const LndNodeMetricsOptionalFields: [] = [] +export type LndNodeMetricsOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + channels_balance_events_ItemOptions?: ChannelBalanceEventOptions + channels_balance_events_CustomCheck?: (v: ChannelBalanceEvent[]) => boolean + chain_balance_events_ItemOptions?: ChainBalanceEventOptions + chain_balance_events_CustomCheck?: (v: ChainBalanceEvent[]) => boolean + offline_channels_CustomCheck?: (v: number) => boolean + online_channels_CustomCheck?: (v: number) => boolean + pending_channels_CustomCheck?: (v: number) => boolean + closing_channels_CustomCheck?: (v: number) => boolean + open_channels_ItemOptions?: OpenChannelOptions + open_channels_CustomCheck?: (v: OpenChannel[]) => boolean + closed_channels_ItemOptions?: ClosedChannelOptions + closed_channels_CustomCheck?: (v: ClosedChannel[]) => boolean + channel_routing_ItemOptions?: ChannelRoutingOptions + channel_routing_CustomCheck?: (v: ChannelRouting[]) => boolean +} +export const LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsOptions = {}, path: string = 'LndNodeMetrics::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!Array.isArray(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: is not an array`) + for (let index = 0; index < o.channels_balance_events.length; index++) { + const channels_balance_eventsErr = ChannelBalanceEventValidate(o.channels_balance_events[index], opts.channels_balance_events_ItemOptions, `${path}.channels_balance_events[${index}]`) + if (channels_balance_eventsErr !== null) return channels_balance_eventsErr + } + if (opts.channels_balance_events_CustomCheck && !opts.channels_balance_events_CustomCheck(o.channels_balance_events)) return new Error(`${path}.channels_balance_events: custom check failed`) + + if (!Array.isArray(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: is not an array`) + for (let index = 0; index < o.chain_balance_events.length; index++) { + const chain_balance_eventsErr = ChainBalanceEventValidate(o.chain_balance_events[index], opts.chain_balance_events_ItemOptions, `${path}.chain_balance_events[${index}]`) + if (chain_balance_eventsErr !== null) return chain_balance_eventsErr + } + if (opts.chain_balance_events_CustomCheck && !opts.chain_balance_events_CustomCheck(o.chain_balance_events)) return new Error(`${path}.chain_balance_events: custom check failed`) + + if (typeof o.offline_channels !== 'number') return new Error(`${path}.offline_channels: is not a number`) + if (opts.offline_channels_CustomCheck && !opts.offline_channels_CustomCheck(o.offline_channels)) return new Error(`${path}.offline_channels: custom check failed`) + + if (typeof o.online_channels !== 'number') return new Error(`${path}.online_channels: is not a number`) + if (opts.online_channels_CustomCheck && !opts.online_channels_CustomCheck(o.online_channels)) return new Error(`${path}.online_channels: custom check failed`) + + if (typeof o.pending_channels !== 'number') return new Error(`${path}.pending_channels: is not a number`) + if (opts.pending_channels_CustomCheck && !opts.pending_channels_CustomCheck(o.pending_channels)) return new Error(`${path}.pending_channels: custom check failed`) + + if (typeof o.closing_channels !== 'number') return new Error(`${path}.closing_channels: is not a number`) + if (opts.closing_channels_CustomCheck && !opts.closing_channels_CustomCheck(o.closing_channels)) return new Error(`${path}.closing_channels: custom check failed`) + + if (!Array.isArray(o.open_channels)) return new Error(`${path}.open_channels: is not an array`) + for (let index = 0; index < o.open_channels.length; index++) { + const open_channelsErr = OpenChannelValidate(o.open_channels[index], opts.open_channels_ItemOptions, `${path}.open_channels[${index}]`) + if (open_channelsErr !== null) return open_channelsErr + } + if (opts.open_channels_CustomCheck && !opts.open_channels_CustomCheck(o.open_channels)) return new Error(`${path}.open_channels: custom check failed`) + + if (!Array.isArray(o.closed_channels)) return new Error(`${path}.closed_channels: is not an array`) + for (let index = 0; index < o.closed_channels.length; index++) { + const closed_channelsErr = ClosedChannelValidate(o.closed_channels[index], opts.closed_channels_ItemOptions, `${path}.closed_channels[${index}]`) + if (closed_channelsErr !== null) return closed_channelsErr + } + if (opts.closed_channels_CustomCheck && !opts.closed_channels_CustomCheck(o.closed_channels)) return new Error(`${path}.closed_channels: custom check failed`) + + if (!Array.isArray(o.channel_routing)) return new Error(`${path}.channel_routing: is not an array`) + for (let index = 0; index < o.channel_routing.length; index++) { + const channel_routingErr = ChannelRoutingValidate(o.channel_routing[index], opts.channel_routing_ItemOptions, `${path}.channel_routing[${index}]`) + if (channel_routingErr !== null) return channel_routingErr + } + if (opts.channel_routing_CustomCheck && !opts.channel_routing_CustomCheck(o.channel_routing)) return new Error(`${path}.channel_routing: custom check failed`) + + return null +} + diff --git a/proto/lnd/chainnotifier.client.ts b/proto/lnd/chainnotifier.client.ts index dba8dc1b..2fe3a8bb 100644 --- a/proto/lnd/chainnotifier.client.ts +++ b/proto/lnd/chainnotifier.client.ts @@ -1,128 +1,128 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "chainnotifier.proto" (package "chainrpc", syntax proto3) -// tslint:disable -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import { ChainNotifier } from "./chainnotifier.js"; -import type { BlockEpoch } from "./chainnotifier.js"; -import type { SpendEvent } from "./chainnotifier.js"; -import type { SpendRequest } from "./chainnotifier.js"; -import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { ConfEvent } from "./chainnotifier.js"; -import type { ConfRequest } from "./chainnotifier.js"; -import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * ChainNotifier is a service that can be used to get information about the - * chain backend by registering notifiers for chain events. - * - * @generated from protobuf service chainrpc.ChainNotifier - */ -export interface IChainNotifierClient { - /** - * - * RegisterConfirmationsNtfn is a synchronous response-streaming RPC that - * registers an intent for a client to be notified once a confirmation request - * has reached its required number of confirmations on-chain. - * - * A confirmation request must have a valid output script. It is also possible - * to give a transaction ID. If the transaction ID is not set, a notification - * is sent once the output script confirms. If the transaction ID is also set, - * a notification is sent once the output script confirms in the given - * transaction. - * - * @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent); - */ - registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * RegisterSpendNtfn is a synchronous response-streaming RPC that registers an - * intent for a client to be notification once a spend request has been spent - * by a transaction that has confirmed on-chain. - * - * A client can specify whether the spend request should be for a particular - * outpoint or for an output script by specifying a zero outpoint. - * - * @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent); - */ - registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * RegisterBlockEpochNtfn is a synchronous response-streaming RPC that - * registers an intent for a client to be notified of blocks in the chain. The - * stream will return a hash and height tuple of a block for each new/stale - * block in the chain. It is the client's responsibility to determine whether - * the tuple returned is for a new or stale block in the chain. - * - * A client can also request a historical backlog of blocks from a particular - * point. This allows clients to be idempotent by ensuring that they do not - * missing processing a single block within the chain. - * - * @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch); - */ - registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall; -} -/** - * ChainNotifier is a service that can be used to get information about the - * chain backend by registering notifiers for chain events. - * - * @generated from protobuf service chainrpc.ChainNotifier - */ -export class ChainNotifierClient implements IChainNotifierClient, ServiceInfo { - typeName = ChainNotifier.typeName; - methods = ChainNotifier.methods; - options = ChainNotifier.options; - constructor(private readonly _transport: RpcTransport) { - } - /** - * - * RegisterConfirmationsNtfn is a synchronous response-streaming RPC that - * registers an intent for a client to be notified once a confirmation request - * has reached its required number of confirmations on-chain. - * - * A confirmation request must have a valid output script. It is also possible - * to give a transaction ID. If the transaction ID is not set, a notification - * is sent once the output script confirms. If the transaction ID is also set, - * a notification is sent once the output script confirms in the given - * transaction. - * - * @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent); - */ - registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * RegisterSpendNtfn is a synchronous response-streaming RPC that registers an - * intent for a client to be notification once a spend request has been spent - * by a transaction that has confirmed on-chain. - * - * A client can specify whether the spend request should be for a particular - * outpoint or for an output script by specifying a zero outpoint. - * - * @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent); - */ - registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * RegisterBlockEpochNtfn is a synchronous response-streaming RPC that - * registers an intent for a client to be notified of blocks in the chain. The - * stream will return a hash and height tuple of a block for each new/stale - * block in the chain. It is the client's responsibility to determine whether - * the tuple returned is for a new or stale block in the chain. - * - * A client can also request a historical backlog of blocks from a particular - * point. This allows clients to be idempotent by ensuring that they do not - * missing processing a single block within the chain. - * - * @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch); - */ - registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } -} +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "chainnotifier.proto" (package "chainrpc", syntax proto3) +// tslint:disable +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import { ChainNotifier } from "./chainnotifier.js"; +import type { BlockEpoch } from "./chainnotifier.js"; +import type { SpendEvent } from "./chainnotifier.js"; +import type { SpendRequest } from "./chainnotifier.js"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +import type { ConfEvent } from "./chainnotifier.js"; +import type { ConfRequest } from "./chainnotifier.js"; +import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +/** + * ChainNotifier is a service that can be used to get information about the + * chain backend by registering notifiers for chain events. + * + * @generated from protobuf service chainrpc.ChainNotifier + */ +export interface IChainNotifierClient { + /** + * + * RegisterConfirmationsNtfn is a synchronous response-streaming RPC that + * registers an intent for a client to be notified once a confirmation request + * has reached its required number of confirmations on-chain. + * + * A confirmation request must have a valid output script. It is also possible + * to give a transaction ID. If the transaction ID is not set, a notification + * is sent once the output script confirms. If the transaction ID is also set, + * a notification is sent once the output script confirms in the given + * transaction. + * + * @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent); + */ + registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * RegisterSpendNtfn is a synchronous response-streaming RPC that registers an + * intent for a client to be notification once a spend request has been spent + * by a transaction that has confirmed on-chain. + * + * A client can specify whether the spend request should be for a particular + * outpoint or for an output script by specifying a zero outpoint. + * + * @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent); + */ + registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * RegisterBlockEpochNtfn is a synchronous response-streaming RPC that + * registers an intent for a client to be notified of blocks in the chain. The + * stream will return a hash and height tuple of a block for each new/stale + * block in the chain. It is the client's responsibility to determine whether + * the tuple returned is for a new or stale block in the chain. + * + * A client can also request a historical backlog of blocks from a particular + * point. This allows clients to be idempotent by ensuring that they do not + * missing processing a single block within the chain. + * + * @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch); + */ + registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall; +} +/** + * ChainNotifier is a service that can be used to get information about the + * chain backend by registering notifiers for chain events. + * + * @generated from protobuf service chainrpc.ChainNotifier + */ +export class ChainNotifierClient implements IChainNotifierClient, ServiceInfo { + typeName = ChainNotifier.typeName; + methods = ChainNotifier.methods; + options = ChainNotifier.options; + constructor(private readonly _transport: RpcTransport) { + } + /** + * + * RegisterConfirmationsNtfn is a synchronous response-streaming RPC that + * registers an intent for a client to be notified once a confirmation request + * has reached its required number of confirmations on-chain. + * + * A confirmation request must have a valid output script. It is also possible + * to give a transaction ID. If the transaction ID is not set, a notification + * is sent once the output script confirms. If the transaction ID is also set, + * a notification is sent once the output script confirms in the given + * transaction. + * + * @generated from protobuf rpc: RegisterConfirmationsNtfn(chainrpc.ConfRequest) returns (stream chainrpc.ConfEvent); + */ + registerConfirmationsNtfn(input: ConfRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * RegisterSpendNtfn is a synchronous response-streaming RPC that registers an + * intent for a client to be notification once a spend request has been spent + * by a transaction that has confirmed on-chain. + * + * A client can specify whether the spend request should be for a particular + * outpoint or for an output script by specifying a zero outpoint. + * + * @generated from protobuf rpc: RegisterSpendNtfn(chainrpc.SpendRequest) returns (stream chainrpc.SpendEvent); + */ + registerSpendNtfn(input: SpendRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[1], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * RegisterBlockEpochNtfn is a synchronous response-streaming RPC that + * registers an intent for a client to be notified of blocks in the chain. The + * stream will return a hash and height tuple of a block for each new/stale + * block in the chain. It is the client's responsibility to determine whether + * the tuple returned is for a new or stale block in the chain. + * + * A client can also request a historical backlog of blocks from a particular + * point. This allows clients to be idempotent by ensuring that they do not + * missing processing a single block within the chain. + * + * @generated from protobuf rpc: RegisterBlockEpochNtfn(chainrpc.BlockEpoch) returns (stream chainrpc.BlockEpoch); + */ + registerBlockEpochNtfn(input: BlockEpoch, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } +} diff --git a/proto/lnd/chainnotifier.ts b/proto/lnd/chainnotifier.ts index 326fa968..63c4b385 100644 --- a/proto/lnd/chainnotifier.ts +++ b/proto/lnd/chainnotifier.ts @@ -1,823 +1,823 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "chainnotifier.proto" (package "chainrpc", syntax proto3) -// tslint:disable -import { ServiceType } from "@protobuf-ts/runtime-rpc"; -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import { WireType } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import { UnknownFieldHandler } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { reflectionMergePartial } from "@protobuf-ts/runtime"; -import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message chainrpc.ConfRequest - */ -export interface ConfRequest { - /** - * - * The transaction hash for which we should request a confirmation notification - * for. If set to a hash of all zeros, then the confirmation notification will - * be requested for the script instead. - * - * @generated from protobuf field: bytes txid = 1; - */ - txid: Uint8Array; - /** - * - * An output script within a transaction with the hash above which will be used - * by light clients to match block filters. If the transaction hash is set to a - * hash of all zeros, then a confirmation notification will be requested for - * this script instead. - * - * @generated from protobuf field: bytes script = 2; - */ - script: Uint8Array; - /** - * - * The number of desired confirmations the transaction/output script should - * reach before dispatching a confirmation notification. - * - * @generated from protobuf field: uint32 num_confs = 3; - */ - numConfs: number; - /** - * - * The earliest height in the chain for which the transaction/output script - * could have been included in a block. This should in most cases be set to the - * broadcast height of the transaction/output script. - * - * @generated from protobuf field: uint32 height_hint = 4; - */ - heightHint: number; - /** - * - * If true, then the block that mines the specified txid/script will be - * included in eventual the notification event. - * - * @generated from protobuf field: bool include_block = 5; - */ - includeBlock: boolean; -} -/** - * @generated from protobuf message chainrpc.ConfDetails - */ -export interface ConfDetails { - /** - * The raw bytes of the confirmed transaction. - * - * @generated from protobuf field: bytes raw_tx = 1; - */ - rawTx: Uint8Array; - /** - * The hash of the block in which the confirmed transaction was included in. - * - * @generated from protobuf field: bytes block_hash = 2; - */ - blockHash: Uint8Array; - /** - * The height of the block in which the confirmed transaction was included - * in. - * - * @generated from protobuf field: uint32 block_height = 3; - */ - blockHeight: number; - /** - * The index of the confirmed transaction within the block. - * - * @generated from protobuf field: uint32 tx_index = 4; - */ - txIndex: number; - /** - * - * The raw bytes of the block that mined the transaction. Only included if - * include_block was set in the request. - * - * @generated from protobuf field: bytes raw_block = 5; - */ - rawBlock: Uint8Array; -} -/** - * TODO(wilmer): need to know how the client will use this first. - * - * @generated from protobuf message chainrpc.Reorg - */ -export interface Reorg { -} -/** - * @generated from protobuf message chainrpc.ConfEvent - */ -export interface ConfEvent { - /** - * @generated from protobuf oneof: event - */ - event: { - oneofKind: "conf"; - /** - * - * An event that includes the confirmation details of the request - * (txid/ouput script). - * - * @generated from protobuf field: chainrpc.ConfDetails conf = 1; - */ - conf: ConfDetails; - } | { - oneofKind: "reorg"; - /** - * - * An event send when the transaction of the request is reorged out of the - * chain. - * - * @generated from protobuf field: chainrpc.Reorg reorg = 2; - */ - reorg: Reorg; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message chainrpc.Outpoint - */ -export interface Outpoint { - /** - * The hash of the transaction. - * - * @generated from protobuf field: bytes hash = 1; - */ - hash: Uint8Array; - /** - * The index of the output within the transaction. - * - * @generated from protobuf field: uint32 index = 2; - */ - index: number; -} -/** - * @generated from protobuf message chainrpc.SpendRequest - */ -export interface SpendRequest { - /** - * - * The outpoint for which we should request a spend notification for. If set to - * a zero outpoint, then the spend notification will be requested for the - * script instead. A zero or nil outpoint is not supported for Taproot spends - * because the output script cannot reliably be computed from the witness alone - * and the spent output script is not always available in the rescan context. - * So an outpoint must _always_ be specified when registering a spend - * notification for a Taproot output. - * - * @generated from protobuf field: chainrpc.Outpoint outpoint = 1; - */ - outpoint?: Outpoint; - /** - * - * The output script for the outpoint above. This will be used by light clients - * to match block filters. If the outpoint is set to a zero outpoint, then a - * spend notification will be requested for this script instead. - * - * @generated from protobuf field: bytes script = 2; - */ - script: Uint8Array; - /** - * - * The earliest height in the chain for which the outpoint/output script could - * have been spent. This should in most cases be set to the broadcast height of - * the outpoint/output script. - * - * @generated from protobuf field: uint32 height_hint = 3; - */ - heightHint: number; -} -/** - * @generated from protobuf message chainrpc.SpendDetails - */ -export interface SpendDetails { - /** - * The outpoint was that spent. - * - * @generated from protobuf field: chainrpc.Outpoint spending_outpoint = 1; - */ - spendingOutpoint?: Outpoint; - /** - * The raw bytes of the spending transaction. - * - * @generated from protobuf field: bytes raw_spending_tx = 2; - */ - rawSpendingTx: Uint8Array; - /** - * The hash of the spending transaction. - * - * @generated from protobuf field: bytes spending_tx_hash = 3; - */ - spendingTxHash: Uint8Array; - /** - * The input of the spending transaction that fulfilled the spend request. - * - * @generated from protobuf field: uint32 spending_input_index = 4; - */ - spendingInputIndex: number; - /** - * The height at which the spending transaction was included in a block. - * - * @generated from protobuf field: uint32 spending_height = 5; - */ - spendingHeight: number; -} -/** - * @generated from protobuf message chainrpc.SpendEvent - */ -export interface SpendEvent { - /** - * @generated from protobuf oneof: event - */ - event: { - oneofKind: "spend"; - /** - * - * An event that includes the details of the spending transaction of the - * request (outpoint/output script). - * - * @generated from protobuf field: chainrpc.SpendDetails spend = 1; - */ - spend: SpendDetails; - } | { - oneofKind: "reorg"; - /** - * - * An event sent when the spending transaction of the request was - * reorged out of the chain. - * - * @generated from protobuf field: chainrpc.Reorg reorg = 2; - */ - reorg: Reorg; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message chainrpc.BlockEpoch - */ -export interface BlockEpoch { - /** - * The hash of the block. - * - * @generated from protobuf field: bytes hash = 1; - */ - hash: Uint8Array; - /** - * The height of the block. - * - * @generated from protobuf field: uint32 height = 2; - */ - height: number; -} -// @generated message type with reflection information, may provide speed optimized methods -class ConfRequest$Type extends MessageType { - constructor() { - super("chainrpc.ConfRequest", [ - { no: 1, name: "txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "script", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "num_confs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "height_hint", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "include_block", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ConfRequest { - const message = { txid: new Uint8Array(0), script: new Uint8Array(0), numConfs: 0, heightHint: 0, includeBlock: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfRequest): ConfRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes txid */ 1: - message.txid = reader.bytes(); - break; - case /* bytes script */ 2: - message.script = reader.bytes(); - break; - case /* uint32 num_confs */ 3: - message.numConfs = reader.uint32(); - break; - case /* uint32 height_hint */ 4: - message.heightHint = reader.uint32(); - break; - case /* bool include_block */ 5: - message.includeBlock = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ConfRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes txid = 1; */ - if (message.txid.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.txid); - /* bytes script = 2; */ - if (message.script.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.script); - /* uint32 num_confs = 3; */ - if (message.numConfs !== 0) - writer.tag(3, WireType.Varint).uint32(message.numConfs); - /* uint32 height_hint = 4; */ - if (message.heightHint !== 0) - writer.tag(4, WireType.Varint).uint32(message.heightHint); - /* bool include_block = 5; */ - if (message.includeBlock !== false) - writer.tag(5, WireType.Varint).bool(message.includeBlock); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.ConfRequest - */ -export const ConfRequest = new ConfRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConfDetails$Type extends MessageType { - constructor() { - super("chainrpc.ConfDetails", [ - { no: 1, name: "raw_tx", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "block_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "block_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "tx_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "raw_block", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): ConfDetails { - const message = { rawTx: new Uint8Array(0), blockHash: new Uint8Array(0), blockHeight: 0, txIndex: 0, rawBlock: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfDetails): ConfDetails { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes raw_tx */ 1: - message.rawTx = reader.bytes(); - break; - case /* bytes block_hash */ 2: - message.blockHash = reader.bytes(); - break; - case /* uint32 block_height */ 3: - message.blockHeight = reader.uint32(); - break; - case /* uint32 tx_index */ 4: - message.txIndex = reader.uint32(); - break; - case /* bytes raw_block */ 5: - message.rawBlock = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ConfDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes raw_tx = 1; */ - if (message.rawTx.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rawTx); - /* bytes block_hash = 2; */ - if (message.blockHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.blockHash); - /* uint32 block_height = 3; */ - if (message.blockHeight !== 0) - writer.tag(3, WireType.Varint).uint32(message.blockHeight); - /* uint32 tx_index = 4; */ - if (message.txIndex !== 0) - writer.tag(4, WireType.Varint).uint32(message.txIndex); - /* bytes raw_block = 5; */ - if (message.rawBlock.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.rawBlock); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.ConfDetails - */ -export const ConfDetails = new ConfDetails$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Reorg$Type extends MessageType { - constructor() { - super("chainrpc.Reorg", []); - } - create(value?: PartialMessage): Reorg { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Reorg): Reorg { - return target ?? this.create(); - } - internalBinaryWrite(message: Reorg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.Reorg - */ -export const Reorg = new Reorg$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConfEvent$Type extends MessageType { - constructor() { - super("chainrpc.ConfEvent", [ - { no: 1, name: "conf", kind: "message", oneof: "event", T: () => ConfDetails }, - { no: 2, name: "reorg", kind: "message", oneof: "event", T: () => Reorg } - ]); - } - create(value?: PartialMessage): ConfEvent { - const message = { event: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfEvent): ConfEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* chainrpc.ConfDetails conf */ 1: - message.event = { - oneofKind: "conf", - conf: ConfDetails.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).conf) - }; - break; - case /* chainrpc.Reorg reorg */ 2: - message.event = { - oneofKind: "reorg", - reorg: Reorg.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).reorg) - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ConfEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* chainrpc.ConfDetails conf = 1; */ - if (message.event.oneofKind === "conf") - ConfDetails.internalBinaryWrite(message.event.conf, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* chainrpc.Reorg reorg = 2; */ - if (message.event.oneofKind === "reorg") - Reorg.internalBinaryWrite(message.event.reorg, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.ConfEvent - */ -export const ConfEvent = new ConfEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Outpoint$Type extends MessageType { - constructor() { - super("chainrpc.Outpoint", [ - { no: 1, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): Outpoint { - const message = { hash: new Uint8Array(0), index: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Outpoint): Outpoint { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes hash */ 1: - message.hash = reader.bytes(); - break; - case /* uint32 index */ 2: - message.index = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Outpoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes hash = 1; */ - if (message.hash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.hash); - /* uint32 index = 2; */ - if (message.index !== 0) - writer.tag(2, WireType.Varint).uint32(message.index); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.Outpoint - */ -export const Outpoint = new Outpoint$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SpendRequest$Type extends MessageType { - constructor() { - super("chainrpc.SpendRequest", [ - { no: 1, name: "outpoint", kind: "message", T: () => Outpoint }, - { no: 2, name: "script", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "height_hint", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): SpendRequest { - const message = { script: new Uint8Array(0), heightHint: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SpendRequest): SpendRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* chainrpc.Outpoint outpoint */ 1: - message.outpoint = Outpoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); - break; - case /* bytes script */ 2: - message.script = reader.bytes(); - break; - case /* uint32 height_hint */ 3: - message.heightHint = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SpendRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* chainrpc.Outpoint outpoint = 1; */ - if (message.outpoint) - Outpoint.internalBinaryWrite(message.outpoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes script = 2; */ - if (message.script.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.script); - /* uint32 height_hint = 3; */ - if (message.heightHint !== 0) - writer.tag(3, WireType.Varint).uint32(message.heightHint); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.SpendRequest - */ -export const SpendRequest = new SpendRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SpendDetails$Type extends MessageType { - constructor() { - super("chainrpc.SpendDetails", [ - { no: 1, name: "spending_outpoint", kind: "message", T: () => Outpoint }, - { no: 2, name: "raw_spending_tx", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "spending_tx_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "spending_input_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "spending_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): SpendDetails { - const message = { rawSpendingTx: new Uint8Array(0), spendingTxHash: new Uint8Array(0), spendingInputIndex: 0, spendingHeight: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SpendDetails): SpendDetails { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* chainrpc.Outpoint spending_outpoint */ 1: - message.spendingOutpoint = Outpoint.internalBinaryRead(reader, reader.uint32(), options, message.spendingOutpoint); - break; - case /* bytes raw_spending_tx */ 2: - message.rawSpendingTx = reader.bytes(); - break; - case /* bytes spending_tx_hash */ 3: - message.spendingTxHash = reader.bytes(); - break; - case /* uint32 spending_input_index */ 4: - message.spendingInputIndex = reader.uint32(); - break; - case /* uint32 spending_height */ 5: - message.spendingHeight = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SpendDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* chainrpc.Outpoint spending_outpoint = 1; */ - if (message.spendingOutpoint) - Outpoint.internalBinaryWrite(message.spendingOutpoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes raw_spending_tx = 2; */ - if (message.rawSpendingTx.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.rawSpendingTx); - /* bytes spending_tx_hash = 3; */ - if (message.spendingTxHash.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.spendingTxHash); - /* uint32 spending_input_index = 4; */ - if (message.spendingInputIndex !== 0) - writer.tag(4, WireType.Varint).uint32(message.spendingInputIndex); - /* uint32 spending_height = 5; */ - if (message.spendingHeight !== 0) - writer.tag(5, WireType.Varint).uint32(message.spendingHeight); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.SpendDetails - */ -export const SpendDetails = new SpendDetails$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SpendEvent$Type extends MessageType { - constructor() { - super("chainrpc.SpendEvent", [ - { no: 1, name: "spend", kind: "message", oneof: "event", T: () => SpendDetails }, - { no: 2, name: "reorg", kind: "message", oneof: "event", T: () => Reorg } - ]); - } - create(value?: PartialMessage): SpendEvent { - const message = { event: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SpendEvent): SpendEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* chainrpc.SpendDetails spend */ 1: - message.event = { - oneofKind: "spend", - spend: SpendDetails.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).spend) - }; - break; - case /* chainrpc.Reorg reorg */ 2: - message.event = { - oneofKind: "reorg", - reorg: Reorg.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).reorg) - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SpendEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* chainrpc.SpendDetails spend = 1; */ - if (message.event.oneofKind === "spend") - SpendDetails.internalBinaryWrite(message.event.spend, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* chainrpc.Reorg reorg = 2; */ - if (message.event.oneofKind === "reorg") - Reorg.internalBinaryWrite(message.event.reorg, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.SpendEvent - */ -export const SpendEvent = new SpendEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BlockEpoch$Type extends MessageType { - constructor() { - super("chainrpc.BlockEpoch", [ - { no: 1, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): BlockEpoch { - const message = { hash: new Uint8Array(0), height: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BlockEpoch): BlockEpoch { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes hash */ 1: - message.hash = reader.bytes(); - break; - case /* uint32 height */ 2: - message.height = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BlockEpoch, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes hash = 1; */ - if (message.hash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.hash); - /* uint32 height = 2; */ - if (message.height !== 0) - writer.tag(2, WireType.Varint).uint32(message.height); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message chainrpc.BlockEpoch - */ -export const BlockEpoch = new BlockEpoch$Type(); -/** - * @generated ServiceType for protobuf service chainrpc.ChainNotifier - */ -export const ChainNotifier = new ServiceType("chainrpc.ChainNotifier", [ - { name: "RegisterConfirmationsNtfn", serverStreaming: true, options: {}, I: ConfRequest, O: ConfEvent }, - { name: "RegisterSpendNtfn", serverStreaming: true, options: {}, I: SpendRequest, O: SpendEvent }, - { name: "RegisterBlockEpochNtfn", serverStreaming: true, options: {}, I: BlockEpoch, O: BlockEpoch } -]); +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "chainnotifier.proto" (package "chainrpc", syntax proto3) +// tslint:disable +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +/** + * @generated from protobuf message chainrpc.ConfRequest + */ +export interface ConfRequest { + /** + * + * The transaction hash for which we should request a confirmation notification + * for. If set to a hash of all zeros, then the confirmation notification will + * be requested for the script instead. + * + * @generated from protobuf field: bytes txid = 1; + */ + txid: Uint8Array; + /** + * + * An output script within a transaction with the hash above which will be used + * by light clients to match block filters. If the transaction hash is set to a + * hash of all zeros, then a confirmation notification will be requested for + * this script instead. + * + * @generated from protobuf field: bytes script = 2; + */ + script: Uint8Array; + /** + * + * The number of desired confirmations the transaction/output script should + * reach before dispatching a confirmation notification. + * + * @generated from protobuf field: uint32 num_confs = 3; + */ + numConfs: number; + /** + * + * The earliest height in the chain for which the transaction/output script + * could have been included in a block. This should in most cases be set to the + * broadcast height of the transaction/output script. + * + * @generated from protobuf field: uint32 height_hint = 4; + */ + heightHint: number; + /** + * + * If true, then the block that mines the specified txid/script will be + * included in eventual the notification event. + * + * @generated from protobuf field: bool include_block = 5; + */ + includeBlock: boolean; +} +/** + * @generated from protobuf message chainrpc.ConfDetails + */ +export interface ConfDetails { + /** + * The raw bytes of the confirmed transaction. + * + * @generated from protobuf field: bytes raw_tx = 1; + */ + rawTx: Uint8Array; + /** + * The hash of the block in which the confirmed transaction was included in. + * + * @generated from protobuf field: bytes block_hash = 2; + */ + blockHash: Uint8Array; + /** + * The height of the block in which the confirmed transaction was included + * in. + * + * @generated from protobuf field: uint32 block_height = 3; + */ + blockHeight: number; + /** + * The index of the confirmed transaction within the block. + * + * @generated from protobuf field: uint32 tx_index = 4; + */ + txIndex: number; + /** + * + * The raw bytes of the block that mined the transaction. Only included if + * include_block was set in the request. + * + * @generated from protobuf field: bytes raw_block = 5; + */ + rawBlock: Uint8Array; +} +/** + * TODO(wilmer): need to know how the client will use this first. + * + * @generated from protobuf message chainrpc.Reorg + */ +export interface Reorg { +} +/** + * @generated from protobuf message chainrpc.ConfEvent + */ +export interface ConfEvent { + /** + * @generated from protobuf oneof: event + */ + event: { + oneofKind: "conf"; + /** + * + * An event that includes the confirmation details of the request + * (txid/ouput script). + * + * @generated from protobuf field: chainrpc.ConfDetails conf = 1; + */ + conf: ConfDetails; + } | { + oneofKind: "reorg"; + /** + * + * An event send when the transaction of the request is reorged out of the + * chain. + * + * @generated from protobuf field: chainrpc.Reorg reorg = 2; + */ + reorg: Reorg; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message chainrpc.Outpoint + */ +export interface Outpoint { + /** + * The hash of the transaction. + * + * @generated from protobuf field: bytes hash = 1; + */ + hash: Uint8Array; + /** + * The index of the output within the transaction. + * + * @generated from protobuf field: uint32 index = 2; + */ + index: number; +} +/** + * @generated from protobuf message chainrpc.SpendRequest + */ +export interface SpendRequest { + /** + * + * The outpoint for which we should request a spend notification for. If set to + * a zero outpoint, then the spend notification will be requested for the + * script instead. A zero or nil outpoint is not supported for Taproot spends + * because the output script cannot reliably be computed from the witness alone + * and the spent output script is not always available in the rescan context. + * So an outpoint must _always_ be specified when registering a spend + * notification for a Taproot output. + * + * @generated from protobuf field: chainrpc.Outpoint outpoint = 1; + */ + outpoint?: Outpoint; + /** + * + * The output script for the outpoint above. This will be used by light clients + * to match block filters. If the outpoint is set to a zero outpoint, then a + * spend notification will be requested for this script instead. + * + * @generated from protobuf field: bytes script = 2; + */ + script: Uint8Array; + /** + * + * The earliest height in the chain for which the outpoint/output script could + * have been spent. This should in most cases be set to the broadcast height of + * the outpoint/output script. + * + * @generated from protobuf field: uint32 height_hint = 3; + */ + heightHint: number; +} +/** + * @generated from protobuf message chainrpc.SpendDetails + */ +export interface SpendDetails { + /** + * The outpoint was that spent. + * + * @generated from protobuf field: chainrpc.Outpoint spending_outpoint = 1; + */ + spendingOutpoint?: Outpoint; + /** + * The raw bytes of the spending transaction. + * + * @generated from protobuf field: bytes raw_spending_tx = 2; + */ + rawSpendingTx: Uint8Array; + /** + * The hash of the spending transaction. + * + * @generated from protobuf field: bytes spending_tx_hash = 3; + */ + spendingTxHash: Uint8Array; + /** + * The input of the spending transaction that fulfilled the spend request. + * + * @generated from protobuf field: uint32 spending_input_index = 4; + */ + spendingInputIndex: number; + /** + * The height at which the spending transaction was included in a block. + * + * @generated from protobuf field: uint32 spending_height = 5; + */ + spendingHeight: number; +} +/** + * @generated from protobuf message chainrpc.SpendEvent + */ +export interface SpendEvent { + /** + * @generated from protobuf oneof: event + */ + event: { + oneofKind: "spend"; + /** + * + * An event that includes the details of the spending transaction of the + * request (outpoint/output script). + * + * @generated from protobuf field: chainrpc.SpendDetails spend = 1; + */ + spend: SpendDetails; + } | { + oneofKind: "reorg"; + /** + * + * An event sent when the spending transaction of the request was + * reorged out of the chain. + * + * @generated from protobuf field: chainrpc.Reorg reorg = 2; + */ + reorg: Reorg; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message chainrpc.BlockEpoch + */ +export interface BlockEpoch { + /** + * The hash of the block. + * + * @generated from protobuf field: bytes hash = 1; + */ + hash: Uint8Array; + /** + * The height of the block. + * + * @generated from protobuf field: uint32 height = 2; + */ + height: number; +} +// @generated message type with reflection information, may provide speed optimized methods +class ConfRequest$Type extends MessageType { + constructor() { + super("chainrpc.ConfRequest", [ + { no: 1, name: "txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "script", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "num_confs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "height_hint", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "include_block", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ConfRequest { + const message = { txid: new Uint8Array(0), script: new Uint8Array(0), numConfs: 0, heightHint: 0, includeBlock: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfRequest): ConfRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes txid */ 1: + message.txid = reader.bytes(); + break; + case /* bytes script */ 2: + message.script = reader.bytes(); + break; + case /* uint32 num_confs */ 3: + message.numConfs = reader.uint32(); + break; + case /* uint32 height_hint */ 4: + message.heightHint = reader.uint32(); + break; + case /* bool include_block */ 5: + message.includeBlock = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ConfRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes txid = 1; */ + if (message.txid.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.txid); + /* bytes script = 2; */ + if (message.script.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.script); + /* uint32 num_confs = 3; */ + if (message.numConfs !== 0) + writer.tag(3, WireType.Varint).uint32(message.numConfs); + /* uint32 height_hint = 4; */ + if (message.heightHint !== 0) + writer.tag(4, WireType.Varint).uint32(message.heightHint); + /* bool include_block = 5; */ + if (message.includeBlock !== false) + writer.tag(5, WireType.Varint).bool(message.includeBlock); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.ConfRequest + */ +export const ConfRequest = new ConfRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ConfDetails$Type extends MessageType { + constructor() { + super("chainrpc.ConfDetails", [ + { no: 1, name: "raw_tx", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "block_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "block_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "tx_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "raw_block", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): ConfDetails { + const message = { rawTx: new Uint8Array(0), blockHash: new Uint8Array(0), blockHeight: 0, txIndex: 0, rawBlock: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfDetails): ConfDetails { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes raw_tx */ 1: + message.rawTx = reader.bytes(); + break; + case /* bytes block_hash */ 2: + message.blockHash = reader.bytes(); + break; + case /* uint32 block_height */ 3: + message.blockHeight = reader.uint32(); + break; + case /* uint32 tx_index */ 4: + message.txIndex = reader.uint32(); + break; + case /* bytes raw_block */ 5: + message.rawBlock = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ConfDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes raw_tx = 1; */ + if (message.rawTx.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.rawTx); + /* bytes block_hash = 2; */ + if (message.blockHash.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.blockHash); + /* uint32 block_height = 3; */ + if (message.blockHeight !== 0) + writer.tag(3, WireType.Varint).uint32(message.blockHeight); + /* uint32 tx_index = 4; */ + if (message.txIndex !== 0) + writer.tag(4, WireType.Varint).uint32(message.txIndex); + /* bytes raw_block = 5; */ + if (message.rawBlock.length) + writer.tag(5, WireType.LengthDelimited).bytes(message.rawBlock); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.ConfDetails + */ +export const ConfDetails = new ConfDetails$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Reorg$Type extends MessageType { + constructor() { + super("chainrpc.Reorg", []); + } + create(value?: PartialMessage): Reorg { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Reorg): Reorg { + return target ?? this.create(); + } + internalBinaryWrite(message: Reorg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.Reorg + */ +export const Reorg = new Reorg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ConfEvent$Type extends MessageType { + constructor() { + super("chainrpc.ConfEvent", [ + { no: 1, name: "conf", kind: "message", oneof: "event", T: () => ConfDetails }, + { no: 2, name: "reorg", kind: "message", oneof: "event", T: () => Reorg } + ]); + } + create(value?: PartialMessage): ConfEvent { + const message = { event: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfEvent): ConfEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* chainrpc.ConfDetails conf */ 1: + message.event = { + oneofKind: "conf", + conf: ConfDetails.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).conf) + }; + break; + case /* chainrpc.Reorg reorg */ 2: + message.event = { + oneofKind: "reorg", + reorg: Reorg.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).reorg) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ConfEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* chainrpc.ConfDetails conf = 1; */ + if (message.event.oneofKind === "conf") + ConfDetails.internalBinaryWrite(message.event.conf, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* chainrpc.Reorg reorg = 2; */ + if (message.event.oneofKind === "reorg") + Reorg.internalBinaryWrite(message.event.reorg, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.ConfEvent + */ +export const ConfEvent = new ConfEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Outpoint$Type extends MessageType { + constructor() { + super("chainrpc.Outpoint", [ + { no: 1, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): Outpoint { + const message = { hash: new Uint8Array(0), index: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Outpoint): Outpoint { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes hash */ 1: + message.hash = reader.bytes(); + break; + case /* uint32 index */ 2: + message.index = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Outpoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes hash = 1; */ + if (message.hash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.hash); + /* uint32 index = 2; */ + if (message.index !== 0) + writer.tag(2, WireType.Varint).uint32(message.index); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.Outpoint + */ +export const Outpoint = new Outpoint$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SpendRequest$Type extends MessageType { + constructor() { + super("chainrpc.SpendRequest", [ + { no: 1, name: "outpoint", kind: "message", T: () => Outpoint }, + { no: 2, name: "script", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "height_hint", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): SpendRequest { + const message = { script: new Uint8Array(0), heightHint: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SpendRequest): SpendRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* chainrpc.Outpoint outpoint */ 1: + message.outpoint = Outpoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); + break; + case /* bytes script */ 2: + message.script = reader.bytes(); + break; + case /* uint32 height_hint */ 3: + message.heightHint = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SpendRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* chainrpc.Outpoint outpoint = 1; */ + if (message.outpoint) + Outpoint.internalBinaryWrite(message.outpoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bytes script = 2; */ + if (message.script.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.script); + /* uint32 height_hint = 3; */ + if (message.heightHint !== 0) + writer.tag(3, WireType.Varint).uint32(message.heightHint); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.SpendRequest + */ +export const SpendRequest = new SpendRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SpendDetails$Type extends MessageType { + constructor() { + super("chainrpc.SpendDetails", [ + { no: 1, name: "spending_outpoint", kind: "message", T: () => Outpoint }, + { no: 2, name: "raw_spending_tx", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "spending_tx_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "spending_input_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "spending_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): SpendDetails { + const message = { rawSpendingTx: new Uint8Array(0), spendingTxHash: new Uint8Array(0), spendingInputIndex: 0, spendingHeight: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SpendDetails): SpendDetails { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* chainrpc.Outpoint spending_outpoint */ 1: + message.spendingOutpoint = Outpoint.internalBinaryRead(reader, reader.uint32(), options, message.spendingOutpoint); + break; + case /* bytes raw_spending_tx */ 2: + message.rawSpendingTx = reader.bytes(); + break; + case /* bytes spending_tx_hash */ 3: + message.spendingTxHash = reader.bytes(); + break; + case /* uint32 spending_input_index */ 4: + message.spendingInputIndex = reader.uint32(); + break; + case /* uint32 spending_height */ 5: + message.spendingHeight = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SpendDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* chainrpc.Outpoint spending_outpoint = 1; */ + if (message.spendingOutpoint) + Outpoint.internalBinaryWrite(message.spendingOutpoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bytes raw_spending_tx = 2; */ + if (message.rawSpendingTx.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.rawSpendingTx); + /* bytes spending_tx_hash = 3; */ + if (message.spendingTxHash.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.spendingTxHash); + /* uint32 spending_input_index = 4; */ + if (message.spendingInputIndex !== 0) + writer.tag(4, WireType.Varint).uint32(message.spendingInputIndex); + /* uint32 spending_height = 5; */ + if (message.spendingHeight !== 0) + writer.tag(5, WireType.Varint).uint32(message.spendingHeight); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.SpendDetails + */ +export const SpendDetails = new SpendDetails$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SpendEvent$Type extends MessageType { + constructor() { + super("chainrpc.SpendEvent", [ + { no: 1, name: "spend", kind: "message", oneof: "event", T: () => SpendDetails }, + { no: 2, name: "reorg", kind: "message", oneof: "event", T: () => Reorg } + ]); + } + create(value?: PartialMessage): SpendEvent { + const message = { event: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SpendEvent): SpendEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* chainrpc.SpendDetails spend */ 1: + message.event = { + oneofKind: "spend", + spend: SpendDetails.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).spend) + }; + break; + case /* chainrpc.Reorg reorg */ 2: + message.event = { + oneofKind: "reorg", + reorg: Reorg.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).reorg) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SpendEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* chainrpc.SpendDetails spend = 1; */ + if (message.event.oneofKind === "spend") + SpendDetails.internalBinaryWrite(message.event.spend, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* chainrpc.Reorg reorg = 2; */ + if (message.event.oneofKind === "reorg") + Reorg.internalBinaryWrite(message.event.reorg, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.SpendEvent + */ +export const SpendEvent = new SpendEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BlockEpoch$Type extends MessageType { + constructor() { + super("chainrpc.BlockEpoch", [ + { no: 1, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): BlockEpoch { + const message = { hash: new Uint8Array(0), height: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BlockEpoch): BlockEpoch { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes hash */ 1: + message.hash = reader.bytes(); + break; + case /* uint32 height */ 2: + message.height = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BlockEpoch, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes hash = 1; */ + if (message.hash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.hash); + /* uint32 height = 2; */ + if (message.height !== 0) + writer.tag(2, WireType.Varint).uint32(message.height); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message chainrpc.BlockEpoch + */ +export const BlockEpoch = new BlockEpoch$Type(); +/** + * @generated ServiceType for protobuf service chainrpc.ChainNotifier + */ +export const ChainNotifier = new ServiceType("chainrpc.ChainNotifier", [ + { name: "RegisterConfirmationsNtfn", serverStreaming: true, options: {}, I: ConfRequest, O: ConfEvent }, + { name: "RegisterSpendNtfn", serverStreaming: true, options: {}, I: SpendRequest, O: SpendEvent }, + { name: "RegisterBlockEpochNtfn", serverStreaming: true, options: {}, I: BlockEpoch, O: BlockEpoch } +]); diff --git a/proto/lnd/invoices.client.ts b/proto/lnd/invoices.client.ts index b529cca1..1c1b66b5 100644 --- a/proto/lnd/invoices.client.ts +++ b/proto/lnd/invoices.client.ts @@ -1,139 +1,139 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) -// tslint:disable -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import { Invoices } from "./invoices.js"; -import type { LookupInvoiceMsg } from "./invoices.js"; -import type { SettleInvoiceResp } from "./invoices.js"; -import type { SettleInvoiceMsg } from "./invoices.js"; -import type { AddHoldInvoiceResp } from "./invoices.js"; -import type { AddHoldInvoiceRequest } from "./invoices.js"; -import type { CancelInvoiceResp } from "./invoices.js"; -import type { CancelInvoiceMsg } from "./invoices.js"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { Invoice } from "./lightning.js"; -import type { SubscribeSingleInvoiceRequest } from "./invoices.js"; -import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * Invoices is a service that can be used to create, accept, settle and cancel - * invoices. - * - * @generated from protobuf service invoicesrpc.Invoices - */ -export interface IInvoicesClient { - /** - * - * SubscribeSingleInvoice returns a uni-directional stream (server -> client) - * to notify the client of state transitions of the specified invoice. - * Initially the current invoice state is always sent out. - * - * @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice); - */ - subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * CancelInvoice cancels a currently open invoice. If the invoice is already - * canceled, this call will succeed. If the invoice is already settled, it will - * fail. - * - * @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp); - */ - cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall; - /** - * - * AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - * supplied in the request. - * - * @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp); - */ - addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall; - /** - * - * SettleInvoice settles an accepted invoice. If the invoice is already - * settled, this call will succeed. - * - * @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp); - */ - settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall; - /** - * - * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced - * using either its payment hash, payment address, or set ID. - * - * @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice); - */ - lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall; -} -/** - * Invoices is a service that can be used to create, accept, settle and cancel - * invoices. - * - * @generated from protobuf service invoicesrpc.Invoices - */ -export class InvoicesClient implements IInvoicesClient, ServiceInfo { - typeName = Invoices.typeName; - methods = Invoices.methods; - options = Invoices.options; - constructor(private readonly _transport: RpcTransport) { - } - /** - * - * SubscribeSingleInvoice returns a uni-directional stream (server -> client) - * to notify the client of state transitions of the specified invoice. - * Initially the current invoice state is always sent out. - * - * @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice); - */ - subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * CancelInvoice cancels a currently open invoice. If the invoice is already - * canceled, this call will succeed. If the invoice is already settled, it will - * fail. - * - * @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp); - */ - cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - * supplied in the request. - * - * @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp); - */ - addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SettleInvoice settles an accepted invoice. If the invoice is already - * settled, this call will succeed. - * - * @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp); - */ - settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced - * using either its payment hash, payment address, or set ID. - * - * @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice); - */ - lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } -} +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) +// tslint:disable +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import { Invoices } from "./invoices.js"; +import type { LookupInvoiceMsg } from "./invoices.js"; +import type { SettleInvoiceResp } from "./invoices.js"; +import type { SettleInvoiceMsg } from "./invoices.js"; +import type { AddHoldInvoiceResp } from "./invoices.js"; +import type { AddHoldInvoiceRequest } from "./invoices.js"; +import type { CancelInvoiceResp } from "./invoices.js"; +import type { CancelInvoiceMsg } from "./invoices.js"; +import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +import type { Invoice } from "./lightning.js"; +import type { SubscribeSingleInvoiceRequest } from "./invoices.js"; +import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +/** + * Invoices is a service that can be used to create, accept, settle and cancel + * invoices. + * + * @generated from protobuf service invoicesrpc.Invoices + */ +export interface IInvoicesClient { + /** + * + * SubscribeSingleInvoice returns a uni-directional stream (server -> client) + * to notify the client of state transitions of the specified invoice. + * Initially the current invoice state is always sent out. + * + * @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice); + */ + subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * CancelInvoice cancels a currently open invoice. If the invoice is already + * canceled, this call will succeed. If the invoice is already settled, it will + * fail. + * + * @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp); + */ + cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall; + /** + * + * AddHoldInvoice creates a hold invoice. It ties the invoice to the hash + * supplied in the request. + * + * @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp); + */ + addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall; + /** + * + * SettleInvoice settles an accepted invoice. If the invoice is already + * settled, this call will succeed. + * + * @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp); + */ + settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall; + /** + * + * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + * using either its payment hash, payment address, or set ID. + * + * @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice); + */ + lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall; +} +/** + * Invoices is a service that can be used to create, accept, settle and cancel + * invoices. + * + * @generated from protobuf service invoicesrpc.Invoices + */ +export class InvoicesClient implements IInvoicesClient, ServiceInfo { + typeName = Invoices.typeName; + methods = Invoices.methods; + options = Invoices.options; + constructor(private readonly _transport: RpcTransport) { + } + /** + * + * SubscribeSingleInvoice returns a uni-directional stream (server -> client) + * to notify the client of state transitions of the specified invoice. + * Initially the current invoice state is always sent out. + * + * @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice); + */ + subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * CancelInvoice cancels a currently open invoice. If the invoice is already + * canceled, this call will succeed. If the invoice is already settled, it will + * fail. + * + * @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp); + */ + cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall { + const method = this.methods[1], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * AddHoldInvoice creates a hold invoice. It ties the invoice to the hash + * supplied in the request. + * + * @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp); + */ + addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SettleInvoice settles an accepted invoice. If the invoice is already + * settled, this call will succeed. + * + * @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp); + */ + settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall { + const method = this.methods[3], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + * using either its payment hash, payment address, or set ID. + * + * @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice); + */ + lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall { + const method = this.methods[4], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } +} diff --git a/proto/lnd/invoices.ts b/proto/lnd/invoices.ts index 4155cf06..79f9d127 100644 --- a/proto/lnd/invoices.ts +++ b/proto/lnd/invoices.ts @@ -1,690 +1,690 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) -// tslint:disable -import { Invoice } from "./lightning.js"; -import { ServiceType } from "@protobuf-ts/runtime-rpc"; -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import { WireType } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import { UnknownFieldHandler } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { reflectionMergePartial } from "@protobuf-ts/runtime"; -import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { RouteHint } from "./lightning.js"; -/** - * @generated from protobuf message invoicesrpc.CancelInvoiceMsg - */ -export interface CancelInvoiceMsg { - /** - * Hash corresponding to the (hold) invoice to cancel. When using - * REST, this field must be encoded as base64. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; -} -/** - * @generated from protobuf message invoicesrpc.CancelInvoiceResp - */ -export interface CancelInvoiceResp { -} -/** - * @generated from protobuf message invoicesrpc.AddHoldInvoiceRequest - */ -export interface AddHoldInvoiceRequest { - /** - * - * An optional memo to attach along with the invoice. Used for record keeping - * purposes for the invoice's creator, and will also be set in the description - * field of the encoded payment request if the description_hash field is not - * being used. - * - * @generated from protobuf field: string memo = 1; - */ - memo: string; - /** - * The hash of the preimage - * - * @generated from protobuf field: bytes hash = 2; - */ - hash: Uint8Array; - /** - * - * The value of this invoice in satoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value = 3; - */ - value: bigint; - /** - * - * The value of this invoice in millisatoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value_msat = 10; - */ - valueMsat: bigint; - /** - * - * Hash (SHA-256) of a description of the payment. Used if the description of - * payment (memo) is too long to naturally fit within the description field - * of an encoded payment request. - * - * @generated from protobuf field: bytes description_hash = 4; - */ - descriptionHash: Uint8Array; - /** - * Payment request expiry time in seconds. Default is 3600 (1 hour). - * - * @generated from protobuf field: int64 expiry = 5; - */ - expiry: bigint; - /** - * Fallback on-chain address. - * - * @generated from protobuf field: string fallback_addr = 6; - */ - fallbackAddr: string; - /** - * Delta to use for the time-lock of the CLTV extended to the final hop. - * - * @generated from protobuf field: uint64 cltv_expiry = 7; - */ - cltvExpiry: bigint; - /** - * - * Route hints that can each be individually used to assist in reaching the - * invoice's destination. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 8; - */ - routeHints: RouteHint[]; - /** - * Whether this invoice should include routing hints for private channels. - * - * @generated from protobuf field: bool private = 9; - */ - private: boolean; -} -/** - * @generated from protobuf message invoicesrpc.AddHoldInvoiceResp - */ -export interface AddHoldInvoiceResp { - /** - * - * A bare-bones invoice for a payment within the Lightning Network. With the - * details of the invoice, the sender has all the data necessary to send a - * payment to the recipient. - * - * @generated from protobuf field: string payment_request = 1; - */ - paymentRequest: string; - /** - * - * The "add" index of this invoice. Each newly created invoice will increment - * this index making it monotonically increasing. Callers to the - * SubscribeInvoices call can use this to instantly get notified of all added - * invoices with an add_index greater than this one. - * - * @generated from protobuf field: uint64 add_index = 2; - */ - addIndex: bigint; - /** - * - * The payment address of the generated invoice. This value should be used - * in all payments for this invoice as we require it for end to end - * security. - * - * @generated from protobuf field: bytes payment_addr = 3; - */ - paymentAddr: Uint8Array; -} -/** - * @generated from protobuf message invoicesrpc.SettleInvoiceMsg - */ -export interface SettleInvoiceMsg { - /** - * Externally discovered pre-image that should be used to settle the hold - * invoice. - * - * @generated from protobuf field: bytes preimage = 1; - */ - preimage: Uint8Array; -} -/** - * @generated from protobuf message invoicesrpc.SettleInvoiceResp - */ -export interface SettleInvoiceResp { -} -/** - * @generated from protobuf message invoicesrpc.SubscribeSingleInvoiceRequest - */ -export interface SubscribeSingleInvoiceRequest { - /** - * Hash corresponding to the (hold) invoice to subscribe to. When using - * REST, this field must be encoded as base64url. - * - * @generated from protobuf field: bytes r_hash = 2; - */ - rHash: Uint8Array; -} -/** - * @generated from protobuf message invoicesrpc.LookupInvoiceMsg - */ -export interface LookupInvoiceMsg { - /** - * @generated from protobuf oneof: invoice_ref - */ - invoiceRef: { - oneofKind: "paymentHash"; - /** - * When using REST, this field must be encoded as base64. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - } | { - oneofKind: "paymentAddr"; - /** - * @generated from protobuf field: bytes payment_addr = 2; - */ - paymentAddr: Uint8Array; - } | { - oneofKind: "setId"; - /** - * @generated from protobuf field: bytes set_id = 3; - */ - setId: Uint8Array; - } | { - oneofKind: undefined; - }; - /** - * @generated from protobuf field: invoicesrpc.LookupModifier lookup_modifier = 4; - */ - lookupModifier: LookupModifier; -} -/** - * @generated from protobuf enum invoicesrpc.LookupModifier - */ -export enum LookupModifier { - /** - * The default look up modifier, no look up behavior is changed. - * - * @generated from protobuf enum value: DEFAULT = 0; - */ - DEFAULT = 0, - /** - * - * Indicates that when a look up is done based on a set_id, then only that set - * of HTLCs related to that set ID should be returned. - * - * @generated from protobuf enum value: HTLC_SET_ONLY = 1; - */ - HTLC_SET_ONLY = 1, - /** - * - * Indicates that when a look up is done using a payment_addr, then no HTLCs - * related to the payment_addr should be returned. This is useful when one - * wants to be able to obtain the set of associated setIDs with a given - * invoice, then look up the sub-invoices "projected" by that set ID. - * - * @generated from protobuf enum value: HTLC_SET_BLANK = 2; - */ - HTLC_SET_BLANK = 2 -} -// @generated message type with reflection information, may provide speed optimized methods -class CancelInvoiceMsg$Type extends MessageType { - constructor() { - super("invoicesrpc.CancelInvoiceMsg", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): CancelInvoiceMsg { - const message = { paymentHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceMsg): CancelInvoiceMsg { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_hash */ 1: - message.paymentHash = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CancelInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceMsg - */ -export const CancelInvoiceMsg = new CancelInvoiceMsg$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CancelInvoiceResp$Type extends MessageType { - constructor() { - super("invoicesrpc.CancelInvoiceResp", []); - } - create(value?: PartialMessage): CancelInvoiceResp { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceResp): CancelInvoiceResp { - return target ?? this.create(); - } - internalBinaryWrite(message: CancelInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceResp - */ -export const CancelInvoiceResp = new CancelInvoiceResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AddHoldInvoiceRequest$Type extends MessageType { - constructor() { - super("invoicesrpc.AddHoldInvoiceRequest", [ - { no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, - { no: 9, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): AddHoldInvoiceRequest { - const message = { memo: "", hash: new Uint8Array(0), value: 0n, valueMsat: 0n, descriptionHash: new Uint8Array(0), expiry: 0n, fallbackAddr: "", cltvExpiry: 0n, routeHints: [], private: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceRequest): AddHoldInvoiceRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string memo */ 1: - message.memo = reader.string(); - break; - case /* bytes hash */ 2: - message.hash = reader.bytes(); - break; - case /* int64 value */ 3: - message.value = reader.int64().toBigInt(); - break; - case /* int64 value_msat */ 10: - message.valueMsat = reader.int64().toBigInt(); - break; - case /* bytes description_hash */ 4: - message.descriptionHash = reader.bytes(); - break; - case /* int64 expiry */ 5: - message.expiry = reader.int64().toBigInt(); - break; - case /* string fallback_addr */ 6: - message.fallbackAddr = reader.string(); - break; - case /* uint64 cltv_expiry */ 7: - message.cltvExpiry = reader.uint64().toBigInt(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 8: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bool private */ 9: - message.private = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AddHoldInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string memo = 1; */ - if (message.memo !== "") - writer.tag(1, WireType.LengthDelimited).string(message.memo); - /* bytes hash = 2; */ - if (message.hash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.hash); - /* int64 value = 3; */ - if (message.value !== 0n) - writer.tag(3, WireType.Varint).int64(message.value); - /* int64 value_msat = 10; */ - if (message.valueMsat !== 0n) - writer.tag(10, WireType.Varint).int64(message.valueMsat); - /* bytes description_hash = 4; */ - if (message.descriptionHash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.descriptionHash); - /* int64 expiry = 5; */ - if (message.expiry !== 0n) - writer.tag(5, WireType.Varint).int64(message.expiry); - /* string fallback_addr = 6; */ - if (message.fallbackAddr !== "") - writer.tag(6, WireType.LengthDelimited).string(message.fallbackAddr); - /* uint64 cltv_expiry = 7; */ - if (message.cltvExpiry !== 0n) - writer.tag(7, WireType.Varint).uint64(message.cltvExpiry); - /* repeated lnrpc.RouteHint route_hints = 8; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* bool private = 9; */ - if (message.private !== false) - writer.tag(9, WireType.Varint).bool(message.private); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceRequest - */ -export const AddHoldInvoiceRequest = new AddHoldInvoiceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AddHoldInvoiceResp$Type extends MessageType { - constructor() { - super("invoicesrpc.AddHoldInvoiceResp", [ - { no: 1, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): AddHoldInvoiceResp { - const message = { paymentRequest: "", addIndex: 0n, paymentAddr: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceResp): AddHoldInvoiceResp { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string payment_request */ 1: - message.paymentRequest = reader.string(); - break; - case /* uint64 add_index */ 2: - message.addIndex = reader.uint64().toBigInt(); - break; - case /* bytes payment_addr */ 3: - message.paymentAddr = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AddHoldInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string payment_request = 1; */ - if (message.paymentRequest !== "") - writer.tag(1, WireType.LengthDelimited).string(message.paymentRequest); - /* uint64 add_index = 2; */ - if (message.addIndex !== 0n) - writer.tag(2, WireType.Varint).uint64(message.addIndex); - /* bytes payment_addr = 3; */ - if (message.paymentAddr.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.paymentAddr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceResp - */ -export const AddHoldInvoiceResp = new AddHoldInvoiceResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SettleInvoiceMsg$Type extends MessageType { - constructor() { - super("invoicesrpc.SettleInvoiceMsg", [ - { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): SettleInvoiceMsg { - const message = { preimage: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceMsg): SettleInvoiceMsg { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes preimage */ 1: - message.preimage = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SettleInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes preimage = 1; */ - if (message.preimage.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceMsg - */ -export const SettleInvoiceMsg = new SettleInvoiceMsg$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SettleInvoiceResp$Type extends MessageType { - constructor() { - super("invoicesrpc.SettleInvoiceResp", []); - } - create(value?: PartialMessage): SettleInvoiceResp { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceResp): SettleInvoiceResp { - return target ?? this.create(); - } - internalBinaryWrite(message: SettleInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceResp - */ -export const SettleInvoiceResp = new SettleInvoiceResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SubscribeSingleInvoiceRequest$Type extends MessageType { - constructor() { - super("invoicesrpc.SubscribeSingleInvoiceRequest", [ - { no: 2, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): SubscribeSingleInvoiceRequest { - const message = { rHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeSingleInvoiceRequest): SubscribeSingleInvoiceRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes r_hash */ 2: - message.rHash = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SubscribeSingleInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes r_hash = 2; */ - if (message.rHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.rHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.SubscribeSingleInvoiceRequest - */ -export const SubscribeSingleInvoiceRequest = new SubscribeSingleInvoiceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LookupInvoiceMsg$Type extends MessageType { - constructor() { - super("invoicesrpc.LookupInvoiceMsg", [ - { no: 1, name: "payment_hash", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "payment_addr", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "set_id", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "lookup_modifier", kind: "enum", T: () => ["invoicesrpc.LookupModifier", LookupModifier] } - ]); - } - create(value?: PartialMessage): LookupInvoiceMsg { - const message = { invoiceRef: { oneofKind: undefined }, lookupModifier: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupInvoiceMsg): LookupInvoiceMsg { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_hash */ 1: - message.invoiceRef = { - oneofKind: "paymentHash", - paymentHash: reader.bytes() - }; - break; - case /* bytes payment_addr */ 2: - message.invoiceRef = { - oneofKind: "paymentAddr", - paymentAddr: reader.bytes() - }; - break; - case /* bytes set_id */ 3: - message.invoiceRef = { - oneofKind: "setId", - setId: reader.bytes() - }; - break; - case /* invoicesrpc.LookupModifier lookup_modifier */ 4: - message.lookupModifier = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LookupInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes payment_hash = 1; */ - if (message.invoiceRef.oneofKind === "paymentHash") - writer.tag(1, WireType.LengthDelimited).bytes(message.invoiceRef.paymentHash); - /* bytes payment_addr = 2; */ - if (message.invoiceRef.oneofKind === "paymentAddr") - writer.tag(2, WireType.LengthDelimited).bytes(message.invoiceRef.paymentAddr); - /* bytes set_id = 3; */ - if (message.invoiceRef.oneofKind === "setId") - writer.tag(3, WireType.LengthDelimited).bytes(message.invoiceRef.setId); - /* invoicesrpc.LookupModifier lookup_modifier = 4; */ - if (message.lookupModifier !== 0) - writer.tag(4, WireType.Varint).int32(message.lookupModifier); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.LookupInvoiceMsg - */ -export const LookupInvoiceMsg = new LookupInvoiceMsg$Type(); -/** - * @generated ServiceType for protobuf service invoicesrpc.Invoices - */ -export const Invoices = new ServiceType("invoicesrpc.Invoices", [ - { name: "SubscribeSingleInvoice", serverStreaming: true, options: {}, I: SubscribeSingleInvoiceRequest, O: Invoice }, - { name: "CancelInvoice", options: {}, I: CancelInvoiceMsg, O: CancelInvoiceResp }, - { name: "AddHoldInvoice", options: {}, I: AddHoldInvoiceRequest, O: AddHoldInvoiceResp }, - { name: "SettleInvoice", options: {}, I: SettleInvoiceMsg, O: SettleInvoiceResp }, - { name: "LookupInvoiceV2", options: {}, I: LookupInvoiceMsg, O: Invoice } -]); +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) +// tslint:disable +import { Invoice } from "./lightning.js"; +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { RouteHint } from "./lightning.js"; +/** + * @generated from protobuf message invoicesrpc.CancelInvoiceMsg + */ +export interface CancelInvoiceMsg { + /** + * Hash corresponding to the (hold) invoice to cancel. When using + * REST, this field must be encoded as base64. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; +} +/** + * @generated from protobuf message invoicesrpc.CancelInvoiceResp + */ +export interface CancelInvoiceResp { +} +/** + * @generated from protobuf message invoicesrpc.AddHoldInvoiceRequest + */ +export interface AddHoldInvoiceRequest { + /** + * + * An optional memo to attach along with the invoice. Used for record keeping + * purposes for the invoice's creator, and will also be set in the description + * field of the encoded payment request if the description_hash field is not + * being used. + * + * @generated from protobuf field: string memo = 1; + */ + memo: string; + /** + * The hash of the preimage + * + * @generated from protobuf field: bytes hash = 2; + */ + hash: Uint8Array; + /** + * + * The value of this invoice in satoshis + * + * The fields value and value_msat are mutually exclusive. + * + * @generated from protobuf field: int64 value = 3; + */ + value: bigint; + /** + * + * The value of this invoice in millisatoshis + * + * The fields value and value_msat are mutually exclusive. + * + * @generated from protobuf field: int64 value_msat = 10; + */ + valueMsat: bigint; + /** + * + * Hash (SHA-256) of a description of the payment. Used if the description of + * payment (memo) is too long to naturally fit within the description field + * of an encoded payment request. + * + * @generated from protobuf field: bytes description_hash = 4; + */ + descriptionHash: Uint8Array; + /** + * Payment request expiry time in seconds. Default is 3600 (1 hour). + * + * @generated from protobuf field: int64 expiry = 5; + */ + expiry: bigint; + /** + * Fallback on-chain address. + * + * @generated from protobuf field: string fallback_addr = 6; + */ + fallbackAddr: string; + /** + * Delta to use for the time-lock of the CLTV extended to the final hop. + * + * @generated from protobuf field: uint64 cltv_expiry = 7; + */ + cltvExpiry: bigint; + /** + * + * Route hints that can each be individually used to assist in reaching the + * invoice's destination. + * + * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 8; + */ + routeHints: RouteHint[]; + /** + * Whether this invoice should include routing hints for private channels. + * + * @generated from protobuf field: bool private = 9; + */ + private: boolean; +} +/** + * @generated from protobuf message invoicesrpc.AddHoldInvoiceResp + */ +export interface AddHoldInvoiceResp { + /** + * + * A bare-bones invoice for a payment within the Lightning Network. With the + * details of the invoice, the sender has all the data necessary to send a + * payment to the recipient. + * + * @generated from protobuf field: string payment_request = 1; + */ + paymentRequest: string; + /** + * + * The "add" index of this invoice. Each newly created invoice will increment + * this index making it monotonically increasing. Callers to the + * SubscribeInvoices call can use this to instantly get notified of all added + * invoices with an add_index greater than this one. + * + * @generated from protobuf field: uint64 add_index = 2; + */ + addIndex: bigint; + /** + * + * The payment address of the generated invoice. This value should be used + * in all payments for this invoice as we require it for end to end + * security. + * + * @generated from protobuf field: bytes payment_addr = 3; + */ + paymentAddr: Uint8Array; +} +/** + * @generated from protobuf message invoicesrpc.SettleInvoiceMsg + */ +export interface SettleInvoiceMsg { + /** + * Externally discovered pre-image that should be used to settle the hold + * invoice. + * + * @generated from protobuf field: bytes preimage = 1; + */ + preimage: Uint8Array; +} +/** + * @generated from protobuf message invoicesrpc.SettleInvoiceResp + */ +export interface SettleInvoiceResp { +} +/** + * @generated from protobuf message invoicesrpc.SubscribeSingleInvoiceRequest + */ +export interface SubscribeSingleInvoiceRequest { + /** + * Hash corresponding to the (hold) invoice to subscribe to. When using + * REST, this field must be encoded as base64url. + * + * @generated from protobuf field: bytes r_hash = 2; + */ + rHash: Uint8Array; +} +/** + * @generated from protobuf message invoicesrpc.LookupInvoiceMsg + */ +export interface LookupInvoiceMsg { + /** + * @generated from protobuf oneof: invoice_ref + */ + invoiceRef: { + oneofKind: "paymentHash"; + /** + * When using REST, this field must be encoded as base64. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; + } | { + oneofKind: "paymentAddr"; + /** + * @generated from protobuf field: bytes payment_addr = 2; + */ + paymentAddr: Uint8Array; + } | { + oneofKind: "setId"; + /** + * @generated from protobuf field: bytes set_id = 3; + */ + setId: Uint8Array; + } | { + oneofKind: undefined; + }; + /** + * @generated from protobuf field: invoicesrpc.LookupModifier lookup_modifier = 4; + */ + lookupModifier: LookupModifier; +} +/** + * @generated from protobuf enum invoicesrpc.LookupModifier + */ +export enum LookupModifier { + /** + * The default look up modifier, no look up behavior is changed. + * + * @generated from protobuf enum value: DEFAULT = 0; + */ + DEFAULT = 0, + /** + * + * Indicates that when a look up is done based on a set_id, then only that set + * of HTLCs related to that set ID should be returned. + * + * @generated from protobuf enum value: HTLC_SET_ONLY = 1; + */ + HTLC_SET_ONLY = 1, + /** + * + * Indicates that when a look up is done using a payment_addr, then no HTLCs + * related to the payment_addr should be returned. This is useful when one + * wants to be able to obtain the set of associated setIDs with a given + * invoice, then look up the sub-invoices "projected" by that set ID. + * + * @generated from protobuf enum value: HTLC_SET_BLANK = 2; + */ + HTLC_SET_BLANK = 2 +} +// @generated message type with reflection information, may provide speed optimized methods +class CancelInvoiceMsg$Type extends MessageType { + constructor() { + super("invoicesrpc.CancelInvoiceMsg", [ + { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): CancelInvoiceMsg { + const message = { paymentHash: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceMsg): CancelInvoiceMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.paymentHash = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CancelInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.paymentHash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceMsg + */ +export const CancelInvoiceMsg = new CancelInvoiceMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CancelInvoiceResp$Type extends MessageType { + constructor() { + super("invoicesrpc.CancelInvoiceResp", []); + } + create(value?: PartialMessage): CancelInvoiceResp { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceResp): CancelInvoiceResp { + return target ?? this.create(); + } + internalBinaryWrite(message: CancelInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceResp + */ +export const CancelInvoiceResp = new CancelInvoiceResp$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddHoldInvoiceRequest$Type extends MessageType { + constructor() { + super("invoicesrpc.AddHoldInvoiceRequest", [ + { no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, + { no: 9, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): AddHoldInvoiceRequest { + const message = { memo: "", hash: new Uint8Array(0), value: 0n, valueMsat: 0n, descriptionHash: new Uint8Array(0), expiry: 0n, fallbackAddr: "", cltvExpiry: 0n, routeHints: [], private: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceRequest): AddHoldInvoiceRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string memo */ 1: + message.memo = reader.string(); + break; + case /* bytes hash */ 2: + message.hash = reader.bytes(); + break; + case /* int64 value */ 3: + message.value = reader.int64().toBigInt(); + break; + case /* int64 value_msat */ 10: + message.valueMsat = reader.int64().toBigInt(); + break; + case /* bytes description_hash */ 4: + message.descriptionHash = reader.bytes(); + break; + case /* int64 expiry */ 5: + message.expiry = reader.int64().toBigInt(); + break; + case /* string fallback_addr */ 6: + message.fallbackAddr = reader.string(); + break; + case /* uint64 cltv_expiry */ 7: + message.cltvExpiry = reader.uint64().toBigInt(); + break; + case /* repeated lnrpc.RouteHint route_hints */ 8: + message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* bool private */ 9: + message.private = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AddHoldInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string memo = 1; */ + if (message.memo !== "") + writer.tag(1, WireType.LengthDelimited).string(message.memo); + /* bytes hash = 2; */ + if (message.hash.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.hash); + /* int64 value = 3; */ + if (message.value !== 0n) + writer.tag(3, WireType.Varint).int64(message.value); + /* int64 value_msat = 10; */ + if (message.valueMsat !== 0n) + writer.tag(10, WireType.Varint).int64(message.valueMsat); + /* bytes description_hash = 4; */ + if (message.descriptionHash.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.descriptionHash); + /* int64 expiry = 5; */ + if (message.expiry !== 0n) + writer.tag(5, WireType.Varint).int64(message.expiry); + /* string fallback_addr = 6; */ + if (message.fallbackAddr !== "") + writer.tag(6, WireType.LengthDelimited).string(message.fallbackAddr); + /* uint64 cltv_expiry = 7; */ + if (message.cltvExpiry !== 0n) + writer.tag(7, WireType.Varint).uint64(message.cltvExpiry); + /* repeated lnrpc.RouteHint route_hints = 8; */ + for (let i = 0; i < message.routeHints.length; i++) + RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* bool private = 9; */ + if (message.private !== false) + writer.tag(9, WireType.Varint).bool(message.private); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceRequest + */ +export const AddHoldInvoiceRequest = new AddHoldInvoiceRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddHoldInvoiceResp$Type extends MessageType { + constructor() { + super("invoicesrpc.AddHoldInvoiceResp", [ + { no: 1, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): AddHoldInvoiceResp { + const message = { paymentRequest: "", addIndex: 0n, paymentAddr: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceResp): AddHoldInvoiceResp { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string payment_request */ 1: + message.paymentRequest = reader.string(); + break; + case /* uint64 add_index */ 2: + message.addIndex = reader.uint64().toBigInt(); + break; + case /* bytes payment_addr */ 3: + message.paymentAddr = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AddHoldInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string payment_request = 1; */ + if (message.paymentRequest !== "") + writer.tag(1, WireType.LengthDelimited).string(message.paymentRequest); + /* uint64 add_index = 2; */ + if (message.addIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.addIndex); + /* bytes payment_addr = 3; */ + if (message.paymentAddr.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.paymentAddr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceResp + */ +export const AddHoldInvoiceResp = new AddHoldInvoiceResp$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SettleInvoiceMsg$Type extends MessageType { + constructor() { + super("invoicesrpc.SettleInvoiceMsg", [ + { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SettleInvoiceMsg { + const message = { preimage: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceMsg): SettleInvoiceMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes preimage */ 1: + message.preimage = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SettleInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes preimage = 1; */ + if (message.preimage.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceMsg + */ +export const SettleInvoiceMsg = new SettleInvoiceMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SettleInvoiceResp$Type extends MessageType { + constructor() { + super("invoicesrpc.SettleInvoiceResp", []); + } + create(value?: PartialMessage): SettleInvoiceResp { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceResp): SettleInvoiceResp { + return target ?? this.create(); + } + internalBinaryWrite(message: SettleInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceResp + */ +export const SettleInvoiceResp = new SettleInvoiceResp$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubscribeSingleInvoiceRequest$Type extends MessageType { + constructor() { + super("invoicesrpc.SubscribeSingleInvoiceRequest", [ + { no: 2, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SubscribeSingleInvoiceRequest { + const message = { rHash: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeSingleInvoiceRequest): SubscribeSingleInvoiceRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes r_hash */ 2: + message.rHash = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SubscribeSingleInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes r_hash = 2; */ + if (message.rHash.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.rHash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.SubscribeSingleInvoiceRequest + */ +export const SubscribeSingleInvoiceRequest = new SubscribeSingleInvoiceRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LookupInvoiceMsg$Type extends MessageType { + constructor() { + super("invoicesrpc.LookupInvoiceMsg", [ + { no: 1, name: "payment_hash", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "payment_addr", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "set_id", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "lookup_modifier", kind: "enum", T: () => ["invoicesrpc.LookupModifier", LookupModifier] } + ]); + } + create(value?: PartialMessage): LookupInvoiceMsg { + const message = { invoiceRef: { oneofKind: undefined }, lookupModifier: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupInvoiceMsg): LookupInvoiceMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.invoiceRef = { + oneofKind: "paymentHash", + paymentHash: reader.bytes() + }; + break; + case /* bytes payment_addr */ 2: + message.invoiceRef = { + oneofKind: "paymentAddr", + paymentAddr: reader.bytes() + }; + break; + case /* bytes set_id */ 3: + message.invoiceRef = { + oneofKind: "setId", + setId: reader.bytes() + }; + break; + case /* invoicesrpc.LookupModifier lookup_modifier */ 4: + message.lookupModifier = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LookupInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.invoiceRef.oneofKind === "paymentHash") + writer.tag(1, WireType.LengthDelimited).bytes(message.invoiceRef.paymentHash); + /* bytes payment_addr = 2; */ + if (message.invoiceRef.oneofKind === "paymentAddr") + writer.tag(2, WireType.LengthDelimited).bytes(message.invoiceRef.paymentAddr); + /* bytes set_id = 3; */ + if (message.invoiceRef.oneofKind === "setId") + writer.tag(3, WireType.LengthDelimited).bytes(message.invoiceRef.setId); + /* invoicesrpc.LookupModifier lookup_modifier = 4; */ + if (message.lookupModifier !== 0) + writer.tag(4, WireType.Varint).int32(message.lookupModifier); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.LookupInvoiceMsg + */ +export const LookupInvoiceMsg = new LookupInvoiceMsg$Type(); +/** + * @generated ServiceType for protobuf service invoicesrpc.Invoices + */ +export const Invoices = new ServiceType("invoicesrpc.Invoices", [ + { name: "SubscribeSingleInvoice", serverStreaming: true, options: {}, I: SubscribeSingleInvoiceRequest, O: Invoice }, + { name: "CancelInvoice", options: {}, I: CancelInvoiceMsg, O: CancelInvoiceResp }, + { name: "AddHoldInvoice", options: {}, I: AddHoldInvoiceRequest, O: AddHoldInvoiceResp }, + { name: "SettleInvoice", options: {}, I: SettleInvoiceMsg, O: SettleInvoiceResp }, + { name: "LookupInvoiceV2", options: {}, I: LookupInvoiceMsg, O: Invoice } +]); diff --git a/proto/lnd/lightning.client.ts b/proto/lnd/lightning.client.ts index 65c89d1d..90b72174 100644 --- a/proto/lnd/lightning.client.ts +++ b/proto/lnd/lightning.client.ts @@ -1,1722 +1,1722 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) -// tslint:disable -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import { Lightning } from "./lightning.js"; -import type { LookupHtlcResponse } from "./lightning.js"; -import type { LookupHtlcRequest } from "./lightning.js"; -import type { ListAliasesResponse } from "./lightning.js"; -import type { ListAliasesRequest } from "./lightning.js"; -import type { CustomMessage } from "./lightning.js"; -import type { SubscribeCustomMessagesRequest } from "./lightning.js"; -import type { SendCustomMessageResponse } from "./lightning.js"; -import type { SendCustomMessageRequest } from "./lightning.js"; -import type { RPCMiddlewareRequest } from "./lightning.js"; -import type { RPCMiddlewareResponse } from "./lightning.js"; -import type { CheckMacPermResponse } from "./lightning.js"; -import type { CheckMacPermRequest } from "./lightning.js"; -import type { ListPermissionsResponse } from "./lightning.js"; -import type { ListPermissionsRequest } from "./lightning.js"; -import type { DeleteMacaroonIDResponse } from "./lightning.js"; -import type { DeleteMacaroonIDRequest } from "./lightning.js"; -import type { ListMacaroonIDsResponse } from "./lightning.js"; -import type { ListMacaroonIDsRequest } from "./lightning.js"; -import type { BakeMacaroonResponse } from "./lightning.js"; -import type { BakeMacaroonRequest } from "./lightning.js"; -import type { ChannelBackupSubscription } from "./lightning.js"; -import type { RestoreBackupResponse } from "./lightning.js"; -import type { RestoreChanBackupRequest } from "./lightning.js"; -import type { VerifyChanBackupResponse } from "./lightning.js"; -import type { ChanBackupSnapshot } from "./lightning.js"; -import type { ChanBackupExportRequest } from "./lightning.js"; -import type { ChannelBackup } from "./lightning.js"; -import type { ExportChannelBackupRequest } from "./lightning.js"; -import type { ForwardingHistoryResponse } from "./lightning.js"; -import type { ForwardingHistoryRequest } from "./lightning.js"; -import type { PolicyUpdateResponse } from "./lightning.js"; -import type { PolicyUpdateRequest } from "./lightning.js"; -import type { FeeReportResponse } from "./lightning.js"; -import type { FeeReportRequest } from "./lightning.js"; -import type { DebugLevelResponse } from "./lightning.js"; -import type { DebugLevelRequest } from "./lightning.js"; -import type { GraphTopologyUpdate } from "./lightning.js"; -import type { GraphTopologySubscription } from "./lightning.js"; -import type { StopResponse } from "./lightning.js"; -import type { StopRequest } from "./lightning.js"; -import type { NetworkInfo } from "./lightning.js"; -import type { NetworkInfoRequest } from "./lightning.js"; -import type { QueryRoutesResponse } from "./lightning.js"; -import type { QueryRoutesRequest } from "./lightning.js"; -import type { NodeInfo } from "./lightning.js"; -import type { NodeInfoRequest } from "./lightning.js"; -import type { ChannelEdge } from "./lightning.js"; -import type { ChanInfoRequest } from "./lightning.js"; -import type { NodeMetricsResponse } from "./lightning.js"; -import type { NodeMetricsRequest } from "./lightning.js"; -import type { ChannelGraph } from "./lightning.js"; -import type { ChannelGraphRequest } from "./lightning.js"; -import type { DeleteAllPaymentsResponse } from "./lightning.js"; -import type { DeleteAllPaymentsRequest } from "./lightning.js"; -import type { DeletePaymentResponse } from "./lightning.js"; -import type { DeletePaymentRequest } from "./lightning.js"; -import type { ListPaymentsResponse } from "./lightning.js"; -import type { ListPaymentsRequest } from "./lightning.js"; -import type { PayReq } from "./lightning.js"; -import type { PayReqString } from "./lightning.js"; -import type { InvoiceSubscription } from "./lightning.js"; -import type { PaymentHash } from "./lightning.js"; -import type { ListInvoiceResponse } from "./lightning.js"; -import type { ListInvoiceRequest } from "./lightning.js"; -import type { AddInvoiceResponse } from "./lightning.js"; -import type { Invoice } from "./lightning.js"; -import type { SendToRouteRequest } from "./lightning.js"; -import type { SendResponse } from "./lightning.js"; -import type { SendRequest } from "./lightning.js"; -import type { AbandonChannelResponse } from "./lightning.js"; -import type { AbandonChannelRequest } from "./lightning.js"; -import type { CloseStatusUpdate } from "./lightning.js"; -import type { CloseChannelRequest } from "./lightning.js"; -import type { ChannelAcceptRequest } from "./lightning.js"; -import type { ChannelAcceptResponse } from "./lightning.js"; -import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { FundingStateStepResp } from "./lightning.js"; -import type { FundingTransitionMsg } from "./lightning.js"; -import type { BatchOpenChannelResponse } from "./lightning.js"; -import type { BatchOpenChannelRequest } from "./lightning.js"; -import type { OpenStatusUpdate } from "./lightning.js"; -import type { ChannelPoint } from "./lightning.js"; -import type { OpenChannelRequest } from "./lightning.js"; -import type { ClosedChannelsResponse } from "./lightning.js"; -import type { ClosedChannelsRequest } from "./lightning.js"; -import type { ChannelEventUpdate } from "./lightning.js"; -import type { ChannelEventSubscription } from "./lightning.js"; -import type { ListChannelsResponse } from "./lightning.js"; -import type { ListChannelsRequest } from "./lightning.js"; -import type { PendingChannelsResponse } from "./lightning.js"; -import type { PendingChannelsRequest } from "./lightning.js"; -import type { GetRecoveryInfoResponse } from "./lightning.js"; -import type { GetRecoveryInfoRequest } from "./lightning.js"; -import type { GetInfoResponse } from "./lightning.js"; -import type { GetInfoRequest } from "./lightning.js"; -import type { PeerEvent } from "./lightning.js"; -import type { PeerEventSubscription } from "./lightning.js"; -import type { ListPeersResponse } from "./lightning.js"; -import type { ListPeersRequest } from "./lightning.js"; -import type { DisconnectPeerResponse } from "./lightning.js"; -import type { DisconnectPeerRequest } from "./lightning.js"; -import type { ConnectPeerResponse } from "./lightning.js"; -import type { ConnectPeerRequest } from "./lightning.js"; -import type { VerifyMessageResponse } from "./lightning.js"; -import type { VerifyMessageRequest } from "./lightning.js"; -import type { SignMessageResponse } from "./lightning.js"; -import type { SignMessageRequest } from "./lightning.js"; -import type { NewAddressResponse } from "./lightning.js"; -import type { NewAddressRequest } from "./lightning.js"; -import type { SendManyResponse } from "./lightning.js"; -import type { SendManyRequest } from "./lightning.js"; -import type { Transaction } from "./lightning.js"; -import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { ListUnspentResponse } from "./lightning.js"; -import type { ListUnspentRequest } from "./lightning.js"; -import type { SendCoinsResponse } from "./lightning.js"; -import type { SendCoinsRequest } from "./lightning.js"; -import type { EstimateFeeResponse } from "./lightning.js"; -import type { EstimateFeeRequest } from "./lightning.js"; -import type { TransactionDetails } from "./lightning.js"; -import type { GetTransactionsRequest } from "./lightning.js"; -import type { ChannelBalanceResponse } from "./lightning.js"; -import type { ChannelBalanceRequest } from "./lightning.js"; -import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { WalletBalanceResponse } from "./lightning.js"; -import type { WalletBalanceRequest } from "./lightning.js"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -// -// Comments in this file will be directly parsed into the API -// Documentation as descriptions of the associated method, message, or field. -// These descriptions should go right above the definition of the object, and -// can be in either block or // comment format. -// -// An RPC method can be matched to an lncli command by placing a line in the -// beginning of the description in exactly the following format: -// lncli: `methodname` -// -// Failure to specify the exact name of the command will cause documentation -// generation to fail. -// -// More information on how exactly the gRPC documentation is generated from -// this proto file can be found here: -// https://github.com/lightninglabs/lightning-api - -/** - * Lightning is the main RPC server of the daemon. - * - * @generated from protobuf service lnrpc.Lightning - */ -export interface ILightningClient { - /** - * lncli: `walletbalance` - * WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - * confirmed unspent outputs and all unconfirmed unspent outputs under control - * of the wallet. - * - * @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse); - */ - walletBalance(input: WalletBalanceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `channelbalance` - * ChannelBalance returns a report on the total funds across all open channels, - * categorized in local/remote, pending local/remote and unsettled local/remote - * balances. - * - * @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse); - */ - channelBalance(input: ChannelBalanceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listchaintxns` - * GetTransactions returns a list describing all the known transactions - * relevant to the wallet. - * - * @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails); - */ - getTransactions(input: GetTransactionsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `estimatefee` - * EstimateFee asks the chain backend to estimate the fee rate and total fees - * for a transaction that pays to multiple specified outputs. - * - * When using REST, the `AddrToAmount` map type can be set by appending - * `&AddrToAmount[
]=` to the URL. Unfortunately this - * map type doesn't appear in the REST API documentation because of a bug in - * the grpc-gateway library. - * - * @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse); - */ - estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendcoins` - * SendCoins executes a request to send coins to a particular address. Unlike - * SendMany, this RPC call only allows creating a single output at a time. If - * neither target_conf, or sat_per_vbyte are set, then the internal wallet will - * consult its fee model to determine a fee for the default confirmation - * target. - * - * @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse); - */ - sendCoins(input: SendCoinsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listunspent` - * Deprecated, use walletrpc.ListUnspent instead. - * - * ListUnspent returns a list of all utxos spendable by the wallet with a - * number of confirmations between the specified minimum and maximum. - * - * @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse); - */ - listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeTransactions creates a uni-directional stream from the server to - * the client in which any newly discovered transactions relevant to the - * wallet are sent over. - * - * @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction); - */ - subscribeTransactions(input: GetTransactionsRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `sendmany` - * SendMany handles a request for a transaction that creates multiple specified - * outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - * the internal wallet will consult its fee model to determine a fee for the - * default confirmation target. - * - * @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse); - */ - sendMany(input: SendManyRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `newaddress` - * NewAddress creates a new address under control of the local wallet. - * - * @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse); - */ - newAddress(input: NewAddressRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `signmessage` - * SignMessage signs a message with this node's private key. The returned - * signature string is `zbase32` encoded and pubkey recoverable, meaning that - * only the message digest and signature are needed for verification. - * - * @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse); - */ - signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `verifymessage` - * VerifyMessage verifies a signature over a msg. The signature must be - * zbase32 encoded and signed by an active node in the resident node's - * channel database. In addition to returning the validity of the signature, - * VerifyMessage also returns the recovered pubkey from the signature. - * - * @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse); - */ - verifyMessage(input: VerifyMessageRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `connect` - * ConnectPeer attempts to establish a connection to a remote peer. This is at - * the networking level, and is used for communication between nodes. This is - * distinct from establishing a channel with a peer. - * - * @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse); - */ - connectPeer(input: ConnectPeerRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `disconnect` - * DisconnectPeer attempts to disconnect one peer from another identified by a - * given pubKey. In the case that we currently have a pending or active channel - * with the target peer, then this action will be not be allowed. - * - * @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse); - */ - disconnectPeer(input: DisconnectPeerRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpeers` - * ListPeers returns a verbose listing of all currently active peers. - * - * @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse); - */ - listPeers(input: ListPeersRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribePeerEvents creates a uni-directional stream from the server to - * the client in which any events relevant to the state of peers are sent - * over. Events include peers going online and offline. - * - * @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent); - */ - subscribePeerEvents(input: PeerEventSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `getinfo` - * GetInfo returns general information concerning the lightning node including - * it's identity pubkey, alias, the chains it is connected to, and information - * concerning the number of open+pending channels. - * - * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); - */ - getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall; - /** - * * lncli: `getrecoveryinfo` - * GetRecoveryInfo returns information concerning the recovery mode including - * whether it's in a recovery mode, whether the recovery is finished, and the - * progress made so far. - * - * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); - */ - getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall; - // TODO(roasbeef): merge with below with bool? - - /** - * lncli: `pendingchannels` - * PendingChannels returns a list of all the channels that are currently - * considered "pending". A channel is pending if it has finished the funding - * workflow and is waiting for confirmations for the funding txn, or is in the - * process of closure, either initiated cooperatively or non-cooperatively. - * - * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); - */ - pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listchannels` - * ListChannels returns a description of all the open channels that this node - * is a participant in. - * - * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); - */ - listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelEvents creates a uni-directional stream from the server to - * the client in which any updates relevant to the state of the channels are - * sent over. Events include new active channels, inactive channels, and closed - * channels. - * - * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); - */ - subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `closedchannels` - * ClosedChannels returns a description of all the closed channels that - * this node was a participant in. - * - * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); - */ - closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * - * OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - * call is meant to be consumed by clients to the REST proxy. As with all - * other sync calls, all byte slices are intended to be populated as hex - * encoded strings. - * - * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); - */ - openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `openchannel` - * OpenChannel attempts to open a singly funded channel specified in the - * request to a remote peer. Users are able to specify a target number of - * blocks that the funding transaction should be confirmed in, or a manual fee - * rate to us for the funding transaction. If neither are specified, then a - * lax block confirmation target is used. Each OpenStatusUpdate will return - * the pending channel ID of the in-progress channel. Depending on the - * arguments specified in the OpenChannelRequest, this pending channel ID can - * then be used to manually progress the channel funding flow. - * - * @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate); - */ - openChannel(input: OpenChannelRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `batchopenchannel` - * BatchOpenChannel attempts to open multiple single-funded channels in a - * single transaction in an atomic way. This means either all channel open - * requests succeed at once or all attempts are aborted if any of them fail. - * This is the safer variant of using PSBTs to manually fund a batch of - * channels through the OpenChannel RPC. - * - * @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse); - */ - batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall; - /** - * - * FundingStateStep is an advanced funding related call that allows the caller - * to either execute some preparatory steps for a funding workflow, or - * manually progress a funding workflow. The primary way a funding flow is - * identified is via its pending channel ID. As an example, this method can be - * used to specify that we're expecting a funding flow for a particular - * pending channel ID, for which we need to use specific parameters. - * Alternatively, this can be used to interactively drive PSBT signing for - * funding for partially complete funding transactions. - * - * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); - */ - fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall; - /** - * - * ChannelAcceptor dispatches a bi-directional streaming RPC in which - * OpenChannel requests are sent to the client and the client responds with - * a boolean that tells LND whether or not to accept the channel. This allows - * node operators to specify their own criteria for accepting inbound channels - * through a single persistent connection. - * - * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); - */ - channelAcceptor(options?: RpcOptions): DuplexStreamingCall; - /** - * lncli: `closechannel` - * CloseChannel attempts to close an active channel identified by its channel - * outpoint (ChannelPoint). The actions of this method can additionally be - * augmented to attempt a force close after a timeout period in the case of an - * inactive peer. If a non-force close (cooperative closure) is requested, - * then the user can specify either a target number of blocks until the - * closure transaction is confirmed, or a manual fee rate. If neither are - * specified, then a default lax, block confirmation target is used. - * - * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); - */ - closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `abandonchannel` - * AbandonChannel removes all channel state from the database except for a - * close summary. This method can be used to get rid of permanently unusable - * channels due to bugs fixed in newer versions of lnd. This method can also be - * used to remove externally funded channels where the funding transaction was - * never broadcast. Only available for non-externally funded channels in dev - * build. - * - * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); - */ - abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendpayment` - * Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - * bi-directional streaming RPC for sending payments through the Lightning - * Network. A single RPC invocation creates a persistent bi-directional - * stream allowing clients to rapidly send payments through the Lightning - * Network with a single persistent connection. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); - */ - sendPayment(options?: RpcOptions): DuplexStreamingCall; - /** - * - * SendPaymentSync is the synchronous non-streaming version of SendPayment. - * This RPC is intended to be consumed by clients of the REST proxy. - * Additionally, this RPC expects the destination's public key and the payment - * hash (if any) to be encoded as hex strings. - * - * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); - */ - sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendtoroute` - * Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - * streaming RPC for sending payment through the Lightning Network. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); - */ - sendToRoute(options?: RpcOptions): DuplexStreamingCall; - /** - * - * SendToRouteSync is a synchronous version of SendToRoute. It Will block - * until the payment either fails or succeeds. - * - * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); - */ - sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `addinvoice` - * AddInvoice attempts to add a new invoice to the invoice database. Any - * duplicated invoices are rejected, therefore all invoices *must* have a - * unique payment preimage. - * - * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); - */ - addInvoice(input: Invoice, options?: RpcOptions): UnaryCall; - /** - * lncli: `listinvoices` - * ListInvoices returns a list of all the invoices currently stored within the - * database. Any active debug invoices are ignored. It has full support for - * paginated responses, allowing users to query for specific invoices through - * their add_index. This can be done by using either the first_index_offset or - * last_index_offset fields included in the response as the index_offset of the - * next request. By default, the first 100 invoices created will be returned. - * Backwards pagination is also supported through the Reversed flag. - * - * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); - */ - listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `lookupinvoice` - * LookupInvoice attempts to look up an invoice according to its payment hash. - * The passed payment hash *must* be exactly 32 bytes, if not, an error is - * returned. - * - * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); - */ - lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeInvoices returns a uni-directional stream (server -> client) for - * notifying the client of newly added/settled invoices. The caller can - * optionally specify the add_index and/or the settle_index. If the add_index - * is specified, then we'll first start by sending add invoice events for all - * invoices with an add_index greater than the specified value. If the - * settle_index is specified, the next, we'll send out all settle events for - * invoices with a settle_index greater than the specified value. One or both - * of these fields can be set. If no fields are set, then we'll only send out - * the latest add/settle events. - * - * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); - */ - subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `decodepayreq` - * DecodePayReq takes an encoded payment request string and attempts to decode - * it, returning a full description of the conditions encoded within the - * payment request. - * - * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); - */ - decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpayments` - * ListPayments returns a list of all outgoing payments. - * - * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); - */ - listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall; - /** - * - * DeletePayment deletes an outgoing payment from DB. Note that it will not - * attempt to delete an In-Flight payment, since that would be unsafe. - * - * @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse); - */ - deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall; - /** - * - * DeleteAllPayments deletes all outgoing payments from DB. Note that it will - * not attempt to delete In-Flight payments, since that would be unsafe. - * - * @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse); - */ - deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `describegraph` - * DescribeGraph returns a description of the latest graph state from the - * point of view of the node. The graph information is partitioned into two - * components: all the nodes/vertexes, and all the edges that connect the - * vertexes themselves. As this is a directed graph, the edges also contain - * the node directional specific routing policy which includes: the time lock - * delta, fee information, etc. - * - * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); - */ - describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnodemetrics` - * GetNodeMetrics returns node metrics calculated from the graph. Currently - * the only supported metric is betweenness centrality of individual nodes. - * - * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); - */ - getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getchaninfo` - * GetChanInfo returns the latest authenticated network announcement for the - * given channel identified by its channel ID: an 8-byte integer which - * uniquely identifies the location of transaction's funding output within the - * blockchain. - * - * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); - */ - getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnodeinfo` - * GetNodeInfo returns the latest advertised, aggregated, and authenticated - * channel information for the specified node identified by its public key. - * - * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); - */ - getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `queryroutes` - * QueryRoutes attempts to query the daemon's Channel Router for a possible - * route to a target destination capable of carrying a specific amount of - * satoshis. The returned route contains the full details required to craft and - * send an HTLC, also including the necessary information that should be - * present within the Sphinx packet encapsulated within the HTLC. - * - * When using REST, the `dest_custom_records` map type can be set by appending - * `&dest_custom_records[]=` - * to the URL. Unfortunately this map type doesn't appear in the REST API - * documentation because of a bug in the grpc-gateway library. - * - * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); - */ - queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnetworkinfo` - * GetNetworkInfo returns some basic stats about the known channel graph from - * the point of view of the node. - * - * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); - */ - getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `stop` - * StopDaemon will send a shutdown request to the interrupt handler, triggering - * a graceful shutdown of the daemon. - * - * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); - */ - stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelGraph launches a streaming RPC that allows the caller to - * receive notifications upon any changes to the channel graph topology from - * the point of view of the responding node. Events notified include: new - * nodes coming online, nodes updating their authenticated attributes, new - * channels being advertised, updates in the routing policy for a directional - * channel edge, and when channels are closed on-chain. - * - * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); - */ - subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `debuglevel` - * DebugLevel allows a caller to programmatically set the logging verbosity of - * lnd. The logging can be targeted according to a coarse daemon-wide logging - * level, or in a granular fashion to specify the logging for a target - * sub-system. - * - * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); - */ - debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `feereport` - * FeeReport allows the caller to obtain a report detailing the current fee - * schedule enforced by the node globally for each channel. - * - * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); - */ - feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `updatechanpolicy` - * UpdateChannelPolicy allows the caller to update the fee schedule and - * channel policies for all channels globally, or a particular channel. - * - * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); - */ - updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `fwdinghistory` - * ForwardingHistory allows the caller to query the htlcswitch for a record of - * all HTLCs forwarded within the target time range, and integer offset - * within that time range, for a maximum number of events. If no maximum number - * of events is specified, up to 100 events will be returned. If no time-range - * is specified, then events will be returned in the order that they occured. - * - * A list of forwarding events are returned. The size of each forwarding event - * is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - * As a result each message can only contain 50k entries. Each response has - * the index offset of the last entry. The index offset can be provided to the - * request to allow the caller to skip a series of records. - * - * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); - */ - forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `exportchanbackup` - * ExportChannelBackup attempts to return an encrypted static channel backup - * for the target channel identified by it channel point. The backup is - * encrypted with a key generated from the aezeed seed of the user. The - * returned backup can either be restored using the RestoreChannelBackup - * method once lnd is running, or via the InitWallet and UnlockWallet methods - * from the WalletUnlocker service. - * - * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); - */ - exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall; - /** - * - * ExportAllChannelBackups returns static channel backups for all existing - * channels known to lnd. A set of regular singular static channel backups for - * each channel are returned. Additionally, a multi-channel backup is returned - * as well, which contains a single encrypted blob containing the backups of - * each channel. - * - * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); - */ - exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall; - /** - * - * VerifyChanBackup allows a caller to verify the integrity of a channel backup - * snapshot. This method will accept either a packed Single or a packed Multi. - * Specifying both will result in an error. - * - * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); - */ - verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall; - /** - * lncli: `restorechanbackup` - * RestoreChannelBackups accepts a set of singular channel backups, or a - * single encrypted multi-chan backup and attempts to recover any funds - * remaining within the channel. If we are able to unpack the backup, then the - * new channel will be shown under listchannels, as well as pending channels. - * - * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); - */ - restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelBackups allows a client to sub-subscribe to the most up to - * date information concerning the state of all channel backups. Each time a - * new channel is added, we return the new set of channels, along with a - * multi-chan backup containing the backup info for all channels. Each time a - * channel is closed, we send a new update, which contains new new chan back - * ups, but the updated set of encrypted multi-chan backups with the closed - * channel(s) removed. - * - * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); - */ - subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `bakemacaroon` - * BakeMacaroon allows the creation of a new macaroon with custom read and - * write permissions. No first-party caveats are added since this can be done - * offline. - * - * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); - */ - bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listmacaroonids` - * ListMacaroonIDs returns all root key IDs that are in use. - * - * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); - */ - listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `deletemacaroonid` - * DeleteMacaroonID deletes the specified macaroon ID and invalidates all - * macaroons derived from that ID. - * - * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); - */ - deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpermissions` - * ListPermissions lists all RPC method URIs and their required macaroon - * permissions to access them. - * - * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); - */ - listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall; - /** - * - * CheckMacaroonPermissions checks whether a request follows the constraints - * imposed on the macaroon and that the macaroon is authorized to follow the - * provided permissions. - * - * @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse); - */ - checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall; - /** - * - * RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A - * gRPC middleware is software component external to lnd that aims to add - * additional business logic to lnd by observing/intercepting/validating - * incoming gRPC client requests and (if needed) replacing/overwriting outgoing - * messages before they're sent to the client. When registering the middleware - * must identify itself and indicate what custom macaroon caveats it wants to - * be responsible for. Only requests that contain a macaroon with that specific - * custom caveat are then sent to the middleware for inspection. The other - * option is to register for the read-only mode in which all requests/responses - * are forwarded for interception to the middleware but the middleware is not - * allowed to modify any responses. As a security measure, _no_ middleware can - * modify responses for requests made with _unencumbered_ macaroons! - * - * @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest); - */ - registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall; - /** - * lncli: `sendcustom` - * SendCustomMessage sends a custom peer message. - * - * @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse); - */ - sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `subscribecustom` - * SubscribeCustomMessages subscribes to a stream of incoming custom peer - * messages. - * - * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); - */ - subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `listaliases` - * ListAliases returns the set of all aliases that have ever existed with - * their confirmed SCID (if it exists) and/or the base SCID (in the case of - * zero conf). - * - * @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse); - */ - listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); - */ - lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall; -} -// -// Comments in this file will be directly parsed into the API -// Documentation as descriptions of the associated method, message, or field. -// These descriptions should go right above the definition of the object, and -// can be in either block or // comment format. -// -// An RPC method can be matched to an lncli command by placing a line in the -// beginning of the description in exactly the following format: -// lncli: `methodname` -// -// Failure to specify the exact name of the command will cause documentation -// generation to fail. -// -// More information on how exactly the gRPC documentation is generated from -// this proto file can be found here: -// https://github.com/lightninglabs/lightning-api - -/** - * Lightning is the main RPC server of the daemon. - * - * @generated from protobuf service lnrpc.Lightning - */ -export class LightningClient implements ILightningClient, ServiceInfo { - typeName = Lightning.typeName; - methods = Lightning.methods; - options = Lightning.options; - constructor(private readonly _transport: RpcTransport) { - } - /** - * lncli: `walletbalance` - * WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - * confirmed unspent outputs and all unconfirmed unspent outputs under control - * of the wallet. - * - * @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse); - */ - walletBalance(input: WalletBalanceRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `channelbalance` - * ChannelBalance returns a report on the total funds across all open channels, - * categorized in local/remote, pending local/remote and unsettled local/remote - * balances. - * - * @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse); - */ - channelBalance(input: ChannelBalanceRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listchaintxns` - * GetTransactions returns a list describing all the known transactions - * relevant to the wallet. - * - * @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails); - */ - getTransactions(input: GetTransactionsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `estimatefee` - * EstimateFee asks the chain backend to estimate the fee rate and total fees - * for a transaction that pays to multiple specified outputs. - * - * When using REST, the `AddrToAmount` map type can be set by appending - * `&AddrToAmount[
]=` to the URL. Unfortunately this - * map type doesn't appear in the REST API documentation because of a bug in - * the grpc-gateway library. - * - * @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse); - */ - estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `sendcoins` - * SendCoins executes a request to send coins to a particular address. Unlike - * SendMany, this RPC call only allows creating a single output at a time. If - * neither target_conf, or sat_per_vbyte are set, then the internal wallet will - * consult its fee model to determine a fee for the default confirmation - * target. - * - * @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse); - */ - sendCoins(input: SendCoinsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listunspent` - * Deprecated, use walletrpc.ListUnspent instead. - * - * ListUnspent returns a list of all utxos spendable by the wallet with a - * number of confirmations between the specified minimum and maximum. - * - * @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse); - */ - listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeTransactions creates a uni-directional stream from the server to - * the client in which any newly discovered transactions relevant to the - * wallet are sent over. - * - * @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction); - */ - subscribeTransactions(input: GetTransactionsRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `sendmany` - * SendMany handles a request for a transaction that creates multiple specified - * outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - * the internal wallet will consult its fee model to determine a fee for the - * default confirmation target. - * - * @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse); - */ - sendMany(input: SendManyRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `newaddress` - * NewAddress creates a new address under control of the local wallet. - * - * @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse); - */ - newAddress(input: NewAddressRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[8], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `signmessage` - * SignMessage signs a message with this node's private key. The returned - * signature string is `zbase32` encoded and pubkey recoverable, meaning that - * only the message digest and signature are needed for verification. - * - * @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse); - */ - signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[9], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `verifymessage` - * VerifyMessage verifies a signature over a msg. The signature must be - * zbase32 encoded and signed by an active node in the resident node's - * channel database. In addition to returning the validity of the signature, - * VerifyMessage also returns the recovered pubkey from the signature. - * - * @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse); - */ - verifyMessage(input: VerifyMessageRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[10], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `connect` - * ConnectPeer attempts to establish a connection to a remote peer. This is at - * the networking level, and is used for communication between nodes. This is - * distinct from establishing a channel with a peer. - * - * @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse); - */ - connectPeer(input: ConnectPeerRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[11], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `disconnect` - * DisconnectPeer attempts to disconnect one peer from another identified by a - * given pubKey. In the case that we currently have a pending or active channel - * with the target peer, then this action will be not be allowed. - * - * @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse); - */ - disconnectPeer(input: DisconnectPeerRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[12], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listpeers` - * ListPeers returns a verbose listing of all currently active peers. - * - * @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse); - */ - listPeers(input: ListPeersRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[13], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribePeerEvents creates a uni-directional stream from the server to - * the client in which any events relevant to the state of peers are sent - * over. Events include peers going online and offline. - * - * @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent); - */ - subscribePeerEvents(input: PeerEventSubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[14], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `getinfo` - * GetInfo returns general information concerning the lightning node including - * it's identity pubkey, alias, the chains it is connected to, and information - * concerning the number of open+pending channels. - * - * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); - */ - getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[15], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * * lncli: `getrecoveryinfo` - * GetRecoveryInfo returns information concerning the recovery mode including - * whether it's in a recovery mode, whether the recovery is finished, and the - * progress made so far. - * - * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); - */ - getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[16], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - // TODO(roasbeef): merge with below with bool? - - /** - * lncli: `pendingchannels` - * PendingChannels returns a list of all the channels that are currently - * considered "pending". A channel is pending if it has finished the funding - * workflow and is waiting for confirmations for the funding txn, or is in the - * process of closure, either initiated cooperatively or non-cooperatively. - * - * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); - */ - pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[17], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listchannels` - * ListChannels returns a description of all the open channels that this node - * is a participant in. - * - * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); - */ - listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[18], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeChannelEvents creates a uni-directional stream from the server to - * the client in which any updates relevant to the state of the channels are - * sent over. Events include new active channels, inactive channels, and closed - * channels. - * - * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); - */ - subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[19], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `closedchannels` - * ClosedChannels returns a description of all the closed channels that - * this node was a participant in. - * - * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); - */ - closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[20], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - * call is meant to be consumed by clients to the REST proxy. As with all - * other sync calls, all byte slices are intended to be populated as hex - * encoded strings. - * - * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); - */ - openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[21], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `openchannel` - * OpenChannel attempts to open a singly funded channel specified in the - * request to a remote peer. Users are able to specify a target number of - * blocks that the funding transaction should be confirmed in, or a manual fee - * rate to us for the funding transaction. If neither are specified, then a - * lax block confirmation target is used. Each OpenStatusUpdate will return - * the pending channel ID of the in-progress channel. Depending on the - * arguments specified in the OpenChannelRequest, this pending channel ID can - * then be used to manually progress the channel funding flow. - * - * @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate); - */ - openChannel(input: OpenChannelRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[22], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `batchopenchannel` - * BatchOpenChannel attempts to open multiple single-funded channels in a - * single transaction in an atomic way. This means either all channel open - * requests succeed at once or all attempts are aborted if any of them fail. - * This is the safer variant of using PSBTs to manually fund a batch of - * channels through the OpenChannel RPC. - * - * @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse); - */ - batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[23], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * FundingStateStep is an advanced funding related call that allows the caller - * to either execute some preparatory steps for a funding workflow, or - * manually progress a funding workflow. The primary way a funding flow is - * identified is via its pending channel ID. As an example, this method can be - * used to specify that we're expecting a funding flow for a particular - * pending channel ID, for which we need to use specific parameters. - * Alternatively, this can be used to interactively drive PSBT signing for - * funding for partially complete funding transactions. - * - * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); - */ - fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall { - const method = this.methods[24], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * ChannelAcceptor dispatches a bi-directional streaming RPC in which - * OpenChannel requests are sent to the client and the client responds with - * a boolean that tells LND whether or not to accept the channel. This allows - * node operators to specify their own criteria for accepting inbound channels - * through a single persistent connection. - * - * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); - */ - channelAcceptor(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[25], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * lncli: `closechannel` - * CloseChannel attempts to close an active channel identified by its channel - * outpoint (ChannelPoint). The actions of this method can additionally be - * augmented to attempt a force close after a timeout period in the case of an - * inactive peer. If a non-force close (cooperative closure) is requested, - * then the user can specify either a target number of blocks until the - * closure transaction is confirmed, or a manual fee rate. If neither are - * specified, then a default lax, block confirmation target is used. - * - * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); - */ - closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[26], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `abandonchannel` - * AbandonChannel removes all channel state from the database except for a - * close summary. This method can be used to get rid of permanently unusable - * channels due to bugs fixed in newer versions of lnd. This method can also be - * used to remove externally funded channels where the funding transaction was - * never broadcast. Only available for non-externally funded channels in dev - * build. - * - * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); - */ - abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[27], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `sendpayment` - * Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - * bi-directional streaming RPC for sending payments through the Lightning - * Network. A single RPC invocation creates a persistent bi-directional - * stream allowing clients to rapidly send payments through the Lightning - * Network with a single persistent connection. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); - */ - sendPayment(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[28], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * - * SendPaymentSync is the synchronous non-streaming version of SendPayment. - * This RPC is intended to be consumed by clients of the REST proxy. - * Additionally, this RPC expects the destination's public key and the payment - * hash (if any) to be encoded as hex strings. - * - * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); - */ - sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[29], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `sendtoroute` - * Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - * streaming RPC for sending payment through the Lightning Network. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); - */ - sendToRoute(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[30], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * - * SendToRouteSync is a synchronous version of SendToRoute. It Will block - * until the payment either fails or succeeds. - * - * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); - */ - sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[31], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `addinvoice` - * AddInvoice attempts to add a new invoice to the invoice database. Any - * duplicated invoices are rejected, therefore all invoices *must* have a - * unique payment preimage. - * - * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); - */ - addInvoice(input: Invoice, options?: RpcOptions): UnaryCall { - const method = this.methods[32], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listinvoices` - * ListInvoices returns a list of all the invoices currently stored within the - * database. Any active debug invoices are ignored. It has full support for - * paginated responses, allowing users to query for specific invoices through - * their add_index. This can be done by using either the first_index_offset or - * last_index_offset fields included in the response as the index_offset of the - * next request. By default, the first 100 invoices created will be returned. - * Backwards pagination is also supported through the Reversed flag. - * - * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); - */ - listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[33], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `lookupinvoice` - * LookupInvoice attempts to look up an invoice according to its payment hash. - * The passed payment hash *must* be exactly 32 bytes, if not, an error is - * returned. - * - * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); - */ - lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall { - const method = this.methods[34], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeInvoices returns a uni-directional stream (server -> client) for - * notifying the client of newly added/settled invoices. The caller can - * optionally specify the add_index and/or the settle_index. If the add_index - * is specified, then we'll first start by sending add invoice events for all - * invoices with an add_index greater than the specified value. If the - * settle_index is specified, the next, we'll send out all settle events for - * invoices with a settle_index greater than the specified value. One or both - * of these fields can be set. If no fields are set, then we'll only send out - * the latest add/settle events. - * - * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); - */ - subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[35], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `decodepayreq` - * DecodePayReq takes an encoded payment request string and attempts to decode - * it, returning a full description of the conditions encoded within the - * payment request. - * - * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); - */ - decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall { - const method = this.methods[36], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listpayments` - * ListPayments returns a list of all outgoing payments. - * - * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); - */ - listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[37], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * DeletePayment deletes an outgoing payment from DB. Note that it will not - * attempt to delete an In-Flight payment, since that would be unsafe. - * - * @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse); - */ - deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[38], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * DeleteAllPayments deletes all outgoing payments from DB. Note that it will - * not attempt to delete In-Flight payments, since that would be unsafe. - * - * @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse); - */ - deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[39], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `describegraph` - * DescribeGraph returns a description of the latest graph state from the - * point of view of the node. The graph information is partitioned into two - * components: all the nodes/vertexes, and all the edges that connect the - * vertexes themselves. As this is a directed graph, the edges also contain - * the node directional specific routing policy which includes: the time lock - * delta, fee information, etc. - * - * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); - */ - describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[40], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getnodemetrics` - * GetNodeMetrics returns node metrics calculated from the graph. Currently - * the only supported metric is betweenness centrality of individual nodes. - * - * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); - */ - getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[41], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getchaninfo` - * GetChanInfo returns the latest authenticated network announcement for the - * given channel identified by its channel ID: an 8-byte integer which - * uniquely identifies the location of transaction's funding output within the - * blockchain. - * - * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); - */ - getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[42], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getnodeinfo` - * GetNodeInfo returns the latest advertised, aggregated, and authenticated - * channel information for the specified node identified by its public key. - * - * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); - */ - getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[43], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `queryroutes` - * QueryRoutes attempts to query the daemon's Channel Router for a possible - * route to a target destination capable of carrying a specific amount of - * satoshis. The returned route contains the full details required to craft and - * send an HTLC, also including the necessary information that should be - * present within the Sphinx packet encapsulated within the HTLC. - * - * When using REST, the `dest_custom_records` map type can be set by appending - * `&dest_custom_records[]=` - * to the URL. Unfortunately this map type doesn't appear in the REST API - * documentation because of a bug in the grpc-gateway library. - * - * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); - */ - queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[44], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getnetworkinfo` - * GetNetworkInfo returns some basic stats about the known channel graph from - * the point of view of the node. - * - * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); - */ - getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[45], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `stop` - * StopDaemon will send a shutdown request to the interrupt handler, triggering - * a graceful shutdown of the daemon. - * - * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); - */ - stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[46], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeChannelGraph launches a streaming RPC that allows the caller to - * receive notifications upon any changes to the channel graph topology from - * the point of view of the responding node. Events notified include: new - * nodes coming online, nodes updating their authenticated attributes, new - * channels being advertised, updates in the routing policy for a directional - * channel edge, and when channels are closed on-chain. - * - * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); - */ - subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[47], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `debuglevel` - * DebugLevel allows a caller to programmatically set the logging verbosity of - * lnd. The logging can be targeted according to a coarse daemon-wide logging - * level, or in a granular fashion to specify the logging for a target - * sub-system. - * - * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); - */ - debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[48], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `feereport` - * FeeReport allows the caller to obtain a report detailing the current fee - * schedule enforced by the node globally for each channel. - * - * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); - */ - feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[49], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `updatechanpolicy` - * UpdateChannelPolicy allows the caller to update the fee schedule and - * channel policies for all channels globally, or a particular channel. - * - * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); - */ - updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[50], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `fwdinghistory` - * ForwardingHistory allows the caller to query the htlcswitch for a record of - * all HTLCs forwarded within the target time range, and integer offset - * within that time range, for a maximum number of events. If no maximum number - * of events is specified, up to 100 events will be returned. If no time-range - * is specified, then events will be returned in the order that they occured. - * - * A list of forwarding events are returned. The size of each forwarding event - * is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - * As a result each message can only contain 50k entries. Each response has - * the index offset of the last entry. The index offset can be provided to the - * request to allow the caller to skip a series of records. - * - * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); - */ - forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[51], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `exportchanbackup` - * ExportChannelBackup attempts to return an encrypted static channel backup - * for the target channel identified by it channel point. The backup is - * encrypted with a key generated from the aezeed seed of the user. The - * returned backup can either be restored using the RestoreChannelBackup - * method once lnd is running, or via the InitWallet and UnlockWallet methods - * from the WalletUnlocker service. - * - * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); - */ - exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[52], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * ExportAllChannelBackups returns static channel backups for all existing - * channels known to lnd. A set of regular singular static channel backups for - * each channel are returned. Additionally, a multi-channel backup is returned - * as well, which contains a single encrypted blob containing the backups of - * each channel. - * - * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); - */ - exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[53], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * VerifyChanBackup allows a caller to verify the integrity of a channel backup - * snapshot. This method will accept either a packed Single or a packed Multi. - * Specifying both will result in an error. - * - * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); - */ - verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall { - const method = this.methods[54], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `restorechanbackup` - * RestoreChannelBackups accepts a set of singular channel backups, or a - * single encrypted multi-chan backup and attempts to recover any funds - * remaining within the channel. If we are able to unpack the backup, then the - * new channel will be shown under listchannels, as well as pending channels. - * - * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); - */ - restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[55], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeChannelBackups allows a client to sub-subscribe to the most up to - * date information concerning the state of all channel backups. Each time a - * new channel is added, we return the new set of channels, along with a - * multi-chan backup containing the backup info for all channels. Each time a - * channel is closed, we send a new update, which contains new new chan back - * ups, but the updated set of encrypted multi-chan backups with the closed - * channel(s) removed. - * - * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); - */ - subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[56], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `bakemacaroon` - * BakeMacaroon allows the creation of a new macaroon with custom read and - * write permissions. No first-party caveats are added since this can be done - * offline. - * - * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); - */ - bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[57], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listmacaroonids` - * ListMacaroonIDs returns all root key IDs that are in use. - * - * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); - */ - listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[58], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `deletemacaroonid` - * DeleteMacaroonID deletes the specified macaroon ID and invalidates all - * macaroons derived from that ID. - * - * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); - */ - deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[59], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listpermissions` - * ListPermissions lists all RPC method URIs and their required macaroon - * permissions to access them. - * - * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); - */ - listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[60], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * CheckMacaroonPermissions checks whether a request follows the constraints - * imposed on the macaroon and that the macaroon is authorized to follow the - * provided permissions. - * - * @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse); - */ - checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[61], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A - * gRPC middleware is software component external to lnd that aims to add - * additional business logic to lnd by observing/intercepting/validating - * incoming gRPC client requests and (if needed) replacing/overwriting outgoing - * messages before they're sent to the client. When registering the middleware - * must identify itself and indicate what custom macaroon caveats it wants to - * be responsible for. Only requests that contain a macaroon with that specific - * custom caveat are then sent to the middleware for inspection. The other - * option is to register for the read-only mode in which all requests/responses - * are forwarded for interception to the middleware but the middleware is not - * allowed to modify any responses. As a security measure, _no_ middleware can - * modify responses for requests made with _unencumbered_ macaroons! - * - * @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest); - */ - registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[62], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * lncli: `sendcustom` - * SendCustomMessage sends a custom peer message. - * - * @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse); - */ - sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[63], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `subscribecustom` - * SubscribeCustomMessages subscribes to a stream of incoming custom peer - * messages. - * - * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); - */ - subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[64], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `listaliases` - * ListAliases returns the set of all aliases that have ever existed with - * their confirmed SCID (if it exists) and/or the base SCID (in the case of - * zero conf). - * - * @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse); - */ - listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[65], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); - */ - lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[66], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } -} +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) +// tslint:disable +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import { Lightning } from "./lightning.js"; +import type { LookupHtlcResponse } from "./lightning.js"; +import type { LookupHtlcRequest } from "./lightning.js"; +import type { ListAliasesResponse } from "./lightning.js"; +import type { ListAliasesRequest } from "./lightning.js"; +import type { CustomMessage } from "./lightning.js"; +import type { SubscribeCustomMessagesRequest } from "./lightning.js"; +import type { SendCustomMessageResponse } from "./lightning.js"; +import type { SendCustomMessageRequest } from "./lightning.js"; +import type { RPCMiddlewareRequest } from "./lightning.js"; +import type { RPCMiddlewareResponse } from "./lightning.js"; +import type { CheckMacPermResponse } from "./lightning.js"; +import type { CheckMacPermRequest } from "./lightning.js"; +import type { ListPermissionsResponse } from "./lightning.js"; +import type { ListPermissionsRequest } from "./lightning.js"; +import type { DeleteMacaroonIDResponse } from "./lightning.js"; +import type { DeleteMacaroonIDRequest } from "./lightning.js"; +import type { ListMacaroonIDsResponse } from "./lightning.js"; +import type { ListMacaroonIDsRequest } from "./lightning.js"; +import type { BakeMacaroonResponse } from "./lightning.js"; +import type { BakeMacaroonRequest } from "./lightning.js"; +import type { ChannelBackupSubscription } from "./lightning.js"; +import type { RestoreBackupResponse } from "./lightning.js"; +import type { RestoreChanBackupRequest } from "./lightning.js"; +import type { VerifyChanBackupResponse } from "./lightning.js"; +import type { ChanBackupSnapshot } from "./lightning.js"; +import type { ChanBackupExportRequest } from "./lightning.js"; +import type { ChannelBackup } from "./lightning.js"; +import type { ExportChannelBackupRequest } from "./lightning.js"; +import type { ForwardingHistoryResponse } from "./lightning.js"; +import type { ForwardingHistoryRequest } from "./lightning.js"; +import type { PolicyUpdateResponse } from "./lightning.js"; +import type { PolicyUpdateRequest } from "./lightning.js"; +import type { FeeReportResponse } from "./lightning.js"; +import type { FeeReportRequest } from "./lightning.js"; +import type { DebugLevelResponse } from "./lightning.js"; +import type { DebugLevelRequest } from "./lightning.js"; +import type { GraphTopologyUpdate } from "./lightning.js"; +import type { GraphTopologySubscription } from "./lightning.js"; +import type { StopResponse } from "./lightning.js"; +import type { StopRequest } from "./lightning.js"; +import type { NetworkInfo } from "./lightning.js"; +import type { NetworkInfoRequest } from "./lightning.js"; +import type { QueryRoutesResponse } from "./lightning.js"; +import type { QueryRoutesRequest } from "./lightning.js"; +import type { NodeInfo } from "./lightning.js"; +import type { NodeInfoRequest } from "./lightning.js"; +import type { ChannelEdge } from "./lightning.js"; +import type { ChanInfoRequest } from "./lightning.js"; +import type { NodeMetricsResponse } from "./lightning.js"; +import type { NodeMetricsRequest } from "./lightning.js"; +import type { ChannelGraph } from "./lightning.js"; +import type { ChannelGraphRequest } from "./lightning.js"; +import type { DeleteAllPaymentsResponse } from "./lightning.js"; +import type { DeleteAllPaymentsRequest } from "./lightning.js"; +import type { DeletePaymentResponse } from "./lightning.js"; +import type { DeletePaymentRequest } from "./lightning.js"; +import type { ListPaymentsResponse } from "./lightning.js"; +import type { ListPaymentsRequest } from "./lightning.js"; +import type { PayReq } from "./lightning.js"; +import type { PayReqString } from "./lightning.js"; +import type { InvoiceSubscription } from "./lightning.js"; +import type { PaymentHash } from "./lightning.js"; +import type { ListInvoiceResponse } from "./lightning.js"; +import type { ListInvoiceRequest } from "./lightning.js"; +import type { AddInvoiceResponse } from "./lightning.js"; +import type { Invoice } from "./lightning.js"; +import type { SendToRouteRequest } from "./lightning.js"; +import type { SendResponse } from "./lightning.js"; +import type { SendRequest } from "./lightning.js"; +import type { AbandonChannelResponse } from "./lightning.js"; +import type { AbandonChannelRequest } from "./lightning.js"; +import type { CloseStatusUpdate } from "./lightning.js"; +import type { CloseChannelRequest } from "./lightning.js"; +import type { ChannelAcceptRequest } from "./lightning.js"; +import type { ChannelAcceptResponse } from "./lightning.js"; +import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; +import type { FundingStateStepResp } from "./lightning.js"; +import type { FundingTransitionMsg } from "./lightning.js"; +import type { BatchOpenChannelResponse } from "./lightning.js"; +import type { BatchOpenChannelRequest } from "./lightning.js"; +import type { OpenStatusUpdate } from "./lightning.js"; +import type { ChannelPoint } from "./lightning.js"; +import type { OpenChannelRequest } from "./lightning.js"; +import type { ClosedChannelsResponse } from "./lightning.js"; +import type { ClosedChannelsRequest } from "./lightning.js"; +import type { ChannelEventUpdate } from "./lightning.js"; +import type { ChannelEventSubscription } from "./lightning.js"; +import type { ListChannelsResponse } from "./lightning.js"; +import type { ListChannelsRequest } from "./lightning.js"; +import type { PendingChannelsResponse } from "./lightning.js"; +import type { PendingChannelsRequest } from "./lightning.js"; +import type { GetRecoveryInfoResponse } from "./lightning.js"; +import type { GetRecoveryInfoRequest } from "./lightning.js"; +import type { GetInfoResponse } from "./lightning.js"; +import type { GetInfoRequest } from "./lightning.js"; +import type { PeerEvent } from "./lightning.js"; +import type { PeerEventSubscription } from "./lightning.js"; +import type { ListPeersResponse } from "./lightning.js"; +import type { ListPeersRequest } from "./lightning.js"; +import type { DisconnectPeerResponse } from "./lightning.js"; +import type { DisconnectPeerRequest } from "./lightning.js"; +import type { ConnectPeerResponse } from "./lightning.js"; +import type { ConnectPeerRequest } from "./lightning.js"; +import type { VerifyMessageResponse } from "./lightning.js"; +import type { VerifyMessageRequest } from "./lightning.js"; +import type { SignMessageResponse } from "./lightning.js"; +import type { SignMessageRequest } from "./lightning.js"; +import type { NewAddressResponse } from "./lightning.js"; +import type { NewAddressRequest } from "./lightning.js"; +import type { SendManyResponse } from "./lightning.js"; +import type { SendManyRequest } from "./lightning.js"; +import type { Transaction } from "./lightning.js"; +import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; +import type { ListUnspentResponse } from "./lightning.js"; +import type { ListUnspentRequest } from "./lightning.js"; +import type { SendCoinsResponse } from "./lightning.js"; +import type { SendCoinsRequest } from "./lightning.js"; +import type { EstimateFeeResponse } from "./lightning.js"; +import type { EstimateFeeRequest } from "./lightning.js"; +import type { TransactionDetails } from "./lightning.js"; +import type { GetTransactionsRequest } from "./lightning.js"; +import type { ChannelBalanceResponse } from "./lightning.js"; +import type { ChannelBalanceRequest } from "./lightning.js"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +import type { WalletBalanceResponse } from "./lightning.js"; +import type { WalletBalanceRequest } from "./lightning.js"; +import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +// +// Comments in this file will be directly parsed into the API +// Documentation as descriptions of the associated method, message, or field. +// These descriptions should go right above the definition of the object, and +// can be in either block or // comment format. +// +// An RPC method can be matched to an lncli command by placing a line in the +// beginning of the description in exactly the following format: +// lncli: `methodname` +// +// Failure to specify the exact name of the command will cause documentation +// generation to fail. +// +// More information on how exactly the gRPC documentation is generated from +// this proto file can be found here: +// https://github.com/lightninglabs/lightning-api + +/** + * Lightning is the main RPC server of the daemon. + * + * @generated from protobuf service lnrpc.Lightning + */ +export interface ILightningClient { + /** + * lncli: `walletbalance` + * WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + * confirmed unspent outputs and all unconfirmed unspent outputs under control + * of the wallet. + * + * @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse); + */ + walletBalance(input: WalletBalanceRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `channelbalance` + * ChannelBalance returns a report on the total funds across all open channels, + * categorized in local/remote, pending local/remote and unsettled local/remote + * balances. + * + * @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse); + */ + channelBalance(input: ChannelBalanceRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `listchaintxns` + * GetTransactions returns a list describing all the known transactions + * relevant to the wallet. + * + * @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails); + */ + getTransactions(input: GetTransactionsRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `estimatefee` + * EstimateFee asks the chain backend to estimate the fee rate and total fees + * for a transaction that pays to multiple specified outputs. + * + * When using REST, the `AddrToAmount` map type can be set by appending + * `&AddrToAmount[
]=` to the URL. Unfortunately this + * map type doesn't appear in the REST API documentation because of a bug in + * the grpc-gateway library. + * + * @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse); + */ + estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `sendcoins` + * SendCoins executes a request to send coins to a particular address. Unlike + * SendMany, this RPC call only allows creating a single output at a time. If + * neither target_conf, or sat_per_vbyte are set, then the internal wallet will + * consult its fee model to determine a fee for the default confirmation + * target. + * + * @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse); + */ + sendCoins(input: SendCoinsRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `listunspent` + * Deprecated, use walletrpc.ListUnspent instead. + * + * ListUnspent returns a list of all utxos spendable by the wallet with a + * number of confirmations between the specified minimum and maximum. + * + * @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse); + */ + listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall; + /** + * + * SubscribeTransactions creates a uni-directional stream from the server to + * the client in which any newly discovered transactions relevant to the + * wallet are sent over. + * + * @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction); + */ + subscribeTransactions(input: GetTransactionsRequest, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `sendmany` + * SendMany handles a request for a transaction that creates multiple specified + * outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then + * the internal wallet will consult its fee model to determine a fee for the + * default confirmation target. + * + * @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse); + */ + sendMany(input: SendManyRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `newaddress` + * NewAddress creates a new address under control of the local wallet. + * + * @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse); + */ + newAddress(input: NewAddressRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `signmessage` + * SignMessage signs a message with this node's private key. The returned + * signature string is `zbase32` encoded and pubkey recoverable, meaning that + * only the message digest and signature are needed for verification. + * + * @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse); + */ + signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `verifymessage` + * VerifyMessage verifies a signature over a msg. The signature must be + * zbase32 encoded and signed by an active node in the resident node's + * channel database. In addition to returning the validity of the signature, + * VerifyMessage also returns the recovered pubkey from the signature. + * + * @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse); + */ + verifyMessage(input: VerifyMessageRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `connect` + * ConnectPeer attempts to establish a connection to a remote peer. This is at + * the networking level, and is used for communication between nodes. This is + * distinct from establishing a channel with a peer. + * + * @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse); + */ + connectPeer(input: ConnectPeerRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `disconnect` + * DisconnectPeer attempts to disconnect one peer from another identified by a + * given pubKey. In the case that we currently have a pending or active channel + * with the target peer, then this action will be not be allowed. + * + * @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse); + */ + disconnectPeer(input: DisconnectPeerRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `listpeers` + * ListPeers returns a verbose listing of all currently active peers. + * + * @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse); + */ + listPeers(input: ListPeersRequest, options?: RpcOptions): UnaryCall; + /** + * + * SubscribePeerEvents creates a uni-directional stream from the server to + * the client in which any events relevant to the state of peers are sent + * over. Events include peers going online and offline. + * + * @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent); + */ + subscribePeerEvents(input: PeerEventSubscription, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `getinfo` + * GetInfo returns general information concerning the lightning node including + * it's identity pubkey, alias, the chains it is connected to, and information + * concerning the number of open+pending channels. + * + * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); + */ + getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall; + /** + * * lncli: `getrecoveryinfo` + * GetRecoveryInfo returns information concerning the recovery mode including + * whether it's in a recovery mode, whether the recovery is finished, and the + * progress made so far. + * + * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); + */ + getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall; + // TODO(roasbeef): merge with below with bool? + + /** + * lncli: `pendingchannels` + * PendingChannels returns a list of all the channels that are currently + * considered "pending". A channel is pending if it has finished the funding + * workflow and is waiting for confirmations for the funding txn, or is in the + * process of closure, either initiated cooperatively or non-cooperatively. + * + * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); + */ + pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `listchannels` + * ListChannels returns a description of all the open channels that this node + * is a participant in. + * + * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); + */ + listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall; + /** + * + * SubscribeChannelEvents creates a uni-directional stream from the server to + * the client in which any updates relevant to the state of the channels are + * sent over. Events include new active channels, inactive channels, and closed + * channels. + * + * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); + */ + subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `closedchannels` + * ClosedChannels returns a description of all the closed channels that + * this node was a participant in. + * + * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); + */ + closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall; + /** + * + * OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + * call is meant to be consumed by clients to the REST proxy. As with all + * other sync calls, all byte slices are intended to be populated as hex + * encoded strings. + * + * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); + */ + openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `openchannel` + * OpenChannel attempts to open a singly funded channel specified in the + * request to a remote peer. Users are able to specify a target number of + * blocks that the funding transaction should be confirmed in, or a manual fee + * rate to us for the funding transaction. If neither are specified, then a + * lax block confirmation target is used. Each OpenStatusUpdate will return + * the pending channel ID of the in-progress channel. Depending on the + * arguments specified in the OpenChannelRequest, this pending channel ID can + * then be used to manually progress the channel funding flow. + * + * @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate); + */ + openChannel(input: OpenChannelRequest, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `batchopenchannel` + * BatchOpenChannel attempts to open multiple single-funded channels in a + * single transaction in an atomic way. This means either all channel open + * requests succeed at once or all attempts are aborted if any of them fail. + * This is the safer variant of using PSBTs to manually fund a batch of + * channels through the OpenChannel RPC. + * + * @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse); + */ + batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall; + /** + * + * FundingStateStep is an advanced funding related call that allows the caller + * to either execute some preparatory steps for a funding workflow, or + * manually progress a funding workflow. The primary way a funding flow is + * identified is via its pending channel ID. As an example, this method can be + * used to specify that we're expecting a funding flow for a particular + * pending channel ID, for which we need to use specific parameters. + * Alternatively, this can be used to interactively drive PSBT signing for + * funding for partially complete funding transactions. + * + * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); + */ + fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall; + /** + * + * ChannelAcceptor dispatches a bi-directional streaming RPC in which + * OpenChannel requests are sent to the client and the client responds with + * a boolean that tells LND whether or not to accept the channel. This allows + * node operators to specify their own criteria for accepting inbound channels + * through a single persistent connection. + * + * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); + */ + channelAcceptor(options?: RpcOptions): DuplexStreamingCall; + /** + * lncli: `closechannel` + * CloseChannel attempts to close an active channel identified by its channel + * outpoint (ChannelPoint). The actions of this method can additionally be + * augmented to attempt a force close after a timeout period in the case of an + * inactive peer. If a non-force close (cooperative closure) is requested, + * then the user can specify either a target number of blocks until the + * closure transaction is confirmed, or a manual fee rate. If neither are + * specified, then a default lax, block confirmation target is used. + * + * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); + */ + closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `abandonchannel` + * AbandonChannel removes all channel state from the database except for a + * close summary. This method can be used to get rid of permanently unusable + * channels due to bugs fixed in newer versions of lnd. This method can also be + * used to remove externally funded channels where the funding transaction was + * never broadcast. Only available for non-externally funded channels in dev + * build. + * + * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); + */ + abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `sendpayment` + * Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a + * bi-directional streaming RPC for sending payments through the Lightning + * Network. A single RPC invocation creates a persistent bi-directional + * stream allowing clients to rapidly send payments through the Lightning + * Network with a single persistent connection. + * + * @deprecated + * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); + */ + sendPayment(options?: RpcOptions): DuplexStreamingCall; + /** + * + * SendPaymentSync is the synchronous non-streaming version of SendPayment. + * This RPC is intended to be consumed by clients of the REST proxy. + * Additionally, this RPC expects the destination's public key and the payment + * hash (if any) to be encoded as hex strings. + * + * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); + */ + sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `sendtoroute` + * Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional + * streaming RPC for sending payment through the Lightning Network. This + * method differs from SendPayment in that it allows users to specify a full + * route manually. This can be used for things like rebalancing, and atomic + * swaps. + * + * @deprecated + * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); + */ + sendToRoute(options?: RpcOptions): DuplexStreamingCall; + /** + * + * SendToRouteSync is a synchronous version of SendToRoute. It Will block + * until the payment either fails or succeeds. + * + * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); + */ + sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `addinvoice` + * AddInvoice attempts to add a new invoice to the invoice database. Any + * duplicated invoices are rejected, therefore all invoices *must* have a + * unique payment preimage. + * + * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); + */ + addInvoice(input: Invoice, options?: RpcOptions): UnaryCall; + /** + * lncli: `listinvoices` + * ListInvoices returns a list of all the invoices currently stored within the + * database. Any active debug invoices are ignored. It has full support for + * paginated responses, allowing users to query for specific invoices through + * their add_index. This can be done by using either the first_index_offset or + * last_index_offset fields included in the response as the index_offset of the + * next request. By default, the first 100 invoices created will be returned. + * Backwards pagination is also supported through the Reversed flag. + * + * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); + */ + listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `lookupinvoice` + * LookupInvoice attempts to look up an invoice according to its payment hash. + * The passed payment hash *must* be exactly 32 bytes, if not, an error is + * returned. + * + * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); + */ + lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall; + /** + * + * SubscribeInvoices returns a uni-directional stream (server -> client) for + * notifying the client of newly added/settled invoices. The caller can + * optionally specify the add_index and/or the settle_index. If the add_index + * is specified, then we'll first start by sending add invoice events for all + * invoices with an add_index greater than the specified value. If the + * settle_index is specified, the next, we'll send out all settle events for + * invoices with a settle_index greater than the specified value. One or both + * of these fields can be set. If no fields are set, then we'll only send out + * the latest add/settle events. + * + * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); + */ + subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `decodepayreq` + * DecodePayReq takes an encoded payment request string and attempts to decode + * it, returning a full description of the conditions encoded within the + * payment request. + * + * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); + */ + decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall; + /** + * lncli: `listpayments` + * ListPayments returns a list of all outgoing payments. + * + * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); + */ + listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall; + /** + * + * DeletePayment deletes an outgoing payment from DB. Note that it will not + * attempt to delete an In-Flight payment, since that would be unsafe. + * + * @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse); + */ + deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall; + /** + * + * DeleteAllPayments deletes all outgoing payments from DB. Note that it will + * not attempt to delete In-Flight payments, since that would be unsafe. + * + * @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse); + */ + deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `describegraph` + * DescribeGraph returns a description of the latest graph state from the + * point of view of the node. The graph information is partitioned into two + * components: all the nodes/vertexes, and all the edges that connect the + * vertexes themselves. As this is a directed graph, the edges also contain + * the node directional specific routing policy which includes: the time lock + * delta, fee information, etc. + * + * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); + */ + describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `getnodemetrics` + * GetNodeMetrics returns node metrics calculated from the graph. Currently + * the only supported metric is betweenness centrality of individual nodes. + * + * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); + */ + getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `getchaninfo` + * GetChanInfo returns the latest authenticated network announcement for the + * given channel identified by its channel ID: an 8-byte integer which + * uniquely identifies the location of transaction's funding output within the + * blockchain. + * + * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); + */ + getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `getnodeinfo` + * GetNodeInfo returns the latest advertised, aggregated, and authenticated + * channel information for the specified node identified by its public key. + * + * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); + */ + getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `queryroutes` + * QueryRoutes attempts to query the daemon's Channel Router for a possible + * route to a target destination capable of carrying a specific amount of + * satoshis. The returned route contains the full details required to craft and + * send an HTLC, also including the necessary information that should be + * present within the Sphinx packet encapsulated within the HTLC. + * + * When using REST, the `dest_custom_records` map type can be set by appending + * `&dest_custom_records[]=` + * to the URL. Unfortunately this map type doesn't appear in the REST API + * documentation because of a bug in the grpc-gateway library. + * + * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); + */ + queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `getnetworkinfo` + * GetNetworkInfo returns some basic stats about the known channel graph from + * the point of view of the node. + * + * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); + */ + getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `stop` + * StopDaemon will send a shutdown request to the interrupt handler, triggering + * a graceful shutdown of the daemon. + * + * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); + */ + stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall; + /** + * + * SubscribeChannelGraph launches a streaming RPC that allows the caller to + * receive notifications upon any changes to the channel graph topology from + * the point of view of the responding node. Events notified include: new + * nodes coming online, nodes updating their authenticated attributes, new + * channels being advertised, updates in the routing policy for a directional + * channel edge, and when channels are closed on-chain. + * + * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); + */ + subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `debuglevel` + * DebugLevel allows a caller to programmatically set the logging verbosity of + * lnd. The logging can be targeted according to a coarse daemon-wide logging + * level, or in a granular fashion to specify the logging for a target + * sub-system. + * + * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); + */ + debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `feereport` + * FeeReport allows the caller to obtain a report detailing the current fee + * schedule enforced by the node globally for each channel. + * + * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); + */ + feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `updatechanpolicy` + * UpdateChannelPolicy allows the caller to update the fee schedule and + * channel policies for all channels globally, or a particular channel. + * + * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); + */ + updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `fwdinghistory` + * ForwardingHistory allows the caller to query the htlcswitch for a record of + * all HTLCs forwarded within the target time range, and integer offset + * within that time range, for a maximum number of events. If no maximum number + * of events is specified, up to 100 events will be returned. If no time-range + * is specified, then events will be returned in the order that they occured. + * + * A list of forwarding events are returned. The size of each forwarding event + * is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. + * As a result each message can only contain 50k entries. Each response has + * the index offset of the last entry. The index offset can be provided to the + * request to allow the caller to skip a series of records. + * + * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); + */ + forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `exportchanbackup` + * ExportChannelBackup attempts to return an encrypted static channel backup + * for the target channel identified by it channel point. The backup is + * encrypted with a key generated from the aezeed seed of the user. The + * returned backup can either be restored using the RestoreChannelBackup + * method once lnd is running, or via the InitWallet and UnlockWallet methods + * from the WalletUnlocker service. + * + * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); + */ + exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall; + /** + * + * ExportAllChannelBackups returns static channel backups for all existing + * channels known to lnd. A set of regular singular static channel backups for + * each channel are returned. Additionally, a multi-channel backup is returned + * as well, which contains a single encrypted blob containing the backups of + * each channel. + * + * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); + */ + exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall; + /** + * + * VerifyChanBackup allows a caller to verify the integrity of a channel backup + * snapshot. This method will accept either a packed Single or a packed Multi. + * Specifying both will result in an error. + * + * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); + */ + verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall; + /** + * lncli: `restorechanbackup` + * RestoreChannelBackups accepts a set of singular channel backups, or a + * single encrypted multi-chan backup and attempts to recover any funds + * remaining within the channel. If we are able to unpack the backup, then the + * new channel will be shown under listchannels, as well as pending channels. + * + * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); + */ + restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall; + /** + * + * SubscribeChannelBackups allows a client to sub-subscribe to the most up to + * date information concerning the state of all channel backups. Each time a + * new channel is added, we return the new set of channels, along with a + * multi-chan backup containing the backup info for all channels. Each time a + * channel is closed, we send a new update, which contains new new chan back + * ups, but the updated set of encrypted multi-chan backups with the closed + * channel(s) removed. + * + * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); + */ + subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `bakemacaroon` + * BakeMacaroon allows the creation of a new macaroon with custom read and + * write permissions. No first-party caveats are added since this can be done + * offline. + * + * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); + */ + bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `listmacaroonids` + * ListMacaroonIDs returns all root key IDs that are in use. + * + * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); + */ + listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `deletemacaroonid` + * DeleteMacaroonID deletes the specified macaroon ID and invalidates all + * macaroons derived from that ID. + * + * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); + */ + deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `listpermissions` + * ListPermissions lists all RPC method URIs and their required macaroon + * permissions to access them. + * + * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); + */ + listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall; + /** + * + * CheckMacaroonPermissions checks whether a request follows the constraints + * imposed on the macaroon and that the macaroon is authorized to follow the + * provided permissions. + * + * @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse); + */ + checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall; + /** + * + * RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A + * gRPC middleware is software component external to lnd that aims to add + * additional business logic to lnd by observing/intercepting/validating + * incoming gRPC client requests and (if needed) replacing/overwriting outgoing + * messages before they're sent to the client. When registering the middleware + * must identify itself and indicate what custom macaroon caveats it wants to + * be responsible for. Only requests that contain a macaroon with that specific + * custom caveat are then sent to the middleware for inspection. The other + * option is to register for the read-only mode in which all requests/responses + * are forwarded for interception to the middleware but the middleware is not + * allowed to modify any responses. As a security measure, _no_ middleware can + * modify responses for requests made with _unencumbered_ macaroons! + * + * @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest); + */ + registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall; + /** + * lncli: `sendcustom` + * SendCustomMessage sends a custom peer message. + * + * @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse); + */ + sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `subscribecustom` + * SubscribeCustomMessages subscribes to a stream of incoming custom peer + * messages. + * + * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); + */ + subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `listaliases` + * ListAliases returns the set of all aliases that have ever existed with + * their confirmed SCID (if it exists) and/or the base SCID (in the case of + * zero conf). + * + * @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse); + */ + listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); + */ + lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall; +} +// +// Comments in this file will be directly parsed into the API +// Documentation as descriptions of the associated method, message, or field. +// These descriptions should go right above the definition of the object, and +// can be in either block or // comment format. +// +// An RPC method can be matched to an lncli command by placing a line in the +// beginning of the description in exactly the following format: +// lncli: `methodname` +// +// Failure to specify the exact name of the command will cause documentation +// generation to fail. +// +// More information on how exactly the gRPC documentation is generated from +// this proto file can be found here: +// https://github.com/lightninglabs/lightning-api + +/** + * Lightning is the main RPC server of the daemon. + * + * @generated from protobuf service lnrpc.Lightning + */ +export class LightningClient implements ILightningClient, ServiceInfo { + typeName = Lightning.typeName; + methods = Lightning.methods; + options = Lightning.options; + constructor(private readonly _transport: RpcTransport) { + } + /** + * lncli: `walletbalance` + * WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + * confirmed unspent outputs and all unconfirmed unspent outputs under control + * of the wallet. + * + * @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse); + */ + walletBalance(input: WalletBalanceRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `channelbalance` + * ChannelBalance returns a report on the total funds across all open channels, + * categorized in local/remote, pending local/remote and unsettled local/remote + * balances. + * + * @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse); + */ + channelBalance(input: ChannelBalanceRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[1], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listchaintxns` + * GetTransactions returns a list describing all the known transactions + * relevant to the wallet. + * + * @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails); + */ + getTransactions(input: GetTransactionsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `estimatefee` + * EstimateFee asks the chain backend to estimate the fee rate and total fees + * for a transaction that pays to multiple specified outputs. + * + * When using REST, the `AddrToAmount` map type can be set by appending + * `&AddrToAmount[
]=` to the URL. Unfortunately this + * map type doesn't appear in the REST API documentation because of a bug in + * the grpc-gateway library. + * + * @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse); + */ + estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[3], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `sendcoins` + * SendCoins executes a request to send coins to a particular address. Unlike + * SendMany, this RPC call only allows creating a single output at a time. If + * neither target_conf, or sat_per_vbyte are set, then the internal wallet will + * consult its fee model to determine a fee for the default confirmation + * target. + * + * @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse); + */ + sendCoins(input: SendCoinsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[4], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listunspent` + * Deprecated, use walletrpc.ListUnspent instead. + * + * ListUnspent returns a list of all utxos spendable by the wallet with a + * number of confirmations between the specified minimum and maximum. + * + * @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse); + */ + listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[5], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SubscribeTransactions creates a uni-directional stream from the server to + * the client in which any newly discovered transactions relevant to the + * wallet are sent over. + * + * @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction); + */ + subscribeTransactions(input: GetTransactionsRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[6], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `sendmany` + * SendMany handles a request for a transaction that creates multiple specified + * outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then + * the internal wallet will consult its fee model to determine a fee for the + * default confirmation target. + * + * @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse); + */ + sendMany(input: SendManyRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[7], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `newaddress` + * NewAddress creates a new address under control of the local wallet. + * + * @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse); + */ + newAddress(input: NewAddressRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[8], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `signmessage` + * SignMessage signs a message with this node's private key. The returned + * signature string is `zbase32` encoded and pubkey recoverable, meaning that + * only the message digest and signature are needed for verification. + * + * @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse); + */ + signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[9], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `verifymessage` + * VerifyMessage verifies a signature over a msg. The signature must be + * zbase32 encoded and signed by an active node in the resident node's + * channel database. In addition to returning the validity of the signature, + * VerifyMessage also returns the recovered pubkey from the signature. + * + * @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse); + */ + verifyMessage(input: VerifyMessageRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[10], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `connect` + * ConnectPeer attempts to establish a connection to a remote peer. This is at + * the networking level, and is used for communication between nodes. This is + * distinct from establishing a channel with a peer. + * + * @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse); + */ + connectPeer(input: ConnectPeerRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[11], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `disconnect` + * DisconnectPeer attempts to disconnect one peer from another identified by a + * given pubKey. In the case that we currently have a pending or active channel + * with the target peer, then this action will be not be allowed. + * + * @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse); + */ + disconnectPeer(input: DisconnectPeerRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[12], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listpeers` + * ListPeers returns a verbose listing of all currently active peers. + * + * @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse); + */ + listPeers(input: ListPeersRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[13], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SubscribePeerEvents creates a uni-directional stream from the server to + * the client in which any events relevant to the state of peers are sent + * over. Events include peers going online and offline. + * + * @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent); + */ + subscribePeerEvents(input: PeerEventSubscription, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[14], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `getinfo` + * GetInfo returns general information concerning the lightning node including + * it's identity pubkey, alias, the chains it is connected to, and information + * concerning the number of open+pending channels. + * + * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); + */ + getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[15], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * * lncli: `getrecoveryinfo` + * GetRecoveryInfo returns information concerning the recovery mode including + * whether it's in a recovery mode, whether the recovery is finished, and the + * progress made so far. + * + * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); + */ + getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[16], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + // TODO(roasbeef): merge with below with bool? + + /** + * lncli: `pendingchannels` + * PendingChannels returns a list of all the channels that are currently + * considered "pending". A channel is pending if it has finished the funding + * workflow and is waiting for confirmations for the funding txn, or is in the + * process of closure, either initiated cooperatively or non-cooperatively. + * + * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); + */ + pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[17], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listchannels` + * ListChannels returns a description of all the open channels that this node + * is a participant in. + * + * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); + */ + listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[18], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SubscribeChannelEvents creates a uni-directional stream from the server to + * the client in which any updates relevant to the state of the channels are + * sent over. Events include new active channels, inactive channels, and closed + * channels. + * + * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); + */ + subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[19], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `closedchannels` + * ClosedChannels returns a description of all the closed channels that + * this node was a participant in. + * + * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); + */ + closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[20], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + * call is meant to be consumed by clients to the REST proxy. As with all + * other sync calls, all byte slices are intended to be populated as hex + * encoded strings. + * + * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); + */ + openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[21], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `openchannel` + * OpenChannel attempts to open a singly funded channel specified in the + * request to a remote peer. Users are able to specify a target number of + * blocks that the funding transaction should be confirmed in, or a manual fee + * rate to us for the funding transaction. If neither are specified, then a + * lax block confirmation target is used. Each OpenStatusUpdate will return + * the pending channel ID of the in-progress channel. Depending on the + * arguments specified in the OpenChannelRequest, this pending channel ID can + * then be used to manually progress the channel funding flow. + * + * @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate); + */ + openChannel(input: OpenChannelRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[22], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `batchopenchannel` + * BatchOpenChannel attempts to open multiple single-funded channels in a + * single transaction in an atomic way. This means either all channel open + * requests succeed at once or all attempts are aborted if any of them fail. + * This is the safer variant of using PSBTs to manually fund a batch of + * channels through the OpenChannel RPC. + * + * @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse); + */ + batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[23], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * FundingStateStep is an advanced funding related call that allows the caller + * to either execute some preparatory steps for a funding workflow, or + * manually progress a funding workflow. The primary way a funding flow is + * identified is via its pending channel ID. As an example, this method can be + * used to specify that we're expecting a funding flow for a particular + * pending channel ID, for which we need to use specific parameters. + * Alternatively, this can be used to interactively drive PSBT signing for + * funding for partially complete funding transactions. + * + * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); + */ + fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall { + const method = this.methods[24], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * ChannelAcceptor dispatches a bi-directional streaming RPC in which + * OpenChannel requests are sent to the client and the client responds with + * a boolean that tells LND whether or not to accept the channel. This allows + * node operators to specify their own criteria for accepting inbound channels + * through a single persistent connection. + * + * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); + */ + channelAcceptor(options?: RpcOptions): DuplexStreamingCall { + const method = this.methods[25], opt = this._transport.mergeOptions(options); + return stackIntercept("duplex", this._transport, method, opt); + } + /** + * lncli: `closechannel` + * CloseChannel attempts to close an active channel identified by its channel + * outpoint (ChannelPoint). The actions of this method can additionally be + * augmented to attempt a force close after a timeout period in the case of an + * inactive peer. If a non-force close (cooperative closure) is requested, + * then the user can specify either a target number of blocks until the + * closure transaction is confirmed, or a manual fee rate. If neither are + * specified, then a default lax, block confirmation target is used. + * + * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); + */ + closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[26], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `abandonchannel` + * AbandonChannel removes all channel state from the database except for a + * close summary. This method can be used to get rid of permanently unusable + * channels due to bugs fixed in newer versions of lnd. This method can also be + * used to remove externally funded channels where the funding transaction was + * never broadcast. Only available for non-externally funded channels in dev + * build. + * + * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); + */ + abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[27], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `sendpayment` + * Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a + * bi-directional streaming RPC for sending payments through the Lightning + * Network. A single RPC invocation creates a persistent bi-directional + * stream allowing clients to rapidly send payments through the Lightning + * Network with a single persistent connection. + * + * @deprecated + * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); + */ + sendPayment(options?: RpcOptions): DuplexStreamingCall { + const method = this.methods[28], opt = this._transport.mergeOptions(options); + return stackIntercept("duplex", this._transport, method, opt); + } + /** + * + * SendPaymentSync is the synchronous non-streaming version of SendPayment. + * This RPC is intended to be consumed by clients of the REST proxy. + * Additionally, this RPC expects the destination's public key and the payment + * hash (if any) to be encoded as hex strings. + * + * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); + */ + sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[29], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `sendtoroute` + * Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional + * streaming RPC for sending payment through the Lightning Network. This + * method differs from SendPayment in that it allows users to specify a full + * route manually. This can be used for things like rebalancing, and atomic + * swaps. + * + * @deprecated + * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); + */ + sendToRoute(options?: RpcOptions): DuplexStreamingCall { + const method = this.methods[30], opt = this._transport.mergeOptions(options); + return stackIntercept("duplex", this._transport, method, opt); + } + /** + * + * SendToRouteSync is a synchronous version of SendToRoute. It Will block + * until the payment either fails or succeeds. + * + * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); + */ + sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[31], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `addinvoice` + * AddInvoice attempts to add a new invoice to the invoice database. Any + * duplicated invoices are rejected, therefore all invoices *must* have a + * unique payment preimage. + * + * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); + */ + addInvoice(input: Invoice, options?: RpcOptions): UnaryCall { + const method = this.methods[32], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listinvoices` + * ListInvoices returns a list of all the invoices currently stored within the + * database. Any active debug invoices are ignored. It has full support for + * paginated responses, allowing users to query for specific invoices through + * their add_index. This can be done by using either the first_index_offset or + * last_index_offset fields included in the response as the index_offset of the + * next request. By default, the first 100 invoices created will be returned. + * Backwards pagination is also supported through the Reversed flag. + * + * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); + */ + listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[33], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `lookupinvoice` + * LookupInvoice attempts to look up an invoice according to its payment hash. + * The passed payment hash *must* be exactly 32 bytes, if not, an error is + * returned. + * + * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); + */ + lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall { + const method = this.methods[34], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SubscribeInvoices returns a uni-directional stream (server -> client) for + * notifying the client of newly added/settled invoices. The caller can + * optionally specify the add_index and/or the settle_index. If the add_index + * is specified, then we'll first start by sending add invoice events for all + * invoices with an add_index greater than the specified value. If the + * settle_index is specified, the next, we'll send out all settle events for + * invoices with a settle_index greater than the specified value. One or both + * of these fields can be set. If no fields are set, then we'll only send out + * the latest add/settle events. + * + * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); + */ + subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[35], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `decodepayreq` + * DecodePayReq takes an encoded payment request string and attempts to decode + * it, returning a full description of the conditions encoded within the + * payment request. + * + * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); + */ + decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall { + const method = this.methods[36], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listpayments` + * ListPayments returns a list of all outgoing payments. + * + * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); + */ + listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[37], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * DeletePayment deletes an outgoing payment from DB. Note that it will not + * attempt to delete an In-Flight payment, since that would be unsafe. + * + * @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse); + */ + deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[38], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * DeleteAllPayments deletes all outgoing payments from DB. Note that it will + * not attempt to delete In-Flight payments, since that would be unsafe. + * + * @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse); + */ + deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[39], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `describegraph` + * DescribeGraph returns a description of the latest graph state from the + * point of view of the node. The graph information is partitioned into two + * components: all the nodes/vertexes, and all the edges that connect the + * vertexes themselves. As this is a directed graph, the edges also contain + * the node directional specific routing policy which includes: the time lock + * delta, fee information, etc. + * + * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); + */ + describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[40], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `getnodemetrics` + * GetNodeMetrics returns node metrics calculated from the graph. Currently + * the only supported metric is betweenness centrality of individual nodes. + * + * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); + */ + getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[41], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `getchaninfo` + * GetChanInfo returns the latest authenticated network announcement for the + * given channel identified by its channel ID: an 8-byte integer which + * uniquely identifies the location of transaction's funding output within the + * blockchain. + * + * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); + */ + getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[42], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `getnodeinfo` + * GetNodeInfo returns the latest advertised, aggregated, and authenticated + * channel information for the specified node identified by its public key. + * + * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); + */ + getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[43], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `queryroutes` + * QueryRoutes attempts to query the daemon's Channel Router for a possible + * route to a target destination capable of carrying a specific amount of + * satoshis. The returned route contains the full details required to craft and + * send an HTLC, also including the necessary information that should be + * present within the Sphinx packet encapsulated within the HTLC. + * + * When using REST, the `dest_custom_records` map type can be set by appending + * `&dest_custom_records[]=` + * to the URL. Unfortunately this map type doesn't appear in the REST API + * documentation because of a bug in the grpc-gateway library. + * + * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); + */ + queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[44], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `getnetworkinfo` + * GetNetworkInfo returns some basic stats about the known channel graph from + * the point of view of the node. + * + * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); + */ + getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[45], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `stop` + * StopDaemon will send a shutdown request to the interrupt handler, triggering + * a graceful shutdown of the daemon. + * + * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); + */ + stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[46], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SubscribeChannelGraph launches a streaming RPC that allows the caller to + * receive notifications upon any changes to the channel graph topology from + * the point of view of the responding node. Events notified include: new + * nodes coming online, nodes updating their authenticated attributes, new + * channels being advertised, updates in the routing policy for a directional + * channel edge, and when channels are closed on-chain. + * + * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); + */ + subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[47], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `debuglevel` + * DebugLevel allows a caller to programmatically set the logging verbosity of + * lnd. The logging can be targeted according to a coarse daemon-wide logging + * level, or in a granular fashion to specify the logging for a target + * sub-system. + * + * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); + */ + debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[48], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `feereport` + * FeeReport allows the caller to obtain a report detailing the current fee + * schedule enforced by the node globally for each channel. + * + * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); + */ + feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[49], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `updatechanpolicy` + * UpdateChannelPolicy allows the caller to update the fee schedule and + * channel policies for all channels globally, or a particular channel. + * + * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); + */ + updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[50], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `fwdinghistory` + * ForwardingHistory allows the caller to query the htlcswitch for a record of + * all HTLCs forwarded within the target time range, and integer offset + * within that time range, for a maximum number of events. If no maximum number + * of events is specified, up to 100 events will be returned. If no time-range + * is specified, then events will be returned in the order that they occured. + * + * A list of forwarding events are returned. The size of each forwarding event + * is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. + * As a result each message can only contain 50k entries. Each response has + * the index offset of the last entry. The index offset can be provided to the + * request to allow the caller to skip a series of records. + * + * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); + */ + forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[51], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `exportchanbackup` + * ExportChannelBackup attempts to return an encrypted static channel backup + * for the target channel identified by it channel point. The backup is + * encrypted with a key generated from the aezeed seed of the user. The + * returned backup can either be restored using the RestoreChannelBackup + * method once lnd is running, or via the InitWallet and UnlockWallet methods + * from the WalletUnlocker service. + * + * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); + */ + exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[52], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * ExportAllChannelBackups returns static channel backups for all existing + * channels known to lnd. A set of regular singular static channel backups for + * each channel are returned. Additionally, a multi-channel backup is returned + * as well, which contains a single encrypted blob containing the backups of + * each channel. + * + * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); + */ + exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[53], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * VerifyChanBackup allows a caller to verify the integrity of a channel backup + * snapshot. This method will accept either a packed Single or a packed Multi. + * Specifying both will result in an error. + * + * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); + */ + verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall { + const method = this.methods[54], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `restorechanbackup` + * RestoreChannelBackups accepts a set of singular channel backups, or a + * single encrypted multi-chan backup and attempts to recover any funds + * remaining within the channel. If we are able to unpack the backup, then the + * new channel will be shown under listchannels, as well as pending channels. + * + * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); + */ + restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[55], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SubscribeChannelBackups allows a client to sub-subscribe to the most up to + * date information concerning the state of all channel backups. Each time a + * new channel is added, we return the new set of channels, along with a + * multi-chan backup containing the backup info for all channels. Each time a + * channel is closed, we send a new update, which contains new new chan back + * ups, but the updated set of encrypted multi-chan backups with the closed + * channel(s) removed. + * + * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); + */ + subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[56], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `bakemacaroon` + * BakeMacaroon allows the creation of a new macaroon with custom read and + * write permissions. No first-party caveats are added since this can be done + * offline. + * + * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); + */ + bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[57], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listmacaroonids` + * ListMacaroonIDs returns all root key IDs that are in use. + * + * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); + */ + listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[58], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `deletemacaroonid` + * DeleteMacaroonID deletes the specified macaroon ID and invalidates all + * macaroons derived from that ID. + * + * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); + */ + deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[59], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `listpermissions` + * ListPermissions lists all RPC method URIs and their required macaroon + * permissions to access them. + * + * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); + */ + listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[60], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * CheckMacaroonPermissions checks whether a request follows the constraints + * imposed on the macaroon and that the macaroon is authorized to follow the + * provided permissions. + * + * @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse); + */ + checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[61], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A + * gRPC middleware is software component external to lnd that aims to add + * additional business logic to lnd by observing/intercepting/validating + * incoming gRPC client requests and (if needed) replacing/overwriting outgoing + * messages before they're sent to the client. When registering the middleware + * must identify itself and indicate what custom macaroon caveats it wants to + * be responsible for. Only requests that contain a macaroon with that specific + * custom caveat are then sent to the middleware for inspection. The other + * option is to register for the read-only mode in which all requests/responses + * are forwarded for interception to the middleware but the middleware is not + * allowed to modify any responses. As a security measure, _no_ middleware can + * modify responses for requests made with _unencumbered_ macaroons! + * + * @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest); + */ + registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall { + const method = this.methods[62], opt = this._transport.mergeOptions(options); + return stackIntercept("duplex", this._transport, method, opt); + } + /** + * lncli: `sendcustom` + * SendCustomMessage sends a custom peer message. + * + * @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse); + */ + sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[63], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `subscribecustom` + * SubscribeCustomMessages subscribes to a stream of incoming custom peer + * messages. + * + * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); + */ + subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[64], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `listaliases` + * ListAliases returns the set of all aliases that have ever existed with + * their confirmed SCID (if it exists) and/or the base SCID (in the case of + * zero conf). + * + * @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse); + */ + listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[65], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); + */ + lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[66], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } +} diff --git a/proto/lnd/lightning.ts b/proto/lnd/lightning.ts index 97aa9e52..fe258d0a 100644 --- a/proto/lnd/lightning.ts +++ b/proto/lnd/lightning.ts @@ -1,20995 +1,20995 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) -// tslint:disable -import { ServiceType } from "@protobuf-ts/runtime-rpc"; -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import { WireType } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import { UnknownFieldHandler } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { reflectionMergePartial } from "@protobuf-ts/runtime"; -import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message lnrpc.LookupHtlcRequest - */ -export interface LookupHtlcRequest { - /** - * @generated from protobuf field: uint64 chan_id = 1; - */ - chanId: bigint; - /** - * @generated from protobuf field: uint64 htlc_index = 2; - */ - htlcIndex: bigint; -} -/** - * @generated from protobuf message lnrpc.LookupHtlcResponse - */ -export interface LookupHtlcResponse { - /** - * @generated from protobuf field: bool settled = 1; - */ - settled: boolean; - /** - * @generated from protobuf field: bool offchain = 2; - */ - offchain: boolean; -} -/** - * @generated from protobuf message lnrpc.SubscribeCustomMessagesRequest - */ -export interface SubscribeCustomMessagesRequest { -} -/** - * @generated from protobuf message lnrpc.CustomMessage - */ -export interface CustomMessage { - /** - * Peer from which the message originates - * - * @generated from protobuf field: bytes peer = 1; - */ - peer: Uint8Array; - /** - * Message type. This value will be in the custom range (>= 32768). - * - * @generated from protobuf field: uint32 type = 2; - */ - type: number; - /** - * Raw message data - * - * @generated from protobuf field: bytes data = 3; - */ - data: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.SendCustomMessageRequest - */ -export interface SendCustomMessageRequest { - /** - * Peer to send the message to - * - * @generated from protobuf field: bytes peer = 1; - */ - peer: Uint8Array; - /** - * Message type. This value needs to be in the custom range (>= 32768). - * - * @generated from protobuf field: uint32 type = 2; - */ - type: number; - /** - * Raw message data. - * - * @generated from protobuf field: bytes data = 3; - */ - data: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.SendCustomMessageResponse - */ -export interface SendCustomMessageResponse { -} -/** - * @generated from protobuf message lnrpc.Utxo - */ -export interface Utxo { - /** - * The type of address - * - * @generated from protobuf field: lnrpc.AddressType address_type = 1; - */ - addressType: AddressType; - /** - * The address - * - * @generated from protobuf field: string address = 2; - */ - address: string; - /** - * The value of the unspent coin in satoshis - * - * @generated from protobuf field: int64 amount_sat = 3; - */ - amountSat: bigint; - /** - * The pkscript in hex - * - * @generated from protobuf field: string pk_script = 4; - */ - pkScript: string; - /** - * The outpoint in format txid:n - * - * @generated from protobuf field: lnrpc.OutPoint outpoint = 5; - */ - outpoint?: OutPoint; - /** - * The number of confirmations for the Utxo - * - * @generated from protobuf field: int64 confirmations = 6; - */ - confirmations: bigint; -} -/** - * @generated from protobuf message lnrpc.OutputDetail - */ -export interface OutputDetail { - /** - * The type of the output - * - * @generated from protobuf field: lnrpc.OutputScriptType output_type = 1; - */ - outputType: OutputScriptType; - /** - * The address - * - * @generated from protobuf field: string address = 2; - */ - address: string; - /** - * The pkscript in hex - * - * @generated from protobuf field: string pk_script = 3; - */ - pkScript: string; - /** - * The output index used in the raw transaction - * - * @generated from protobuf field: int64 output_index = 4; - */ - outputIndex: bigint; - /** - * The value of the output coin in satoshis - * - * @generated from protobuf field: int64 amount = 5; - */ - amount: bigint; - /** - * Denotes if the output is controlled by the internal wallet - * - * @generated from protobuf field: bool is_our_address = 6; - */ - isOurAddress: boolean; -} -/** - * @generated from protobuf message lnrpc.Transaction - */ -export interface Transaction { - /** - * The transaction hash - * - * @generated from protobuf field: string tx_hash = 1; - */ - txHash: string; - /** - * The transaction amount, denominated in satoshis - * - * @generated from protobuf field: int64 amount = 2; - */ - amount: bigint; - /** - * The number of confirmations - * - * @generated from protobuf field: int32 num_confirmations = 3; - */ - numConfirmations: number; - /** - * The hash of the block this transaction was included in - * - * @generated from protobuf field: string block_hash = 4; - */ - blockHash: string; - /** - * The height of the block this transaction was included in - * - * @generated from protobuf field: int32 block_height = 5; - */ - blockHeight: number; - /** - * Timestamp of this transaction - * - * @generated from protobuf field: int64 time_stamp = 6; - */ - timeStamp: bigint; - /** - * Fees paid for this transaction - * - * @generated from protobuf field: int64 total_fees = 7; - */ - totalFees: bigint; - /** - * Addresses that received funds for this transaction. Deprecated as it is - * now incorporated in the output_details field. - * - * @deprecated - * @generated from protobuf field: repeated string dest_addresses = 8 [deprecated = true]; - */ - destAddresses: string[]; - /** - * Outputs that received funds for this transaction - * - * @generated from protobuf field: repeated lnrpc.OutputDetail output_details = 11; - */ - outputDetails: OutputDetail[]; - /** - * The raw transaction hex. - * - * @generated from protobuf field: string raw_tx_hex = 9; - */ - rawTxHex: string; - /** - * A label that was optionally set on transaction broadcast. - * - * @generated from protobuf field: string label = 10; - */ - label: string; - /** - * PreviousOutpoints/Inputs of this transaction. - * - * @generated from protobuf field: repeated lnrpc.PreviousOutPoint previous_outpoints = 12; - */ - previousOutpoints: PreviousOutPoint[]; -} -/** - * @generated from protobuf message lnrpc.GetTransactionsRequest - */ -export interface GetTransactionsRequest { - /** - * - * The height from which to list transactions, inclusive. If this value is - * greater than end_height, transactions will be read in reverse. - * - * @generated from protobuf field: int32 start_height = 1; - */ - startHeight: number; - /** - * - * The height until which to list transactions, inclusive. To include - * unconfirmed transactions, this value should be set to -1, which will - * return transactions from start_height until the current chain tip and - * unconfirmed transactions. If no end_height is provided, the call will - * default to this option. - * - * @generated from protobuf field: int32 end_height = 2; - */ - endHeight: number; - /** - * An optional filter to only include transactions relevant to an account. - * - * @generated from protobuf field: string account = 3; - */ - account: string; -} -/** - * @generated from protobuf message lnrpc.TransactionDetails - */ -export interface TransactionDetails { - /** - * The list of transactions relevant to the wallet. - * - * @generated from protobuf field: repeated lnrpc.Transaction transactions = 1; - */ - transactions: Transaction[]; -} -/** - * @generated from protobuf message lnrpc.FeeLimit - */ -export interface FeeLimit { - /** - * @generated from protobuf oneof: limit - */ - limit: { - oneofKind: "fixed"; - /** - * - * The fee limit expressed as a fixed amount of satoshis. - * - * The fields fixed and fixed_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fixed = 1; - */ - fixed: bigint; - } | { - oneofKind: "fixedMsat"; - /** - * - * The fee limit expressed as a fixed amount of millisatoshis. - * - * The fields fixed and fixed_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fixed_msat = 3; - */ - fixedMsat: bigint; - } | { - oneofKind: "percent"; - /** - * The fee limit expressed as a percentage of the payment amount. - * - * @generated from protobuf field: int64 percent = 2; - */ - percent: bigint; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.SendRequest - */ -export interface SendRequest { - /** - * - * The identity pubkey of the payment recipient. When using REST, this field - * must be encoded as base64. - * - * @generated from protobuf field: bytes dest = 1; - */ - dest: Uint8Array; - /** - * - * The hex-encoded identity pubkey of the payment recipient. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string dest_string = 2 [deprecated = true]; - */ - destString: string; - /** - * - * The amount to send expressed in satoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt = 3; - */ - amt: bigint; - /** - * - * The amount to send expressed in millisatoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt_msat = 12; - */ - amtMsat: bigint; - /** - * - * The hash to use within the payment's HTLC. When using REST, this field - * must be encoded as base64. - * - * @generated from protobuf field: bytes payment_hash = 4; - */ - paymentHash: Uint8Array; - /** - * - * The hex-encoded hash to use within the payment's HTLC. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string payment_hash_string = 5 [deprecated = true]; - */ - paymentHashString: string; - /** - * - * A bare-bones invoice for a payment within the Lightning Network. With the - * details of the invoice, the sender has all the data necessary to send a - * payment to the recipient. - * - * @generated from protobuf field: string payment_request = 6; - */ - paymentRequest: string; - /** - * - * The CLTV delta from the current height that should be used to set the - * timelock for the final hop. - * - * @generated from protobuf field: int32 final_cltv_delta = 7; - */ - finalCltvDelta: number; - /** - * - * The maximum number of satoshis that will be paid as a fee of the payment. - * This value can be represented either as a percentage of the amount being - * sent, or as a fixed amount of the maximum fee the user is willing the pay to - * send the payment. If not specified, lnd will use a default value of 100% - * fees for small amounts (<=1k sat) or 5% fees for larger amounts. - * - * @generated from protobuf field: lnrpc.FeeLimit fee_limit = 8; - */ - feeLimit?: FeeLimit; - /** - * - * The channel id of the channel that must be taken to the first hop. If zero, - * any channel may be used. - * - * @generated from protobuf field: uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * The pubkey of the last hop of the route. If empty, any hop may be used. - * - * @generated from protobuf field: bytes last_hop_pubkey = 13; - */ - lastHopPubkey: Uint8Array; - /** - * - * An optional maximum total time lock for the route. This should not exceed - * lnd's `--max-cltv-expiry` setting. If zero, then the value of - * `--max-cltv-expiry` is enforced. - * - * @generated from protobuf field: uint32 cltv_limit = 10; - */ - cltvLimit: number; - /** - * - * An optional field that can be used to pass an arbitrary set of TLV records - * to a peer which understands the new records. This can be used to pass - * application specific data during the payment attempt. Record types are - * required to be in the custom range >= 65536. When using REST, the values - * must be encoded as base64. - * - * @generated from protobuf field: map dest_custom_records = 11; - */ - destCustomRecords: { - [key: string]: Uint8Array; - }; - /** - * If set, circular payments to self are permitted. - * - * @generated from protobuf field: bool allow_self_payment = 14; - */ - allowSelfPayment: boolean; - /** - * - * Features assumed to be supported by the final node. All transitive feature - * dependencies must also be set properly. For a given feature bit pair, either - * optional or remote may be set, but not both. If this field is nil or empty, - * the router will try to load destination features from the graph as a - * fallback. - * - * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 15; - */ - destFeatures: FeatureBit[]; - /** - * - * The payment address of the generated invoice. - * - * @generated from protobuf field: bytes payment_addr = 16; - */ - paymentAddr: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.SendResponse - */ -export interface SendResponse { - /** - * @generated from protobuf field: string payment_error = 1; - */ - paymentError: string; - /** - * @generated from protobuf field: bytes payment_preimage = 2; - */ - paymentPreimage: Uint8Array; - /** - * @generated from protobuf field: lnrpc.Route payment_route = 3; - */ - paymentRoute?: Route; - /** - * @generated from protobuf field: bytes payment_hash = 4; - */ - paymentHash: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.SendToRouteRequest - */ -export interface SendToRouteRequest { - /** - * - * The payment hash to use for the HTLC. When using REST, this field must be - * encoded as base64. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - /** - * - * An optional hex-encoded payment hash to be used for the HTLC. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string payment_hash_string = 2 [deprecated = true]; - */ - paymentHashString: string; - /** - * Route that should be used to attempt to complete the payment. - * - * @generated from protobuf field: lnrpc.Route route = 4; - */ - route?: Route; -} -/** - * @generated from protobuf message lnrpc.ChannelAcceptRequest - */ -export interface ChannelAcceptRequest { - /** - * The pubkey of the node that wishes to open an inbound channel. - * - * @generated from protobuf field: bytes node_pubkey = 1; - */ - nodePubkey: Uint8Array; - /** - * The hash of the genesis block that the proposed channel resides in. - * - * @generated from protobuf field: bytes chain_hash = 2; - */ - chainHash: Uint8Array; - /** - * The pending channel id. - * - * @generated from protobuf field: bytes pending_chan_id = 3; - */ - pendingChanId: Uint8Array; - /** - * The funding amount in satoshis that initiator wishes to use in the - * channel. - * - * @generated from protobuf field: uint64 funding_amt = 4; - */ - fundingAmt: bigint; - /** - * The push amount of the proposed channel in millisatoshis. - * - * @generated from protobuf field: uint64 push_amt = 5; - */ - pushAmt: bigint; - /** - * The dust limit of the initiator's commitment tx. - * - * @generated from protobuf field: uint64 dust_limit = 6; - */ - dustLimit: bigint; - /** - * The maximum amount of coins in millisatoshis that can be pending in this - * channel. - * - * @generated from protobuf field: uint64 max_value_in_flight = 7; - */ - maxValueInFlight: bigint; - /** - * The minimum amount of satoshis the initiator requires us to have at all - * times. - * - * @generated from protobuf field: uint64 channel_reserve = 8; - */ - channelReserve: bigint; - /** - * The smallest HTLC in millisatoshis that the initiator will accept. - * - * @generated from protobuf field: uint64 min_htlc = 9; - */ - minHtlc: bigint; - /** - * The initial fee rate that the initiator suggests for both commitment - * transactions. - * - * @generated from protobuf field: uint64 fee_per_kw = 10; - */ - feePerKw: bigint; - /** - * - * The number of blocks to use for the relative time lock in the pay-to-self - * output of both commitment transactions. - * - * @generated from protobuf field: uint32 csv_delay = 11; - */ - csvDelay: number; - /** - * The total number of incoming HTLC's that the initiator will accept. - * - * @generated from protobuf field: uint32 max_accepted_htlcs = 12; - */ - maxAcceptedHtlcs: number; - /** - * A bit-field which the initiator uses to specify proposed channel - * behavior. - * - * @generated from protobuf field: uint32 channel_flags = 13; - */ - channelFlags: number; - /** - * The commitment type the initiator wishes to use for the proposed channel. - * - * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 14; - */ - commitmentType: CommitmentType; - /** - * Whether the initiator wants to open a zero-conf channel via the channel - * type. - * - * @generated from protobuf field: bool wants_zero_conf = 15; - */ - wantsZeroConf: boolean; - /** - * Whether the initiator wants to use the scid-alias channel type. This is - * separate from the feature bit. - * - * @generated from protobuf field: bool wants_scid_alias = 16; - */ - wantsScidAlias: boolean; -} -/** - * @generated from protobuf message lnrpc.ChannelAcceptResponse - */ -export interface ChannelAcceptResponse { - /** - * Whether or not the client accepts the channel. - * - * @generated from protobuf field: bool accept = 1; - */ - accept: boolean; - /** - * The pending channel id to which this response applies. - * - * @generated from protobuf field: bytes pending_chan_id = 2; - */ - pendingChanId: Uint8Array; - /** - * - * An optional error to send the initiating party to indicate why the channel - * was rejected. This field *should not* contain sensitive information, it will - * be sent to the initiating party. This field should only be set if accept is - * false, the channel will be rejected if an error is set with accept=true - * because the meaning of this response is ambiguous. Limited to 500 - * characters. - * - * @generated from protobuf field: string error = 3; - */ - error: string; - /** - * - * The upfront shutdown address to use if the initiating peer supports option - * upfront shutdown script (see ListPeers for the features supported). Note - * that the channel open will fail if this value is set for a peer that does - * not support this feature bit. - * - * @generated from protobuf field: string upfront_shutdown = 4; - */ - upfrontShutdown: string; - /** - * - * The csv delay (in blocks) that we require for the remote party. - * - * @generated from protobuf field: uint32 csv_delay = 5; - */ - csvDelay: number; - /** - * - * The reserve amount in satoshis that we require the remote peer to adhere to. - * We require that the remote peer always have some reserve amount allocated to - * them so that there is always a disincentive to broadcast old state (if they - * hold 0 sats on their side of the channel, there is nothing to lose). - * - * @generated from protobuf field: uint64 reserve_sat = 6; - */ - reserveSat: bigint; - /** - * - * The maximum amount of funds in millisatoshis that we allow the remote peer - * to have in outstanding htlcs. - * - * @generated from protobuf field: uint64 in_flight_max_msat = 7; - */ - inFlightMaxMsat: bigint; - /** - * - * The maximum number of htlcs that the remote peer can offer us. - * - * @generated from protobuf field: uint32 max_htlc_count = 8; - */ - maxHtlcCount: number; - /** - * - * The minimum value in millisatoshis for incoming htlcs on the channel. - * - * @generated from protobuf field: uint64 min_htlc_in = 9; - */ - minHtlcIn: bigint; - /** - * - * The number of confirmations we require before we consider the channel open. - * - * @generated from protobuf field: uint32 min_accept_depth = 10; - */ - minAcceptDepth: number; - /** - * - * Whether the responder wants this to be a zero-conf channel. This will fail - * if either side does not have the scid-alias feature bit set. The minimum - * depth field must be zero if this is true. - * - * @generated from protobuf field: bool zero_conf = 11; - */ - zeroConf: boolean; -} -/** - * @generated from protobuf message lnrpc.ChannelPoint - */ -export interface ChannelPoint { - /** - * @generated from protobuf oneof: funding_txid - */ - fundingTxid: { - oneofKind: "fundingTxidBytes"; - /** - * - * Txid of the funding transaction. When using REST, this field must be - * encoded as base64. - * - * @generated from protobuf field: bytes funding_txid_bytes = 1; - */ - fundingTxidBytes: Uint8Array; - } | { - oneofKind: "fundingTxidStr"; - /** - * - * Hex-encoded string representing the byte-reversed hash of the funding - * transaction. - * - * @generated from protobuf field: string funding_txid_str = 2; - */ - fundingTxidStr: string; - } | { - oneofKind: undefined; - }; - /** - * The index of the output of the funding transaction - * - * @generated from protobuf field: uint32 output_index = 3; - */ - outputIndex: number; -} -/** - * @generated from protobuf message lnrpc.OutPoint - */ -export interface OutPoint { - /** - * Raw bytes representing the transaction id. - * - * @generated from protobuf field: bytes txid_bytes = 1; - */ - txidBytes: Uint8Array; - /** - * Reversed, hex-encoded string representing the transaction id. - * - * @generated from protobuf field: string txid_str = 2; - */ - txidStr: string; - /** - * The index of the output on the transaction. - * - * @generated from protobuf field: uint32 output_index = 3; - */ - outputIndex: number; -} -/** - * @generated from protobuf message lnrpc.PreviousOutPoint - */ -export interface PreviousOutPoint { - /** - * The outpoint in format txid:n. - * - * @generated from protobuf field: string outpoint = 1; - */ - outpoint: string; - /** - * Denotes if the outpoint is controlled by the internal wallet. - * The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. - * - * @generated from protobuf field: bool is_our_output = 2; - */ - isOurOutput: boolean; -} -/** - * @generated from protobuf message lnrpc.LightningAddress - */ -export interface LightningAddress { - /** - * The identity pubkey of the Lightning node. - * - * @generated from protobuf field: string pubkey = 1; - */ - pubkey: string; - /** - * The network location of the lightning node, e.g. `69.69.69.69:1337` or - * `localhost:10011`. - * - * @generated from protobuf field: string host = 2; - */ - host: string; -} -/** - * @generated from protobuf message lnrpc.EstimateFeeRequest - */ -export interface EstimateFeeRequest { - /** - * The map from addresses to amounts for the transaction. - * - * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; - */ - addrToAmount: { - [key: string]: bigint; - }; - /** - * The target number of blocks that this transaction should be confirmed - * by. - * - * @generated from protobuf field: int32 target_conf = 2; - */ - targetConf: number; - /** - * The minimum number of confirmations each one of your outputs used for - * the transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 3; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 4; - */ - spendUnconfirmed: boolean; -} -/** - * @generated from protobuf message lnrpc.EstimateFeeResponse - */ -export interface EstimateFeeResponse { - /** - * The total fee in satoshis. - * - * @generated from protobuf field: int64 fee_sat = 1; - */ - feeSat: bigint; - /** - * Deprecated, use sat_per_vbyte. - * The fee rate in satoshi/vbyte. - * - * @deprecated - * @generated from protobuf field: int64 feerate_sat_per_byte = 2 [deprecated = true]; - */ - feerateSatPerByte: bigint; - /** - * The fee rate in satoshi/vbyte. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 3; - */ - satPerVbyte: bigint; -} -/** - * @generated from protobuf message lnrpc.SendManyRequest - */ -export interface SendManyRequest { - /** - * The map from addresses to amounts - * - * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; - */ - addrToAmount: { - [key: string]: bigint; - }; - /** - * The target number of blocks that this transaction should be confirmed - * by. - * - * @generated from protobuf field: int32 target_conf = 3; - */ - targetConf: number; - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 4; - */ - satPerVbyte: bigint; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; - */ - satPerByte: bigint; - /** - * An optional label for the transaction, limited to 500 characters. - * - * @generated from protobuf field: string label = 6; - */ - label: string; - /** - * The minimum number of confirmations each one of your outputs used for - * the transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 7; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 8; - */ - spendUnconfirmed: boolean; -} -/** - * @generated from protobuf message lnrpc.SendManyResponse - */ -export interface SendManyResponse { - /** - * The id of the transaction - * - * @generated from protobuf field: string txid = 1; - */ - txid: string; -} -/** - * @generated from protobuf message lnrpc.SendCoinsRequest - */ -export interface SendCoinsRequest { - /** - * The address to send coins to - * - * @generated from protobuf field: string addr = 1; - */ - addr: string; - /** - * The amount in satoshis to send - * - * @generated from protobuf field: int64 amount = 2; - */ - amount: bigint; - /** - * The target number of blocks that this transaction should be confirmed - * by. - * - * @generated from protobuf field: int32 target_conf = 3; - */ - targetConf: number; - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 4; - */ - satPerVbyte: bigint; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; - */ - satPerByte: bigint; - /** - * - * If set, then the amount field will be ignored, and lnd will attempt to - * send all the coins under control of the internal wallet to the specified - * address. - * - * @generated from protobuf field: bool send_all = 6; - */ - sendAll: boolean; - /** - * An optional label for the transaction, limited to 500 characters. - * - * @generated from protobuf field: string label = 7; - */ - label: string; - /** - * The minimum number of confirmations each one of your outputs used for - * the transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 8; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 9; - */ - spendUnconfirmed: boolean; -} -/** - * @generated from protobuf message lnrpc.SendCoinsResponse - */ -export interface SendCoinsResponse { - /** - * The transaction ID of the transaction - * - * @generated from protobuf field: string txid = 1; - */ - txid: string; -} -/** - * @generated from protobuf message lnrpc.ListUnspentRequest - */ -export interface ListUnspentRequest { - /** - * The minimum number of confirmations to be included. - * - * @generated from protobuf field: int32 min_confs = 1; - */ - minConfs: number; - /** - * The maximum number of confirmations to be included. - * - * @generated from protobuf field: int32 max_confs = 2; - */ - maxConfs: number; - /** - * An optional filter to only include outputs belonging to an account. - * - * @generated from protobuf field: string account = 3; - */ - account: string; -} -/** - * @generated from protobuf message lnrpc.ListUnspentResponse - */ -export interface ListUnspentResponse { - /** - * A list of utxos - * - * @generated from protobuf field: repeated lnrpc.Utxo utxos = 1; - */ - utxos: Utxo[]; -} -/** - * @generated from protobuf message lnrpc.NewAddressRequest - */ -export interface NewAddressRequest { - /** - * The type of address to generate. - * - * @generated from protobuf field: lnrpc.AddressType type = 1; - */ - type: AddressType; - /** - * - * The name of the account to generate a new address for. If empty, the - * default wallet account is used. - * - * @generated from protobuf field: string account = 2; - */ - account: string; -} -/** - * @generated from protobuf message lnrpc.NewAddressResponse - */ -export interface NewAddressResponse { - /** - * The newly generated wallet address - * - * @generated from protobuf field: string address = 1; - */ - address: string; -} -/** - * @generated from protobuf message lnrpc.SignMessageRequest - */ -export interface SignMessageRequest { - /** - * - * The message to be signed. When using REST, this field must be encoded as - * base64. - * - * @generated from protobuf field: bytes msg = 1; - */ - msg: Uint8Array; - /** - * - * Instead of the default double-SHA256 hashing of the message before signing, - * only use one round of hashing instead. - * - * @generated from protobuf field: bool single_hash = 2; - */ - singleHash: boolean; -} -/** - * @generated from protobuf message lnrpc.SignMessageResponse - */ -export interface SignMessageResponse { - /** - * The signature for the given message - * - * @generated from protobuf field: string signature = 1; - */ - signature: string; -} -/** - * @generated from protobuf message lnrpc.VerifyMessageRequest - */ -export interface VerifyMessageRequest { - /** - * - * The message over which the signature is to be verified. When using REST, - * this field must be encoded as base64. - * - * @generated from protobuf field: bytes msg = 1; - */ - msg: Uint8Array; - /** - * The signature to be verified over the given message - * - * @generated from protobuf field: string signature = 2; - */ - signature: string; -} -/** - * @generated from protobuf message lnrpc.VerifyMessageResponse - */ -export interface VerifyMessageResponse { - /** - * Whether the signature was valid over the given message - * - * @generated from protobuf field: bool valid = 1; - */ - valid: boolean; - /** - * The pubkey recovered from the signature - * - * @generated from protobuf field: string pubkey = 2; - */ - pubkey: string; -} -/** - * @generated from protobuf message lnrpc.ConnectPeerRequest - */ -export interface ConnectPeerRequest { - /** - * - * Lightning address of the peer to connect to. - * - * @generated from protobuf field: lnrpc.LightningAddress addr = 1; - */ - addr?: LightningAddress; - /** - * - * If set, the daemon will attempt to persistently connect to the target - * peer. Otherwise, the call will be synchronous. - * - * @generated from protobuf field: bool perm = 2; - */ - perm: boolean; - /** - * - * The connection timeout value (in seconds) for this request. It won't affect - * other requests. - * - * @generated from protobuf field: uint64 timeout = 3; - */ - timeout: bigint; -} -/** - * @generated from protobuf message lnrpc.ConnectPeerResponse - */ -export interface ConnectPeerResponse { -} -/** - * @generated from protobuf message lnrpc.DisconnectPeerRequest - */ -export interface DisconnectPeerRequest { - /** - * The pubkey of the node to disconnect from - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; -} -/** - * @generated from protobuf message lnrpc.DisconnectPeerResponse - */ -export interface DisconnectPeerResponse { -} -/** - * @generated from protobuf message lnrpc.HTLC - */ -export interface HTLC { - /** - * @generated from protobuf field: bool incoming = 1; - */ - incoming: boolean; - /** - * @generated from protobuf field: int64 amount = 2; - */ - amount: bigint; - /** - * @generated from protobuf field: bytes hash_lock = 3; - */ - hashLock: Uint8Array; - /** - * @generated from protobuf field: uint32 expiration_height = 4; - */ - expirationHeight: number; - /** - * Index identifying the htlc on the channel. - * - * @generated from protobuf field: uint64 htlc_index = 5; - */ - htlcIndex: bigint; - /** - * If this HTLC is involved in a forwarding operation, this field indicates - * the forwarding channel. For an outgoing htlc, it is the incoming channel. - * For an incoming htlc, it is the outgoing channel. When the htlc - * originates from this node or this node is the final destination, - * forwarding_channel will be zero. The forwarding channel will also be zero - * for htlcs that need to be forwarded but don't have a forwarding decision - * persisted yet. - * - * @generated from protobuf field: uint64 forwarding_channel = 6; - */ - forwardingChannel: bigint; - /** - * Index identifying the htlc on the forwarding channel. - * - * @generated from protobuf field: uint64 forwarding_htlc_index = 7; - */ - forwardingHtlcIndex: bigint; -} -/** - * @generated from protobuf message lnrpc.ChannelConstraints - */ -export interface ChannelConstraints { - /** - * - * The CSV delay expressed in relative blocks. If the channel is force closed, - * we will need to wait for this many blocks before we can regain our funds. - * - * @generated from protobuf field: uint32 csv_delay = 1; - */ - csvDelay: number; - /** - * The minimum satoshis this node is required to reserve in its balance. - * - * @generated from protobuf field: uint64 chan_reserve_sat = 2; - */ - chanReserveSat: bigint; - /** - * The dust limit (in satoshis) of the initiator's commitment tx. - * - * @generated from protobuf field: uint64 dust_limit_sat = 3; - */ - dustLimitSat: bigint; - /** - * The maximum amount of coins in millisatoshis that can be pending in this - * channel. - * - * @generated from protobuf field: uint64 max_pending_amt_msat = 4; - */ - maxPendingAmtMsat: bigint; - /** - * The smallest HTLC in millisatoshis that the initiator will accept. - * - * @generated from protobuf field: uint64 min_htlc_msat = 5; - */ - minHtlcMsat: bigint; - /** - * The total number of incoming HTLC's that the initiator will accept. - * - * @generated from protobuf field: uint32 max_accepted_htlcs = 6; - */ - maxAcceptedHtlcs: number; -} -/** - * @generated from protobuf message lnrpc.Channel - */ -export interface Channel { - /** - * Whether this channel is active or not - * - * @generated from protobuf field: bool active = 1; - */ - active: boolean; - /** - * The identity pubkey of the remote node - * - * @generated from protobuf field: string remote_pubkey = 2; - */ - remotePubkey: string; - /** - * - * The outpoint (txid:index) of the funding transaction. With this value, Bob - * will be able to generate a signature for Alice's version of the commitment - * transaction. - * - * @generated from protobuf field: string channel_point = 3; - */ - channelPoint: string; - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 4 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The total amount of funds held in this channel - * - * @generated from protobuf field: int64 capacity = 5; - */ - capacity: bigint; - /** - * This node's current balance in this channel - * - * @generated from protobuf field: int64 local_balance = 6; - */ - localBalance: bigint; - /** - * The counterparty's current balance in this channel - * - * @generated from protobuf field: int64 remote_balance = 7; - */ - remoteBalance: bigint; - /** - * - * The amount calculated to be paid in fees for the current set of commitment - * transactions. The fee amount is persisted with the channel in order to - * allow the fee amount to be removed and recalculated with each channel state - * update, including updates that happen after a system restart. - * - * @generated from protobuf field: int64 commit_fee = 8; - */ - commitFee: bigint; - /** - * The weight of the commitment transaction - * - * @generated from protobuf field: int64 commit_weight = 9; - */ - commitWeight: bigint; - /** - * - * The required number of satoshis per kilo-weight that the requester will pay - * at all times, for both the funding transaction and commitment transaction. - * This value can later be updated once the channel is open. - * - * @generated from protobuf field: int64 fee_per_kw = 10; - */ - feePerKw: bigint; - /** - * The unsettled balance in this channel - * - * @generated from protobuf field: int64 unsettled_balance = 11; - */ - unsettledBalance: bigint; - /** - * - * The total number of satoshis we've sent within this channel. - * - * @generated from protobuf field: int64 total_satoshis_sent = 12; - */ - totalSatoshisSent: bigint; - /** - * - * The total number of satoshis we've received within this channel. - * - * @generated from protobuf field: int64 total_satoshis_received = 13; - */ - totalSatoshisReceived: bigint; - /** - * - * The total number of updates conducted within this channel. - * - * @generated from protobuf field: uint64 num_updates = 14; - */ - numUpdates: bigint; - /** - * - * The list of active, uncleared HTLCs currently pending within the channel. - * - * @generated from protobuf field: repeated lnrpc.HTLC pending_htlcs = 15; - */ - pendingHtlcs: HTLC[]; - /** - * - * Deprecated. The CSV delay expressed in relative blocks. If the channel is - * force closed, we will need to wait for this many blocks before we can regain - * our funds. - * - * @deprecated - * @generated from protobuf field: uint32 csv_delay = 16 [deprecated = true]; - */ - csvDelay: number; - /** - * Whether this channel is advertised to the network or not. - * - * @generated from protobuf field: bool private = 17; - */ - private: boolean; - /** - * True if we were the ones that created the channel. - * - * @generated from protobuf field: bool initiator = 18; - */ - initiator: boolean; - /** - * A set of flags showing the current state of the channel. - * - * @generated from protobuf field: string chan_status_flags = 19; - */ - chanStatusFlags: string; - /** - * Deprecated. The minimum satoshis this node is required to reserve in its - * balance. - * - * @deprecated - * @generated from protobuf field: int64 local_chan_reserve_sat = 20 [deprecated = true]; - */ - localChanReserveSat: bigint; - /** - * - * Deprecated. The minimum satoshis the other node is required to reserve in - * its balance. - * - * @deprecated - * @generated from protobuf field: int64 remote_chan_reserve_sat = 21 [deprecated = true]; - */ - remoteChanReserveSat: bigint; - /** - * Deprecated. Use commitment_type. - * - * @deprecated - * @generated from protobuf field: bool static_remote_key = 22 [deprecated = true]; - */ - staticRemoteKey: boolean; - /** - * The commitment type used by this channel. - * - * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 26; - */ - commitmentType: CommitmentType; - /** - * - * The number of seconds that the channel has been monitored by the channel - * scoring system. Scores are currently not persisted, so this value may be - * less than the lifetime of the channel [EXPERIMENTAL]. - * - * @generated from protobuf field: int64 lifetime = 23; - */ - lifetime: bigint; - /** - * - * The number of seconds that the remote peer has been observed as being online - * by the channel scoring system over the lifetime of the channel - * [EXPERIMENTAL]. - * - * @generated from protobuf field: int64 uptime = 24; - */ - uptime: bigint; - /** - * - * Close address is the address that we will enforce payout to on cooperative - * close if the channel was opened utilizing option upfront shutdown. This - * value can be set on channel open by setting close_address in an open channel - * request. If this value is not set, you can still choose a payout address by - * cooperatively closing with the delivery_address field set. - * - * @generated from protobuf field: string close_address = 25; - */ - closeAddress: string; - /** - * - * The amount that the initiator of the channel optionally pushed to the remote - * party on channel open. This amount will be zero if the channel initiator did - * not push any funds to the remote peer. If the initiator field is true, we - * pushed this amount to our peer, if it is false, the remote peer pushed this - * amount to us. - * - * @generated from protobuf field: uint64 push_amount_sat = 27; - */ - pushAmountSat: bigint; - /** - * - * This uint32 indicates if this channel is to be considered 'frozen'. A - * frozen channel doest not allow a cooperative channel close by the - * initiator. The thaw_height is the height that this restriction stops - * applying to the channel. This field is optional, not setting it or using a - * value of zero will mean the channel has no additional restrictions. The - * height can be interpreted in two ways: as a relative height if the value is - * less than 500,000, or as an absolute height otherwise. - * - * @generated from protobuf field: uint32 thaw_height = 28; - */ - thawHeight: number; - /** - * List constraints for the local node. - * - * @generated from protobuf field: lnrpc.ChannelConstraints local_constraints = 29; - */ - localConstraints?: ChannelConstraints; - /** - * List constraints for the remote node. - * - * @generated from protobuf field: lnrpc.ChannelConstraints remote_constraints = 30; - */ - remoteConstraints?: ChannelConstraints; - /** - * - * This lists out the set of alias short channel ids that exist for a channel. - * This may be empty. - * - * @generated from protobuf field: repeated uint64 alias_scids = 31; - */ - aliasScids: bigint[]; - /** - * Whether or not this is a zero-conf channel. - * - * @generated from protobuf field: bool zero_conf = 32; - */ - zeroConf: boolean; - /** - * This is the confirmed / on-chain zero-conf SCID. - * - * @generated from protobuf field: uint64 zero_conf_confirmed_scid = 33; - */ - zeroConfConfirmedScid: bigint; -} -/** - * @generated from protobuf message lnrpc.ListChannelsRequest - */ -export interface ListChannelsRequest { - /** - * @generated from protobuf field: bool active_only = 1; - */ - activeOnly: boolean; - /** - * @generated from protobuf field: bool inactive_only = 2; - */ - inactiveOnly: boolean; - /** - * @generated from protobuf field: bool public_only = 3; - */ - publicOnly: boolean; - /** - * @generated from protobuf field: bool private_only = 4; - */ - privateOnly: boolean; - /** - * - * Filters the response for channels with a target peer's pubkey. If peer is - * empty, all channels will be returned. - * - * @generated from protobuf field: bytes peer = 5; - */ - peer: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.ListChannelsResponse - */ -export interface ListChannelsResponse { - /** - * The list of active channels - * - * @generated from protobuf field: repeated lnrpc.Channel channels = 11; - */ - channels: Channel[]; -} -/** - * @generated from protobuf message lnrpc.AliasMap - */ -export interface AliasMap { - /** - * - * For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is - * the first assigned "base" alias. - * - * @generated from protobuf field: uint64 base_scid = 1; - */ - baseScid: bigint; - /** - * The set of all aliases stored for the base SCID. - * - * @generated from protobuf field: repeated uint64 aliases = 2; - */ - aliases: bigint[]; -} -/** - * @generated from protobuf message lnrpc.ListAliasesRequest - */ -export interface ListAliasesRequest { -} -/** - * @generated from protobuf message lnrpc.ListAliasesResponse - */ -export interface ListAliasesResponse { - /** - * @generated from protobuf field: repeated lnrpc.AliasMap alias_maps = 1; - */ - aliasMaps: AliasMap[]; -} -/** - * @generated from protobuf message lnrpc.ChannelCloseSummary - */ -export interface ChannelCloseSummary { - /** - * The outpoint (txid:index) of the funding transaction. - * - * @generated from protobuf field: string channel_point = 1; - */ - channelPoint: string; - /** - * The unique channel ID for the channel. - * - * @generated from protobuf field: uint64 chan_id = 2 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The hash of the genesis block that this channel resides within. - * - * @generated from protobuf field: string chain_hash = 3; - */ - chainHash: string; - /** - * The txid of the transaction which ultimately closed this channel. - * - * @generated from protobuf field: string closing_tx_hash = 4; - */ - closingTxHash: string; - /** - * Public key of the remote peer that we formerly had a channel with. - * - * @generated from protobuf field: string remote_pubkey = 5; - */ - remotePubkey: string; - /** - * Total capacity of the channel. - * - * @generated from protobuf field: int64 capacity = 6; - */ - capacity: bigint; - /** - * Height at which the funding transaction was spent. - * - * @generated from protobuf field: uint32 close_height = 7; - */ - closeHeight: number; - /** - * Settled balance at the time of channel closure - * - * @generated from protobuf field: int64 settled_balance = 8; - */ - settledBalance: bigint; - /** - * The sum of all the time-locked outputs at the time of channel closure - * - * @generated from protobuf field: int64 time_locked_balance = 9; - */ - timeLockedBalance: bigint; - /** - * Details on how the channel was closed. - * - * @generated from protobuf field: lnrpc.ChannelCloseSummary.ClosureType close_type = 10; - */ - closeType: ChannelCloseSummary_ClosureType; - /** - * - * Open initiator is the party that initiated opening the channel. Note that - * this value may be unknown if the channel was closed before we migrated to - * store open channel information after close. - * - * @generated from protobuf field: lnrpc.Initiator open_initiator = 11; - */ - openInitiator: Initiator; - /** - * - * Close initiator indicates which party initiated the close. This value will - * be unknown for channels that were cooperatively closed before we started - * tracking cooperative close initiators. Note that this indicates which party - * initiated a close, and it is possible for both to initiate cooperative or - * force closes, although only one party's close will be confirmed on chain. - * - * @generated from protobuf field: lnrpc.Initiator close_initiator = 12; - */ - closeInitiator: Initiator; - /** - * @generated from protobuf field: repeated lnrpc.Resolution resolutions = 13; - */ - resolutions: Resolution[]; - /** - * - * This lists out the set of alias short channel ids that existed for the - * closed channel. This may be empty. - * - * @generated from protobuf field: repeated uint64 alias_scids = 14; - */ - aliasScids: bigint[]; - /** - * The confirmed SCID for a zero-conf channel. - * - * @generated from protobuf field: uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; - */ - zeroConfConfirmedScid: string; -} -/** - * @generated from protobuf enum lnrpc.ChannelCloseSummary.ClosureType - */ -export enum ChannelCloseSummary_ClosureType { - /** - * @generated from protobuf enum value: COOPERATIVE_CLOSE = 0; - */ - COOPERATIVE_CLOSE = 0, - /** - * @generated from protobuf enum value: LOCAL_FORCE_CLOSE = 1; - */ - LOCAL_FORCE_CLOSE = 1, - /** - * @generated from protobuf enum value: REMOTE_FORCE_CLOSE = 2; - */ - REMOTE_FORCE_CLOSE = 2, - /** - * @generated from protobuf enum value: BREACH_CLOSE = 3; - */ - BREACH_CLOSE = 3, - /** - * @generated from protobuf enum value: FUNDING_CANCELED = 4; - */ - FUNDING_CANCELED = 4, - /** - * @generated from protobuf enum value: ABANDONED = 5; - */ - ABANDONED = 5 -} -/** - * @generated from protobuf message lnrpc.Resolution - */ -export interface Resolution { - /** - * The type of output we are resolving. - * - * @generated from protobuf field: lnrpc.ResolutionType resolution_type = 1; - */ - resolutionType: ResolutionType; - /** - * The outcome of our on chain action that resolved the outpoint. - * - * @generated from protobuf field: lnrpc.ResolutionOutcome outcome = 2; - */ - outcome: ResolutionOutcome; - /** - * The outpoint that was spent by the resolution. - * - * @generated from protobuf field: lnrpc.OutPoint outpoint = 3; - */ - outpoint?: OutPoint; - /** - * The amount that was claimed by the resolution. - * - * @generated from protobuf field: uint64 amount_sat = 4; - */ - amountSat: bigint; - /** - * The hex-encoded transaction ID of the sweep transaction that spent the - * output. - * - * @generated from protobuf field: string sweep_txid = 5; - */ - sweepTxid: string; -} -/** - * @generated from protobuf message lnrpc.ClosedChannelsRequest - */ -export interface ClosedChannelsRequest { - /** - * @generated from protobuf field: bool cooperative = 1; - */ - cooperative: boolean; - /** - * @generated from protobuf field: bool local_force = 2; - */ - localForce: boolean; - /** - * @generated from protobuf field: bool remote_force = 3; - */ - remoteForce: boolean; - /** - * @generated from protobuf field: bool breach = 4; - */ - breach: boolean; - /** - * @generated from protobuf field: bool funding_canceled = 5; - */ - fundingCanceled: boolean; - /** - * @generated from protobuf field: bool abandoned = 6; - */ - abandoned: boolean; -} -/** - * @generated from protobuf message lnrpc.ClosedChannelsResponse - */ -export interface ClosedChannelsResponse { - /** - * @generated from protobuf field: repeated lnrpc.ChannelCloseSummary channels = 1; - */ - channels: ChannelCloseSummary[]; -} -/** - * @generated from protobuf message lnrpc.Peer - */ -export interface Peer { - /** - * The identity pubkey of the peer - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * Network address of the peer; eg `127.0.0.1:10011` - * - * @generated from protobuf field: string address = 3; - */ - address: string; - /** - * Bytes of data transmitted to this peer - * - * @generated from protobuf field: uint64 bytes_sent = 4; - */ - bytesSent: bigint; - /** - * Bytes of data transmitted from this peer - * - * @generated from protobuf field: uint64 bytes_recv = 5; - */ - bytesRecv: bigint; - /** - * Satoshis sent to this peer - * - * @generated from protobuf field: int64 sat_sent = 6; - */ - satSent: bigint; - /** - * Satoshis received from this peer - * - * @generated from protobuf field: int64 sat_recv = 7; - */ - satRecv: bigint; - /** - * A channel is inbound if the counterparty initiated the channel - * - * @generated from protobuf field: bool inbound = 8; - */ - inbound: boolean; - /** - * Ping time to this peer - * - * @generated from protobuf field: int64 ping_time = 9; - */ - pingTime: bigint; - /** - * The type of sync we are currently performing with this peer. - * - * @generated from protobuf field: lnrpc.Peer.SyncType sync_type = 10; - */ - syncType: Peer_SyncType; - /** - * Features advertised by the remote peer in their init message. - * - * @generated from protobuf field: map features = 11; - */ - features: { - [key: number]: Feature; - }; - /** - * - * The latest errors received from our peer with timestamps, limited to the 10 - * most recent errors. These errors are tracked across peer connections, but - * are not persisted across lnd restarts. Note that these errors are only - * stored for peers that we have channels open with, to prevent peers from - * spamming us with errors at no cost. - * - * @generated from protobuf field: repeated lnrpc.TimestampedError errors = 12; - */ - errors: TimestampedError[]; - /** - * - * The number of times we have recorded this peer going offline or coming - * online, recorded across restarts. Note that this value is decreased over - * time if the peer has not recently flapped, so that we can forgive peers - * with historically high flap counts. - * - * @generated from protobuf field: int32 flap_count = 13; - */ - flapCount: number; - /** - * - * The timestamp of the last flap we observed for this peer. If this value is - * zero, we have not observed any flaps for this peer. - * - * @generated from protobuf field: int64 last_flap_ns = 14; - */ - lastFlapNs: bigint; - /** - * - * The last ping payload the peer has sent to us. - * - * @generated from protobuf field: bytes last_ping_payload = 15; - */ - lastPingPayload: Uint8Array; -} -/** - * @generated from protobuf enum lnrpc.Peer.SyncType - */ -export enum Peer_SyncType { - /** - * - * Denotes that we cannot determine the peer's current sync type. - * - * @generated from protobuf enum value: UNKNOWN_SYNC = 0; - */ - UNKNOWN_SYNC = 0, - /** - * - * Denotes that we are actively receiving new graph updates from the peer. - * - * @generated from protobuf enum value: ACTIVE_SYNC = 1; - */ - ACTIVE_SYNC = 1, - /** - * - * Denotes that we are not receiving new graph updates from the peer. - * - * @generated from protobuf enum value: PASSIVE_SYNC = 2; - */ - PASSIVE_SYNC = 2, - /** - * - * Denotes that this peer is pinned into an active sync. - * - * @generated from protobuf enum value: PINNED_SYNC = 3; - */ - PINNED_SYNC = 3 -} -/** - * @generated from protobuf message lnrpc.TimestampedError - */ -export interface TimestampedError { - /** - * The unix timestamp in seconds when the error occurred. - * - * @generated from protobuf field: uint64 timestamp = 1; - */ - timestamp: bigint; - /** - * The string representation of the error sent by our peer. - * - * @generated from protobuf field: string error = 2; - */ - error: string; -} -/** - * @generated from protobuf message lnrpc.ListPeersRequest - */ -export interface ListPeersRequest { - /** - * - * If true, only the last error that our peer sent us will be returned with - * the peer's information, rather than the full set of historic errors we have - * stored. - * - * @generated from protobuf field: bool latest_error = 1; - */ - latestError: boolean; -} -/** - * @generated from protobuf message lnrpc.ListPeersResponse - */ -export interface ListPeersResponse { - /** - * The list of currently connected peers - * - * @generated from protobuf field: repeated lnrpc.Peer peers = 1; - */ - peers: Peer[]; -} -/** - * @generated from protobuf message lnrpc.PeerEventSubscription - */ -export interface PeerEventSubscription { -} -/** - * @generated from protobuf message lnrpc.PeerEvent - */ -export interface PeerEvent { - /** - * The identity pubkey of the peer. - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * @generated from protobuf field: lnrpc.PeerEvent.EventType type = 2; - */ - type: PeerEvent_EventType; -} -/** - * @generated from protobuf enum lnrpc.PeerEvent.EventType - */ -export enum PeerEvent_EventType { - /** - * @generated from protobuf enum value: PEER_ONLINE = 0; - */ - PEER_ONLINE = 0, - /** - * @generated from protobuf enum value: PEER_OFFLINE = 1; - */ - PEER_OFFLINE = 1 -} -/** - * @generated from protobuf message lnrpc.GetInfoRequest - */ -export interface GetInfoRequest { -} -/** - * @generated from protobuf message lnrpc.GetInfoResponse - */ -export interface GetInfoResponse { - /** - * The version of the LND software that the node is running. - * - * @generated from protobuf field: string version = 14; - */ - version: string; - /** - * The SHA1 commit hash that the daemon is compiled with. - * - * @generated from protobuf field: string commit_hash = 20; - */ - commitHash: string; - /** - * The identity pubkey of the current node. - * - * @generated from protobuf field: string identity_pubkey = 1; - */ - identityPubkey: string; - /** - * If applicable, the alias of the current node, e.g. "bob" - * - * @generated from protobuf field: string alias = 2; - */ - alias: string; - /** - * The color of the current node in hex code format - * - * @generated from protobuf field: string color = 17; - */ - color: string; - /** - * Number of pending channels - * - * @generated from protobuf field: uint32 num_pending_channels = 3; - */ - numPendingChannels: number; - /** - * Number of active channels - * - * @generated from protobuf field: uint32 num_active_channels = 4; - */ - numActiveChannels: number; - /** - * Number of inactive channels - * - * @generated from protobuf field: uint32 num_inactive_channels = 15; - */ - numInactiveChannels: number; - /** - * Number of peers - * - * @generated from protobuf field: uint32 num_peers = 5; - */ - numPeers: number; - /** - * The node's current view of the height of the best block - * - * @generated from protobuf field: uint32 block_height = 6; - */ - blockHeight: number; - /** - * The node's current view of the hash of the best block - * - * @generated from protobuf field: string block_hash = 8; - */ - blockHash: string; - /** - * Timestamp of the block best known to the wallet - * - * @generated from protobuf field: int64 best_header_timestamp = 13; - */ - bestHeaderTimestamp: bigint; - /** - * Whether the wallet's view is synced to the main chain - * - * @generated from protobuf field: bool synced_to_chain = 9; - */ - syncedToChain: boolean; - /** - * Whether we consider ourselves synced with the public channel graph. - * - * @generated from protobuf field: bool synced_to_graph = 18; - */ - syncedToGraph: boolean; - /** - * - * Whether the current node is connected to testnet. This field is - * deprecated and the network field should be used instead - * - * @deprecated - * @generated from protobuf field: bool testnet = 10 [deprecated = true]; - */ - testnet: boolean; - /** - * A list of active chains the node is connected to - * - * @generated from protobuf field: repeated lnrpc.Chain chains = 16; - */ - chains: Chain[]; - /** - * The URIs of the current node. - * - * @generated from protobuf field: repeated string uris = 12; - */ - uris: string[]; - /** - * - * Features that our node has advertised in our init message, node - * announcements and invoices. - * - * @generated from protobuf field: map features = 19; - */ - features: { - [key: number]: Feature; - }; - /** - * - * Indicates whether the HTLC interceptor API is in always-on mode. - * - * @generated from protobuf field: bool require_htlc_interceptor = 21; - */ - requireHtlcInterceptor: boolean; -} -/** - * @generated from protobuf message lnrpc.GetRecoveryInfoRequest - */ -export interface GetRecoveryInfoRequest { -} -/** - * @generated from protobuf message lnrpc.GetRecoveryInfoResponse - */ -export interface GetRecoveryInfoResponse { - /** - * Whether the wallet is in recovery mode - * - * @generated from protobuf field: bool recovery_mode = 1; - */ - recoveryMode: boolean; - /** - * Whether the wallet recovery progress is finished - * - * @generated from protobuf field: bool recovery_finished = 2; - */ - recoveryFinished: boolean; - /** - * The recovery progress, ranging from 0 to 1. - * - * @generated from protobuf field: double progress = 3; - */ - progress: number; -} -/** - * @generated from protobuf message lnrpc.Chain - */ -export interface Chain { - /** - * The blockchain the node is on (eg bitcoin, litecoin) - * - * @generated from protobuf field: string chain = 1; - */ - chain: string; - /** - * The network the node is on (eg regtest, testnet, mainnet) - * - * @generated from protobuf field: string network = 2; - */ - network: string; -} -/** - * @generated from protobuf message lnrpc.ConfirmationUpdate - */ -export interface ConfirmationUpdate { - /** - * @generated from protobuf field: bytes block_sha = 1; - */ - blockSha: Uint8Array; - /** - * @generated from protobuf field: int32 block_height = 2; - */ - blockHeight: number; - /** - * @generated from protobuf field: uint32 num_confs_left = 3; - */ - numConfsLeft: number; -} -/** - * @generated from protobuf message lnrpc.ChannelOpenUpdate - */ -export interface ChannelOpenUpdate { - /** - * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; - */ - channelPoint?: ChannelPoint; -} -/** - * @generated from protobuf message lnrpc.ChannelCloseUpdate - */ -export interface ChannelCloseUpdate { - /** - * @generated from protobuf field: bytes closing_txid = 1; - */ - closingTxid: Uint8Array; - /** - * @generated from protobuf field: bool success = 2; - */ - success: boolean; -} -/** - * @generated from protobuf message lnrpc.CloseChannelRequest - */ -export interface CloseChannelRequest { - /** - * - * The outpoint (txid:index) of the funding transaction. With this value, Bob - * will be able to generate a signature for Alice's version of the commitment - * transaction. - * - * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; - */ - channelPoint?: ChannelPoint; - /** - * If true, then the channel will be closed forcibly. This means the - * current commitment transaction will be signed and broadcast. - * - * @generated from protobuf field: bool force = 2; - */ - force: boolean; - /** - * The target number of blocks that the closure transaction should be - * confirmed by. - * - * @generated from protobuf field: int32 target_conf = 3; - */ - targetConf: number; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * closure transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 4 [deprecated = true]; - */ - satPerByte: bigint; - /** - * - * An optional address to send funds to in the case of a cooperative close. - * If the channel was opened with an upfront shutdown script and this field - * is set, the request to close will fail because the channel must pay out - * to the upfront shutdown addresss. - * - * @generated from protobuf field: string delivery_address = 5; - */ - deliveryAddress: string; - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * closure transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 6; - */ - satPerVbyte: bigint; - /** - * The maximum fee rate the closer is willing to pay. - * - * NOTE: This field is only respected if we're the initiator of the channel. - * - * @generated from protobuf field: uint64 max_fee_per_vbyte = 7; - */ - maxFeePerVbyte: bigint; -} -/** - * @generated from protobuf message lnrpc.CloseStatusUpdate - */ -export interface CloseStatusUpdate { - /** - * @generated from protobuf oneof: update - */ - update: { - oneofKind: "closePending"; - /** - * @generated from protobuf field: lnrpc.PendingUpdate close_pending = 1; - */ - closePending: PendingUpdate; - } | { - oneofKind: "chanClose"; - /** - * @generated from protobuf field: lnrpc.ChannelCloseUpdate chan_close = 3; - */ - chanClose: ChannelCloseUpdate; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.PendingUpdate - */ -export interface PendingUpdate { - /** - * @generated from protobuf field: bytes txid = 1; - */ - txid: Uint8Array; - /** - * @generated from protobuf field: uint32 output_index = 2; - */ - outputIndex: number; -} -/** - * @generated from protobuf message lnrpc.ReadyForPsbtFunding - */ -export interface ReadyForPsbtFunding { - /** - * - * The P2WSH address of the channel funding multisig address that the below - * specified amount in satoshis needs to be sent to. - * - * @generated from protobuf field: string funding_address = 1; - */ - fundingAddress: string; - /** - * - * The exact amount in satoshis that needs to be sent to the above address to - * fund the pending channel. - * - * @generated from protobuf field: int64 funding_amount = 2; - */ - fundingAmount: bigint; - /** - * - * A raw PSBT that contains the pending channel output. If a base PSBT was - * provided in the PsbtShim, this is the base PSBT with one additional output. - * If no base PSBT was specified, this is an otherwise empty PSBT with exactly - * one output. - * - * @generated from protobuf field: bytes psbt = 3; - */ - psbt: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.BatchOpenChannelRequest - */ -export interface BatchOpenChannelRequest { - /** - * The list of channels to open. - * - * @generated from protobuf field: repeated lnrpc.BatchOpenChannel channels = 1; - */ - channels: BatchOpenChannel[]; - /** - * The target number of blocks that the funding transaction should be - * confirmed by. - * - * @generated from protobuf field: int32 target_conf = 2; - */ - targetConf: number; - /** - * A manual fee rate set in sat/vByte that should be used when crafting the - * funding transaction. - * - * @generated from protobuf field: int64 sat_per_vbyte = 3; - */ - satPerVbyte: bigint; - /** - * The minimum number of confirmations each one of your outputs used for - * the funding transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 4; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the funding - * transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 5; - */ - spendUnconfirmed: boolean; - /** - * An optional label for the batch transaction, limited to 500 characters. - * - * @generated from protobuf field: string label = 6; - */ - label: string; -} -/** - * @generated from protobuf message lnrpc.BatchOpenChannel - */ -export interface BatchOpenChannel { - /** - * The pubkey of the node to open a channel with. When using REST, this - * field must be encoded as base64. - * - * @generated from protobuf field: bytes node_pubkey = 1; - */ - nodePubkey: Uint8Array; - /** - * The number of satoshis the wallet should commit to the channel. - * - * @generated from protobuf field: int64 local_funding_amount = 2; - */ - localFundingAmount: bigint; - /** - * The number of satoshis to push to the remote side as part of the initial - * commitment state. - * - * @generated from protobuf field: int64 push_sat = 3; - */ - pushSat: bigint; - /** - * Whether this channel should be private, not announced to the greater - * network. - * - * @generated from protobuf field: bool private = 4; - */ - private: boolean; - /** - * The minimum value in millisatoshi we will require for incoming HTLCs on - * the channel. - * - * @generated from protobuf field: int64 min_htlc_msat = 5; - */ - minHtlcMsat: bigint; - /** - * The delay we require on the remote's commitment transaction. If this is - * not set, it will be scaled automatically with the channel size. - * - * @generated from protobuf field: uint32 remote_csv_delay = 6; - */ - remoteCsvDelay: number; - /** - * - * Close address is an optional address which specifies the address to which - * funds should be paid out to upon cooperative close. This field may only be - * set if the peer supports the option upfront feature bit (call listpeers - * to check). The remote peer will only accept cooperative closes to this - * address if it is set. - * - * Note: If this value is set on channel creation, you will *not* be able to - * cooperatively close out to a different address. - * - * @generated from protobuf field: string close_address = 7; - */ - closeAddress: string; - /** - * - * An optional, unique identifier of 32 random bytes that will be used as the - * pending channel ID to identify the channel while it is in the pre-pending - * state. - * - * @generated from protobuf field: bytes pending_chan_id = 8; - */ - pendingChanId: Uint8Array; - /** - * - * The explicit commitment type to use. Note this field will only be used if - * the remote peer supports explicit channel negotiation. - * - * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 9; - */ - commitmentType: CommitmentType; -} -/** - * @generated from protobuf message lnrpc.BatchOpenChannelResponse - */ -export interface BatchOpenChannelResponse { - /** - * @generated from protobuf field: repeated lnrpc.PendingUpdate pending_channels = 1; - */ - pendingChannels: PendingUpdate[]; -} -/** - * @generated from protobuf message lnrpc.OpenChannelRequest - */ -export interface OpenChannelRequest { - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * funding transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 1; - */ - satPerVbyte: bigint; - /** - * - * The pubkey of the node to open a channel with. When using REST, this field - * must be encoded as base64. - * - * @generated from protobuf field: bytes node_pubkey = 2; - */ - nodePubkey: Uint8Array; - /** - * - * The hex encoded pubkey of the node to open a channel with. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string node_pubkey_string = 3 [deprecated = true]; - */ - nodePubkeyString: string; - /** - * The number of satoshis the wallet should commit to the channel - * - * @generated from protobuf field: int64 local_funding_amount = 4; - */ - localFundingAmount: bigint; - /** - * The number of satoshis to push to the remote side as part of the initial - * commitment state - * - * @generated from protobuf field: int64 push_sat = 5; - */ - pushSat: bigint; - /** - * The target number of blocks that the funding transaction should be - * confirmed by. - * - * @generated from protobuf field: int32 target_conf = 6; - */ - targetConf: number; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * funding transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 7 [deprecated = true]; - */ - satPerByte: bigint; - /** - * Whether this channel should be private, not announced to the greater - * network. - * - * @generated from protobuf field: bool private = 8; - */ - private: boolean; - /** - * The minimum value in millisatoshi we will require for incoming HTLCs on - * the channel. - * - * @generated from protobuf field: int64 min_htlc_msat = 9; - */ - minHtlcMsat: bigint; - /** - * The delay we require on the remote's commitment transaction. If this is - * not set, it will be scaled automatically with the channel size. - * - * @generated from protobuf field: uint32 remote_csv_delay = 10; - */ - remoteCsvDelay: number; - /** - * The minimum number of confirmations each one of your outputs used for - * the funding transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 11; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the funding - * transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 12; - */ - spendUnconfirmed: boolean; - /** - * - * Close address is an optional address which specifies the address to which - * funds should be paid out to upon cooperative close. This field may only be - * set if the peer supports the option upfront feature bit (call listpeers - * to check). The remote peer will only accept cooperative closes to this - * address if it is set. - * - * Note: If this value is set on channel creation, you will *not* be able to - * cooperatively close out to a different address. - * - * @generated from protobuf field: string close_address = 13; - */ - closeAddress: string; - /** - * - * Funding shims are an optional argument that allow the caller to intercept - * certain funding functionality. For example, a shim can be provided to use a - * particular key for the commitment key (ideally cold) rather than use one - * that is generated by the wallet as normal, or signal that signing will be - * carried out in an interactive manner (PSBT based). - * - * @generated from protobuf field: lnrpc.FundingShim funding_shim = 14; - */ - fundingShim?: FundingShim; - /** - * - * The maximum amount of coins in millisatoshi that can be pending within - * the channel. It only applies to the remote party. - * - * @generated from protobuf field: uint64 remote_max_value_in_flight_msat = 15; - */ - remoteMaxValueInFlightMsat: bigint; - /** - * - * The maximum number of concurrent HTLCs we will allow the remote party to add - * to the commitment transaction. - * - * @generated from protobuf field: uint32 remote_max_htlcs = 16; - */ - remoteMaxHtlcs: number; - /** - * - * Max local csv is the maximum csv delay we will allow for our own commitment - * transaction. - * - * @generated from protobuf field: uint32 max_local_csv = 17; - */ - maxLocalCsv: number; - /** - * - * The explicit commitment type to use. Note this field will only be used if - * the remote peer supports explicit channel negotiation. - * - * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 18; - */ - commitmentType: CommitmentType; - /** - * - * If this is true, then a zero-conf channel open will be attempted. - * - * @generated from protobuf field: bool zero_conf = 19; - */ - zeroConf: boolean; - /** - * - * If this is true, then an option-scid-alias channel-type open will be - * attempted. - * - * @generated from protobuf field: bool scid_alias = 20; - */ - scidAlias: boolean; - /** - * - * The base fee charged regardless of the number of milli-satoshis sent. - * - * @generated from protobuf field: uint64 base_fee = 21; - */ - baseFee: bigint; - /** - * - * The fee rate in ppm (parts per million) that will be charged in - * proportion of the value of each forwarded HTLC. - * - * @generated from protobuf field: uint64 fee_rate = 22; - */ - feeRate: bigint; - /** - * - * If use_base_fee is true the open channel announcement will update the - * channel base fee with the value specified in base_fee. In the case of - * a base_fee of 0 use_base_fee is needed downstream to distinguish whether - * to use the default base fee value specified in the config or 0. - * - * @generated from protobuf field: bool use_base_fee = 23; - */ - useBaseFee: boolean; - /** - * - * If use_fee_rate is true the open channel announcement will update the - * channel fee rate with the value specified in fee_rate. In the case of - * a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether - * to use the default fee rate value specified in the config or 0. - * - * @generated from protobuf field: bool use_fee_rate = 24; - */ - useFeeRate: boolean; - /** - * - * The number of satoshis we require the remote peer to reserve. This value, - * if specified, must be above the dust limit and below 20% of the channel - * capacity. - * - * @generated from protobuf field: uint64 remote_chan_reserve_sat = 25; - */ - remoteChanReserveSat: bigint; -} -/** - * @generated from protobuf message lnrpc.OpenStatusUpdate - */ -export interface OpenStatusUpdate { - /** - * @generated from protobuf oneof: update - */ - update: { - oneofKind: "chanPending"; - /** - * - * Signals that the channel is now fully negotiated and the funding - * transaction published. - * - * @generated from protobuf field: lnrpc.PendingUpdate chan_pending = 1; - */ - chanPending: PendingUpdate; - } | { - oneofKind: "chanOpen"; - /** - * - * Signals that the channel's funding transaction has now reached the - * required number of confirmations on chain and can be used. - * - * @generated from protobuf field: lnrpc.ChannelOpenUpdate chan_open = 3; - */ - chanOpen: ChannelOpenUpdate; - } | { - oneofKind: "psbtFund"; - /** - * - * Signals that the funding process has been suspended and the construction - * of a PSBT that funds the channel PK script is now required. - * - * @generated from protobuf field: lnrpc.ReadyForPsbtFunding psbt_fund = 5; - */ - psbtFund: ReadyForPsbtFunding; - } | { - oneofKind: undefined; - }; - /** - * - * The pending channel ID of the created channel. This value may be used to - * further the funding flow manually via the FundingStateStep method. - * - * @generated from protobuf field: bytes pending_chan_id = 4; - */ - pendingChanId: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.KeyLocator - */ -export interface KeyLocator { - /** - * The family of key being identified. - * - * @generated from protobuf field: int32 key_family = 1; - */ - keyFamily: number; - /** - * The precise index of the key being identified. - * - * @generated from protobuf field: int32 key_index = 2; - */ - keyIndex: number; -} -/** - * @generated from protobuf message lnrpc.KeyDescriptor - */ -export interface KeyDescriptor { - /** - * - * The raw bytes of the key being identified. - * - * @generated from protobuf field: bytes raw_key_bytes = 1; - */ - rawKeyBytes: Uint8Array; - /** - * - * The key locator that identifies which key to use for signing. - * - * @generated from protobuf field: lnrpc.KeyLocator key_loc = 2; - */ - keyLoc?: KeyLocator; -} -/** - * @generated from protobuf message lnrpc.ChanPointShim - */ -export interface ChanPointShim { - /** - * - * The size of the pre-crafted output to be used as the channel point for this - * channel funding. - * - * @generated from protobuf field: int64 amt = 1; - */ - amt: bigint; - /** - * The target channel point to refrence in created commitment transactions. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; - */ - chanPoint?: ChannelPoint; - /** - * Our local key to use when creating the multi-sig output. - * - * @generated from protobuf field: lnrpc.KeyDescriptor local_key = 3; - */ - localKey?: KeyDescriptor; - /** - * The key of the remote party to use when creating the multi-sig output. - * - * @generated from protobuf field: bytes remote_key = 4; - */ - remoteKey: Uint8Array; - /** - * - * If non-zero, then this will be used as the pending channel ID on the wire - * protocol to initate the funding request. This is an optional field, and - * should only be set if the responder is already expecting a specific pending - * channel ID. - * - * @generated from protobuf field: bytes pending_chan_id = 5; - */ - pendingChanId: Uint8Array; - /** - * - * This uint32 indicates if this channel is to be considered 'frozen'. A frozen - * channel does not allow a cooperative channel close by the initiator. The - * thaw_height is the height that this restriction stops applying to the - * channel. The height can be interpreted in two ways: as a relative height if - * the value is less than 500,000, or as an absolute height otherwise. - * - * @generated from protobuf field: uint32 thaw_height = 6; - */ - thawHeight: number; -} -/** - * @generated from protobuf message lnrpc.PsbtShim - */ -export interface PsbtShim { - /** - * - * A unique identifier of 32 random bytes that will be used as the pending - * channel ID to identify the PSBT state machine when interacting with it and - * on the wire protocol to initiate the funding request. - * - * @generated from protobuf field: bytes pending_chan_id = 1; - */ - pendingChanId: Uint8Array; - /** - * - * An optional base PSBT the new channel output will be added to. If this is - * non-empty, it must be a binary serialized PSBT. - * - * @generated from protobuf field: bytes base_psbt = 2; - */ - basePsbt: Uint8Array; - /** - * - * If a channel should be part of a batch (multiple channel openings in one - * transaction), it can be dangerous if the whole batch transaction is - * published too early before all channel opening negotiations are completed. - * This flag prevents this particular channel from broadcasting the transaction - * after the negotiation with the remote peer. In a batch of channel openings - * this flag should be set to true for every channel but the very last. - * - * @generated from protobuf field: bool no_publish = 3; - */ - noPublish: boolean; -} -/** - * @generated from protobuf message lnrpc.FundingShim - */ -export interface FundingShim { - /** - * @generated from protobuf oneof: shim - */ - shim: { - oneofKind: "chanPointShim"; - /** - * - * A channel shim where the channel point was fully constructed outside - * of lnd's wallet and the transaction might already be published. - * - * @generated from protobuf field: lnrpc.ChanPointShim chan_point_shim = 1; - */ - chanPointShim: ChanPointShim; - } | { - oneofKind: "psbtShim"; - /** - * - * A channel shim that uses a PSBT to fund and sign the channel funding - * transaction. - * - * @generated from protobuf field: lnrpc.PsbtShim psbt_shim = 2; - */ - psbtShim: PsbtShim; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.FundingShimCancel - */ -export interface FundingShimCancel { - /** - * The pending channel ID of the channel to cancel the funding shim for. - * - * @generated from protobuf field: bytes pending_chan_id = 1; - */ - pendingChanId: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.FundingPsbtVerify - */ -export interface FundingPsbtVerify { - /** - * - * The funded but not yet signed PSBT that sends the exact channel capacity - * amount to the PK script returned in the open channel message in a previous - * step. - * - * @generated from protobuf field: bytes funded_psbt = 1; - */ - fundedPsbt: Uint8Array; - /** - * The pending channel ID of the channel to get the PSBT for. - * - * @generated from protobuf field: bytes pending_chan_id = 2; - */ - pendingChanId: Uint8Array; - /** - * - * Can only be used if the no_publish flag was set to true in the OpenChannel - * call meaning that the caller is solely responsible for publishing the final - * funding transaction. If skip_finalize is set to true then lnd will not wait - * for a FundingPsbtFinalize state step and instead assumes that a transaction - * with the same TXID as the passed in PSBT will eventually confirm. - * IT IS ABSOLUTELY IMPERATIVE that the TXID of the transaction that is - * eventually published does have the _same TXID_ as the verified PSBT. That - * means no inputs or outputs can change, only signatures can be added. If the - * TXID changes between this call and the publish step then the channel will - * never be created and the funds will be in limbo. - * - * @generated from protobuf field: bool skip_finalize = 3; - */ - skipFinalize: boolean; -} -/** - * @generated from protobuf message lnrpc.FundingPsbtFinalize - */ -export interface FundingPsbtFinalize { - /** - * - * The funded PSBT that contains all witness data to send the exact channel - * capacity amount to the PK script returned in the open channel message in a - * previous step. Cannot be set at the same time as final_raw_tx. - * - * @generated from protobuf field: bytes signed_psbt = 1; - */ - signedPsbt: Uint8Array; - /** - * The pending channel ID of the channel to get the PSBT for. - * - * @generated from protobuf field: bytes pending_chan_id = 2; - */ - pendingChanId: Uint8Array; - /** - * - * As an alternative to the signed PSBT with all witness data, the final raw - * wire format transaction can also be specified directly. Cannot be set at the - * same time as signed_psbt. - * - * @generated from protobuf field: bytes final_raw_tx = 3; - */ - finalRawTx: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.FundingTransitionMsg - */ -export interface FundingTransitionMsg { - /** - * @generated from protobuf oneof: trigger - */ - trigger: { - oneofKind: "shimRegister"; - /** - * - * The funding shim to register. This should be used before any - * channel funding has began by the remote party, as it is intended as a - * preparatory step for the full channel funding. - * - * @generated from protobuf field: lnrpc.FundingShim shim_register = 1; - */ - shimRegister: FundingShim; - } | { - oneofKind: "shimCancel"; - /** - * Used to cancel an existing registered funding shim. - * - * @generated from protobuf field: lnrpc.FundingShimCancel shim_cancel = 2; - */ - shimCancel: FundingShimCancel; - } | { - oneofKind: "psbtVerify"; - /** - * - * Used to continue a funding flow that was initiated to be executed - * through a PSBT. This step verifies that the PSBT contains the correct - * outputs to fund the channel. - * - * @generated from protobuf field: lnrpc.FundingPsbtVerify psbt_verify = 3; - */ - psbtVerify: FundingPsbtVerify; - } | { - oneofKind: "psbtFinalize"; - /** - * - * Used to continue a funding flow that was initiated to be executed - * through a PSBT. This step finalizes the funded and signed PSBT, finishes - * negotiation with the peer and finally publishes the resulting funding - * transaction. - * - * @generated from protobuf field: lnrpc.FundingPsbtFinalize psbt_finalize = 4; - */ - psbtFinalize: FundingPsbtFinalize; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.FundingStateStepResp - */ -export interface FundingStateStepResp { -} -/** - * @generated from protobuf message lnrpc.PendingHTLC - */ -export interface PendingHTLC { - /** - * The direction within the channel that the htlc was sent - * - * @generated from protobuf field: bool incoming = 1; - */ - incoming: boolean; - /** - * The total value of the htlc - * - * @generated from protobuf field: int64 amount = 2; - */ - amount: bigint; - /** - * The final output to be swept back to the user's wallet - * - * @generated from protobuf field: string outpoint = 3; - */ - outpoint: string; - /** - * The next block height at which we can spend the current stage - * - * @generated from protobuf field: uint32 maturity_height = 4; - */ - maturityHeight: number; - /** - * - * The number of blocks remaining until the current stage can be swept. - * Negative values indicate how many blocks have passed since becoming - * mature. - * - * @generated from protobuf field: int32 blocks_til_maturity = 5; - */ - blocksTilMaturity: number; - /** - * Indicates whether the htlc is in its first or second stage of recovery - * - * @generated from protobuf field: uint32 stage = 6; - */ - stage: number; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsRequest - */ -export interface PendingChannelsRequest { -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse - */ -export interface PendingChannelsResponse { - /** - * The balance in satoshis encumbered in pending channels - * - * @generated from protobuf field: int64 total_limbo_balance = 1; - */ - totalLimboBalance: bigint; - /** - * Channels pending opening - * - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels = 2; - */ - pendingOpenChannels: PendingChannelsResponse_PendingOpenChannel[]; - /** - * - * Deprecated: Channels pending closing previously contained cooperatively - * closed channels with a single confirmation. These channels are now - * considered closed from the time we see them on chain. - * - * @deprecated - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true]; - */ - pendingClosingChannels: PendingChannelsResponse_ClosedChannel[]; - /** - * Channels pending force closing - * - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels = 4; - */ - pendingForceClosingChannels: PendingChannelsResponse_ForceClosedChannel[]; - /** - * Channels waiting for closing tx to confirm - * - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels = 5; - */ - waitingCloseChannels: PendingChannelsResponse_WaitingCloseChannel[]; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.PendingChannel - */ -export interface PendingChannelsResponse_PendingChannel { - /** - * @generated from protobuf field: string remote_node_pub = 1; - */ - remoteNodePub: string; - /** - * @generated from protobuf field: string channel_point = 2; - */ - channelPoint: string; - /** - * @generated from protobuf field: int64 capacity = 3; - */ - capacity: bigint; - /** - * @generated from protobuf field: int64 local_balance = 4; - */ - localBalance: bigint; - /** - * @generated from protobuf field: int64 remote_balance = 5; - */ - remoteBalance: bigint; - /** - * The minimum satoshis this node is required to reserve in its - * balance. - * - * @generated from protobuf field: int64 local_chan_reserve_sat = 6; - */ - localChanReserveSat: bigint; - /** - * - * The minimum satoshis the other node is required to reserve in its - * balance. - * - * @generated from protobuf field: int64 remote_chan_reserve_sat = 7; - */ - remoteChanReserveSat: bigint; - /** - * The party that initiated opening the channel. - * - * @generated from protobuf field: lnrpc.Initiator initiator = 8; - */ - initiator: Initiator; - /** - * The commitment type used by this channel. - * - * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 9; - */ - commitmentType: CommitmentType; - /** - * Total number of forwarding packages created in this channel. - * - * @generated from protobuf field: int64 num_forwarding_packages = 10; - */ - numForwardingPackages: bigint; - /** - * A set of flags showing the current state of the channel. - * - * @generated from protobuf field: string chan_status_flags = 11; - */ - chanStatusFlags: string; - /** - * Whether this channel is advertised to the network or not. - * - * @generated from protobuf field: bool private = 12; - */ - private: boolean; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.PendingOpenChannel - */ -export interface PendingChannelsResponse_PendingOpenChannel { - /** - * The pending channel - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * - * The amount calculated to be paid in fees for the current set of - * commitment transactions. The fee amount is persisted with the channel - * in order to allow the fee amount to be removed and recalculated with - * each channel state update, including updates that happen after a system - * restart. - * - * @generated from protobuf field: int64 commit_fee = 4; - */ - commitFee: bigint; - /** - * The weight of the commitment transaction - * - * @generated from protobuf field: int64 commit_weight = 5; - */ - commitWeight: bigint; - /** - * - * The required number of satoshis per kilo-weight that the requester will - * pay at all times, for both the funding transaction and commitment - * transaction. This value can later be updated once the channel is open. - * - * @generated from protobuf field: int64 fee_per_kw = 6; - */ - feePerKw: bigint; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel - */ -export interface PendingChannelsResponse_WaitingCloseChannel { - /** - * The pending channel waiting for closing tx to confirm - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * The balance in satoshis encumbered in this channel - * - * @generated from protobuf field: int64 limbo_balance = 2; - */ - limboBalance: bigint; - /** - * - * A list of valid commitment transactions. Any of these can confirm at - * this point. - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.Commitments commitments = 3; - */ - commitments?: PendingChannelsResponse_Commitments; - /** - * The transaction id of the closing transaction - * - * @generated from protobuf field: string closing_txid = 4; - */ - closingTxid: string; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.Commitments - */ -export interface PendingChannelsResponse_Commitments { - /** - * Hash of the local version of the commitment tx. - * - * @generated from protobuf field: string local_txid = 1; - */ - localTxid: string; - /** - * Hash of the remote version of the commitment tx. - * - * @generated from protobuf field: string remote_txid = 2; - */ - remoteTxid: string; - /** - * Hash of the remote pending version of the commitment tx. - * - * @generated from protobuf field: string remote_pending_txid = 3; - */ - remotePendingTxid: string; - /** - * - * The amount in satoshis calculated to be paid in fees for the local - * commitment. - * - * @generated from protobuf field: uint64 local_commit_fee_sat = 4; - */ - localCommitFeeSat: bigint; - /** - * - * The amount in satoshis calculated to be paid in fees for the remote - * commitment. - * - * @generated from protobuf field: uint64 remote_commit_fee_sat = 5; - */ - remoteCommitFeeSat: bigint; - /** - * - * The amount in satoshis calculated to be paid in fees for the remote - * pending commitment. - * - * @generated from protobuf field: uint64 remote_pending_commit_fee_sat = 6; - */ - remotePendingCommitFeeSat: bigint; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.ClosedChannel - */ -export interface PendingChannelsResponse_ClosedChannel { - /** - * The pending channel to be closed - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * The transaction id of the closing transaction - * - * @generated from protobuf field: string closing_txid = 2; - */ - closingTxid: string; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.ForceClosedChannel - */ -export interface PendingChannelsResponse_ForceClosedChannel { - /** - * The pending channel to be force closed - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * The transaction id of the closing transaction - * - * @generated from protobuf field: string closing_txid = 2; - */ - closingTxid: string; - /** - * The balance in satoshis encumbered in this pending channel - * - * @generated from protobuf field: int64 limbo_balance = 3; - */ - limboBalance: bigint; - /** - * The height at which funds can be swept into the wallet - * - * @generated from protobuf field: uint32 maturity_height = 4; - */ - maturityHeight: number; - /** - * - * Remaining # of blocks until the commitment output can be swept. - * Negative values indicate how many blocks have passed since becoming - * mature. - * - * @generated from protobuf field: int32 blocks_til_maturity = 5; - */ - blocksTilMaturity: number; - /** - * The total value of funds successfully recovered from this channel - * - * @generated from protobuf field: int64 recovered_balance = 6; - */ - recoveredBalance: bigint; - /** - * @generated from protobuf field: repeated lnrpc.PendingHTLC pending_htlcs = 8; - */ - pendingHtlcs: PendingHTLC[]; - /** - * @generated from protobuf field: lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor = 9; - */ - anchor: PendingChannelsResponse_ForceClosedChannel_AnchorState; -} -/** - * - * There are three resolution states for the anchor: - * limbo, lost and recovered. Derive the current state - * from the limbo and recovered balances. - * - * @generated from protobuf enum lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState - */ -export enum PendingChannelsResponse_ForceClosedChannel_AnchorState { - /** - * The recovered_balance is zero and limbo_balance is non-zero. - * - * @generated from protobuf enum value: LIMBO = 0; - */ - LIMBO = 0, - /** - * The recovered_balance is non-zero. - * - * @generated from protobuf enum value: RECOVERED = 1; - */ - RECOVERED = 1, - /** - * A state that is neither LIMBO nor RECOVERED. - * - * @generated from protobuf enum value: LOST = 2; - */ - LOST = 2 -} -/** - * @generated from protobuf message lnrpc.ChannelEventSubscription - */ -export interface ChannelEventSubscription { -} -/** - * @generated from protobuf message lnrpc.ChannelEventUpdate - */ -export interface ChannelEventUpdate { - /** - * @generated from protobuf oneof: channel - */ - channel: { - oneofKind: "openChannel"; - /** - * @generated from protobuf field: lnrpc.Channel open_channel = 1; - */ - openChannel: Channel; - } | { - oneofKind: "closedChannel"; - /** - * @generated from protobuf field: lnrpc.ChannelCloseSummary closed_channel = 2; - */ - closedChannel: ChannelCloseSummary; - } | { - oneofKind: "activeChannel"; - /** - * @generated from protobuf field: lnrpc.ChannelPoint active_channel = 3; - */ - activeChannel: ChannelPoint; - } | { - oneofKind: "inactiveChannel"; - /** - * @generated from protobuf field: lnrpc.ChannelPoint inactive_channel = 4; - */ - inactiveChannel: ChannelPoint; - } | { - oneofKind: "pendingOpenChannel"; - /** - * @generated from protobuf field: lnrpc.PendingUpdate pending_open_channel = 6; - */ - pendingOpenChannel: PendingUpdate; - } | { - oneofKind: "fullyResolvedChannel"; - /** - * @generated from protobuf field: lnrpc.ChannelPoint fully_resolved_channel = 7; - */ - fullyResolvedChannel: ChannelPoint; - } | { - oneofKind: undefined; - }; - /** - * @generated from protobuf field: lnrpc.ChannelEventUpdate.UpdateType type = 5; - */ - type: ChannelEventUpdate_UpdateType; -} -/** - * @generated from protobuf enum lnrpc.ChannelEventUpdate.UpdateType - */ -export enum ChannelEventUpdate_UpdateType { - /** - * @generated from protobuf enum value: OPEN_CHANNEL = 0; - */ - OPEN_CHANNEL = 0, - /** - * @generated from protobuf enum value: CLOSED_CHANNEL = 1; - */ - CLOSED_CHANNEL = 1, - /** - * @generated from protobuf enum value: ACTIVE_CHANNEL = 2; - */ - ACTIVE_CHANNEL = 2, - /** - * @generated from protobuf enum value: INACTIVE_CHANNEL = 3; - */ - INACTIVE_CHANNEL = 3, - /** - * @generated from protobuf enum value: PENDING_OPEN_CHANNEL = 4; - */ - PENDING_OPEN_CHANNEL = 4, - /** - * @generated from protobuf enum value: FULLY_RESOLVED_CHANNEL = 5; - */ - FULLY_RESOLVED_CHANNEL = 5 -} -/** - * @generated from protobuf message lnrpc.WalletAccountBalance - */ -export interface WalletAccountBalance { - /** - * The confirmed balance of the account (with >= 1 confirmations). - * - * @generated from protobuf field: int64 confirmed_balance = 1; - */ - confirmedBalance: bigint; - /** - * The unconfirmed balance of the account (with 0 confirmations). - * - * @generated from protobuf field: int64 unconfirmed_balance = 2; - */ - unconfirmedBalance: bigint; -} -/** - * @generated from protobuf message lnrpc.WalletBalanceRequest - */ -export interface WalletBalanceRequest { -} -/** - * @generated from protobuf message lnrpc.WalletBalanceResponse - */ -export interface WalletBalanceResponse { - /** - * The balance of the wallet - * - * @generated from protobuf field: int64 total_balance = 1; - */ - totalBalance: bigint; - /** - * The confirmed balance of a wallet(with >= 1 confirmations) - * - * @generated from protobuf field: int64 confirmed_balance = 2; - */ - confirmedBalance: bigint; - /** - * The unconfirmed balance of a wallet(with 0 confirmations) - * - * @generated from protobuf field: int64 unconfirmed_balance = 3; - */ - unconfirmedBalance: bigint; - /** - * The total amount of wallet UTXOs held in outputs that are locked for - * other usage. - * - * @generated from protobuf field: int64 locked_balance = 5; - */ - lockedBalance: bigint; - /** - * The amount of reserve required. - * - * @generated from protobuf field: int64 reserved_balance_anchor_chan = 6; - */ - reservedBalanceAnchorChan: bigint; - /** - * A mapping of each wallet account's name to its balance. - * - * @generated from protobuf field: map account_balance = 4; - */ - accountBalance: { - [key: string]: WalletAccountBalance; - }; -} -/** - * @generated from protobuf message lnrpc.Amount - */ -export interface Amount { - /** - * Value denominated in satoshis. - * - * @generated from protobuf field: uint64 sat = 1; - */ - sat: bigint; - /** - * Value denominated in milli-satoshis. - * - * @generated from protobuf field: uint64 msat = 2; - */ - msat: bigint; -} -/** - * @generated from protobuf message lnrpc.ChannelBalanceRequest - */ -export interface ChannelBalanceRequest { -} -/** - * @generated from protobuf message lnrpc.ChannelBalanceResponse - */ -export interface ChannelBalanceResponse { - /** - * Deprecated. Sum of channels balances denominated in satoshis - * - * @deprecated - * @generated from protobuf field: int64 balance = 1 [deprecated = true]; - */ - balance: bigint; - /** - * Deprecated. Sum of channels pending balances denominated in satoshis - * - * @deprecated - * @generated from protobuf field: int64 pending_open_balance = 2 [deprecated = true]; - */ - pendingOpenBalance: bigint; - /** - * Sum of channels local balances. - * - * @generated from protobuf field: lnrpc.Amount local_balance = 3; - */ - localBalance?: Amount; - /** - * Sum of channels remote balances. - * - * @generated from protobuf field: lnrpc.Amount remote_balance = 4; - */ - remoteBalance?: Amount; - /** - * Sum of channels local unsettled balances. - * - * @generated from protobuf field: lnrpc.Amount unsettled_local_balance = 5; - */ - unsettledLocalBalance?: Amount; - /** - * Sum of channels remote unsettled balances. - * - * @generated from protobuf field: lnrpc.Amount unsettled_remote_balance = 6; - */ - unsettledRemoteBalance?: Amount; - /** - * Sum of channels pending local balances. - * - * @generated from protobuf field: lnrpc.Amount pending_open_local_balance = 7; - */ - pendingOpenLocalBalance?: Amount; - /** - * Sum of channels pending remote balances. - * - * @generated from protobuf field: lnrpc.Amount pending_open_remote_balance = 8; - */ - pendingOpenRemoteBalance?: Amount; -} -/** - * @generated from protobuf message lnrpc.QueryRoutesRequest - */ -export interface QueryRoutesRequest { - /** - * The 33-byte hex-encoded public key for the payment destination - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * - * The amount to send expressed in satoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt = 2; - */ - amt: bigint; - /** - * - * The amount to send expressed in millisatoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt_msat = 12; - */ - amtMsat: bigint; - /** - * - * An optional CLTV delta from the current height that should be used for the - * timelock of the final hop. Note that unlike SendPayment, QueryRoutes does - * not add any additional block padding on top of final_ctlv_delta. This - * padding of a few blocks needs to be added manually or otherwise failures may - * happen when a block comes in while the payment is in flight. - * - * @generated from protobuf field: int32 final_cltv_delta = 4; - */ - finalCltvDelta: number; - /** - * - * The maximum number of satoshis that will be paid as a fee of the payment. - * This value can be represented either as a percentage of the amount being - * sent, or as a fixed amount of the maximum fee the user is willing the pay to - * send the payment. If not specified, lnd will use a default value of 100% - * fees for small amounts (<=1k sat) or 5% fees for larger amounts. - * - * @generated from protobuf field: lnrpc.FeeLimit fee_limit = 5; - */ - feeLimit?: FeeLimit; - /** - * - * A list of nodes to ignore during path finding. When using REST, these fields - * must be encoded as base64. - * - * @generated from protobuf field: repeated bytes ignored_nodes = 6; - */ - ignoredNodes: Uint8Array[]; - /** - * - * Deprecated. A list of edges to ignore during path finding. - * - * @deprecated - * @generated from protobuf field: repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true]; - */ - ignoredEdges: EdgeLocator[]; - /** - * - * The source node where the request route should originated from. If empty, - * self is assumed. - * - * @generated from protobuf field: string source_pub_key = 8; - */ - sourcePubKey: string; - /** - * - * If set to true, edge probabilities from mission control will be used to get - * the optimal route. - * - * @generated from protobuf field: bool use_mission_control = 9; - */ - useMissionControl: boolean; - /** - * - * A list of directed node pairs that will be ignored during path finding. - * - * @generated from protobuf field: repeated lnrpc.NodePair ignored_pairs = 10; - */ - ignoredPairs: NodePair[]; - /** - * - * An optional maximum total time lock for the route. If the source is empty or - * ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If - * zero, then the value of `--max-cltv-expiry` is used as the limit. - * - * @generated from protobuf field: uint32 cltv_limit = 11; - */ - cltvLimit: number; - /** - * - * An optional field that can be used to pass an arbitrary set of TLV records - * to a peer which understands the new records. This can be used to pass - * application specific data during the payment attempt. If the destination - * does not support the specified records, an error will be returned. - * Record types are required to be in the custom range >= 65536. When using - * REST, the values must be encoded as base64. - * - * @generated from protobuf field: map dest_custom_records = 13; - */ - destCustomRecords: { - [key: string]: Uint8Array; - }; - /** - * - * The channel id of the channel that must be taken to the first hop. If zero, - * any channel may be used. - * - * @generated from protobuf field: uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * The pubkey of the last hop of the route. If empty, any hop may be used. - * - * @generated from protobuf field: bytes last_hop_pubkey = 15; - */ - lastHopPubkey: Uint8Array; - /** - * - * Optional route hints to reach the destination through private channels. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 16; - */ - routeHints: RouteHint[]; - /** - * - * Features assumed to be supported by the final node. All transitive feature - * dependencies must also be set properly. For a given feature bit pair, either - * optional or remote may be set, but not both. If this field is nil or empty, - * the router will try to load destination features from the graph as a - * fallback. - * - * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 17; - */ - destFeatures: FeatureBit[]; - /** - * - * The time preference for this payment. Set to -1 to optimize for fees - * only, to 1 to optimize for reliability only or a value inbetween for a mix. - * - * @generated from protobuf field: double time_pref = 18; - */ - timePref: number; -} -/** - * @generated from protobuf message lnrpc.NodePair - */ -export interface NodePair { - /** - * - * The sending node of the pair. When using REST, this field must be encoded as - * base64. - * - * @generated from protobuf field: bytes from = 1; - */ - from: Uint8Array; - /** - * - * The receiving node of the pair. When using REST, this field must be encoded - * as base64. - * - * @generated from protobuf field: bytes to = 2; - */ - to: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.EdgeLocator - */ -export interface EdgeLocator { - /** - * The short channel id of this edge. - * - * @generated from protobuf field: uint64 channel_id = 1 [jstype = JS_STRING]; - */ - channelId: string; - /** - * - * The direction of this edge. If direction_reverse is false, the direction - * of this edge is from the channel endpoint with the lexicographically smaller - * pub key to the endpoint with the larger pub key. If direction_reverse is - * is true, the edge goes the other way. - * - * @generated from protobuf field: bool direction_reverse = 2; - */ - directionReverse: boolean; -} -/** - * @generated from protobuf message lnrpc.QueryRoutesResponse - */ -export interface QueryRoutesResponse { - /** - * - * The route that results from the path finding operation. This is still a - * repeated field to retain backwards compatibility. - * - * @generated from protobuf field: repeated lnrpc.Route routes = 1; - */ - routes: Route[]; - /** - * - * The success probability of the returned route based on the current mission - * control state. [EXPERIMENTAL] - * - * @generated from protobuf field: double success_prob = 2; - */ - successProb: number; -} -/** - * @generated from protobuf message lnrpc.Hop - */ -export interface Hop { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * @deprecated - * @generated from protobuf field: int64 chan_capacity = 2 [deprecated = true]; - */ - chanCapacity: bigint; - /** - * @deprecated - * @generated from protobuf field: int64 amt_to_forward = 3 [deprecated = true]; - */ - amtToForward: bigint; - /** - * @deprecated - * @generated from protobuf field: int64 fee = 4 [deprecated = true]; - */ - fee: bigint; - /** - * @generated from protobuf field: uint32 expiry = 5; - */ - expiry: number; - /** - * @generated from protobuf field: int64 amt_to_forward_msat = 6; - */ - amtToForwardMsat: bigint; - /** - * @generated from protobuf field: int64 fee_msat = 7; - */ - feeMsat: bigint; - /** - * - * An optional public key of the hop. If the public key is given, the payment - * can be executed without relying on a copy of the channel graph. - * - * @generated from protobuf field: string pub_key = 8; - */ - pubKey: string; - /** - * - * If set to true, then this hop will be encoded using the new variable length - * TLV format. Note that if any custom tlv_records below are specified, then - * this field MUST be set to true for them to be encoded properly. - * - * @deprecated - * @generated from protobuf field: bool tlv_payload = 9 [deprecated = true]; - */ - tlvPayload: boolean; - /** - * - * An optional TLV record that signals the use of an MPP payment. If present, - * the receiver will enforce that the same mpp_record is included in the final - * hop payload of all non-zero payments in the HTLC set. If empty, a regular - * single-shot payment is or was attempted. - * - * @generated from protobuf field: lnrpc.MPPRecord mpp_record = 10; - */ - mppRecord?: MPPRecord; - /** - * - * An optional TLV record that signals the use of an AMP payment. If present, - * the receiver will treat all received payments including the same - * (payment_addr, set_id) pair as being part of one logical payment. The - * payment will be settled by XORing the root_share's together and deriving the - * child hashes and preimages according to BOLT XX. Must be used in conjunction - * with mpp_record. - * - * @generated from protobuf field: lnrpc.AMPRecord amp_record = 12; - */ - ampRecord?: AMPRecord; - /** - * - * An optional set of key-value TLV records. This is useful within the context - * of the SendToRoute call as it allows callers to specify arbitrary K-V pairs - * to drop off at each hop within the onion. - * - * @generated from protobuf field: map custom_records = 11; - */ - customRecords: { - [key: string]: Uint8Array; - }; - /** - * The payment metadata to send along with the payment to the payee. - * - * @generated from protobuf field: bytes metadata = 13; - */ - metadata: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.MPPRecord - */ -export interface MPPRecord { - /** - * - * A unique, random identifier used to authenticate the sender as the intended - * payer of a multi-path payment. The payment_addr must be the same for all - * subpayments, and match the payment_addr provided in the receiver's invoice. - * The same payment_addr must be used on all subpayments. - * - * @generated from protobuf field: bytes payment_addr = 11; - */ - paymentAddr: Uint8Array; - /** - * - * The total amount in milli-satoshis being sent as part of a larger multi-path - * payment. The caller is responsible for ensuring subpayments to the same node - * and payment_hash sum exactly to total_amt_msat. The same - * total_amt_msat must be used on all subpayments. - * - * @generated from protobuf field: int64 total_amt_msat = 10; - */ - totalAmtMsat: bigint; -} -/** - * @generated from protobuf message lnrpc.AMPRecord - */ -export interface AMPRecord { - /** - * @generated from protobuf field: bytes root_share = 1; - */ - rootShare: Uint8Array; - /** - * @generated from protobuf field: bytes set_id = 2; - */ - setId: Uint8Array; - /** - * @generated from protobuf field: uint32 child_index = 3; - */ - childIndex: number; -} -/** - * - * A path through the channel graph which runs over one or more channels in - * succession. This struct carries all the information required to craft the - * Sphinx onion packet, and send the payment along the first hop in the path. A - * route is only selected as valid if all the channels have sufficient capacity to - * carry the initial payment amount after fees are accounted for. - * - * @generated from protobuf message lnrpc.Route - */ -export interface Route { - /** - * - * The cumulative (final) time lock across the entire route. This is the CLTV - * value that should be extended to the first hop in the route. All other hops - * will decrement the time-lock as advertised, leaving enough time for all - * hops to wait for or present the payment preimage to complete the payment. - * - * @generated from protobuf field: uint32 total_time_lock = 1; - */ - totalTimeLock: number; - /** - * - * The sum of the fees paid at each hop within the final route. In the case - * of a one-hop payment, this value will be zero as we don't need to pay a fee - * to ourselves. - * - * @deprecated - * @generated from protobuf field: int64 total_fees = 2 [deprecated = true]; - */ - totalFees: bigint; - /** - * - * The total amount of funds required to complete a payment over this route. - * This value includes the cumulative fees at each hop. As a result, the HTLC - * extended to the first-hop in the route will need to have at least this many - * satoshis, otherwise the route will fail at an intermediate node due to an - * insufficient amount of fees. - * - * @deprecated - * @generated from protobuf field: int64 total_amt = 3 [deprecated = true]; - */ - totalAmt: bigint; - /** - * - * Contains details concerning the specific forwarding details at each hop. - * - * @generated from protobuf field: repeated lnrpc.Hop hops = 4; - */ - hops: Hop[]; - /** - * - * The total fees in millisatoshis. - * - * @generated from protobuf field: int64 total_fees_msat = 5; - */ - totalFeesMsat: bigint; - /** - * - * The total amount in millisatoshis. - * - * @generated from protobuf field: int64 total_amt_msat = 6; - */ - totalAmtMsat: bigint; -} -/** - * @generated from protobuf message lnrpc.NodeInfoRequest - */ -export interface NodeInfoRequest { - /** - * The 33-byte hex-encoded compressed public of the target node - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * If true, will include all known channels associated with the node. - * - * @generated from protobuf field: bool include_channels = 2; - */ - includeChannels: boolean; -} -/** - * @generated from protobuf message lnrpc.NodeInfo - */ -export interface NodeInfo { - /** - * - * An individual vertex/node within the channel graph. A node is - * connected to other nodes by one or more channel edges emanating from it. As - * the graph is directed, a node will also have an incoming edge attached to - * it for each outgoing edge. - * - * @generated from protobuf field: lnrpc.LightningNode node = 1; - */ - node?: LightningNode; - /** - * The total number of channels for the node. - * - * @generated from protobuf field: uint32 num_channels = 2; - */ - numChannels: number; - /** - * The sum of all channels capacity for the node, denominated in satoshis. - * - * @generated from protobuf field: int64 total_capacity = 3; - */ - totalCapacity: bigint; - /** - * A list of all public channels for the node. - * - * @generated from protobuf field: repeated lnrpc.ChannelEdge channels = 4; - */ - channels: ChannelEdge[]; -} -/** - * - * An individual vertex/node within the channel graph. A node is - * connected to other nodes by one or more channel edges emanating from it. As the - * graph is directed, a node will also have an incoming edge attached to it for - * each outgoing edge. - * - * @generated from protobuf message lnrpc.LightningNode - */ -export interface LightningNode { - /** - * @generated from protobuf field: uint32 last_update = 1; - */ - lastUpdate: number; - /** - * @generated from protobuf field: string pub_key = 2; - */ - pubKey: string; - /** - * @generated from protobuf field: string alias = 3; - */ - alias: string; - /** - * @generated from protobuf field: repeated lnrpc.NodeAddress addresses = 4; - */ - addresses: NodeAddress[]; - /** - * @generated from protobuf field: string color = 5; - */ - color: string; - /** - * @generated from protobuf field: map features = 6; - */ - features: { - [key: number]: Feature; - }; - /** - * Custom node announcement tlv records. - * - * @generated from protobuf field: map custom_records = 7; - */ - customRecords: { - [key: string]: Uint8Array; - }; -} -/** - * @generated from protobuf message lnrpc.NodeAddress - */ -export interface NodeAddress { - /** - * @generated from protobuf field: string network = 1; - */ - network: string; - /** - * @generated from protobuf field: string addr = 2; - */ - addr: string; -} -/** - * @generated from protobuf message lnrpc.RoutingPolicy - */ -export interface RoutingPolicy { - /** - * @generated from protobuf field: uint32 time_lock_delta = 1; - */ - timeLockDelta: number; - /** - * @generated from protobuf field: int64 min_htlc = 2; - */ - minHtlc: bigint; - /** - * @generated from protobuf field: int64 fee_base_msat = 3; - */ - feeBaseMsat: bigint; - /** - * @generated from protobuf field: int64 fee_rate_milli_msat = 4; - */ - feeRateMilliMsat: bigint; - /** - * @generated from protobuf field: bool disabled = 5; - */ - disabled: boolean; - /** - * @generated from protobuf field: uint64 max_htlc_msat = 6; - */ - maxHtlcMsat: bigint; - /** - * @generated from protobuf field: uint32 last_update = 7; - */ - lastUpdate: number; - /** - * Custom channel update tlv records. - * - * @generated from protobuf field: map custom_records = 8; - */ - customRecords: { - [key: string]: Uint8Array; - }; -} -/** - * - * A fully authenticated channel along with all its unique attributes. - * Once an authenticated channel announcement has been processed on the network, - * then an instance of ChannelEdgeInfo encapsulating the channels attributes is - * stored. The other portions relevant to routing policy of a channel are stored - * within a ChannelEdgePolicy for each direction of the channel. - * - * @generated from protobuf message lnrpc.ChannelEdge - */ -export interface ChannelEdge { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 channel_id = 1 [jstype = JS_STRING]; - */ - channelId: string; - /** - * @generated from protobuf field: string chan_point = 2; - */ - chanPoint: string; - /** - * @deprecated - * @generated from protobuf field: uint32 last_update = 3 [deprecated = true]; - */ - lastUpdate: number; - /** - * @generated from protobuf field: string node1_pub = 4; - */ - node1Pub: string; - /** - * @generated from protobuf field: string node2_pub = 5; - */ - node2Pub: string; - /** - * @generated from protobuf field: int64 capacity = 6; - */ - capacity: bigint; - /** - * @generated from protobuf field: lnrpc.RoutingPolicy node1_policy = 7; - */ - node1Policy?: RoutingPolicy; - /** - * @generated from protobuf field: lnrpc.RoutingPolicy node2_policy = 8; - */ - node2Policy?: RoutingPolicy; - /** - * Custom channel announcement tlv records. - * - * @generated from protobuf field: map custom_records = 9; - */ - customRecords: { - [key: string]: Uint8Array; - }; -} -/** - * @generated from protobuf message lnrpc.ChannelGraphRequest - */ -export interface ChannelGraphRequest { - /** - * - * Whether unannounced channels are included in the response or not. If set, - * unannounced channels are included. Unannounced channels are both private - * channels, and public channels that are not yet announced to the network. - * - * @generated from protobuf field: bool include_unannounced = 1; - */ - includeUnannounced: boolean; -} -/** - * Returns a new instance of the directed channel graph. - * - * @generated from protobuf message lnrpc.ChannelGraph - */ -export interface ChannelGraph { - /** - * The list of `LightningNode`s in this channel graph - * - * @generated from protobuf field: repeated lnrpc.LightningNode nodes = 1; - */ - nodes: LightningNode[]; - /** - * The list of `ChannelEdge`s in this channel graph - * - * @generated from protobuf field: repeated lnrpc.ChannelEdge edges = 2; - */ - edges: ChannelEdge[]; -} -/** - * @generated from protobuf message lnrpc.NodeMetricsRequest - */ -export interface NodeMetricsRequest { - /** - * The requested node metrics. - * - * @generated from protobuf field: repeated lnrpc.NodeMetricType types = 1; - */ - types: NodeMetricType[]; -} -/** - * @generated from protobuf message lnrpc.NodeMetricsResponse - */ -export interface NodeMetricsResponse { - /** - * - * Betweenness centrality is the sum of the ratio of shortest paths that pass - * through the node for each pair of nodes in the graph (not counting paths - * starting or ending at this node). - * Map of node pubkey to betweenness centrality of the node. Normalized - * values are in the [0,1] closed interval. - * - * @generated from protobuf field: map betweenness_centrality = 1; - */ - betweennessCentrality: { - [key: string]: FloatMetric; - }; -} -/** - * @generated from protobuf message lnrpc.FloatMetric - */ -export interface FloatMetric { - /** - * Arbitrary float value. - * - * @generated from protobuf field: double value = 1; - */ - value: number; - /** - * The value normalized to [0,1] or [-1,1]. - * - * @generated from protobuf field: double normalized_value = 2; - */ - normalizedValue: number; -} -/** - * @generated from protobuf message lnrpc.ChanInfoRequest - */ -export interface ChanInfoRequest { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; -} -/** - * @generated from protobuf message lnrpc.NetworkInfoRequest - */ -export interface NetworkInfoRequest { -} -/** - * @generated from protobuf message lnrpc.NetworkInfo - */ -export interface NetworkInfo { - /** - * @generated from protobuf field: uint32 graph_diameter = 1; - */ - graphDiameter: number; - /** - * @generated from protobuf field: double avg_out_degree = 2; - */ - avgOutDegree: number; - /** - * @generated from protobuf field: uint32 max_out_degree = 3; - */ - maxOutDegree: number; - /** - * @generated from protobuf field: uint32 num_nodes = 4; - */ - numNodes: number; - /** - * @generated from protobuf field: uint32 num_channels = 5; - */ - numChannels: number; - /** - * @generated from protobuf field: int64 total_network_capacity = 6; - */ - totalNetworkCapacity: bigint; - /** - * @generated from protobuf field: double avg_channel_size = 7; - */ - avgChannelSize: number; - /** - * @generated from protobuf field: int64 min_channel_size = 8; - */ - minChannelSize: bigint; - /** - * @generated from protobuf field: int64 max_channel_size = 9; - */ - maxChannelSize: bigint; - /** - * @generated from protobuf field: int64 median_channel_size_sat = 10; - */ - medianChannelSizeSat: bigint; - /** - * The number of edges marked as zombies. - * - * @generated from protobuf field: uint64 num_zombie_chans = 11; - */ - numZombieChans: bigint; -} -/** - * @generated from protobuf message lnrpc.StopRequest - */ -export interface StopRequest { -} -/** - * @generated from protobuf message lnrpc.StopResponse - */ -export interface StopResponse { -} -/** - * @generated from protobuf message lnrpc.GraphTopologySubscription - */ -export interface GraphTopologySubscription { -} -/** - * @generated from protobuf message lnrpc.GraphTopologyUpdate - */ -export interface GraphTopologyUpdate { - /** - * @generated from protobuf field: repeated lnrpc.NodeUpdate node_updates = 1; - */ - nodeUpdates: NodeUpdate[]; - /** - * @generated from protobuf field: repeated lnrpc.ChannelEdgeUpdate channel_updates = 2; - */ - channelUpdates: ChannelEdgeUpdate[]; - /** - * @generated from protobuf field: repeated lnrpc.ClosedChannelUpdate closed_chans = 3; - */ - closedChans: ClosedChannelUpdate[]; -} -/** - * @generated from protobuf message lnrpc.NodeUpdate - */ -export interface NodeUpdate { - /** - * - * Deprecated, use node_addresses. - * - * @deprecated - * @generated from protobuf field: repeated string addresses = 1 [deprecated = true]; - */ - addresses: string[]; - /** - * @generated from protobuf field: string identity_key = 2; - */ - identityKey: string; - /** - * - * Deprecated, use features. - * - * @deprecated - * @generated from protobuf field: bytes global_features = 3 [deprecated = true]; - */ - globalFeatures: Uint8Array; - /** - * @generated from protobuf field: string alias = 4; - */ - alias: string; - /** - * @generated from protobuf field: string color = 5; - */ - color: string; - /** - * @generated from protobuf field: repeated lnrpc.NodeAddress node_addresses = 7; - */ - nodeAddresses: NodeAddress[]; - /** - * - * Features that the node has advertised in the init message, node - * announcements and invoices. - * - * @generated from protobuf field: map features = 6; - */ - features: { - [key: number]: Feature; - }; -} -/** - * @generated from protobuf message lnrpc.ChannelEdgeUpdate - */ -export interface ChannelEdgeUpdate { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; - */ - chanPoint?: ChannelPoint; - /** - * @generated from protobuf field: int64 capacity = 3; - */ - capacity: bigint; - /** - * @generated from protobuf field: lnrpc.RoutingPolicy routing_policy = 4; - */ - routingPolicy?: RoutingPolicy; - /** - * @generated from protobuf field: string advertising_node = 5; - */ - advertisingNode: string; - /** - * @generated from protobuf field: string connecting_node = 6; - */ - connectingNode: string; -} -/** - * @generated from protobuf message lnrpc.ClosedChannelUpdate - */ -export interface ClosedChannelUpdate { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * @generated from protobuf field: int64 capacity = 2; - */ - capacity: bigint; - /** - * @generated from protobuf field: uint32 closed_height = 3; - */ - closedHeight: number; - /** - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 4; - */ - chanPoint?: ChannelPoint; -} -/** - * @generated from protobuf message lnrpc.HopHint - */ -export interface HopHint { - /** - * The public key of the node at the start of the channel. - * - * @generated from protobuf field: string node_id = 1; - */ - nodeId: string; - /** - * The unique identifier of the channel. - * - * @generated from protobuf field: uint64 chan_id = 2 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The base fee of the channel denominated in millisatoshis. - * - * @generated from protobuf field: uint32 fee_base_msat = 3; - */ - feeBaseMsat: number; - /** - * - * The fee rate of the channel for sending one satoshi across it denominated in - * millionths of a satoshi. - * - * @generated from protobuf field: uint32 fee_proportional_millionths = 4; - */ - feeProportionalMillionths: number; - /** - * The time-lock delta of the channel. - * - * @generated from protobuf field: uint32 cltv_expiry_delta = 5; - */ - cltvExpiryDelta: number; -} -/** - * @generated from protobuf message lnrpc.SetID - */ -export interface SetID { - /** - * @generated from protobuf field: bytes set_id = 1; - */ - setId: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.RouteHint - */ -export interface RouteHint { - /** - * - * A list of hop hints that when chained together can assist in reaching a - * specific destination. - * - * @generated from protobuf field: repeated lnrpc.HopHint hop_hints = 1; - */ - hopHints: HopHint[]; -} -/** - * @generated from protobuf message lnrpc.AMPInvoiceState - */ -export interface AMPInvoiceState { - /** - * The state the HTLCs associated with this setID are in. - * - * @generated from protobuf field: lnrpc.InvoiceHTLCState state = 1; - */ - state: InvoiceHTLCState; - /** - * The settle index of this HTLC set, if the invoice state is settled. - * - * @generated from protobuf field: uint64 settle_index = 2; - */ - settleIndex: bigint; - /** - * The time this HTLC set was settled expressed in unix epoch. - * - * @generated from protobuf field: int64 settle_time = 3; - */ - settleTime: bigint; - /** - * The total amount paid for the sub-invoice expressed in milli satoshis. - * - * @generated from protobuf field: int64 amt_paid_msat = 5; - */ - amtPaidMsat: bigint; -} -/** - * @generated from protobuf message lnrpc.Invoice - */ -export interface Invoice { - /** - * - * An optional memo to attach along with the invoice. Used for record keeping - * purposes for the invoice's creator, and will also be set in the description - * field of the encoded payment request if the description_hash field is not - * being used. - * - * @generated from protobuf field: string memo = 1; - */ - memo: string; - /** - * - * The hex-encoded preimage (32 byte) which will allow settling an incoming - * HTLC payable to this preimage. When using REST, this field must be encoded - * as base64. - * - * @generated from protobuf field: bytes r_preimage = 3; - */ - rPreimage: Uint8Array; - /** - * - * The hash of the preimage. When using REST, this field must be encoded as - * base64. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: bytes r_hash = 4; - */ - rHash: Uint8Array; - /** - * - * The value of this invoice in satoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value = 5; - */ - value: bigint; - /** - * - * The value of this invoice in millisatoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value_msat = 23; - */ - valueMsat: bigint; - /** - * - * Whether this invoice has been fulfilled - * - * The field is deprecated. Use the state field instead (compare to SETTLED). - * - * @deprecated - * @generated from protobuf field: bool settled = 6 [deprecated = true]; - */ - settled: boolean; - /** - * - * When this invoice was created. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: int64 creation_date = 7; - */ - creationDate: bigint; - /** - * - * When this invoice was settled. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: int64 settle_date = 8; - */ - settleDate: bigint; - /** - * - * A bare-bones invoice for a payment within the Lightning Network. With the - * details of the invoice, the sender has all the data necessary to send a - * payment to the recipient. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: string payment_request = 9; - */ - paymentRequest: string; - /** - * - * Hash (SHA-256) of a description of the payment. Used if the description of - * payment (memo) is too long to naturally fit within the description field - * of an encoded payment request. When using REST, this field must be encoded - * as base64. - * - * @generated from protobuf field: bytes description_hash = 10; - */ - descriptionHash: Uint8Array; - /** - * Payment request expiry time in seconds. Default is 3600 (1 hour). - * - * @generated from protobuf field: int64 expiry = 11; - */ - expiry: bigint; - /** - * Fallback on-chain address. - * - * @generated from protobuf field: string fallback_addr = 12; - */ - fallbackAddr: string; - /** - * Delta to use for the time-lock of the CLTV extended to the final hop. - * - * @generated from protobuf field: uint64 cltv_expiry = 13; - */ - cltvExpiry: bigint; - /** - * - * Route hints that can each be individually used to assist in reaching the - * invoice's destination. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 14; - */ - routeHints: RouteHint[]; - /** - * Whether this invoice should include routing hints for private channels. - * - * @generated from protobuf field: bool private = 15; - */ - private: boolean; - /** - * - * The "add" index of this invoice. Each newly created invoice will increment - * this index making it monotonically increasing. Callers to the - * SubscribeInvoices call can use this to instantly get notified of all added - * invoices with an add_index greater than this one. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: uint64 add_index = 16; - */ - addIndex: bigint; - /** - * - * The "settle" index of this invoice. Each newly settled invoice will - * increment this index making it monotonically increasing. Callers to the - * SubscribeInvoices call can use this to instantly get notified of all - * settled invoices with an settle_index greater than this one. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: uint64 settle_index = 17; - */ - settleIndex: bigint; - /** - * Deprecated, use amt_paid_sat or amt_paid_msat. - * - * @deprecated - * @generated from protobuf field: int64 amt_paid = 18 [deprecated = true]; - */ - amtPaid: bigint; - /** - * - * The amount that was accepted for this invoice, in satoshis. This will ONLY - * be set if this invoice has been settled. We provide this field as if the - * invoice was created with a zero value, then we need to record what amount - * was ultimately accepted. Additionally, it's possible that the sender paid - * MORE that was specified in the original invoice. So we'll record that here - * as well. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: int64 amt_paid_sat = 19; - */ - amtPaidSat: bigint; - /** - * - * The amount that was accepted for this invoice, in millisatoshis. This will - * ONLY be set if this invoice has been settled. We provide this field as if - * the invoice was created with a zero value, then we need to record what - * amount was ultimately accepted. Additionally, it's possible that the sender - * paid MORE that was specified in the original invoice. So we'll record that - * here as well. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: int64 amt_paid_msat = 20; - */ - amtPaidMsat: bigint; - /** - * - * The state the invoice is in. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: lnrpc.Invoice.InvoiceState state = 21; - */ - state: Invoice_InvoiceState; - /** - * - * List of HTLCs paying to this invoice [EXPERIMENTAL]. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: repeated lnrpc.InvoiceHTLC htlcs = 22; - */ - htlcs: InvoiceHTLC[]; - /** - * - * List of features advertised on the invoice. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: map features = 24; - */ - features: { - [key: number]: Feature; - }; - /** - * - * Indicates if this invoice was a spontaneous payment that arrived via keysend - * [EXPERIMENTAL]. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: bool is_keysend = 25; - */ - isKeysend: boolean; - /** - * - * The payment address of this invoice. This value will be used in MPP - * payments, and also for newer invoices that always require the MPP payload - * for added end-to-end security. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: bytes payment_addr = 26; - */ - paymentAddr: Uint8Array; - /** - * - * Signals whether or not this is an AMP invoice. - * - * @generated from protobuf field: bool is_amp = 27; - */ - isAmp: boolean; - /** - * - * [EXPERIMENTAL]: - * - * Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the - * given set ID. This field is always populated for AMP invoices, and can be - * used along side LookupInvoice to obtain the HTLC information related to a - * given sub-invoice. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: map amp_invoice_state = 28; - */ - ampInvoiceState: { - [key: string]: AMPInvoiceState; - }; -} -/** - * @generated from protobuf enum lnrpc.Invoice.InvoiceState - */ -export enum Invoice_InvoiceState { - /** - * @generated from protobuf enum value: OPEN = 0; - */ - OPEN = 0, - /** - * @generated from protobuf enum value: SETTLED = 1; - */ - SETTLED = 1, - /** - * @generated from protobuf enum value: CANCELED = 2; - */ - CANCELED = 2, - /** - * @generated from protobuf enum value: ACCEPTED = 3; - */ - ACCEPTED = 3 -} -/** - * Details of an HTLC that paid to an invoice - * - * @generated from protobuf message lnrpc.InvoiceHTLC - */ -export interface InvoiceHTLC { - /** - * Short channel id over which the htlc was received. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * Index identifying the htlc on the channel. - * - * @generated from protobuf field: uint64 htlc_index = 2; - */ - htlcIndex: bigint; - /** - * The amount of the htlc in msat. - * - * @generated from protobuf field: uint64 amt_msat = 3; - */ - amtMsat: bigint; - /** - * Block height at which this htlc was accepted. - * - * @generated from protobuf field: int32 accept_height = 4; - */ - acceptHeight: number; - /** - * Time at which this htlc was accepted. - * - * @generated from protobuf field: int64 accept_time = 5; - */ - acceptTime: bigint; - /** - * Time at which this htlc was settled or canceled. - * - * @generated from protobuf field: int64 resolve_time = 6; - */ - resolveTime: bigint; - /** - * Block height at which this htlc expires. - * - * @generated from protobuf field: int32 expiry_height = 7; - */ - expiryHeight: number; - /** - * Current state the htlc is in. - * - * @generated from protobuf field: lnrpc.InvoiceHTLCState state = 8; - */ - state: InvoiceHTLCState; - /** - * Custom tlv records. - * - * @generated from protobuf field: map custom_records = 9; - */ - customRecords: { - [key: string]: Uint8Array; - }; - /** - * The total amount of the mpp payment in msat. - * - * @generated from protobuf field: uint64 mpp_total_amt_msat = 10; - */ - mppTotalAmtMsat: bigint; - /** - * Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. - * - * @generated from protobuf field: lnrpc.AMP amp = 11; - */ - amp?: AMP; -} -/** - * Details specific to AMP HTLCs. - * - * @generated from protobuf message lnrpc.AMP - */ -export interface AMP { - /** - * An n-of-n secret share of the root seed from which child payment hashes - * and preimages are derived. - * - * @generated from protobuf field: bytes root_share = 1; - */ - rootShare: Uint8Array; - /** - * An identifier for the HTLC set that this HTLC belongs to. - * - * @generated from protobuf field: bytes set_id = 2; - */ - setId: Uint8Array; - /** - * A nonce used to randomize the child preimage and child hash from a given - * root_share. - * - * @generated from protobuf field: uint32 child_index = 3; - */ - childIndex: number; - /** - * The payment hash of the AMP HTLC. - * - * @generated from protobuf field: bytes hash = 4; - */ - hash: Uint8Array; - /** - * The preimage used to settle this AMP htlc. This field will only be - * populated if the invoice is in InvoiceState_ACCEPTED or - * InvoiceState_SETTLED. - * - * @generated from protobuf field: bytes preimage = 5; - */ - preimage: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.AddInvoiceResponse - */ -export interface AddInvoiceResponse { - /** - * @generated from protobuf field: bytes r_hash = 1; - */ - rHash: Uint8Array; - /** - * - * A bare-bones invoice for a payment within the Lightning Network. With the - * details of the invoice, the sender has all the data necessary to send a - * payment to the recipient. - * - * @generated from protobuf field: string payment_request = 2; - */ - paymentRequest: string; - /** - * - * The "add" index of this invoice. Each newly created invoice will increment - * this index making it monotonically increasing. Callers to the - * SubscribeInvoices call can use this to instantly get notified of all added - * invoices with an add_index greater than this one. - * - * @generated from protobuf field: uint64 add_index = 16; - */ - addIndex: bigint; - /** - * - * The payment address of the generated invoice. This value should be used - * in all payments for this invoice as we require it for end to end - * security. - * - * @generated from protobuf field: bytes payment_addr = 17; - */ - paymentAddr: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.PaymentHash - */ -export interface PaymentHash { - /** - * - * The hex-encoded payment hash of the invoice to be looked up. The passed - * payment hash must be exactly 32 bytes, otherwise an error is returned. - * Deprecated now that the REST gateway supports base64 encoding of bytes - * fields. - * - * @deprecated - * @generated from protobuf field: string r_hash_str = 1 [deprecated = true]; - */ - rHashStr: string; - /** - * - * The payment hash of the invoice to be looked up. When using REST, this field - * must be encoded as base64. - * - * @generated from protobuf field: bytes r_hash = 2; - */ - rHash: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.ListInvoiceRequest - */ -export interface ListInvoiceRequest { - /** - * - * If set, only invoices that are not settled and not canceled will be returned - * in the response. - * - * @generated from protobuf field: bool pending_only = 1; - */ - pendingOnly: boolean; - /** - * - * The index of an invoice that will be used as either the start or end of a - * query to determine which invoices should be returned in the response. - * - * @generated from protobuf field: uint64 index_offset = 4; - */ - indexOffset: bigint; - /** - * The max number of invoices to return in the response to this query. - * - * @generated from protobuf field: uint64 num_max_invoices = 5; - */ - numMaxInvoices: bigint; - /** - * - * If set, the invoices returned will result from seeking backwards from the - * specified index offset. This can be used to paginate backwards. - * - * @generated from protobuf field: bool reversed = 6; - */ - reversed: boolean; -} -/** - * @generated from protobuf message lnrpc.ListInvoiceResponse - */ -export interface ListInvoiceResponse { - /** - * - * A list of invoices from the time slice of the time series specified in the - * request. - * - * @generated from protobuf field: repeated lnrpc.Invoice invoices = 1; - */ - invoices: Invoice[]; - /** - * - * The index of the last item in the set of returned invoices. This can be used - * to seek further, pagination style. - * - * @generated from protobuf field: uint64 last_index_offset = 2; - */ - lastIndexOffset: bigint; - /** - * - * The index of the last item in the set of returned invoices. This can be used - * to seek backwards, pagination style. - * - * @generated from protobuf field: uint64 first_index_offset = 3; - */ - firstIndexOffset: bigint; -} -/** - * @generated from protobuf message lnrpc.InvoiceSubscription - */ -export interface InvoiceSubscription { - /** - * - * If specified (non-zero), then we'll first start by sending out - * notifications for all added indexes with an add_index greater than this - * value. This allows callers to catch up on any events they missed while they - * weren't connected to the streaming RPC. - * - * @generated from protobuf field: uint64 add_index = 1; - */ - addIndex: bigint; - /** - * - * If specified (non-zero), then we'll first start by sending out - * notifications for all settled indexes with an settle_index greater than - * this value. This allows callers to catch up on any events they missed while - * they weren't connected to the streaming RPC. - * - * @generated from protobuf field: uint64 settle_index = 2; - */ - settleIndex: bigint; -} -/** - * @generated from protobuf message lnrpc.Payment - */ -export interface Payment { - /** - * The payment hash - * - * @generated from protobuf field: string payment_hash = 1; - */ - paymentHash: string; - /** - * Deprecated, use value_sat or value_msat. - * - * @deprecated - * @generated from protobuf field: int64 value = 2 [deprecated = true]; - */ - value: bigint; - /** - * Deprecated, use creation_time_ns - * - * @deprecated - * @generated from protobuf field: int64 creation_date = 3 [deprecated = true]; - */ - creationDate: bigint; - /** - * Deprecated, use fee_sat or fee_msat. - * - * @deprecated - * @generated from protobuf field: int64 fee = 5 [deprecated = true]; - */ - fee: bigint; - /** - * The payment preimage - * - * @generated from protobuf field: string payment_preimage = 6; - */ - paymentPreimage: string; - /** - * The value of the payment in satoshis - * - * @generated from protobuf field: int64 value_sat = 7; - */ - valueSat: bigint; - /** - * The value of the payment in milli-satoshis - * - * @generated from protobuf field: int64 value_msat = 8; - */ - valueMsat: bigint; - /** - * The optional payment request being fulfilled. - * - * @generated from protobuf field: string payment_request = 9; - */ - paymentRequest: string; - /** - * The status of the payment. - * - * @generated from protobuf field: lnrpc.Payment.PaymentStatus status = 10; - */ - status: Payment_PaymentStatus; - /** - * The fee paid for this payment in satoshis - * - * @generated from protobuf field: int64 fee_sat = 11; - */ - feeSat: bigint; - /** - * The fee paid for this payment in milli-satoshis - * - * @generated from protobuf field: int64 fee_msat = 12; - */ - feeMsat: bigint; - /** - * The time in UNIX nanoseconds at which the payment was created. - * - * @generated from protobuf field: int64 creation_time_ns = 13; - */ - creationTimeNs: bigint; - /** - * The HTLCs made in attempt to settle the payment. - * - * @generated from protobuf field: repeated lnrpc.HTLCAttempt htlcs = 14; - */ - htlcs: HTLCAttempt[]; - /** - * - * The creation index of this payment. Each payment can be uniquely identified - * by this index, which may not strictly increment by 1 for payments made in - * older versions of lnd. - * - * @generated from protobuf field: uint64 payment_index = 15; - */ - paymentIndex: bigint; - /** - * @generated from protobuf field: lnrpc.PaymentFailureReason failure_reason = 16; - */ - failureReason: PaymentFailureReason; -} -/** - * @generated from protobuf enum lnrpc.Payment.PaymentStatus - */ -export enum Payment_PaymentStatus { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: IN_FLIGHT = 1; - */ - IN_FLIGHT = 1, - /** - * @generated from protobuf enum value: SUCCEEDED = 2; - */ - SUCCEEDED = 2, - /** - * @generated from protobuf enum value: FAILED = 3; - */ - FAILED = 3 -} -/** - * @generated from protobuf message lnrpc.HTLCAttempt - */ -export interface HTLCAttempt { - /** - * The unique ID that is used for this attempt. - * - * @generated from protobuf field: uint64 attempt_id = 7; - */ - attemptId: bigint; - /** - * The status of the HTLC. - * - * @generated from protobuf field: lnrpc.HTLCAttempt.HTLCStatus status = 1; - */ - status: HTLCAttempt_HTLCStatus; - /** - * The route taken by this HTLC. - * - * @generated from protobuf field: lnrpc.Route route = 2; - */ - route?: Route; - /** - * The time in UNIX nanoseconds at which this HTLC was sent. - * - * @generated from protobuf field: int64 attempt_time_ns = 3; - */ - attemptTimeNs: bigint; - /** - * - * The time in UNIX nanoseconds at which this HTLC was settled or failed. - * This value will not be set if the HTLC is still IN_FLIGHT. - * - * @generated from protobuf field: int64 resolve_time_ns = 4; - */ - resolveTimeNs: bigint; - /** - * Detailed htlc failure info. - * - * @generated from protobuf field: lnrpc.Failure failure = 5; - */ - failure?: Failure; - /** - * The preimage that was used to settle the HTLC. - * - * @generated from protobuf field: bytes preimage = 6; - */ - preimage: Uint8Array; -} -/** - * @generated from protobuf enum lnrpc.HTLCAttempt.HTLCStatus - */ -export enum HTLCAttempt_HTLCStatus { - /** - * @generated from protobuf enum value: IN_FLIGHT = 0; - */ - IN_FLIGHT = 0, - /** - * @generated from protobuf enum value: SUCCEEDED = 1; - */ - SUCCEEDED = 1, - /** - * @generated from protobuf enum value: FAILED = 2; - */ - FAILED = 2 -} -/** - * @generated from protobuf message lnrpc.ListPaymentsRequest - */ -export interface ListPaymentsRequest { - /** - * - * If true, then return payments that have not yet fully completed. This means - * that pending payments, as well as failed payments will show up if this - * field is set to true. This flag doesn't change the meaning of the indices, - * which are tied to individual payments. - * - * @generated from protobuf field: bool include_incomplete = 1; - */ - includeIncomplete: boolean; - /** - * - * The index of a payment that will be used as either the start or end of a - * query to determine which payments should be returned in the response. The - * index_offset is exclusive. In the case of a zero index_offset, the query - * will start with the oldest payment when paginating forwards, or will end - * with the most recent payment when paginating backwards. - * - * @generated from protobuf field: uint64 index_offset = 2; - */ - indexOffset: bigint; - /** - * The maximal number of payments returned in the response to this query. - * - * @generated from protobuf field: uint64 max_payments = 3; - */ - maxPayments: bigint; - /** - * - * If set, the payments returned will result from seeking backwards from the - * specified index offset. This can be used to paginate backwards. The order - * of the returned payments is always oldest first (ascending index order). - * - * @generated from protobuf field: bool reversed = 4; - */ - reversed: boolean; - /** - * - * If set, all payments (complete and incomplete, independent of the - * max_payments parameter) will be counted. Note that setting this to true will - * increase the run time of the call significantly on systems that have a lot - * of payments, as all of them have to be iterated through to be counted. - * - * @generated from protobuf field: bool count_total_payments = 5; - */ - countTotalPayments: boolean; -} -/** - * @generated from protobuf message lnrpc.ListPaymentsResponse - */ -export interface ListPaymentsResponse { - /** - * The list of payments - * - * @generated from protobuf field: repeated lnrpc.Payment payments = 1; - */ - payments: Payment[]; - /** - * - * The index of the first item in the set of returned payments. This can be - * used as the index_offset to continue seeking backwards in the next request. - * - * @generated from protobuf field: uint64 first_index_offset = 2; - */ - firstIndexOffset: bigint; - /** - * - * The index of the last item in the set of returned payments. This can be used - * as the index_offset to continue seeking forwards in the next request. - * - * @generated from protobuf field: uint64 last_index_offset = 3; - */ - lastIndexOffset: bigint; - /** - * - * Will only be set if count_total_payments in the request was set. Represents - * the total number of payments (complete and incomplete, independent of the - * number of payments requested in the query) currently present in the payments - * database. - * - * @generated from protobuf field: uint64 total_num_payments = 4; - */ - totalNumPayments: bigint; -} -/** - * @generated from protobuf message lnrpc.DeletePaymentRequest - */ -export interface DeletePaymentRequest { - /** - * Payment hash to delete. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - /** - * - * Only delete failed HTLCs from the payment, not the payment itself. - * - * @generated from protobuf field: bool failed_htlcs_only = 2; - */ - failedHtlcsOnly: boolean; -} -/** - * @generated from protobuf message lnrpc.DeleteAllPaymentsRequest - */ -export interface DeleteAllPaymentsRequest { - /** - * Only delete failed payments. - * - * @generated from protobuf field: bool failed_payments_only = 1; - */ - failedPaymentsOnly: boolean; - /** - * - * Only delete failed HTLCs from payments, not the payment itself. - * - * @generated from protobuf field: bool failed_htlcs_only = 2; - */ - failedHtlcsOnly: boolean; -} -/** - * @generated from protobuf message lnrpc.DeletePaymentResponse - */ -export interface DeletePaymentResponse { -} -/** - * @generated from protobuf message lnrpc.DeleteAllPaymentsResponse - */ -export interface DeleteAllPaymentsResponse { -} -/** - * @generated from protobuf message lnrpc.AbandonChannelRequest - */ -export interface AbandonChannelRequest { - /** - * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; - */ - channelPoint?: ChannelPoint; - /** - * @generated from protobuf field: bool pending_funding_shim_only = 2; - */ - pendingFundingShimOnly: boolean; - /** - * - * Override the requirement for being in dev mode by setting this to true and - * confirming the user knows what they are doing and this is a potential foot - * gun to lose funds if used on active channels. - * - * @generated from protobuf field: bool i_know_what_i_am_doing = 3; - */ - iKnowWhatIAmDoing: boolean; -} -/** - * @generated from protobuf message lnrpc.AbandonChannelResponse - */ -export interface AbandonChannelResponse { -} -/** - * @generated from protobuf message lnrpc.DebugLevelRequest - */ -export interface DebugLevelRequest { - /** - * @generated from protobuf field: bool show = 1; - */ - show: boolean; - /** - * @generated from protobuf field: string level_spec = 2; - */ - levelSpec: string; -} -/** - * @generated from protobuf message lnrpc.DebugLevelResponse - */ -export interface DebugLevelResponse { - /** - * @generated from protobuf field: string sub_systems = 1; - */ - subSystems: string; -} -/** - * @generated from protobuf message lnrpc.PayReqString - */ -export interface PayReqString { - /** - * The payment request string to be decoded - * - * @generated from protobuf field: string pay_req = 1; - */ - payReq: string; -} -/** - * @generated from protobuf message lnrpc.PayReq - */ -export interface PayReq { - /** - * @generated from protobuf field: string destination = 1; - */ - destination: string; - /** - * @generated from protobuf field: string payment_hash = 2; - */ - paymentHash: string; - /** - * @generated from protobuf field: int64 num_satoshis = 3; - */ - numSatoshis: bigint; - /** - * @generated from protobuf field: int64 timestamp = 4; - */ - timestamp: bigint; - /** - * @generated from protobuf field: int64 expiry = 5; - */ - expiry: bigint; - /** - * @generated from protobuf field: string description = 6; - */ - description: string; - /** - * @generated from protobuf field: string description_hash = 7; - */ - descriptionHash: string; - /** - * @generated from protobuf field: string fallback_addr = 8; - */ - fallbackAddr: string; - /** - * @generated from protobuf field: int64 cltv_expiry = 9; - */ - cltvExpiry: bigint; - /** - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; - */ - routeHints: RouteHint[]; - /** - * @generated from protobuf field: bytes payment_addr = 11; - */ - paymentAddr: Uint8Array; - /** - * @generated from protobuf field: int64 num_msat = 12; - */ - numMsat: bigint; - /** - * @generated from protobuf field: map features = 13; - */ - features: { - [key: number]: Feature; - }; -} -/** - * @generated from protobuf message lnrpc.Feature - */ -export interface Feature { - /** - * @generated from protobuf field: string name = 2; - */ - name: string; - /** - * @generated from protobuf field: bool is_required = 3; - */ - isRequired: boolean; - /** - * @generated from protobuf field: bool is_known = 4; - */ - isKnown: boolean; -} -/** - * @generated from protobuf message lnrpc.FeeReportRequest - */ -export interface FeeReportRequest { -} -/** - * @generated from protobuf message lnrpc.ChannelFeeReport - */ -export interface ChannelFeeReport { - /** - * The short channel id that this fee report belongs to. - * - * @generated from protobuf field: uint64 chan_id = 5 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The channel that this fee report belongs to. - * - * @generated from protobuf field: string channel_point = 1; - */ - channelPoint: string; - /** - * The base fee charged regardless of the number of milli-satoshis sent. - * - * @generated from protobuf field: int64 base_fee_msat = 2; - */ - baseFeeMsat: bigint; - /** - * The amount charged per milli-satoshis transferred expressed in - * millionths of a satoshi. - * - * @generated from protobuf field: int64 fee_per_mil = 3; - */ - feePerMil: bigint; - /** - * The effective fee rate in milli-satoshis. Computed by dividing the - * fee_per_mil value by 1 million. - * - * @generated from protobuf field: double fee_rate = 4; - */ - feeRate: number; -} -/** - * @generated from protobuf message lnrpc.FeeReportResponse - */ -export interface FeeReportResponse { - /** - * An array of channel fee reports which describes the current fee schedule - * for each channel. - * - * @generated from protobuf field: repeated lnrpc.ChannelFeeReport channel_fees = 1; - */ - channelFees: ChannelFeeReport[]; - /** - * The total amount of fee revenue (in satoshis) the switch has collected - * over the past 24 hrs. - * - * @generated from protobuf field: uint64 day_fee_sum = 2; - */ - dayFeeSum: bigint; - /** - * The total amount of fee revenue (in satoshis) the switch has collected - * over the past 1 week. - * - * @generated from protobuf field: uint64 week_fee_sum = 3; - */ - weekFeeSum: bigint; - /** - * The total amount of fee revenue (in satoshis) the switch has collected - * over the past 1 month. - * - * @generated from protobuf field: uint64 month_fee_sum = 4; - */ - monthFeeSum: bigint; -} -/** - * @generated from protobuf message lnrpc.PolicyUpdateRequest - */ -export interface PolicyUpdateRequest { - /** - * @generated from protobuf oneof: scope - */ - scope: { - oneofKind: "global"; - /** - * If set, then this update applies to all currently active channels. - * - * @generated from protobuf field: bool global = 1; - */ - global: boolean; - } | { - oneofKind: "chanPoint"; - /** - * If set, this update will target a specific channel. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; - */ - chanPoint: ChannelPoint; - } | { - oneofKind: undefined; - }; - /** - * The base fee charged regardless of the number of milli-satoshis sent. - * - * @generated from protobuf field: int64 base_fee_msat = 3; - */ - baseFeeMsat: bigint; - /** - * The effective fee rate in milli-satoshis. The precision of this value - * goes up to 6 decimal places, so 1e-6. - * - * @generated from protobuf field: double fee_rate = 4; - */ - feeRate: number; - /** - * The effective fee rate in micro-satoshis (parts per million). - * - * @generated from protobuf field: uint32 fee_rate_ppm = 9; - */ - feeRatePpm: number; - /** - * The required timelock delta for HTLCs forwarded over the channel. - * - * @generated from protobuf field: uint32 time_lock_delta = 5; - */ - timeLockDelta: number; - /** - * If set, the maximum HTLC size in milli-satoshis. If unset, the maximum - * HTLC will be unchanged. - * - * @generated from protobuf field: uint64 max_htlc_msat = 6; - */ - maxHtlcMsat: bigint; - /** - * The minimum HTLC size in milli-satoshis. Only applied if - * min_htlc_msat_specified is true. - * - * @generated from protobuf field: uint64 min_htlc_msat = 7; - */ - minHtlcMsat: bigint; - /** - * If true, min_htlc_msat is applied. - * - * @generated from protobuf field: bool min_htlc_msat_specified = 8; - */ - minHtlcMsatSpecified: boolean; -} -/** - * @generated from protobuf message lnrpc.FailedUpdate - */ -export interface FailedUpdate { - /** - * The outpoint in format txid:n - * - * @generated from protobuf field: lnrpc.OutPoint outpoint = 1; - */ - outpoint?: OutPoint; - /** - * Reason for the policy update failure. - * - * @generated from protobuf field: lnrpc.UpdateFailure reason = 2; - */ - reason: UpdateFailure; - /** - * A string representation of the policy update error. - * - * @generated from protobuf field: string update_error = 3; - */ - updateError: string; -} -/** - * @generated from protobuf message lnrpc.PolicyUpdateResponse - */ -export interface PolicyUpdateResponse { - /** - * List of failed policy updates. - * - * @generated from protobuf field: repeated lnrpc.FailedUpdate failed_updates = 1; - */ - failedUpdates: FailedUpdate[]; -} -/** - * @generated from protobuf message lnrpc.ForwardingHistoryRequest - */ -export interface ForwardingHistoryRequest { - /** - * Start time is the starting point of the forwarding history request. All - * records beyond this point will be included, respecting the end time, and - * the index offset. - * - * @generated from protobuf field: uint64 start_time = 1; - */ - startTime: bigint; - /** - * End time is the end point of the forwarding history request. The - * response will carry at most 50k records between the start time and the - * end time. The index offset can be used to implement pagination. - * - * @generated from protobuf field: uint64 end_time = 2; - */ - endTime: bigint; - /** - * Index offset is the offset in the time series to start at. As each - * response can only contain 50k records, callers can use this to skip - * around within a packed time series. - * - * @generated from protobuf field: uint32 index_offset = 3; - */ - indexOffset: number; - /** - * The max number of events to return in the response to this query. - * - * @generated from protobuf field: uint32 num_max_events = 4; - */ - numMaxEvents: number; - /** - * Informs the server if the peer alias should be looked up for each - * forwarding event. - * - * @generated from protobuf field: bool peer_alias_lookup = 5; - */ - peerAliasLookup: boolean; -} -/** - * @generated from protobuf message lnrpc.ForwardingEvent - */ -export interface ForwardingEvent { - /** - * Timestamp is the time (unix epoch offset) that this circuit was - * completed. Deprecated by timestamp_ns. - * - * @deprecated - * @generated from protobuf field: uint64 timestamp = 1 [deprecated = true]; - */ - timestamp: bigint; - /** - * The incoming channel ID that carried the HTLC that created the circuit. - * - * @generated from protobuf field: uint64 chan_id_in = 2 [jstype = JS_STRING]; - */ - chanIdIn: string; - /** - * The outgoing channel ID that carried the preimage that completed the - * circuit. - * - * @generated from protobuf field: uint64 chan_id_out = 4 [jstype = JS_STRING]; - */ - chanIdOut: string; - /** - * The total amount (in satoshis) of the incoming HTLC that created half - * the circuit. - * - * @generated from protobuf field: uint64 amt_in = 5; - */ - amtIn: bigint; - /** - * The total amount (in satoshis) of the outgoing HTLC that created the - * second half of the circuit. - * - * @generated from protobuf field: uint64 amt_out = 6; - */ - amtOut: bigint; - /** - * The total fee (in satoshis) that this payment circuit carried. - * - * @generated from protobuf field: uint64 fee = 7; - */ - fee: bigint; - /** - * The total fee (in milli-satoshis) that this payment circuit carried. - * - * @generated from protobuf field: uint64 fee_msat = 8; - */ - feeMsat: bigint; - /** - * The total amount (in milli-satoshis) of the incoming HTLC that created - * half the circuit. - * - * @generated from protobuf field: uint64 amt_in_msat = 9; - */ - amtInMsat: bigint; - /** - * The total amount (in milli-satoshis) of the outgoing HTLC that created - * the second half of the circuit. - * - * @generated from protobuf field: uint64 amt_out_msat = 10; - */ - amtOutMsat: bigint; - /** - * The number of nanoseconds elapsed since January 1, 1970 UTC when this - * circuit was completed. - * - * @generated from protobuf field: uint64 timestamp_ns = 11; - */ - timestampNs: bigint; - /** - * The peer alias of the incoming channel. - * - * @generated from protobuf field: string peer_alias_in = 12; - */ - peerAliasIn: string; - /** - * The peer alias of the outgoing channel. - * - * @generated from protobuf field: string peer_alias_out = 13; - */ - peerAliasOut: string; -} -/** - * @generated from protobuf message lnrpc.ForwardingHistoryResponse - */ -export interface ForwardingHistoryResponse { - /** - * A list of forwarding events from the time slice of the time series - * specified in the request. - * - * @generated from protobuf field: repeated lnrpc.ForwardingEvent forwarding_events = 1; - */ - forwardingEvents: ForwardingEvent[]; - /** - * The index of the last time in the set of returned forwarding events. Can - * be used to seek further, pagination style. - * - * @generated from protobuf field: uint32 last_offset_index = 2; - */ - lastOffsetIndex: number; -} -/** - * @generated from protobuf message lnrpc.ExportChannelBackupRequest - */ -export interface ExportChannelBackupRequest { - /** - * The target channel point to obtain a back up for. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; - */ - chanPoint?: ChannelPoint; -} -/** - * @generated from protobuf message lnrpc.ChannelBackup - */ -export interface ChannelBackup { - /** - * - * Identifies the channel that this backup belongs to. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; - */ - chanPoint?: ChannelPoint; - /** - * - * Is an encrypted single-chan backup. this can be passed to - * RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in - * order to trigger the recovery protocol. When using REST, this field must be - * encoded as base64. - * - * @generated from protobuf field: bytes chan_backup = 2; - */ - chanBackup: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.MultiChanBackup - */ -export interface MultiChanBackup { - /** - * - * Is the set of all channels that are included in this multi-channel backup. - * - * @generated from protobuf field: repeated lnrpc.ChannelPoint chan_points = 1; - */ - chanPoints: ChannelPoint[]; - /** - * - * A single encrypted blob containing all the static channel backups of the - * channel listed above. This can be stored as a single file or blob, and - * safely be replaced with any prior/future versions. When using REST, this - * field must be encoded as base64. - * - * @generated from protobuf field: bytes multi_chan_backup = 2; - */ - multiChanBackup: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.ChanBackupExportRequest - */ -export interface ChanBackupExportRequest { -} -/** - * @generated from protobuf message lnrpc.ChanBackupSnapshot - */ -export interface ChanBackupSnapshot { - /** - * - * The set of new channels that have been added since the last channel backup - * snapshot was requested. - * - * @generated from protobuf field: lnrpc.ChannelBackups single_chan_backups = 1; - */ - singleChanBackups?: ChannelBackups; - /** - * - * A multi-channel backup that covers all open channels currently known to - * lnd. - * - * @generated from protobuf field: lnrpc.MultiChanBackup multi_chan_backup = 2; - */ - multiChanBackup?: MultiChanBackup; -} -/** - * @generated from protobuf message lnrpc.ChannelBackups - */ -export interface ChannelBackups { - /** - * - * A set of single-chan static channel backups. - * - * @generated from protobuf field: repeated lnrpc.ChannelBackup chan_backups = 1; - */ - chanBackups: ChannelBackup[]; -} -/** - * @generated from protobuf message lnrpc.RestoreChanBackupRequest - */ -export interface RestoreChanBackupRequest { - /** - * @generated from protobuf oneof: backup - */ - backup: { - oneofKind: "chanBackups"; - /** - * - * The channels to restore as a list of channel/backup pairs. - * - * @generated from protobuf field: lnrpc.ChannelBackups chan_backups = 1; - */ - chanBackups: ChannelBackups; - } | { - oneofKind: "multiChanBackup"; - /** - * - * The channels to restore in the packed multi backup format. When using - * REST, this field must be encoded as base64. - * - * @generated from protobuf field: bytes multi_chan_backup = 2; - */ - multiChanBackup: Uint8Array; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.RestoreBackupResponse - */ -export interface RestoreBackupResponse { -} -/** - * @generated from protobuf message lnrpc.ChannelBackupSubscription - */ -export interface ChannelBackupSubscription { -} -/** - * @generated from protobuf message lnrpc.VerifyChanBackupResponse - */ -export interface VerifyChanBackupResponse { -} -/** - * @generated from protobuf message lnrpc.MacaroonPermission - */ -export interface MacaroonPermission { - /** - * The entity a permission grants access to. - * - * @generated from protobuf field: string entity = 1; - */ - entity: string; - /** - * The action that is granted. - * - * @generated from protobuf field: string action = 2; - */ - action: string; -} -/** - * @generated from protobuf message lnrpc.BakeMacaroonRequest - */ -export interface BakeMacaroonRequest { - /** - * The list of permissions the new macaroon should grant. - * - * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 1; - */ - permissions: MacaroonPermission[]; - /** - * The root key ID used to create the macaroon, must be a positive integer. - * - * @generated from protobuf field: uint64 root_key_id = 2; - */ - rootKeyId: bigint; - /** - * - * Informs the RPC on whether to allow external permissions that LND is not - * aware of. - * - * @generated from protobuf field: bool allow_external_permissions = 3; - */ - allowExternalPermissions: boolean; -} -/** - * @generated from protobuf message lnrpc.BakeMacaroonResponse - */ -export interface BakeMacaroonResponse { - /** - * The hex encoded macaroon, serialized in binary format. - * - * @generated from protobuf field: string macaroon = 1; - */ - macaroon: string; -} -/** - * @generated from protobuf message lnrpc.ListMacaroonIDsRequest - */ -export interface ListMacaroonIDsRequest { -} -/** - * @generated from protobuf message lnrpc.ListMacaroonIDsResponse - */ -export interface ListMacaroonIDsResponse { - /** - * The list of root key IDs that are in use. - * - * @generated from protobuf field: repeated uint64 root_key_ids = 1; - */ - rootKeyIds: bigint[]; -} -/** - * @generated from protobuf message lnrpc.DeleteMacaroonIDRequest - */ -export interface DeleteMacaroonIDRequest { - /** - * The root key ID to be removed. - * - * @generated from protobuf field: uint64 root_key_id = 1; - */ - rootKeyId: bigint; -} -/** - * @generated from protobuf message lnrpc.DeleteMacaroonIDResponse - */ -export interface DeleteMacaroonIDResponse { - /** - * A boolean indicates that the deletion is successful. - * - * @generated from protobuf field: bool deleted = 1; - */ - deleted: boolean; -} -/** - * @generated from protobuf message lnrpc.MacaroonPermissionList - */ -export interface MacaroonPermissionList { - /** - * A list of macaroon permissions. - * - * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 1; - */ - permissions: MacaroonPermission[]; -} -/** - * @generated from protobuf message lnrpc.ListPermissionsRequest - */ -export interface ListPermissionsRequest { -} -/** - * @generated from protobuf message lnrpc.ListPermissionsResponse - */ -export interface ListPermissionsResponse { - /** - * - * A map between all RPC method URIs and their required macaroon permissions to - * access them. - * - * @generated from protobuf field: map method_permissions = 1; - */ - methodPermissions: { - [key: string]: MacaroonPermissionList; - }; -} -/** - * @generated from protobuf message lnrpc.Failure - */ -export interface Failure { - /** - * Failure code as defined in the Lightning spec - * - * @generated from protobuf field: lnrpc.Failure.FailureCode code = 1; - */ - code: Failure_FailureCode; - /** - * An optional channel update message. - * - * @generated from protobuf field: lnrpc.ChannelUpdate channel_update = 3; - */ - channelUpdate?: ChannelUpdate; - /** - * A failure type-dependent htlc value. - * - * @generated from protobuf field: uint64 htlc_msat = 4; - */ - htlcMsat: bigint; - /** - * The sha256 sum of the onion payload. - * - * @generated from protobuf field: bytes onion_sha_256 = 5; - */ - onionSha256: Uint8Array; - /** - * A failure type-dependent cltv expiry value. - * - * @generated from protobuf field: uint32 cltv_expiry = 6; - */ - cltvExpiry: number; - /** - * A failure type-dependent flags value. - * - * @generated from protobuf field: uint32 flags = 7; - */ - flags: number; - /** - * - * The position in the path of the intermediate or final node that generated - * the failure message. Position zero is the sender node. - * - * @generated from protobuf field: uint32 failure_source_index = 8; - */ - failureSourceIndex: number; - /** - * A failure type-dependent block height. - * - * @generated from protobuf field: uint32 height = 9; - */ - height: number; -} -/** - * @generated from protobuf enum lnrpc.Failure.FailureCode - */ -export enum Failure_FailureCode { - /** - * - * The numbers assigned in this enumeration match the failure codes as - * defined in BOLT #4. Because protobuf 3 requires enums to start with 0, - * a RESERVED value is added. - * - * @generated from protobuf enum value: RESERVED = 0; - */ - RESERVED = 0, - /** - * @generated from protobuf enum value: INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; - */ - INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1, - /** - * @generated from protobuf enum value: INCORRECT_PAYMENT_AMOUNT = 2; - */ - INCORRECT_PAYMENT_AMOUNT = 2, - /** - * @generated from protobuf enum value: FINAL_INCORRECT_CLTV_EXPIRY = 3; - */ - FINAL_INCORRECT_CLTV_EXPIRY = 3, - /** - * @generated from protobuf enum value: FINAL_INCORRECT_HTLC_AMOUNT = 4; - */ - FINAL_INCORRECT_HTLC_AMOUNT = 4, - /** - * @generated from protobuf enum value: FINAL_EXPIRY_TOO_SOON = 5; - */ - FINAL_EXPIRY_TOO_SOON = 5, - /** - * @generated from protobuf enum value: INVALID_REALM = 6; - */ - INVALID_REALM = 6, - /** - * @generated from protobuf enum value: EXPIRY_TOO_SOON = 7; - */ - EXPIRY_TOO_SOON = 7, - /** - * @generated from protobuf enum value: INVALID_ONION_VERSION = 8; - */ - INVALID_ONION_VERSION = 8, - /** - * @generated from protobuf enum value: INVALID_ONION_HMAC = 9; - */ - INVALID_ONION_HMAC = 9, - /** - * @generated from protobuf enum value: INVALID_ONION_KEY = 10; - */ - INVALID_ONION_KEY = 10, - /** - * @generated from protobuf enum value: AMOUNT_BELOW_MINIMUM = 11; - */ - AMOUNT_BELOW_MINIMUM = 11, - /** - * @generated from protobuf enum value: FEE_INSUFFICIENT = 12; - */ - FEE_INSUFFICIENT = 12, - /** - * @generated from protobuf enum value: INCORRECT_CLTV_EXPIRY = 13; - */ - INCORRECT_CLTV_EXPIRY = 13, - /** - * @generated from protobuf enum value: CHANNEL_DISABLED = 14; - */ - CHANNEL_DISABLED = 14, - /** - * @generated from protobuf enum value: TEMPORARY_CHANNEL_FAILURE = 15; - */ - TEMPORARY_CHANNEL_FAILURE = 15, - /** - * @generated from protobuf enum value: REQUIRED_NODE_FEATURE_MISSING = 16; - */ - REQUIRED_NODE_FEATURE_MISSING = 16, - /** - * @generated from protobuf enum value: REQUIRED_CHANNEL_FEATURE_MISSING = 17; - */ - REQUIRED_CHANNEL_FEATURE_MISSING = 17, - /** - * @generated from protobuf enum value: UNKNOWN_NEXT_PEER = 18; - */ - UNKNOWN_NEXT_PEER = 18, - /** - * @generated from protobuf enum value: TEMPORARY_NODE_FAILURE = 19; - */ - TEMPORARY_NODE_FAILURE = 19, - /** - * @generated from protobuf enum value: PERMANENT_NODE_FAILURE = 20; - */ - PERMANENT_NODE_FAILURE = 20, - /** - * @generated from protobuf enum value: PERMANENT_CHANNEL_FAILURE = 21; - */ - PERMANENT_CHANNEL_FAILURE = 21, - /** - * @generated from protobuf enum value: EXPIRY_TOO_FAR = 22; - */ - EXPIRY_TOO_FAR = 22, - /** - * @generated from protobuf enum value: MPP_TIMEOUT = 23; - */ - MPP_TIMEOUT = 23, - /** - * @generated from protobuf enum value: INVALID_ONION_PAYLOAD = 24; - */ - INVALID_ONION_PAYLOAD = 24, - /** - * - * An internal error occurred. - * - * @generated from protobuf enum value: INTERNAL_FAILURE = 997; - */ - INTERNAL_FAILURE = 997, - /** - * - * The error source is known, but the failure itself couldn't be decoded. - * - * @generated from protobuf enum value: UNKNOWN_FAILURE = 998; - */ - UNKNOWN_FAILURE = 998, - /** - * - * An unreadable failure result is returned if the received failure message - * cannot be decrypted. In that case the error source is unknown. - * - * @generated from protobuf enum value: UNREADABLE_FAILURE = 999; - */ - UNREADABLE_FAILURE = 999 -} -/** - * @generated from protobuf message lnrpc.ChannelUpdate - */ -export interface ChannelUpdate { - /** - * - * The signature that validates the announced data and proves the ownership - * of node id. - * - * @generated from protobuf field: bytes signature = 1; - */ - signature: Uint8Array; - /** - * - * The target chain that this channel was opened within. This value - * should be the genesis hash of the target chain. Along with the short - * channel ID, this uniquely identifies the channel globally in a - * blockchain. - * - * @generated from protobuf field: bytes chain_hash = 2; - */ - chainHash: Uint8Array; - /** - * - * The unique description of the funding transaction. - * - * @generated from protobuf field: uint64 chan_id = 3 [jstype = JS_STRING]; - */ - chanId: string; - /** - * - * A timestamp that allows ordering in the case of multiple announcements. - * We should ignore the message if timestamp is not greater than the - * last-received. - * - * @generated from protobuf field: uint32 timestamp = 4; - */ - timestamp: number; - /** - * - * The bitfield that describes whether optional fields are present in this - * update. Currently, the least-significant bit must be set to 1 if the - * optional field MaxHtlc is present. - * - * @generated from protobuf field: uint32 message_flags = 10; - */ - messageFlags: number; - /** - * - * The bitfield that describes additional meta-data concerning how the - * update is to be interpreted. Currently, the least-significant bit must be - * set to 0 if the creating node corresponds to the first node in the - * previously sent channel announcement and 1 otherwise. If the second bit - * is set, then the channel is set to be disabled. - * - * @generated from protobuf field: uint32 channel_flags = 5; - */ - channelFlags: number; - /** - * - * The minimum number of blocks this node requires to be added to the expiry - * of HTLCs. This is a security parameter determined by the node operator. - * This value represents the required gap between the time locks of the - * incoming and outgoing HTLC's set to this node. - * - * @generated from protobuf field: uint32 time_lock_delta = 6; - */ - timeLockDelta: number; - /** - * - * The minimum HTLC value which will be accepted. - * - * @generated from protobuf field: uint64 htlc_minimum_msat = 7; - */ - htlcMinimumMsat: bigint; - /** - * - * The base fee that must be used for incoming HTLC's to this particular - * channel. This value will be tacked onto the required for a payment - * independent of the size of the payment. - * - * @generated from protobuf field: uint32 base_fee = 8; - */ - baseFee: number; - /** - * - * The fee rate that will be charged per millionth of a satoshi. - * - * @generated from protobuf field: uint32 fee_rate = 9; - */ - feeRate: number; - /** - * - * The maximum HTLC value which will be accepted. - * - * @generated from protobuf field: uint64 htlc_maximum_msat = 11; - */ - htlcMaximumMsat: bigint; - /** - * - * The set of data that was appended to this message, some of which we may - * not actually know how to iterate or parse. By holding onto this data, we - * ensure that we're able to properly validate the set of signatures that - * cover these new fields, and ensure we're able to make upgrades to the - * network in a forwards compatible manner. - * - * @generated from protobuf field: bytes extra_opaque_data = 12; - */ - extraOpaqueData: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.MacaroonId - */ -export interface MacaroonId { - /** - * @generated from protobuf field: bytes nonce = 1; - */ - nonce: Uint8Array; - /** - * @generated from protobuf field: bytes storageId = 2; - */ - storageId: Uint8Array; - /** - * @generated from protobuf field: repeated lnrpc.Op ops = 3; - */ - ops: Op[]; -} -/** - * @generated from protobuf message lnrpc.Op - */ -export interface Op { - /** - * @generated from protobuf field: string entity = 1; - */ - entity: string; - /** - * @generated from protobuf field: repeated string actions = 2; - */ - actions: string[]; -} -/** - * @generated from protobuf message lnrpc.CheckMacPermRequest - */ -export interface CheckMacPermRequest { - /** - * @generated from protobuf field: bytes macaroon = 1; - */ - macaroon: Uint8Array; - /** - * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 2; - */ - permissions: MacaroonPermission[]; - /** - * @generated from protobuf field: string fullMethod = 3; - */ - fullMethod: string; -} -/** - * @generated from protobuf message lnrpc.CheckMacPermResponse - */ -export interface CheckMacPermResponse { - /** - * @generated from protobuf field: bool valid = 1; - */ - valid: boolean; -} -/** - * @generated from protobuf message lnrpc.RPCMiddlewareRequest - */ -export interface RPCMiddlewareRequest { - /** - * - * The unique ID of the intercepted original gRPC request. Useful for mapping - * request to response when implementing full duplex message interception. For - * streaming requests, this will be the same ID for all incoming and outgoing - * middleware intercept messages of the _same_ stream. - * - * @generated from protobuf field: uint64 request_id = 1; - */ - requestId: bigint; - /** - * - * The raw bytes of the complete macaroon as sent by the gRPC client in the - * original request. This might be empty for a request that doesn't require - * macaroons such as the wallet unlocker RPCs. - * - * @generated from protobuf field: bytes raw_macaroon = 2; - */ - rawMacaroon: Uint8Array; - /** - * - * The parsed condition of the macaroon's custom caveat for convenient access. - * This field only contains the value of the custom caveat that the handling - * middleware has registered itself for. The condition _must_ be validated for - * messages of intercept_type stream_auth and request! - * - * @generated from protobuf field: string custom_caveat_condition = 3; - */ - customCaveatCondition: string; - /** - * @generated from protobuf oneof: intercept_type - */ - interceptType: { - oneofKind: "streamAuth"; - /** - * - * Intercept stream authentication: each new streaming RPC call that is - * initiated against lnd and contains the middleware's custom macaroon - * caveat can be approved or denied based upon the macaroon in the stream - * header. This message will only be sent for streaming RPCs, unary RPCs - * must handle the macaroon authentication in the request interception to - * avoid an additional message round trip between lnd and the middleware. - * - * @generated from protobuf field: lnrpc.StreamAuth stream_auth = 4; - */ - streamAuth: StreamAuth; - } | { - oneofKind: "request"; - /** - * - * Intercept incoming gRPC client request message: all incoming messages, - * both on streaming and unary RPCs, are forwarded to the middleware for - * inspection. For unary RPC messages the middleware is also expected to - * validate the custom macaroon caveat of the request. - * - * @generated from protobuf field: lnrpc.RPCMessage request = 5; - */ - request: RPCMessage; - } | { - oneofKind: "response"; - /** - * - * Intercept outgoing gRPC response message: all outgoing messages, both on - * streaming and unary RPCs, are forwarded to the middleware for inspection - * and amendment. The response in this message is the original response as - * it was generated by the main RPC server. It can either be accepted - * (=forwarded to the client), replaced/overwritten with a new message of - * the same type, or replaced by an error message. - * - * @generated from protobuf field: lnrpc.RPCMessage response = 6; - */ - response: RPCMessage; - } | { - oneofKind: "regComplete"; - /** - * - * This is used to indicate to the client that the server has successfully - * registered the interceptor. This is only used in the very first message - * that the server sends to the client after the client sends the server - * the middleware registration message. - * - * @generated from protobuf field: bool reg_complete = 8; - */ - regComplete: boolean; - } | { - oneofKind: undefined; - }; - /** - * - * The unique message ID of this middleware intercept message. There can be - * multiple middleware intercept messages per single gRPC request (one for the - * incoming request and one for the outgoing response) or gRPC stream (one for - * each incoming message and one for each outgoing response). This message ID - * must be referenced when responding (accepting/rejecting/modifying) to an - * intercept message. - * - * @generated from protobuf field: uint64 msg_id = 7; - */ - msgId: bigint; -} -/** - * @generated from protobuf message lnrpc.StreamAuth - */ -export interface StreamAuth { - /** - * - * The full URI (in the format /./MethodName, for - * example /lnrpc.Lightning/GetInfo) of the streaming RPC method that was just - * established. - * - * @generated from protobuf field: string method_full_uri = 1; - */ - methodFullUri: string; -} -/** - * @generated from protobuf message lnrpc.RPCMessage - */ -export interface RPCMessage { - /** - * - * The full URI (in the format /./MethodName, for - * example /lnrpc.Lightning/GetInfo) of the RPC method the message was sent - * to/from. - * - * @generated from protobuf field: string method_full_uri = 1; - */ - methodFullUri: string; - /** - * - * Indicates whether the message was sent over a streaming RPC method or not. - * - * @generated from protobuf field: bool stream_rpc = 2; - */ - streamRpc: boolean; - /** - * - * The full canonical gRPC name of the message type (in the format - * .TypeName, for example lnrpc.GetInfoRequest). In case of an - * error being returned from lnd, this simply contains the string "error". - * - * @generated from protobuf field: string type_name = 3; - */ - typeName: string; - /** - * - * The full content of the gRPC message, serialized in the binary protobuf - * format. - * - * @generated from protobuf field: bytes serialized = 4; - */ - serialized: Uint8Array; - /** - * - * Indicates that the response from lnd was an error, not a gRPC response. If - * this is set to true then the type_name contains the string "error" and - * serialized contains the error string. - * - * @generated from protobuf field: bool is_error = 5; - */ - isError: boolean; -} -/** - * @generated from protobuf message lnrpc.RPCMiddlewareResponse - */ -export interface RPCMiddlewareResponse { - /** - * - * The request message ID this response refers to. Must always be set when - * giving feedback to an intercept but is ignored for the initial registration - * message. - * - * @generated from protobuf field: uint64 ref_msg_id = 1; - */ - refMsgId: bigint; - /** - * @generated from protobuf oneof: middleware_message - */ - middlewareMessage: { - oneofKind: "register"; - /** - * - * The registration message identifies the middleware that's being - * registered in lnd. The registration message must be sent immediately - * after initiating the RegisterRpcMiddleware stream, otherwise lnd will - * time out the attempt and terminate the request. NOTE: The middleware - * will only receive interception messages for requests that contain a - * macaroon with the custom caveat that the middleware declares it is - * responsible for handling in the registration message! As a security - * measure, _no_ middleware can intercept requests made with _unencumbered_ - * macaroons! - * - * @generated from protobuf field: lnrpc.MiddlewareRegistration register = 2; - */ - register: MiddlewareRegistration; - } | { - oneofKind: "feedback"; - /** - * - * The middleware received an interception request and gives feedback to - * it. The request_id indicates what message the feedback refers to. - * - * @generated from protobuf field: lnrpc.InterceptFeedback feedback = 3; - */ - feedback: InterceptFeedback; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.MiddlewareRegistration - */ -export interface MiddlewareRegistration { - /** - * - * The name of the middleware to register. The name should be as informative - * as possible and is logged on registration. - * - * @generated from protobuf field: string middleware_name = 1; - */ - middlewareName: string; - /** - * - * The name of the custom macaroon caveat that this middleware is responsible - * for. Only requests/responses that contain a macaroon with the registered - * custom caveat are forwarded for interception to the middleware. The - * exception being the read-only mode: All requests/responses are forwarded to - * a middleware that requests read-only access but such a middleware won't be - * allowed to _alter_ responses. As a security measure, _no_ middleware can - * change responses to requests made with _unencumbered_ macaroons! - * NOTE: Cannot be used at the same time as read_only_mode. - * - * @generated from protobuf field: string custom_macaroon_caveat_name = 2; - */ - customMacaroonCaveatName: string; - /** - * - * Instead of defining a custom macaroon caveat name a middleware can register - * itself for read-only access only. In that mode all requests/responses are - * forwarded to the middleware but the middleware isn't allowed to alter any of - * the responses. - * NOTE: Cannot be used at the same time as custom_macaroon_caveat_name. - * - * @generated from protobuf field: bool read_only_mode = 3; - */ - readOnlyMode: boolean; -} -/** - * @generated from protobuf message lnrpc.InterceptFeedback - */ -export interface InterceptFeedback { - /** - * - * The error to return to the user. If this is non-empty, the incoming gRPC - * stream/request is aborted and the error is returned to the gRPC client. If - * this value is empty, it means the middleware accepts the stream/request/ - * response and the processing of it can continue. - * - * @generated from protobuf field: string error = 1; - */ - error: string; - /** - * - * A boolean indicating that the gRPC message should be replaced/overwritten. - * This boolean is needed because in protobuf an empty message is serialized as - * a 0-length or nil byte slice and we wouldn't be able to distinguish between - * an empty replacement message and the "don't replace anything" case. - * - * @generated from protobuf field: bool replace_response = 2; - */ - replaceResponse: boolean; - /** - * - * If the replace_response field is set to true, this field must contain the - * binary serialized gRPC message in the protobuf format. - * - * @generated from protobuf field: bytes replacement_serialized = 3; - */ - replacementSerialized: Uint8Array; -} -/** - * @generated from protobuf enum lnrpc.OutputScriptType - */ -export enum OutputScriptType { - /** - * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY_HASH = 0; - */ - SCRIPT_TYPE_PUBKEY_HASH = 0, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_SCRIPT_HASH = 1; - */ - SCRIPT_TYPE_SCRIPT_HASH = 1, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; - */ - SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; - */ - SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY = 4; - */ - SCRIPT_TYPE_PUBKEY = 4, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_MULTISIG = 5; - */ - SCRIPT_TYPE_MULTISIG = 5, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_NULLDATA = 6; - */ - SCRIPT_TYPE_NULLDATA = 6, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_NON_STANDARD = 7; - */ - SCRIPT_TYPE_NON_STANDARD = 7, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_UNKNOWN = 8; - */ - SCRIPT_TYPE_WITNESS_UNKNOWN = 8, - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9; - */ - SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9 -} -/** - * - * `AddressType` has to be one of: - * - * - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) - * - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) - * - `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) - * - * @generated from protobuf enum lnrpc.AddressType - */ -export enum AddressType { - /** - * @generated from protobuf enum value: WITNESS_PUBKEY_HASH = 0; - */ - WITNESS_PUBKEY_HASH = 0, - /** - * @generated from protobuf enum value: NESTED_PUBKEY_HASH = 1; - */ - NESTED_PUBKEY_HASH = 1, - /** - * @generated from protobuf enum value: UNUSED_WITNESS_PUBKEY_HASH = 2; - */ - UNUSED_WITNESS_PUBKEY_HASH = 2, - /** - * @generated from protobuf enum value: UNUSED_NESTED_PUBKEY_HASH = 3; - */ - UNUSED_NESTED_PUBKEY_HASH = 3, - /** - * @generated from protobuf enum value: TAPROOT_PUBKEY = 4; - */ - TAPROOT_PUBKEY = 4, - /** - * @generated from protobuf enum value: UNUSED_TAPROOT_PUBKEY = 5; - */ - UNUSED_TAPROOT_PUBKEY = 5 -} -/** - * @generated from protobuf enum lnrpc.CommitmentType - */ -export enum CommitmentType { - /** - * - * Returned when the commitment type isn't known or unavailable. - * - * @generated from protobuf enum value: UNKNOWN_COMMITMENT_TYPE = 0; - */ - UNKNOWN_COMMITMENT_TYPE = 0, - /** - * - * A channel using the legacy commitment format having tweaked to_remote - * keys. - * - * @generated from protobuf enum value: LEGACY = 1; - */ - LEGACY = 1, - /** - * - * A channel that uses the modern commitment format where the key in the - * output of the remote party does not change each state. This makes back - * up and recovery easier as when the channel is closed, the funds go - * directly to that key. - * - * @generated from protobuf enum value: STATIC_REMOTE_KEY = 2; - */ - STATIC_REMOTE_KEY = 2, - /** - * - * A channel that uses a commitment format that has anchor outputs on the - * commitments, allowing fee bumping after a force close transaction has - * been broadcast. - * - * @generated from protobuf enum value: ANCHORS = 3; - */ - ANCHORS = 3, - /** - * - * A channel that uses a commitment type that builds upon the anchors - * commitment format, but in addition requires a CLTV clause to spend outputs - * paying to the channel initiator. This is intended for use on leased channels - * to guarantee that the channel initiator has no incentives to close a leased - * channel before its maturity date. - * - * @generated from protobuf enum value: SCRIPT_ENFORCED_LEASE = 4; - */ - SCRIPT_ENFORCED_LEASE = 4 -} -/** - * @generated from protobuf enum lnrpc.Initiator - */ -export enum Initiator { - /** - * @generated from protobuf enum value: INITIATOR_UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: INITIATOR_LOCAL = 1; - */ - LOCAL = 1, - /** - * @generated from protobuf enum value: INITIATOR_REMOTE = 2; - */ - REMOTE = 2, - /** - * @generated from protobuf enum value: INITIATOR_BOTH = 3; - */ - BOTH = 3 -} -/** - * @generated from protobuf enum lnrpc.ResolutionType - */ -export enum ResolutionType { - /** - * @generated from protobuf enum value: TYPE_UNKNOWN = 0; - */ - TYPE_UNKNOWN = 0, - /** - * We resolved an anchor output. - * - * @generated from protobuf enum value: ANCHOR = 1; - */ - ANCHOR = 1, - /** - * - * We are resolving an incoming htlc on chain. This if this htlc is - * claimed, we swept the incoming htlc with the preimage. If it is timed - * out, our peer swept the timeout path. - * - * @generated from protobuf enum value: INCOMING_HTLC = 2; - */ - INCOMING_HTLC = 2, - /** - * - * We are resolving an outgoing htlc on chain. If this htlc is claimed, - * the remote party swept the htlc with the preimage. If it is timed out, - * we swept it with the timeout path. - * - * @generated from protobuf enum value: OUTGOING_HTLC = 3; - */ - OUTGOING_HTLC = 3, - /** - * We force closed and need to sweep our time locked commitment output. - * - * @generated from protobuf enum value: COMMIT = 4; - */ - COMMIT = 4 -} -/** - * @generated from protobuf enum lnrpc.ResolutionOutcome - */ -export enum ResolutionOutcome { - /** - * Outcome unknown. - * - * @generated from protobuf enum value: OUTCOME_UNKNOWN = 0; - */ - OUTCOME_UNKNOWN = 0, - /** - * An output was claimed on chain. - * - * @generated from protobuf enum value: CLAIMED = 1; - */ - CLAIMED = 1, - /** - * An output was left unclaimed on chain. - * - * @generated from protobuf enum value: UNCLAIMED = 2; - */ - UNCLAIMED = 2, - /** - * - * ResolverOutcomeAbandoned indicates that an output that we did not - * claim on chain, for example an anchor that we did not sweep and a - * third party claimed on chain, or a htlc that we could not decode - * so left unclaimed. - * - * @generated from protobuf enum value: ABANDONED = 3; - */ - ABANDONED = 3, - /** - * - * If we force closed our channel, our htlcs need to be claimed in two - * stages. This outcome represents the broadcast of a timeout or success - * transaction for this two stage htlc claim. - * - * @generated from protobuf enum value: FIRST_STAGE = 4; - */ - FIRST_STAGE = 4, - /** - * A htlc was timed out on chain. - * - * @generated from protobuf enum value: TIMEOUT = 5; - */ - TIMEOUT = 5 -} -/** - * @generated from protobuf enum lnrpc.NodeMetricType - */ -export enum NodeMetricType { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: BETWEENNESS_CENTRALITY = 1; - */ - BETWEENNESS_CENTRALITY = 1 -} -/** - * @generated from protobuf enum lnrpc.InvoiceHTLCState - */ -export enum InvoiceHTLCState { - /** - * @generated from protobuf enum value: ACCEPTED = 0; - */ - ACCEPTED = 0, - /** - * @generated from protobuf enum value: SETTLED = 1; - */ - SETTLED = 1, - /** - * @generated from protobuf enum value: CANCELED = 2; - */ - CANCELED = 2 -} -/** - * @generated from protobuf enum lnrpc.PaymentFailureReason - */ -export enum PaymentFailureReason { - /** - * - * Payment isn't failed (yet). - * - * @generated from protobuf enum value: FAILURE_REASON_NONE = 0; - */ - FAILURE_REASON_NONE = 0, - /** - * - * There are more routes to try, but the payment timeout was exceeded. - * - * @generated from protobuf enum value: FAILURE_REASON_TIMEOUT = 1; - */ - FAILURE_REASON_TIMEOUT = 1, - /** - * - * All possible routes were tried and failed permanently. Or were no - * routes to the destination at all. - * - * @generated from protobuf enum value: FAILURE_REASON_NO_ROUTE = 2; - */ - FAILURE_REASON_NO_ROUTE = 2, - /** - * - * A non-recoverable error has occured. - * - * @generated from protobuf enum value: FAILURE_REASON_ERROR = 3; - */ - FAILURE_REASON_ERROR = 3, - /** - * - * Payment details incorrect (unknown hash, invalid amt or - * invalid final cltv delta) - * - * @generated from protobuf enum value: FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; - */ - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4, - /** - * - * Insufficient local balance. - * - * @generated from protobuf enum value: FAILURE_REASON_INSUFFICIENT_BALANCE = 5; - */ - FAILURE_REASON_INSUFFICIENT_BALANCE = 5 -} -/** - * @generated from protobuf enum lnrpc.FeatureBit - */ -export enum FeatureBit { - /** - * @generated from protobuf enum value: DATALOSS_PROTECT_REQ = 0; - */ - DATALOSS_PROTECT_REQ = 0, - /** - * @generated from protobuf enum value: DATALOSS_PROTECT_OPT = 1; - */ - DATALOSS_PROTECT_OPT = 1, - /** - * @generated from protobuf enum value: INITIAL_ROUING_SYNC = 3; - */ - INITIAL_ROUING_SYNC = 3, - /** - * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; - */ - UPFRONT_SHUTDOWN_SCRIPT_REQ = 4, - /** - * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; - */ - UPFRONT_SHUTDOWN_SCRIPT_OPT = 5, - /** - * @generated from protobuf enum value: GOSSIP_QUERIES_REQ = 6; - */ - GOSSIP_QUERIES_REQ = 6, - /** - * @generated from protobuf enum value: GOSSIP_QUERIES_OPT = 7; - */ - GOSSIP_QUERIES_OPT = 7, - /** - * @generated from protobuf enum value: TLV_ONION_REQ = 8; - */ - TLV_ONION_REQ = 8, - /** - * @generated from protobuf enum value: TLV_ONION_OPT = 9; - */ - TLV_ONION_OPT = 9, - /** - * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_REQ = 10; - */ - EXT_GOSSIP_QUERIES_REQ = 10, - /** - * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_OPT = 11; - */ - EXT_GOSSIP_QUERIES_OPT = 11, - /** - * @generated from protobuf enum value: STATIC_REMOTE_KEY_REQ = 12; - */ - STATIC_REMOTE_KEY_REQ = 12, - /** - * @generated from protobuf enum value: STATIC_REMOTE_KEY_OPT = 13; - */ - STATIC_REMOTE_KEY_OPT = 13, - /** - * @generated from protobuf enum value: PAYMENT_ADDR_REQ = 14; - */ - PAYMENT_ADDR_REQ = 14, - /** - * @generated from protobuf enum value: PAYMENT_ADDR_OPT = 15; - */ - PAYMENT_ADDR_OPT = 15, - /** - * @generated from protobuf enum value: MPP_REQ = 16; - */ - MPP_REQ = 16, - /** - * @generated from protobuf enum value: MPP_OPT = 17; - */ - MPP_OPT = 17, - /** - * @generated from protobuf enum value: WUMBO_CHANNELS_REQ = 18; - */ - WUMBO_CHANNELS_REQ = 18, - /** - * @generated from protobuf enum value: WUMBO_CHANNELS_OPT = 19; - */ - WUMBO_CHANNELS_OPT = 19, - /** - * @generated from protobuf enum value: ANCHORS_REQ = 20; - */ - ANCHORS_REQ = 20, - /** - * @generated from protobuf enum value: ANCHORS_OPT = 21; - */ - ANCHORS_OPT = 21, - /** - * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_REQ = 22; - */ - ANCHORS_ZERO_FEE_HTLC_REQ = 22, - /** - * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_OPT = 23; - */ - ANCHORS_ZERO_FEE_HTLC_OPT = 23, - /** - * @generated from protobuf enum value: AMP_REQ = 30; - */ - AMP_REQ = 30, - /** - * @generated from protobuf enum value: AMP_OPT = 31; - */ - AMP_OPT = 31 -} -/** - * @generated from protobuf enum lnrpc.UpdateFailure - */ -export enum UpdateFailure { - /** - * @generated from protobuf enum value: UPDATE_FAILURE_UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: UPDATE_FAILURE_PENDING = 1; - */ - PENDING = 1, - /** - * @generated from protobuf enum value: UPDATE_FAILURE_NOT_FOUND = 2; - */ - NOT_FOUND = 2, - /** - * @generated from protobuf enum value: UPDATE_FAILURE_INTERNAL_ERR = 3; - */ - INTERNAL_ERR = 3, - /** - * @generated from protobuf enum value: UPDATE_FAILURE_INVALID_PARAMETER = 4; - */ - INVALID_PARAMETER = 4 -} -// @generated message type with reflection information, may provide speed optimized methods -class LookupHtlcRequest$Type extends MessageType { - constructor() { - super("lnrpc.LookupHtlcRequest", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): LookupHtlcRequest { - const message = { chanId: 0n, htlcIndex: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcRequest): LookupHtlcRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id */ 1: - message.chanId = reader.uint64().toBigInt(); - break; - case /* uint64 htlc_index */ 2: - message.htlcIndex = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LookupHtlcRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 1; */ - if (message.chanId !== 0n) - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* uint64 htlc_index = 2; */ - if (message.htlcIndex !== 0n) - writer.tag(2, WireType.Varint).uint64(message.htlcIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.LookupHtlcRequest - */ -export const LookupHtlcRequest = new LookupHtlcRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LookupHtlcResponse$Type extends MessageType { - constructor() { - super("lnrpc.LookupHtlcResponse", [ - { no: 1, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "offchain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): LookupHtlcResponse { - const message = { settled: false, offchain: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcResponse): LookupHtlcResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool settled */ 1: - message.settled = reader.bool(); - break; - case /* bool offchain */ 2: - message.offchain = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LookupHtlcResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool settled = 1; */ - if (message.settled !== false) - writer.tag(1, WireType.Varint).bool(message.settled); - /* bool offchain = 2; */ - if (message.offchain !== false) - writer.tag(2, WireType.Varint).bool(message.offchain); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.LookupHtlcResponse - */ -export const LookupHtlcResponse = new LookupHtlcResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SubscribeCustomMessagesRequest$Type extends MessageType { - constructor() { - super("lnrpc.SubscribeCustomMessagesRequest", []); - } - create(value?: PartialMessage): SubscribeCustomMessagesRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeCustomMessagesRequest): SubscribeCustomMessagesRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: SubscribeCustomMessagesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SubscribeCustomMessagesRequest - */ -export const SubscribeCustomMessagesRequest = new SubscribeCustomMessagesRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CustomMessage$Type extends MessageType { - constructor() { - super("lnrpc.CustomMessage", [ - { no: 1, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "type", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): CustomMessage { - const message = { peer: new Uint8Array(0), type: 0, data: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CustomMessage): CustomMessage { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes peer */ 1: - message.peer = reader.bytes(); - break; - case /* uint32 type */ 2: - message.type = reader.uint32(); - break; - case /* bytes data */ 3: - message.data = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CustomMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes peer = 1; */ - if (message.peer.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.peer); - /* uint32 type = 2; */ - if (message.type !== 0) - writer.tag(2, WireType.Varint).uint32(message.type); - /* bytes data = 3; */ - if (message.data.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.data); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.CustomMessage - */ -export const CustomMessage = new CustomMessage$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendCustomMessageRequest$Type extends MessageType { - constructor() { - super("lnrpc.SendCustomMessageRequest", [ - { no: 1, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "type", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): SendCustomMessageRequest { - const message = { peer: new Uint8Array(0), type: 0, data: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageRequest): SendCustomMessageRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes peer */ 1: - message.peer = reader.bytes(); - break; - case /* uint32 type */ 2: - message.type = reader.uint32(); - break; - case /* bytes data */ 3: - message.data = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendCustomMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes peer = 1; */ - if (message.peer.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.peer); - /* uint32 type = 2; */ - if (message.type !== 0) - writer.tag(2, WireType.Varint).uint32(message.type); - /* bytes data = 3; */ - if (message.data.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.data); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendCustomMessageRequest - */ -export const SendCustomMessageRequest = new SendCustomMessageRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendCustomMessageResponse$Type extends MessageType { - constructor() { - super("lnrpc.SendCustomMessageResponse", []); - } - create(value?: PartialMessage): SendCustomMessageResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageResponse): SendCustomMessageResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: SendCustomMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendCustomMessageResponse - */ -export const SendCustomMessageResponse = new SendCustomMessageResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Utxo$Type extends MessageType { - constructor() { - super("lnrpc.Utxo", [ - { no: 1, name: "address_type", kind: "enum", T: () => ["lnrpc.AddressType", AddressType] }, - { no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "amount_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "pk_script", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "outpoint", kind: "message", T: () => OutPoint }, - { no: 6, name: "confirmations", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): Utxo { - const message = { addressType: 0, address: "", amountSat: 0n, pkScript: "", confirmations: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Utxo): Utxo { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.AddressType address_type */ 1: - message.addressType = reader.int32(); - break; - case /* string address */ 2: - message.address = reader.string(); - break; - case /* int64 amount_sat */ 3: - message.amountSat = reader.int64().toBigInt(); - break; - case /* string pk_script */ 4: - message.pkScript = reader.string(); - break; - case /* lnrpc.OutPoint outpoint */ 5: - message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); - break; - case /* int64 confirmations */ 6: - message.confirmations = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Utxo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.AddressType address_type = 1; */ - if (message.addressType !== 0) - writer.tag(1, WireType.Varint).int32(message.addressType); - /* string address = 2; */ - if (message.address !== "") - writer.tag(2, WireType.LengthDelimited).string(message.address); - /* int64 amount_sat = 3; */ - if (message.amountSat !== 0n) - writer.tag(3, WireType.Varint).int64(message.amountSat); - /* string pk_script = 4; */ - if (message.pkScript !== "") - writer.tag(4, WireType.LengthDelimited).string(message.pkScript); - /* lnrpc.OutPoint outpoint = 5; */ - if (message.outpoint) - OutPoint.internalBinaryWrite(message.outpoint, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* int64 confirmations = 6; */ - if (message.confirmations !== 0n) - writer.tag(6, WireType.Varint).int64(message.confirmations); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Utxo - */ -export const Utxo = new Utxo$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class OutputDetail$Type extends MessageType { - constructor() { - super("lnrpc.OutputDetail", [ - { no: 1, name: "output_type", kind: "enum", T: () => ["lnrpc.OutputScriptType", OutputScriptType] }, - { no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "pk_script", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "output_index", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "is_our_address", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): OutputDetail { - const message = { outputType: 0, address: "", pkScript: "", outputIndex: 0n, amount: 0n, isOurAddress: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OutputDetail): OutputDetail { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.OutputScriptType output_type */ 1: - message.outputType = reader.int32(); - break; - case /* string address */ 2: - message.address = reader.string(); - break; - case /* string pk_script */ 3: - message.pkScript = reader.string(); - break; - case /* int64 output_index */ 4: - message.outputIndex = reader.int64().toBigInt(); - break; - case /* int64 amount */ 5: - message.amount = reader.int64().toBigInt(); - break; - case /* bool is_our_address */ 6: - message.isOurAddress = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: OutputDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.OutputScriptType output_type = 1; */ - if (message.outputType !== 0) - writer.tag(1, WireType.Varint).int32(message.outputType); - /* string address = 2; */ - if (message.address !== "") - writer.tag(2, WireType.LengthDelimited).string(message.address); - /* string pk_script = 3; */ - if (message.pkScript !== "") - writer.tag(3, WireType.LengthDelimited).string(message.pkScript); - /* int64 output_index = 4; */ - if (message.outputIndex !== 0n) - writer.tag(4, WireType.Varint).int64(message.outputIndex); - /* int64 amount = 5; */ - if (message.amount !== 0n) - writer.tag(5, WireType.Varint).int64(message.amount); - /* bool is_our_address = 6; */ - if (message.isOurAddress !== false) - writer.tag(6, WireType.Varint).bool(message.isOurAddress); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.OutputDetail - */ -export const OutputDetail = new OutputDetail$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Transaction$Type extends MessageType { - constructor() { - super("lnrpc.Transaction", [ - { no: 1, name: "tx_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "num_confirmations", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "block_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "block_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 6, name: "time_stamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "dest_addresses", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "output_details", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => OutputDetail }, - { no: 9, name: "raw_tx_hex", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "previous_outpoints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PreviousOutPoint } - ]); - } - create(value?: PartialMessage): Transaction { - const message = { txHash: "", amount: 0n, numConfirmations: 0, blockHash: "", blockHeight: 0, timeStamp: 0n, totalFees: 0n, destAddresses: [], outputDetails: [], rawTxHex: "", label: "", previousOutpoints: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Transaction): Transaction { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string tx_hash */ 1: - message.txHash = reader.string(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toBigInt(); - break; - case /* int32 num_confirmations */ 3: - message.numConfirmations = reader.int32(); - break; - case /* string block_hash */ 4: - message.blockHash = reader.string(); - break; - case /* int32 block_height */ 5: - message.blockHeight = reader.int32(); - break; - case /* int64 time_stamp */ 6: - message.timeStamp = reader.int64().toBigInt(); - break; - case /* int64 total_fees */ 7: - message.totalFees = reader.int64().toBigInt(); - break; - case /* repeated string dest_addresses = 8 [deprecated = true];*/ 8: - message.destAddresses.push(reader.string()); - break; - case /* repeated lnrpc.OutputDetail output_details */ 11: - message.outputDetails.push(OutputDetail.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* string raw_tx_hex */ 9: - message.rawTxHex = reader.string(); - break; - case /* string label */ 10: - message.label = reader.string(); - break; - case /* repeated lnrpc.PreviousOutPoint previous_outpoints */ 12: - message.previousOutpoints.push(PreviousOutPoint.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Transaction, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string tx_hash = 1; */ - if (message.txHash !== "") - writer.tag(1, WireType.LengthDelimited).string(message.txHash); - /* int64 amount = 2; */ - if (message.amount !== 0n) - writer.tag(2, WireType.Varint).int64(message.amount); - /* int32 num_confirmations = 3; */ - if (message.numConfirmations !== 0) - writer.tag(3, WireType.Varint).int32(message.numConfirmations); - /* string block_hash = 4; */ - if (message.blockHash !== "") - writer.tag(4, WireType.LengthDelimited).string(message.blockHash); - /* int32 block_height = 5; */ - if (message.blockHeight !== 0) - writer.tag(5, WireType.Varint).int32(message.blockHeight); - /* int64 time_stamp = 6; */ - if (message.timeStamp !== 0n) - writer.tag(6, WireType.Varint).int64(message.timeStamp); - /* int64 total_fees = 7; */ - if (message.totalFees !== 0n) - writer.tag(7, WireType.Varint).int64(message.totalFees); - /* repeated string dest_addresses = 8 [deprecated = true]; */ - for (let i = 0; i < message.destAddresses.length; i++) - writer.tag(8, WireType.LengthDelimited).string(message.destAddresses[i]); - /* repeated lnrpc.OutputDetail output_details = 11; */ - for (let i = 0; i < message.outputDetails.length; i++) - OutputDetail.internalBinaryWrite(message.outputDetails[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join(); - /* string raw_tx_hex = 9; */ - if (message.rawTxHex !== "") - writer.tag(9, WireType.LengthDelimited).string(message.rawTxHex); - /* string label = 10; */ - if (message.label !== "") - writer.tag(10, WireType.LengthDelimited).string(message.label); - /* repeated lnrpc.PreviousOutPoint previous_outpoints = 12; */ - for (let i = 0; i < message.previousOutpoints.length; i++) - PreviousOutPoint.internalBinaryWrite(message.previousOutpoints[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Transaction - */ -export const Transaction = new Transaction$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetTransactionsRequest$Type extends MessageType { - constructor() { - super("lnrpc.GetTransactionsRequest", [ - { no: 1, name: "start_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "end_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): GetTransactionsRequest { - const message = { startHeight: 0, endHeight: 0, account: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetTransactionsRequest): GetTransactionsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 start_height */ 1: - message.startHeight = reader.int32(); - break; - case /* int32 end_height */ 2: - message.endHeight = reader.int32(); - break; - case /* string account */ 3: - message.account = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetTransactionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 start_height = 1; */ - if (message.startHeight !== 0) - writer.tag(1, WireType.Varint).int32(message.startHeight); - /* int32 end_height = 2; */ - if (message.endHeight !== 0) - writer.tag(2, WireType.Varint).int32(message.endHeight); - /* string account = 3; */ - if (message.account !== "") - writer.tag(3, WireType.LengthDelimited).string(message.account); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetTransactionsRequest - */ -export const GetTransactionsRequest = new GetTransactionsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class TransactionDetails$Type extends MessageType { - constructor() { - super("lnrpc.TransactionDetails", [ - { no: 1, name: "transactions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Transaction } - ]); - } - create(value?: PartialMessage): TransactionDetails { - const message = { transactions: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TransactionDetails): TransactionDetails { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Transaction transactions */ 1: - message.transactions.push(Transaction.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: TransactionDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.Transaction transactions = 1; */ - for (let i = 0; i < message.transactions.length; i++) - Transaction.internalBinaryWrite(message.transactions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.TransactionDetails - */ -export const TransactionDetails = new TransactionDetails$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FeeLimit$Type extends MessageType { - constructor() { - super("lnrpc.FeeLimit", [ - { no: 1, name: "fixed", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "fixed_msat", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "percent", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): FeeLimit { - const message = { limit: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeLimit): FeeLimit { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 fixed */ 1: - message.limit = { - oneofKind: "fixed", - fixed: reader.int64().toBigInt() - }; - break; - case /* int64 fixed_msat */ 3: - message.limit = { - oneofKind: "fixedMsat", - fixedMsat: reader.int64().toBigInt() - }; - break; - case /* int64 percent */ 2: - message.limit = { - oneofKind: "percent", - percent: reader.int64().toBigInt() - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FeeLimit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 fixed = 1; */ - if (message.limit.oneofKind === "fixed") - writer.tag(1, WireType.Varint).int64(message.limit.fixed); - /* int64 fixed_msat = 3; */ - if (message.limit.oneofKind === "fixedMsat") - writer.tag(3, WireType.Varint).int64(message.limit.fixedMsat); - /* int64 percent = 2; */ - if (message.limit.oneofKind === "percent") - writer.tag(2, WireType.Varint).int64(message.limit.percent); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FeeLimit - */ -export const FeeLimit = new FeeLimit$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendRequest$Type extends MessageType { - constructor() { - super("lnrpc.SendRequest", [ - { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "dest_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "payment_hash_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 8, name: "fee_limit", kind: "message", T: () => FeeLimit }, - { no: 9, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 13, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 10, name: "cltv_limit", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 11, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 14, name: "allow_self_payment", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 15, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, - { no: 16, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): SendRequest { - const message = { dest: new Uint8Array(0), destString: "", amt: 0n, amtMsat: 0n, paymentHash: new Uint8Array(0), paymentHashString: "", paymentRequest: "", finalCltvDelta: 0, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), cltvLimit: 0, destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], paymentAddr: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendRequest): SendRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes dest */ 1: - message.dest = reader.bytes(); - break; - case /* string dest_string = 2 [deprecated = true];*/ 2: - message.destString = reader.string(); - break; - case /* int64 amt */ 3: - message.amt = reader.int64().toBigInt(); - break; - case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toBigInt(); - break; - case /* bytes payment_hash */ 4: - message.paymentHash = reader.bytes(); - break; - case /* string payment_hash_string = 5 [deprecated = true];*/ 5: - message.paymentHashString = reader.string(); - break; - case /* string payment_request */ 6: - message.paymentRequest = reader.string(); - break; - case /* int32 final_cltv_delta */ 7: - message.finalCltvDelta = reader.int32(); - break; - case /* lnrpc.FeeLimit fee_limit */ 8: - message.feeLimit = FeeLimit.internalBinaryRead(reader, reader.uint32(), options, message.feeLimit); - break; - case /* uint64 outgoing_chan_id = 9 [jstype = JS_STRING];*/ 9: - message.outgoingChanId = reader.uint64().toString(); - break; - case /* bytes last_hop_pubkey */ 13: - message.lastHopPubkey = reader.bytes(); - break; - case /* uint32 cltv_limit */ 10: - message.cltvLimit = reader.uint32(); - break; - case /* map dest_custom_records */ 11: - this.binaryReadMap11(message.destCustomRecords, reader, options); - break; - case /* bool allow_self_payment */ 14: - message.allowSelfPayment = reader.bool(); - break; - case /* repeated lnrpc.FeatureBit dest_features */ 15: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.destFeatures.push(reader.int32()); - else - message.destFeatures.push(reader.int32()); - break; - case /* bytes payment_addr */ 16: - message.paymentAddr = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap11(map: SendRequest["destCustomRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof SendRequest["destCustomRecords"] | undefined, val: SendRequest["destCustomRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.SendRequest.dest_custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: SendRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes dest = 1; */ - if (message.dest.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.dest); - /* string dest_string = 2 [deprecated = true]; */ - if (message.destString !== "") - writer.tag(2, WireType.LengthDelimited).string(message.destString); - /* int64 amt = 3; */ - if (message.amt !== 0n) - writer.tag(3, WireType.Varint).int64(message.amt); - /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0n) - writer.tag(12, WireType.Varint).int64(message.amtMsat); - /* bytes payment_hash = 4; */ - if (message.paymentHash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.paymentHash); - /* string payment_hash_string = 5 [deprecated = true]; */ - if (message.paymentHashString !== "") - writer.tag(5, WireType.LengthDelimited).string(message.paymentHashString); - /* string payment_request = 6; */ - if (message.paymentRequest !== "") - writer.tag(6, WireType.LengthDelimited).string(message.paymentRequest); - /* int32 final_cltv_delta = 7; */ - if (message.finalCltvDelta !== 0) - writer.tag(7, WireType.Varint).int32(message.finalCltvDelta); - /* lnrpc.FeeLimit fee_limit = 8; */ - if (message.feeLimit) - FeeLimit.internalBinaryWrite(message.feeLimit, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(9, WireType.Varint).uint64(message.outgoingChanId); - /* bytes last_hop_pubkey = 13; */ - if (message.lastHopPubkey.length) - writer.tag(13, WireType.LengthDelimited).bytes(message.lastHopPubkey); - /* uint32 cltv_limit = 10; */ - if (message.cltvLimit !== 0) - writer.tag(10, WireType.Varint).uint32(message.cltvLimit); - /* map dest_custom_records = 11; */ - for (let k of Object.keys(message.destCustomRecords)) - writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); - /* bool allow_self_payment = 14; */ - if (message.allowSelfPayment !== false) - writer.tag(14, WireType.Varint).bool(message.allowSelfPayment); - /* repeated lnrpc.FeatureBit dest_features = 15; */ - if (message.destFeatures.length) { - writer.tag(15, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.destFeatures.length; i++) - writer.int32(message.destFeatures[i]); - writer.join(); - } - /* bytes payment_addr = 16; */ - if (message.paymentAddr.length) - writer.tag(16, WireType.LengthDelimited).bytes(message.paymentAddr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendRequest - */ -export const SendRequest = new SendRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendResponse$Type extends MessageType { - constructor() { - super("lnrpc.SendResponse", [ - { no: 1, name: "payment_error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "payment_preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "payment_route", kind: "message", T: () => Route }, - { no: 4, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): SendResponse { - const message = { paymentError: "", paymentPreimage: new Uint8Array(0), paymentHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendResponse): SendResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string payment_error */ 1: - message.paymentError = reader.string(); - break; - case /* bytes payment_preimage */ 2: - message.paymentPreimage = reader.bytes(); - break; - case /* lnrpc.Route payment_route */ 3: - message.paymentRoute = Route.internalBinaryRead(reader, reader.uint32(), options, message.paymentRoute); - break; - case /* bytes payment_hash */ 4: - message.paymentHash = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string payment_error = 1; */ - if (message.paymentError !== "") - writer.tag(1, WireType.LengthDelimited).string(message.paymentError); - /* bytes payment_preimage = 2; */ - if (message.paymentPreimage.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.paymentPreimage); - /* lnrpc.Route payment_route = 3; */ - if (message.paymentRoute) - Route.internalBinaryWrite(message.paymentRoute, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* bytes payment_hash = 4; */ - if (message.paymentHash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.paymentHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendResponse - */ -export const SendResponse = new SendResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendToRouteRequest$Type extends MessageType { - constructor() { - super("lnrpc.SendToRouteRequest", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "payment_hash_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "route", kind: "message", T: () => Route } - ]); - } - create(value?: PartialMessage): SendToRouteRequest { - const message = { paymentHash: new Uint8Array(0), paymentHashString: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteRequest): SendToRouteRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_hash */ 1: - message.paymentHash = reader.bytes(); - break; - case /* string payment_hash_string = 2 [deprecated = true];*/ 2: - message.paymentHashString = reader.string(); - break; - case /* lnrpc.Route route */ 4: - message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendToRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - /* string payment_hash_string = 2 [deprecated = true]; */ - if (message.paymentHashString !== "") - writer.tag(2, WireType.LengthDelimited).string(message.paymentHashString); - /* lnrpc.Route route = 4; */ - if (message.route) - Route.internalBinaryWrite(message.route, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendToRouteRequest - */ -export const SendToRouteRequest = new SendToRouteRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelAcceptRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChannelAcceptRequest", [ - { no: 1, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "chain_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "funding_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "push_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "dust_limit", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "max_value_in_flight", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "channel_reserve", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "min_htlc", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 11, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 12, name: "max_accepted_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 13, name: "channel_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 14, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, - { no: 15, name: "wants_zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 16, name: "wants_scid_alias", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ChannelAcceptRequest { - const message = { nodePubkey: new Uint8Array(0), chainHash: new Uint8Array(0), pendingChanId: new Uint8Array(0), fundingAmt: 0n, pushAmt: 0n, dustLimit: 0n, maxValueInFlight: 0n, channelReserve: 0n, minHtlc: 0n, feePerKw: 0n, csvDelay: 0, maxAcceptedHtlcs: 0, channelFlags: 0, commitmentType: 0, wantsZeroConf: false, wantsScidAlias: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAcceptRequest): ChannelAcceptRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes node_pubkey */ 1: - message.nodePubkey = reader.bytes(); - break; - case /* bytes chain_hash */ 2: - message.chainHash = reader.bytes(); - break; - case /* bytes pending_chan_id */ 3: - message.pendingChanId = reader.bytes(); - break; - case /* uint64 funding_amt */ 4: - message.fundingAmt = reader.uint64().toBigInt(); - break; - case /* uint64 push_amt */ 5: - message.pushAmt = reader.uint64().toBigInt(); - break; - case /* uint64 dust_limit */ 6: - message.dustLimit = reader.uint64().toBigInt(); - break; - case /* uint64 max_value_in_flight */ 7: - message.maxValueInFlight = reader.uint64().toBigInt(); - break; - case /* uint64 channel_reserve */ 8: - message.channelReserve = reader.uint64().toBigInt(); - break; - case /* uint64 min_htlc */ 9: - message.minHtlc = reader.uint64().toBigInt(); - break; - case /* uint64 fee_per_kw */ 10: - message.feePerKw = reader.uint64().toBigInt(); - break; - case /* uint32 csv_delay */ 11: - message.csvDelay = reader.uint32(); - break; - case /* uint32 max_accepted_htlcs */ 12: - message.maxAcceptedHtlcs = reader.uint32(); - break; - case /* uint32 channel_flags */ 13: - message.channelFlags = reader.uint32(); - break; - case /* lnrpc.CommitmentType commitment_type */ 14: - message.commitmentType = reader.int32(); - break; - case /* bool wants_zero_conf */ 15: - message.wantsZeroConf = reader.bool(); - break; - case /* bool wants_scid_alias */ 16: - message.wantsScidAlias = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelAcceptRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes node_pubkey = 1; */ - if (message.nodePubkey.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); - /* bytes chain_hash = 2; */ - if (message.chainHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.chainHash); - /* bytes pending_chan_id = 3; */ - if (message.pendingChanId.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.pendingChanId); - /* uint64 funding_amt = 4; */ - if (message.fundingAmt !== 0n) - writer.tag(4, WireType.Varint).uint64(message.fundingAmt); - /* uint64 push_amt = 5; */ - if (message.pushAmt !== 0n) - writer.tag(5, WireType.Varint).uint64(message.pushAmt); - /* uint64 dust_limit = 6; */ - if (message.dustLimit !== 0n) - writer.tag(6, WireType.Varint).uint64(message.dustLimit); - /* uint64 max_value_in_flight = 7; */ - if (message.maxValueInFlight !== 0n) - writer.tag(7, WireType.Varint).uint64(message.maxValueInFlight); - /* uint64 channel_reserve = 8; */ - if (message.channelReserve !== 0n) - writer.tag(8, WireType.Varint).uint64(message.channelReserve); - /* uint64 min_htlc = 9; */ - if (message.minHtlc !== 0n) - writer.tag(9, WireType.Varint).uint64(message.minHtlc); - /* uint64 fee_per_kw = 10; */ - if (message.feePerKw !== 0n) - writer.tag(10, WireType.Varint).uint64(message.feePerKw); - /* uint32 csv_delay = 11; */ - if (message.csvDelay !== 0) - writer.tag(11, WireType.Varint).uint32(message.csvDelay); - /* uint32 max_accepted_htlcs = 12; */ - if (message.maxAcceptedHtlcs !== 0) - writer.tag(12, WireType.Varint).uint32(message.maxAcceptedHtlcs); - /* uint32 channel_flags = 13; */ - if (message.channelFlags !== 0) - writer.tag(13, WireType.Varint).uint32(message.channelFlags); - /* lnrpc.CommitmentType commitment_type = 14; */ - if (message.commitmentType !== 0) - writer.tag(14, WireType.Varint).int32(message.commitmentType); - /* bool wants_zero_conf = 15; */ - if (message.wantsZeroConf !== false) - writer.tag(15, WireType.Varint).bool(message.wantsZeroConf); - /* bool wants_scid_alias = 16; */ - if (message.wantsScidAlias !== false) - writer.tag(16, WireType.Varint).bool(message.wantsScidAlias); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelAcceptRequest - */ -export const ChannelAcceptRequest = new ChannelAcceptRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelAcceptResponse$Type extends MessageType { - constructor() { - super("lnrpc.ChannelAcceptResponse", [ - { no: 1, name: "accept", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "upfront_shutdown", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "in_flight_max_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "max_htlc_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 9, name: "min_htlc_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "min_accept_depth", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 11, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ChannelAcceptResponse { - const message = { accept: false, pendingChanId: new Uint8Array(0), error: "", upfrontShutdown: "", csvDelay: 0, reserveSat: 0n, inFlightMaxMsat: 0n, maxHtlcCount: 0, minHtlcIn: 0n, minAcceptDepth: 0, zeroConf: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAcceptResponse): ChannelAcceptResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool accept */ 1: - message.accept = reader.bool(); - break; - case /* bytes pending_chan_id */ 2: - message.pendingChanId = reader.bytes(); - break; - case /* string error */ 3: - message.error = reader.string(); - break; - case /* string upfront_shutdown */ 4: - message.upfrontShutdown = reader.string(); - break; - case /* uint32 csv_delay */ 5: - message.csvDelay = reader.uint32(); - break; - case /* uint64 reserve_sat */ 6: - message.reserveSat = reader.uint64().toBigInt(); - break; - case /* uint64 in_flight_max_msat */ 7: - message.inFlightMaxMsat = reader.uint64().toBigInt(); - break; - case /* uint32 max_htlc_count */ 8: - message.maxHtlcCount = reader.uint32(); - break; - case /* uint64 min_htlc_in */ 9: - message.minHtlcIn = reader.uint64().toBigInt(); - break; - case /* uint32 min_accept_depth */ 10: - message.minAcceptDepth = reader.uint32(); - break; - case /* bool zero_conf */ 11: - message.zeroConf = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelAcceptResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool accept = 1; */ - if (message.accept !== false) - writer.tag(1, WireType.Varint).bool(message.accept); - /* bytes pending_chan_id = 2; */ - if (message.pendingChanId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); - /* string error = 3; */ - if (message.error !== "") - writer.tag(3, WireType.LengthDelimited).string(message.error); - /* string upfront_shutdown = 4; */ - if (message.upfrontShutdown !== "") - writer.tag(4, WireType.LengthDelimited).string(message.upfrontShutdown); - /* uint32 csv_delay = 5; */ - if (message.csvDelay !== 0) - writer.tag(5, WireType.Varint).uint32(message.csvDelay); - /* uint64 reserve_sat = 6; */ - if (message.reserveSat !== 0n) - writer.tag(6, WireType.Varint).uint64(message.reserveSat); - /* uint64 in_flight_max_msat = 7; */ - if (message.inFlightMaxMsat !== 0n) - writer.tag(7, WireType.Varint).uint64(message.inFlightMaxMsat); - /* uint32 max_htlc_count = 8; */ - if (message.maxHtlcCount !== 0) - writer.tag(8, WireType.Varint).uint32(message.maxHtlcCount); - /* uint64 min_htlc_in = 9; */ - if (message.minHtlcIn !== 0n) - writer.tag(9, WireType.Varint).uint64(message.minHtlcIn); - /* uint32 min_accept_depth = 10; */ - if (message.minAcceptDepth !== 0) - writer.tag(10, WireType.Varint).uint32(message.minAcceptDepth); - /* bool zero_conf = 11; */ - if (message.zeroConf !== false) - writer.tag(11, WireType.Varint).bool(message.zeroConf); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelAcceptResponse - */ -export const ChannelAcceptResponse = new ChannelAcceptResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelPoint$Type extends MessageType { - constructor() { - super("lnrpc.ChannelPoint", [ - { no: 1, name: "funding_txid_bytes", kind: "scalar", oneof: "fundingTxid", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "funding_txid_str", kind: "scalar", oneof: "fundingTxid", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): ChannelPoint { - const message = { fundingTxid: { oneofKind: undefined }, outputIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelPoint): ChannelPoint { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes funding_txid_bytes */ 1: - message.fundingTxid = { - oneofKind: "fundingTxidBytes", - fundingTxidBytes: reader.bytes() - }; - break; - case /* string funding_txid_str */ 2: - message.fundingTxid = { - oneofKind: "fundingTxidStr", - fundingTxidStr: reader.string() - }; - break; - case /* uint32 output_index */ 3: - message.outputIndex = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes funding_txid_bytes = 1; */ - if (message.fundingTxid.oneofKind === "fundingTxidBytes") - writer.tag(1, WireType.LengthDelimited).bytes(message.fundingTxid.fundingTxidBytes); - /* string funding_txid_str = 2; */ - if (message.fundingTxid.oneofKind === "fundingTxidStr") - writer.tag(2, WireType.LengthDelimited).string(message.fundingTxid.fundingTxidStr); - /* uint32 output_index = 3; */ - if (message.outputIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.outputIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelPoint - */ -export const ChannelPoint = new ChannelPoint$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class OutPoint$Type extends MessageType { - constructor() { - super("lnrpc.OutPoint", [ - { no: 1, name: "txid_bytes", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "txid_str", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): OutPoint { - const message = { txidBytes: new Uint8Array(0), txidStr: "", outputIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OutPoint): OutPoint { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes txid_bytes */ 1: - message.txidBytes = reader.bytes(); - break; - case /* string txid_str */ 2: - message.txidStr = reader.string(); - break; - case /* uint32 output_index */ 3: - message.outputIndex = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: OutPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes txid_bytes = 1; */ - if (message.txidBytes.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.txidBytes); - /* string txid_str = 2; */ - if (message.txidStr !== "") - writer.tag(2, WireType.LengthDelimited).string(message.txidStr); - /* uint32 output_index = 3; */ - if (message.outputIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.outputIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.OutPoint - */ -export const OutPoint = new OutPoint$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PreviousOutPoint$Type extends MessageType { - constructor() { - super("lnrpc.PreviousOutPoint", [ - { no: 1, name: "outpoint", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "is_our_output", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): PreviousOutPoint { - const message = { outpoint: "", isOurOutput: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PreviousOutPoint): PreviousOutPoint { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string outpoint */ 1: - message.outpoint = reader.string(); - break; - case /* bool is_our_output */ 2: - message.isOurOutput = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PreviousOutPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string outpoint = 1; */ - if (message.outpoint !== "") - writer.tag(1, WireType.LengthDelimited).string(message.outpoint); - /* bool is_our_output = 2; */ - if (message.isOurOutput !== false) - writer.tag(2, WireType.Varint).bool(message.isOurOutput); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PreviousOutPoint - */ -export const PreviousOutPoint = new PreviousOutPoint$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LightningAddress$Type extends MessageType { - constructor() { - super("lnrpc.LightningAddress", [ - { no: 1, name: "pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "host", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): LightningAddress { - const message = { pubkey: "", host: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LightningAddress): LightningAddress { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pubkey */ 1: - message.pubkey = reader.string(); - break; - case /* string host */ 2: - message.host = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LightningAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string pubkey = 1; */ - if (message.pubkey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubkey); - /* string host = 2; */ - if (message.host !== "") - writer.tag(2, WireType.LengthDelimited).string(message.host); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.LightningAddress - */ -export const LightningAddress = new LightningAddress$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class EstimateFeeRequest$Type extends MessageType { - constructor() { - super("lnrpc.EstimateFeeRequest", [ - { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } }, - { no: 2, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): EstimateFeeRequest { - const message = { addrToAmount: {}, targetConf: 0, minConfs: 0, spendUnconfirmed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EstimateFeeRequest): EstimateFeeRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map AddrToAmount = 1 [json_name = "AddrToAmount"];*/ 1: - this.binaryReadMap1(message.addrToAmount, reader, options); - break; - case /* int32 target_conf */ 2: - message.targetConf = reader.int32(); - break; - case /* int32 min_confs */ 3: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 4: - message.spendUnconfirmed = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap1(map: EstimateFeeRequest["addrToAmount"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof EstimateFeeRequest["addrToAmount"] | undefined, val: EstimateFeeRequest["addrToAmount"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.int64().toBigInt(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.EstimateFeeRequest.AddrToAmount"); - } - } - map[key ?? ""] = val ?? 0n; - } - internalBinaryWrite(message: EstimateFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ - for (let k of Object.keys(message.addrToAmount)) - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int64(message.addrToAmount[k]).join(); - /* int32 target_conf = 2; */ - if (message.targetConf !== 0) - writer.tag(2, WireType.Varint).int32(message.targetConf); - /* int32 min_confs = 3; */ - if (message.minConfs !== 0) - writer.tag(3, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 4; */ - if (message.spendUnconfirmed !== false) - writer.tag(4, WireType.Varint).bool(message.spendUnconfirmed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.EstimateFeeRequest - */ -export const EstimateFeeRequest = new EstimateFeeRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class EstimateFeeResponse$Type extends MessageType { - constructor() { - super("lnrpc.EstimateFeeResponse", [ - { no: 1, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "feerate_sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): EstimateFeeResponse { - const message = { feeSat: 0n, feerateSatPerByte: 0n, satPerVbyte: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EstimateFeeResponse): EstimateFeeResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 fee_sat */ 1: - message.feeSat = reader.int64().toBigInt(); - break; - case /* int64 feerate_sat_per_byte = 2 [deprecated = true];*/ 2: - message.feerateSatPerByte = reader.int64().toBigInt(); - break; - case /* uint64 sat_per_vbyte */ 3: - message.satPerVbyte = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: EstimateFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 fee_sat = 1; */ - if (message.feeSat !== 0n) - writer.tag(1, WireType.Varint).int64(message.feeSat); - /* int64 feerate_sat_per_byte = 2 [deprecated = true]; */ - if (message.feerateSatPerByte !== 0n) - writer.tag(2, WireType.Varint).int64(message.feerateSatPerByte); - /* uint64 sat_per_vbyte = 3; */ - if (message.satPerVbyte !== 0n) - writer.tag(3, WireType.Varint).uint64(message.satPerVbyte); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.EstimateFeeResponse - */ -export const EstimateFeeResponse = new EstimateFeeResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendManyRequest$Type extends MessageType { - constructor() { - super("lnrpc.SendManyRequest", [ - { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } }, - { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 8, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): SendManyRequest { - const message = { addrToAmount: {}, targetConf: 0, satPerVbyte: 0n, satPerByte: 0n, label: "", minConfs: 0, spendUnconfirmed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendManyRequest): SendManyRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map AddrToAmount = 1 [json_name = "AddrToAmount"];*/ 1: - this.binaryReadMap1(message.addrToAmount, reader, options); - break; - case /* int32 target_conf */ 3: - message.targetConf = reader.int32(); - break; - case /* uint64 sat_per_vbyte */ 4: - message.satPerVbyte = reader.uint64().toBigInt(); - break; - case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toBigInt(); - break; - case /* string label */ 6: - message.label = reader.string(); - break; - case /* int32 min_confs */ 7: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 8: - message.spendUnconfirmed = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap1(map: SendManyRequest["addrToAmount"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof SendManyRequest["addrToAmount"] | undefined, val: SendManyRequest["addrToAmount"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.int64().toBigInt(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.SendManyRequest.AddrToAmount"); - } - } - map[key ?? ""] = val ?? 0n; - } - internalBinaryWrite(message: SendManyRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ - for (let k of Object.keys(message.addrToAmount)) - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int64(message.addrToAmount[k]).join(); - /* int32 target_conf = 3; */ - if (message.targetConf !== 0) - writer.tag(3, WireType.Varint).int32(message.targetConf); - /* uint64 sat_per_vbyte = 4; */ - if (message.satPerVbyte !== 0n) - writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); - /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== 0n) - writer.tag(5, WireType.Varint).int64(message.satPerByte); - /* string label = 6; */ - if (message.label !== "") - writer.tag(6, WireType.LengthDelimited).string(message.label); - /* int32 min_confs = 7; */ - if (message.minConfs !== 0) - writer.tag(7, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 8; */ - if (message.spendUnconfirmed !== false) - writer.tag(8, WireType.Varint).bool(message.spendUnconfirmed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendManyRequest - */ -export const SendManyRequest = new SendManyRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendManyResponse$Type extends MessageType { - constructor() { - super("lnrpc.SendManyResponse", [ - { no: 1, name: "txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): SendManyResponse { - const message = { txid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendManyResponse): SendManyResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string txid */ 1: - message.txid = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendManyResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string txid = 1; */ - if (message.txid !== "") - writer.tag(1, WireType.LengthDelimited).string(message.txid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendManyResponse - */ -export const SendManyResponse = new SendManyResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendCoinsRequest$Type extends MessageType { - constructor() { - super("lnrpc.SendCoinsRequest", [ - { no: 1, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "send_all", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 7, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 9, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): SendCoinsRequest { - const message = { addr: "", amount: 0n, targetConf: 0, satPerVbyte: 0n, satPerByte: 0n, sendAll: false, label: "", minConfs: 0, spendUnconfirmed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCoinsRequest): SendCoinsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string addr */ 1: - message.addr = reader.string(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toBigInt(); - break; - case /* int32 target_conf */ 3: - message.targetConf = reader.int32(); - break; - case /* uint64 sat_per_vbyte */ 4: - message.satPerVbyte = reader.uint64().toBigInt(); - break; - case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toBigInt(); - break; - case /* bool send_all */ 6: - message.sendAll = reader.bool(); - break; - case /* string label */ 7: - message.label = reader.string(); - break; - case /* int32 min_confs */ 8: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 9: - message.spendUnconfirmed = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendCoinsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string addr = 1; */ - if (message.addr !== "") - writer.tag(1, WireType.LengthDelimited).string(message.addr); - /* int64 amount = 2; */ - if (message.amount !== 0n) - writer.tag(2, WireType.Varint).int64(message.amount); - /* int32 target_conf = 3; */ - if (message.targetConf !== 0) - writer.tag(3, WireType.Varint).int32(message.targetConf); - /* uint64 sat_per_vbyte = 4; */ - if (message.satPerVbyte !== 0n) - writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); - /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== 0n) - writer.tag(5, WireType.Varint).int64(message.satPerByte); - /* bool send_all = 6; */ - if (message.sendAll !== false) - writer.tag(6, WireType.Varint).bool(message.sendAll); - /* string label = 7; */ - if (message.label !== "") - writer.tag(7, WireType.LengthDelimited).string(message.label); - /* int32 min_confs = 8; */ - if (message.minConfs !== 0) - writer.tag(8, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 9; */ - if (message.spendUnconfirmed !== false) - writer.tag(9, WireType.Varint).bool(message.spendUnconfirmed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendCoinsRequest - */ -export const SendCoinsRequest = new SendCoinsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendCoinsResponse$Type extends MessageType { - constructor() { - super("lnrpc.SendCoinsResponse", [ - { no: 1, name: "txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): SendCoinsResponse { - const message = { txid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCoinsResponse): SendCoinsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string txid */ 1: - message.txid = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendCoinsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string txid = 1; */ - if (message.txid !== "") - writer.tag(1, WireType.LengthDelimited).string(message.txid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendCoinsResponse - */ -export const SendCoinsResponse = new SendCoinsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListUnspentRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListUnspentRequest", [ - { no: 1, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "max_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): ListUnspentRequest { - const message = { minConfs: 0, maxConfs: 0, account: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUnspentRequest): ListUnspentRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 min_confs */ 1: - message.minConfs = reader.int32(); - break; - case /* int32 max_confs */ 2: - message.maxConfs = reader.int32(); - break; - case /* string account */ 3: - message.account = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListUnspentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 min_confs = 1; */ - if (message.minConfs !== 0) - writer.tag(1, WireType.Varint).int32(message.minConfs); - /* int32 max_confs = 2; */ - if (message.maxConfs !== 0) - writer.tag(2, WireType.Varint).int32(message.maxConfs); - /* string account = 3; */ - if (message.account !== "") - writer.tag(3, WireType.LengthDelimited).string(message.account); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListUnspentRequest - */ -export const ListUnspentRequest = new ListUnspentRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListUnspentResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListUnspentResponse", [ - { no: 1, name: "utxos", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Utxo } - ]); - } - create(value?: PartialMessage): ListUnspentResponse { - const message = { utxos: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUnspentResponse): ListUnspentResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Utxo utxos */ 1: - message.utxos.push(Utxo.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListUnspentResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.Utxo utxos = 1; */ - for (let i = 0; i < message.utxos.length; i++) - Utxo.internalBinaryWrite(message.utxos[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListUnspentResponse - */ -export const ListUnspentResponse = new ListUnspentResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NewAddressRequest$Type extends MessageType { - constructor() { - super("lnrpc.NewAddressRequest", [ - { no: 1, name: "type", kind: "enum", T: () => ["lnrpc.AddressType", AddressType] }, - { no: 2, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): NewAddressRequest { - const message = { type: 0, account: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NewAddressRequest): NewAddressRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.AddressType type */ 1: - message.type = reader.int32(); - break; - case /* string account */ 2: - message.account = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NewAddressRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.AddressType type = 1; */ - if (message.type !== 0) - writer.tag(1, WireType.Varint).int32(message.type); - /* string account = 2; */ - if (message.account !== "") - writer.tag(2, WireType.LengthDelimited).string(message.account); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NewAddressRequest - */ -export const NewAddressRequest = new NewAddressRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NewAddressResponse$Type extends MessageType { - constructor() { - super("lnrpc.NewAddressResponse", [ - { no: 1, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): NewAddressResponse { - const message = { address: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NewAddressResponse): NewAddressResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string address */ 1: - message.address = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NewAddressResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string address = 1; */ - if (message.address !== "") - writer.tag(1, WireType.LengthDelimited).string(message.address); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NewAddressResponse - */ -export const NewAddressResponse = new NewAddressResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SignMessageRequest$Type extends MessageType { - constructor() { - super("lnrpc.SignMessageRequest", [ - { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "single_hash", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): SignMessageRequest { - const message = { msg: new Uint8Array(0), singleHash: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SignMessageRequest): SignMessageRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes msg */ 1: - message.msg = reader.bytes(); - break; - case /* bool single_hash */ 2: - message.singleHash = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SignMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes msg = 1; */ - if (message.msg.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.msg); - /* bool single_hash = 2; */ - if (message.singleHash !== false) - writer.tag(2, WireType.Varint).bool(message.singleHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SignMessageRequest - */ -export const SignMessageRequest = new SignMessageRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SignMessageResponse$Type extends MessageType { - constructor() { - super("lnrpc.SignMessageResponse", [ - { no: 1, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): SignMessageResponse { - const message = { signature: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SignMessageResponse): SignMessageResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string signature */ 1: - message.signature = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SignMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string signature = 1; */ - if (message.signature !== "") - writer.tag(1, WireType.LengthDelimited).string(message.signature); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SignMessageResponse - */ -export const SignMessageResponse = new SignMessageResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class VerifyMessageRequest$Type extends MessageType { - constructor() { - super("lnrpc.VerifyMessageRequest", [ - { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): VerifyMessageRequest { - const message = { msg: new Uint8Array(0), signature: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyMessageRequest): VerifyMessageRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes msg */ 1: - message.msg = reader.bytes(); - break; - case /* string signature */ 2: - message.signature = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: VerifyMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes msg = 1; */ - if (message.msg.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.msg); - /* string signature = 2; */ - if (message.signature !== "") - writer.tag(2, WireType.LengthDelimited).string(message.signature); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyMessageRequest - */ -export const VerifyMessageRequest = new VerifyMessageRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class VerifyMessageResponse$Type extends MessageType { - constructor() { - super("lnrpc.VerifyMessageResponse", [ - { no: 1, name: "valid", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): VerifyMessageResponse { - const message = { valid: false, pubkey: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyMessageResponse): VerifyMessageResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool valid */ 1: - message.valid = reader.bool(); - break; - case /* string pubkey */ 2: - message.pubkey = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: VerifyMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool valid = 1; */ - if (message.valid !== false) - writer.tag(1, WireType.Varint).bool(message.valid); - /* string pubkey = 2; */ - if (message.pubkey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.pubkey); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyMessageResponse - */ -export const VerifyMessageResponse = new VerifyMessageResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConnectPeerRequest$Type extends MessageType { - constructor() { - super("lnrpc.ConnectPeerRequest", [ - { no: 1, name: "addr", kind: "message", T: () => LightningAddress }, - { no: 2, name: "perm", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "timeout", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): ConnectPeerRequest { - const message = { perm: false, timeout: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConnectPeerRequest): ConnectPeerRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.LightningAddress addr */ 1: - message.addr = LightningAddress.internalBinaryRead(reader, reader.uint32(), options, message.addr); - break; - case /* bool perm */ 2: - message.perm = reader.bool(); - break; - case /* uint64 timeout */ 3: - message.timeout = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ConnectPeerRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.LightningAddress addr = 1; */ - if (message.addr) - LightningAddress.internalBinaryWrite(message.addr, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bool perm = 2; */ - if (message.perm !== false) - writer.tag(2, WireType.Varint).bool(message.perm); - /* uint64 timeout = 3; */ - if (message.timeout !== 0n) - writer.tag(3, WireType.Varint).uint64(message.timeout); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ConnectPeerRequest - */ -export const ConnectPeerRequest = new ConnectPeerRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConnectPeerResponse$Type extends MessageType { - constructor() { - super("lnrpc.ConnectPeerResponse", []); - } - create(value?: PartialMessage): ConnectPeerResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConnectPeerResponse): ConnectPeerResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: ConnectPeerResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ConnectPeerResponse - */ -export const ConnectPeerResponse = new ConnectPeerResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DisconnectPeerRequest$Type extends MessageType { - constructor() { - super("lnrpc.DisconnectPeerRequest", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): DisconnectPeerRequest { - const message = { pubKey: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisconnectPeerRequest): DisconnectPeerRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: DisconnectPeerRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DisconnectPeerRequest - */ -export const DisconnectPeerRequest = new DisconnectPeerRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DisconnectPeerResponse$Type extends MessageType { - constructor() { - super("lnrpc.DisconnectPeerResponse", []); - } - create(value?: PartialMessage): DisconnectPeerResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisconnectPeerResponse): DisconnectPeerResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: DisconnectPeerResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DisconnectPeerResponse - */ -export const DisconnectPeerResponse = new DisconnectPeerResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HTLC$Type extends MessageType { - constructor() { - super("lnrpc.HTLC", [ - { no: 1, name: "incoming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "hash_lock", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "expiration_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "forwarding_channel", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "forwarding_htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): HTLC { - const message = { incoming: false, amount: 0n, hashLock: new Uint8Array(0), expirationHeight: 0, htlcIndex: 0n, forwardingChannel: 0n, forwardingHtlcIndex: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HTLC): HTLC { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool incoming */ 1: - message.incoming = reader.bool(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toBigInt(); - break; - case /* bytes hash_lock */ 3: - message.hashLock = reader.bytes(); - break; - case /* uint32 expiration_height */ 4: - message.expirationHeight = reader.uint32(); - break; - case /* uint64 htlc_index */ 5: - message.htlcIndex = reader.uint64().toBigInt(); - break; - case /* uint64 forwarding_channel */ 6: - message.forwardingChannel = reader.uint64().toBigInt(); - break; - case /* uint64 forwarding_htlc_index */ 7: - message.forwardingHtlcIndex = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: HTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool incoming = 1; */ - if (message.incoming !== false) - writer.tag(1, WireType.Varint).bool(message.incoming); - /* int64 amount = 2; */ - if (message.amount !== 0n) - writer.tag(2, WireType.Varint).int64(message.amount); - /* bytes hash_lock = 3; */ - if (message.hashLock.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.hashLock); - /* uint32 expiration_height = 4; */ - if (message.expirationHeight !== 0) - writer.tag(4, WireType.Varint).uint32(message.expirationHeight); - /* uint64 htlc_index = 5; */ - if (message.htlcIndex !== 0n) - writer.tag(5, WireType.Varint).uint64(message.htlcIndex); - /* uint64 forwarding_channel = 6; */ - if (message.forwardingChannel !== 0n) - writer.tag(6, WireType.Varint).uint64(message.forwardingChannel); - /* uint64 forwarding_htlc_index = 7; */ - if (message.forwardingHtlcIndex !== 0n) - writer.tag(7, WireType.Varint).uint64(message.forwardingHtlcIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.HTLC - */ -export const HTLC = new HTLC$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelConstraints$Type extends MessageType { - constructor() { - super("lnrpc.ChannelConstraints", [ - { no: 1, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "dust_limit_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "max_pending_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "max_accepted_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): ChannelConstraints { - const message = { csvDelay: 0, chanReserveSat: 0n, dustLimitSat: 0n, maxPendingAmtMsat: 0n, minHtlcMsat: 0n, maxAcceptedHtlcs: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelConstraints): ChannelConstraints { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 csv_delay */ 1: - message.csvDelay = reader.uint32(); - break; - case /* uint64 chan_reserve_sat */ 2: - message.chanReserveSat = reader.uint64().toBigInt(); - break; - case /* uint64 dust_limit_sat */ 3: - message.dustLimitSat = reader.uint64().toBigInt(); - break; - case /* uint64 max_pending_amt_msat */ 4: - message.maxPendingAmtMsat = reader.uint64().toBigInt(); - break; - case /* uint64 min_htlc_msat */ 5: - message.minHtlcMsat = reader.uint64().toBigInt(); - break; - case /* uint32 max_accepted_htlcs */ 6: - message.maxAcceptedHtlcs = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelConstraints, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint32 csv_delay = 1; */ - if (message.csvDelay !== 0) - writer.tag(1, WireType.Varint).uint32(message.csvDelay); - /* uint64 chan_reserve_sat = 2; */ - if (message.chanReserveSat !== 0n) - writer.tag(2, WireType.Varint).uint64(message.chanReserveSat); - /* uint64 dust_limit_sat = 3; */ - if (message.dustLimitSat !== 0n) - writer.tag(3, WireType.Varint).uint64(message.dustLimitSat); - /* uint64 max_pending_amt_msat = 4; */ - if (message.maxPendingAmtMsat !== 0n) - writer.tag(4, WireType.Varint).uint64(message.maxPendingAmtMsat); - /* uint64 min_htlc_msat = 5; */ - if (message.minHtlcMsat !== 0n) - writer.tag(5, WireType.Varint).uint64(message.minHtlcMsat); - /* uint32 max_accepted_htlcs = 6; */ - if (message.maxAcceptedHtlcs !== 0) - writer.tag(6, WireType.Varint).uint32(message.maxAcceptedHtlcs); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelConstraints - */ -export const ChannelConstraints = new ChannelConstraints$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Channel$Type extends MessageType { - constructor() { - super("lnrpc.Channel", [ - { no: 1, name: "active", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "remote_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 11, name: "unsettled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "total_satoshis_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 13, name: "total_satoshis_received", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 14, name: "num_updates", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 15, name: "pending_htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLC }, - { no: 16, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 17, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 18, name: "initiator", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 19, name: "chan_status_flags", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 20, name: "local_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 21, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 22, name: "static_remote_key", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 26, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, - { no: 23, name: "lifetime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 24, name: "uptime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 25, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 27, name: "push_amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 28, name: "thaw_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 29, name: "local_constraints", kind: "message", T: () => ChannelConstraints }, - { no: 30, name: "remote_constraints", kind: "message", T: () => ChannelConstraints }, - { no: 31, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 32, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 33, name: "zero_conf_confirmed_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): Channel { - const message = { active: false, remotePubkey: "", channelPoint: "", chanId: "0", capacity: 0n, localBalance: 0n, remoteBalance: 0n, commitFee: 0n, commitWeight: 0n, feePerKw: 0n, unsettledBalance: 0n, totalSatoshisSent: 0n, totalSatoshisReceived: 0n, numUpdates: 0n, pendingHtlcs: [], csvDelay: 0, private: false, initiator: false, chanStatusFlags: "", localChanReserveSat: 0n, remoteChanReserveSat: 0n, staticRemoteKey: false, commitmentType: 0, lifetime: 0n, uptime: 0n, closeAddress: "", pushAmountSat: 0n, thawHeight: 0, aliasScids: [], zeroConf: false, zeroConfConfirmedScid: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Channel): Channel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool active */ 1: - message.active = reader.bool(); - break; - case /* string remote_pubkey */ 2: - message.remotePubkey = reader.string(); - break; - case /* string channel_point */ 3: - message.channelPoint = reader.string(); - break; - case /* uint64 chan_id = 4 [jstype = JS_STRING];*/ 4: - message.chanId = reader.uint64().toString(); - break; - case /* int64 capacity */ 5: - message.capacity = reader.int64().toBigInt(); - break; - case /* int64 local_balance */ 6: - message.localBalance = reader.int64().toBigInt(); - break; - case /* int64 remote_balance */ 7: - message.remoteBalance = reader.int64().toBigInt(); - break; - case /* int64 commit_fee */ 8: - message.commitFee = reader.int64().toBigInt(); - break; - case /* int64 commit_weight */ 9: - message.commitWeight = reader.int64().toBigInt(); - break; - case /* int64 fee_per_kw */ 10: - message.feePerKw = reader.int64().toBigInt(); - break; - case /* int64 unsettled_balance */ 11: - message.unsettledBalance = reader.int64().toBigInt(); - break; - case /* int64 total_satoshis_sent */ 12: - message.totalSatoshisSent = reader.int64().toBigInt(); - break; - case /* int64 total_satoshis_received */ 13: - message.totalSatoshisReceived = reader.int64().toBigInt(); - break; - case /* uint64 num_updates */ 14: - message.numUpdates = reader.uint64().toBigInt(); - break; - case /* repeated lnrpc.HTLC pending_htlcs */ 15: - message.pendingHtlcs.push(HTLC.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint32 csv_delay = 16 [deprecated = true];*/ 16: - message.csvDelay = reader.uint32(); - break; - case /* bool private */ 17: - message.private = reader.bool(); - break; - case /* bool initiator */ 18: - message.initiator = reader.bool(); - break; - case /* string chan_status_flags */ 19: - message.chanStatusFlags = reader.string(); - break; - case /* int64 local_chan_reserve_sat = 20 [deprecated = true];*/ 20: - message.localChanReserveSat = reader.int64().toBigInt(); - break; - case /* int64 remote_chan_reserve_sat = 21 [deprecated = true];*/ 21: - message.remoteChanReserveSat = reader.int64().toBigInt(); - break; - case /* bool static_remote_key = 22 [deprecated = true];*/ 22: - message.staticRemoteKey = reader.bool(); - break; - case /* lnrpc.CommitmentType commitment_type */ 26: - message.commitmentType = reader.int32(); - break; - case /* int64 lifetime */ 23: - message.lifetime = reader.int64().toBigInt(); - break; - case /* int64 uptime */ 24: - message.uptime = reader.int64().toBigInt(); - break; - case /* string close_address */ 25: - message.closeAddress = reader.string(); - break; - case /* uint64 push_amount_sat */ 27: - message.pushAmountSat = reader.uint64().toBigInt(); - break; - case /* uint32 thaw_height */ 28: - message.thawHeight = reader.uint32(); - break; - case /* lnrpc.ChannelConstraints local_constraints */ 29: - message.localConstraints = ChannelConstraints.internalBinaryRead(reader, reader.uint32(), options, message.localConstraints); - break; - case /* lnrpc.ChannelConstraints remote_constraints */ 30: - message.remoteConstraints = ChannelConstraints.internalBinaryRead(reader, reader.uint32(), options, message.remoteConstraints); - break; - case /* repeated uint64 alias_scids */ 31: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.aliasScids.push(reader.uint64().toBigInt()); - else - message.aliasScids.push(reader.uint64().toBigInt()); - break; - case /* bool zero_conf */ 32: - message.zeroConf = reader.bool(); - break; - case /* uint64 zero_conf_confirmed_scid */ 33: - message.zeroConfConfirmedScid = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Channel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool active = 1; */ - if (message.active !== false) - writer.tag(1, WireType.Varint).bool(message.active); - /* string remote_pubkey = 2; */ - if (message.remotePubkey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.remotePubkey); - /* string channel_point = 3; */ - if (message.channelPoint !== "") - writer.tag(3, WireType.LengthDelimited).string(message.channelPoint); - /* uint64 chan_id = 4 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(4, WireType.Varint).uint64(message.chanId); - /* int64 capacity = 5; */ - if (message.capacity !== 0n) - writer.tag(5, WireType.Varint).int64(message.capacity); - /* int64 local_balance = 6; */ - if (message.localBalance !== 0n) - writer.tag(6, WireType.Varint).int64(message.localBalance); - /* int64 remote_balance = 7; */ - if (message.remoteBalance !== 0n) - writer.tag(7, WireType.Varint).int64(message.remoteBalance); - /* int64 commit_fee = 8; */ - if (message.commitFee !== 0n) - writer.tag(8, WireType.Varint).int64(message.commitFee); - /* int64 commit_weight = 9; */ - if (message.commitWeight !== 0n) - writer.tag(9, WireType.Varint).int64(message.commitWeight); - /* int64 fee_per_kw = 10; */ - if (message.feePerKw !== 0n) - writer.tag(10, WireType.Varint).int64(message.feePerKw); - /* int64 unsettled_balance = 11; */ - if (message.unsettledBalance !== 0n) - writer.tag(11, WireType.Varint).int64(message.unsettledBalance); - /* int64 total_satoshis_sent = 12; */ - if (message.totalSatoshisSent !== 0n) - writer.tag(12, WireType.Varint).int64(message.totalSatoshisSent); - /* int64 total_satoshis_received = 13; */ - if (message.totalSatoshisReceived !== 0n) - writer.tag(13, WireType.Varint).int64(message.totalSatoshisReceived); - /* uint64 num_updates = 14; */ - if (message.numUpdates !== 0n) - writer.tag(14, WireType.Varint).uint64(message.numUpdates); - /* repeated lnrpc.HTLC pending_htlcs = 15; */ - for (let i = 0; i < message.pendingHtlcs.length; i++) - HTLC.internalBinaryWrite(message.pendingHtlcs[i], writer.tag(15, WireType.LengthDelimited).fork(), options).join(); - /* uint32 csv_delay = 16 [deprecated = true]; */ - if (message.csvDelay !== 0) - writer.tag(16, WireType.Varint).uint32(message.csvDelay); - /* bool private = 17; */ - if (message.private !== false) - writer.tag(17, WireType.Varint).bool(message.private); - /* bool initiator = 18; */ - if (message.initiator !== false) - writer.tag(18, WireType.Varint).bool(message.initiator); - /* string chan_status_flags = 19; */ - if (message.chanStatusFlags !== "") - writer.tag(19, WireType.LengthDelimited).string(message.chanStatusFlags); - /* int64 local_chan_reserve_sat = 20 [deprecated = true]; */ - if (message.localChanReserveSat !== 0n) - writer.tag(20, WireType.Varint).int64(message.localChanReserveSat); - /* int64 remote_chan_reserve_sat = 21 [deprecated = true]; */ - if (message.remoteChanReserveSat !== 0n) - writer.tag(21, WireType.Varint).int64(message.remoteChanReserveSat); - /* bool static_remote_key = 22 [deprecated = true]; */ - if (message.staticRemoteKey !== false) - writer.tag(22, WireType.Varint).bool(message.staticRemoteKey); - /* lnrpc.CommitmentType commitment_type = 26; */ - if (message.commitmentType !== 0) - writer.tag(26, WireType.Varint).int32(message.commitmentType); - /* int64 lifetime = 23; */ - if (message.lifetime !== 0n) - writer.tag(23, WireType.Varint).int64(message.lifetime); - /* int64 uptime = 24; */ - if (message.uptime !== 0n) - writer.tag(24, WireType.Varint).int64(message.uptime); - /* string close_address = 25; */ - if (message.closeAddress !== "") - writer.tag(25, WireType.LengthDelimited).string(message.closeAddress); - /* uint64 push_amount_sat = 27; */ - if (message.pushAmountSat !== 0n) - writer.tag(27, WireType.Varint).uint64(message.pushAmountSat); - /* uint32 thaw_height = 28; */ - if (message.thawHeight !== 0) - writer.tag(28, WireType.Varint).uint32(message.thawHeight); - /* lnrpc.ChannelConstraints local_constraints = 29; */ - if (message.localConstraints) - ChannelConstraints.internalBinaryWrite(message.localConstraints, writer.tag(29, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelConstraints remote_constraints = 30; */ - if (message.remoteConstraints) - ChannelConstraints.internalBinaryWrite(message.remoteConstraints, writer.tag(30, WireType.LengthDelimited).fork(), options).join(); - /* repeated uint64 alias_scids = 31; */ - if (message.aliasScids.length) { - writer.tag(31, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.aliasScids.length; i++) - writer.uint64(message.aliasScids[i]); - writer.join(); - } - /* bool zero_conf = 32; */ - if (message.zeroConf !== false) - writer.tag(32, WireType.Varint).bool(message.zeroConf); - /* uint64 zero_conf_confirmed_scid = 33; */ - if (message.zeroConfConfirmedScid !== 0n) - writer.tag(33, WireType.Varint).uint64(message.zeroConfConfirmedScid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Channel - */ -export const Channel = new Channel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListChannelsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListChannelsRequest", [ - { no: 1, name: "active_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "inactive_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "public_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "private_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): ListChannelsRequest { - const message = { activeOnly: false, inactiveOnly: false, publicOnly: false, privateOnly: false, peer: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChannelsRequest): ListChannelsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool active_only */ 1: - message.activeOnly = reader.bool(); - break; - case /* bool inactive_only */ 2: - message.inactiveOnly = reader.bool(); - break; - case /* bool public_only */ 3: - message.publicOnly = reader.bool(); - break; - case /* bool private_only */ 4: - message.privateOnly = reader.bool(); - break; - case /* bytes peer */ 5: - message.peer = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool active_only = 1; */ - if (message.activeOnly !== false) - writer.tag(1, WireType.Varint).bool(message.activeOnly); - /* bool inactive_only = 2; */ - if (message.inactiveOnly !== false) - writer.tag(2, WireType.Varint).bool(message.inactiveOnly); - /* bool public_only = 3; */ - if (message.publicOnly !== false) - writer.tag(3, WireType.Varint).bool(message.publicOnly); - /* bool private_only = 4; */ - if (message.privateOnly !== false) - writer.tag(4, WireType.Varint).bool(message.privateOnly); - /* bytes peer = 5; */ - if (message.peer.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.peer); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListChannelsRequest - */ -export const ListChannelsRequest = new ListChannelsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListChannelsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListChannelsResponse", [ - { no: 11, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Channel } - ]); - } - create(value?: PartialMessage): ListChannelsResponse { - const message = { channels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChannelsResponse): ListChannelsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Channel channels */ 11: - message.channels.push(Channel.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.Channel channels = 11; */ - for (let i = 0; i < message.channels.length; i++) - Channel.internalBinaryWrite(message.channels[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListChannelsResponse - */ -export const ListChannelsResponse = new ListChannelsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AliasMap$Type extends MessageType { - constructor() { - super("lnrpc.AliasMap", [ - { no: 1, name: "base_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "aliases", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): AliasMap { - const message = { baseScid: 0n, aliases: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AliasMap): AliasMap { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 base_scid */ 1: - message.baseScid = reader.uint64().toBigInt(); - break; - case /* repeated uint64 aliases */ 2: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.aliases.push(reader.uint64().toBigInt()); - else - message.aliases.push(reader.uint64().toBigInt()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AliasMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 base_scid = 1; */ - if (message.baseScid !== 0n) - writer.tag(1, WireType.Varint).uint64(message.baseScid); - /* repeated uint64 aliases = 2; */ - if (message.aliases.length) { - writer.tag(2, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.aliases.length; i++) - writer.uint64(message.aliases[i]); - writer.join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AliasMap - */ -export const AliasMap = new AliasMap$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListAliasesRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListAliasesRequest", []); - } - create(value?: PartialMessage): ListAliasesRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesRequest): ListAliasesRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: ListAliasesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListAliasesRequest - */ -export const ListAliasesRequest = new ListAliasesRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListAliasesResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListAliasesResponse", [ - { no: 1, name: "alias_maps", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => AliasMap } - ]); - } - create(value?: PartialMessage): ListAliasesResponse { - const message = { aliasMaps: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesResponse): ListAliasesResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.AliasMap alias_maps */ 1: - message.aliasMaps.push(AliasMap.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListAliasesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.AliasMap alias_maps = 1; */ - for (let i = 0; i < message.aliasMaps.length; i++) - AliasMap.internalBinaryWrite(message.aliasMaps[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListAliasesResponse - */ -export const ListAliasesResponse = new ListAliasesResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelCloseSummary$Type extends MessageType { - constructor() { - super("lnrpc.ChannelCloseSummary", [ - { no: 1, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "chain_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "closing_tx_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "remote_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "close_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 8, name: "settled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "time_locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "close_type", kind: "enum", T: () => ["lnrpc.ChannelCloseSummary.ClosureType", ChannelCloseSummary_ClosureType] }, - { no: 11, name: "open_initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, - { no: 12, name: "close_initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, - { no: 13, name: "resolutions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Resolution }, - { no: 14, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 15, name: "zero_conf_confirmed_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } - ]); - } - create(value?: PartialMessage): ChannelCloseSummary { - const message = { channelPoint: "", chanId: "0", chainHash: "", closingTxHash: "", remotePubkey: "", capacity: 0n, closeHeight: 0, settledBalance: 0n, timeLockedBalance: 0n, closeType: 0, openInitiator: 0, closeInitiator: 0, resolutions: [], aliasScids: [], zeroConfConfirmedScid: "0" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelCloseSummary): ChannelCloseSummary { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string channel_point */ 1: - message.channelPoint = reader.string(); - break; - case /* uint64 chan_id = 2 [jstype = JS_STRING];*/ 2: - message.chanId = reader.uint64().toString(); - break; - case /* string chain_hash */ 3: - message.chainHash = reader.string(); - break; - case /* string closing_tx_hash */ 4: - message.closingTxHash = reader.string(); - break; - case /* string remote_pubkey */ 5: - message.remotePubkey = reader.string(); - break; - case /* int64 capacity */ 6: - message.capacity = reader.int64().toBigInt(); - break; - case /* uint32 close_height */ 7: - message.closeHeight = reader.uint32(); - break; - case /* int64 settled_balance */ 8: - message.settledBalance = reader.int64().toBigInt(); - break; - case /* int64 time_locked_balance */ 9: - message.timeLockedBalance = reader.int64().toBigInt(); - break; - case /* lnrpc.ChannelCloseSummary.ClosureType close_type */ 10: - message.closeType = reader.int32(); - break; - case /* lnrpc.Initiator open_initiator */ 11: - message.openInitiator = reader.int32(); - break; - case /* lnrpc.Initiator close_initiator */ 12: - message.closeInitiator = reader.int32(); - break; - case /* repeated lnrpc.Resolution resolutions */ 13: - message.resolutions.push(Resolution.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated uint64 alias_scids */ 14: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.aliasScids.push(reader.uint64().toBigInt()); - else - message.aliasScids.push(reader.uint64().toBigInt()); - break; - case /* uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING];*/ 15: - message.zeroConfConfirmedScid = reader.uint64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelCloseSummary, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string channel_point = 1; */ - if (message.channelPoint !== "") - writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); - /* uint64 chan_id = 2 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(2, WireType.Varint).uint64(message.chanId); - /* string chain_hash = 3; */ - if (message.chainHash !== "") - writer.tag(3, WireType.LengthDelimited).string(message.chainHash); - /* string closing_tx_hash = 4; */ - if (message.closingTxHash !== "") - writer.tag(4, WireType.LengthDelimited).string(message.closingTxHash); - /* string remote_pubkey = 5; */ - if (message.remotePubkey !== "") - writer.tag(5, WireType.LengthDelimited).string(message.remotePubkey); - /* int64 capacity = 6; */ - if (message.capacity !== 0n) - writer.tag(6, WireType.Varint).int64(message.capacity); - /* uint32 close_height = 7; */ - if (message.closeHeight !== 0) - writer.tag(7, WireType.Varint).uint32(message.closeHeight); - /* int64 settled_balance = 8; */ - if (message.settledBalance !== 0n) - writer.tag(8, WireType.Varint).int64(message.settledBalance); - /* int64 time_locked_balance = 9; */ - if (message.timeLockedBalance !== 0n) - writer.tag(9, WireType.Varint).int64(message.timeLockedBalance); - /* lnrpc.ChannelCloseSummary.ClosureType close_type = 10; */ - if (message.closeType !== 0) - writer.tag(10, WireType.Varint).int32(message.closeType); - /* lnrpc.Initiator open_initiator = 11; */ - if (message.openInitiator !== 0) - writer.tag(11, WireType.Varint).int32(message.openInitiator); - /* lnrpc.Initiator close_initiator = 12; */ - if (message.closeInitiator !== 0) - writer.tag(12, WireType.Varint).int32(message.closeInitiator); - /* repeated lnrpc.Resolution resolutions = 13; */ - for (let i = 0; i < message.resolutions.length; i++) - Resolution.internalBinaryWrite(message.resolutions[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join(); - /* repeated uint64 alias_scids = 14; */ - if (message.aliasScids.length) { - writer.tag(14, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.aliasScids.length; i++) - writer.uint64(message.aliasScids[i]); - writer.join(); - } - /* uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; */ - if (message.zeroConfConfirmedScid !== "0") - writer.tag(15, WireType.Varint).uint64(message.zeroConfConfirmedScid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelCloseSummary - */ -export const ChannelCloseSummary = new ChannelCloseSummary$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Resolution$Type extends MessageType { - constructor() { - super("lnrpc.Resolution", [ - { no: 1, name: "resolution_type", kind: "enum", T: () => ["lnrpc.ResolutionType", ResolutionType] }, - { no: 2, name: "outcome", kind: "enum", T: () => ["lnrpc.ResolutionOutcome", ResolutionOutcome] }, - { no: 3, name: "outpoint", kind: "message", T: () => OutPoint }, - { no: 4, name: "amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "sweep_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): Resolution { - const message = { resolutionType: 0, outcome: 0, amountSat: 0n, sweepTxid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Resolution): Resolution { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ResolutionType resolution_type */ 1: - message.resolutionType = reader.int32(); - break; - case /* lnrpc.ResolutionOutcome outcome */ 2: - message.outcome = reader.int32(); - break; - case /* lnrpc.OutPoint outpoint */ 3: - message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); - break; - case /* uint64 amount_sat */ 4: - message.amountSat = reader.uint64().toBigInt(); - break; - case /* string sweep_txid */ 5: - message.sweepTxid = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Resolution, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ResolutionType resolution_type = 1; */ - if (message.resolutionType !== 0) - writer.tag(1, WireType.Varint).int32(message.resolutionType); - /* lnrpc.ResolutionOutcome outcome = 2; */ - if (message.outcome !== 0) - writer.tag(2, WireType.Varint).int32(message.outcome); - /* lnrpc.OutPoint outpoint = 3; */ - if (message.outpoint) - OutPoint.internalBinaryWrite(message.outpoint, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* uint64 amount_sat = 4; */ - if (message.amountSat !== 0n) - writer.tag(4, WireType.Varint).uint64(message.amountSat); - /* string sweep_txid = 5; */ - if (message.sweepTxid !== "") - writer.tag(5, WireType.LengthDelimited).string(message.sweepTxid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Resolution - */ -export const Resolution = new Resolution$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ClosedChannelsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ClosedChannelsRequest", [ - { no: 1, name: "cooperative", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "local_force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "remote_force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "breach", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "funding_canceled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "abandoned", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ClosedChannelsRequest { - const message = { cooperative: false, localForce: false, remoteForce: false, breach: false, fundingCanceled: false, abandoned: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelsRequest): ClosedChannelsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool cooperative */ 1: - message.cooperative = reader.bool(); - break; - case /* bool local_force */ 2: - message.localForce = reader.bool(); - break; - case /* bool remote_force */ 3: - message.remoteForce = reader.bool(); - break; - case /* bool breach */ 4: - message.breach = reader.bool(); - break; - case /* bool funding_canceled */ 5: - message.fundingCanceled = reader.bool(); - break; - case /* bool abandoned */ 6: - message.abandoned = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ClosedChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool cooperative = 1; */ - if (message.cooperative !== false) - writer.tag(1, WireType.Varint).bool(message.cooperative); - /* bool local_force = 2; */ - if (message.localForce !== false) - writer.tag(2, WireType.Varint).bool(message.localForce); - /* bool remote_force = 3; */ - if (message.remoteForce !== false) - writer.tag(3, WireType.Varint).bool(message.remoteForce); - /* bool breach = 4; */ - if (message.breach !== false) - writer.tag(4, WireType.Varint).bool(message.breach); - /* bool funding_canceled = 5; */ - if (message.fundingCanceled !== false) - writer.tag(5, WireType.Varint).bool(message.fundingCanceled); - /* bool abandoned = 6; */ - if (message.abandoned !== false) - writer.tag(6, WireType.Varint).bool(message.abandoned); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ClosedChannelsRequest - */ -export const ClosedChannelsRequest = new ClosedChannelsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ClosedChannelsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ClosedChannelsResponse", [ - { no: 1, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelCloseSummary } - ]); - } - create(value?: PartialMessage): ClosedChannelsResponse { - const message = { channels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelsResponse): ClosedChannelsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelCloseSummary channels */ 1: - message.channels.push(ChannelCloseSummary.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ClosedChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.ChannelCloseSummary channels = 1; */ - for (let i = 0; i < message.channels.length; i++) - ChannelCloseSummary.internalBinaryWrite(message.channels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ClosedChannelsResponse - */ -export const ClosedChannelsResponse = new ClosedChannelsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Peer$Type extends MessageType { - constructor() { - super("lnrpc.Peer", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "bytes_sent", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "bytes_recv", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "sat_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "sat_recv", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "inbound", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "ping_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "sync_type", kind: "enum", T: () => ["lnrpc.Peer.SyncType", Peer_SyncType] }, - { no: 11, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, - { no: 12, name: "errors", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => TimestampedError }, - { no: 13, name: "flap_count", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 14, name: "last_flap_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 15, name: "last_ping_payload", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): Peer { - const message = { pubKey: "", address: "", bytesSent: 0n, bytesRecv: 0n, satSent: 0n, satRecv: 0n, inbound: false, pingTime: 0n, syncType: 0, features: {}, errors: [], flapCount: 0, lastFlapNs: 0n, lastPingPayload: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Peer): Peer { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* string address */ 3: - message.address = reader.string(); - break; - case /* uint64 bytes_sent */ 4: - message.bytesSent = reader.uint64().toBigInt(); - break; - case /* uint64 bytes_recv */ 5: - message.bytesRecv = reader.uint64().toBigInt(); - break; - case /* int64 sat_sent */ 6: - message.satSent = reader.int64().toBigInt(); - break; - case /* int64 sat_recv */ 7: - message.satRecv = reader.int64().toBigInt(); - break; - case /* bool inbound */ 8: - message.inbound = reader.bool(); - break; - case /* int64 ping_time */ 9: - message.pingTime = reader.int64().toBigInt(); - break; - case /* lnrpc.Peer.SyncType sync_type */ 10: - message.syncType = reader.int32(); - break; - case /* map features */ 11: - this.binaryReadMap11(message.features, reader, options); - break; - case /* repeated lnrpc.TimestampedError errors */ 12: - message.errors.push(TimestampedError.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* int32 flap_count */ 13: - message.flapCount = reader.int32(); - break; - case /* int64 last_flap_ns */ 14: - message.lastFlapNs = reader.int64().toBigInt(); - break; - case /* bytes last_ping_payload */ 15: - message.lastPingPayload = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap11(map: Peer["features"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof Peer["features"] | undefined, val: Peer["features"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.Peer.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message: Peer, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* string address = 3; */ - if (message.address !== "") - writer.tag(3, WireType.LengthDelimited).string(message.address); - /* uint64 bytes_sent = 4; */ - if (message.bytesSent !== 0n) - writer.tag(4, WireType.Varint).uint64(message.bytesSent); - /* uint64 bytes_recv = 5; */ - if (message.bytesRecv !== 0n) - writer.tag(5, WireType.Varint).uint64(message.bytesRecv); - /* int64 sat_sent = 6; */ - if (message.satSent !== 0n) - writer.tag(6, WireType.Varint).int64(message.satSent); - /* int64 sat_recv = 7; */ - if (message.satRecv !== 0n) - writer.tag(7, WireType.Varint).int64(message.satRecv); - /* bool inbound = 8; */ - if (message.inbound !== false) - writer.tag(8, WireType.Varint).bool(message.inbound); - /* int64 ping_time = 9; */ - if (message.pingTime !== 0n) - writer.tag(9, WireType.Varint).int64(message.pingTime); - /* lnrpc.Peer.SyncType sync_type = 10; */ - if (message.syncType !== 0) - writer.tag(10, WireType.Varint).int32(message.syncType); - /* map features = 11; */ - for (let k of Object.keys(message.features)) { - writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k as any], writer, options); - writer.join().join(); - } - /* repeated lnrpc.TimestampedError errors = 12; */ - for (let i = 0; i < message.errors.length; i++) - TimestampedError.internalBinaryWrite(message.errors[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); - /* int32 flap_count = 13; */ - if (message.flapCount !== 0) - writer.tag(13, WireType.Varint).int32(message.flapCount); - /* int64 last_flap_ns = 14; */ - if (message.lastFlapNs !== 0n) - writer.tag(14, WireType.Varint).int64(message.lastFlapNs); - /* bytes last_ping_payload = 15; */ - if (message.lastPingPayload.length) - writer.tag(15, WireType.LengthDelimited).bytes(message.lastPingPayload); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Peer - */ -export const Peer = new Peer$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class TimestampedError$Type extends MessageType { - constructor() { - super("lnrpc.TimestampedError", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): TimestampedError { - const message = { timestamp: 0n, error: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TimestampedError): TimestampedError { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 timestamp */ 1: - message.timestamp = reader.uint64().toBigInt(); - break; - case /* string error */ 2: - message.error = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: TimestampedError, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 timestamp = 1; */ - if (message.timestamp !== 0n) - writer.tag(1, WireType.Varint).uint64(message.timestamp); - /* string error = 2; */ - if (message.error !== "") - writer.tag(2, WireType.LengthDelimited).string(message.error); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.TimestampedError - */ -export const TimestampedError = new TimestampedError$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPeersRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListPeersRequest", [ - { no: 1, name: "latest_error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ListPeersRequest { - const message = { latestError: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPeersRequest): ListPeersRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool latest_error */ 1: - message.latestError = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListPeersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool latest_error = 1; */ - if (message.latestError !== false) - writer.tag(1, WireType.Varint).bool(message.latestError); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPeersRequest - */ -export const ListPeersRequest = new ListPeersRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPeersResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListPeersResponse", [ - { no: 1, name: "peers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Peer } - ]); - } - create(value?: PartialMessage): ListPeersResponse { - const message = { peers: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPeersResponse): ListPeersResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Peer peers */ 1: - message.peers.push(Peer.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListPeersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.Peer peers = 1; */ - for (let i = 0; i < message.peers.length; i++) - Peer.internalBinaryWrite(message.peers[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPeersResponse - */ -export const ListPeersResponse = new ListPeersResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeerEventSubscription$Type extends MessageType { - constructor() { - super("lnrpc.PeerEventSubscription", []); - } - create(value?: PartialMessage): PeerEventSubscription { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeerEventSubscription): PeerEventSubscription { - return target ?? this.create(); - } - internalBinaryWrite(message: PeerEventSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PeerEventSubscription - */ -export const PeerEventSubscription = new PeerEventSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeerEvent$Type extends MessageType { - constructor() { - super("lnrpc.PeerEvent", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "type", kind: "enum", T: () => ["lnrpc.PeerEvent.EventType", PeerEvent_EventType] } - ]); - } - create(value?: PartialMessage): PeerEvent { - const message = { pubKey: "", type: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeerEvent): PeerEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* lnrpc.PeerEvent.EventType type */ 2: - message.type = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PeerEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* lnrpc.PeerEvent.EventType type = 2; */ - if (message.type !== 0) - writer.tag(2, WireType.Varint).int32(message.type); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PeerEvent - */ -export const PeerEvent = new PeerEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.GetInfoRequest", []); - } - create(value?: PartialMessage): GetInfoRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetInfoRequest): GetInfoRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: GetInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetInfoRequest - */ -export const GetInfoRequest = new GetInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetInfoResponse$Type extends MessageType { - constructor() { - super("lnrpc.GetInfoResponse", [ - { no: 14, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 20, name: "commit_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 1, name: "identity_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 17, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "num_pending_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "num_active_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 15, name: "num_inactive_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "num_peers", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "block_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 8, name: "block_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "best_header_timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "synced_to_chain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 18, name: "synced_to_graph", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 10, name: "testnet", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 16, name: "chains", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Chain }, - { no: 12, name: "uris", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 19, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, - { no: 21, name: "require_htlc_interceptor", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): GetInfoResponse { - const message = { version: "", commitHash: "", identityPubkey: "", alias: "", color: "", numPendingChannels: 0, numActiveChannels: 0, numInactiveChannels: 0, numPeers: 0, blockHeight: 0, blockHash: "", bestHeaderTimestamp: 0n, syncedToChain: false, syncedToGraph: false, testnet: false, chains: [], uris: [], features: {}, requireHtlcInterceptor: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetInfoResponse): GetInfoResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string version */ 14: - message.version = reader.string(); - break; - case /* string commit_hash */ 20: - message.commitHash = reader.string(); - break; - case /* string identity_pubkey */ 1: - message.identityPubkey = reader.string(); - break; - case /* string alias */ 2: - message.alias = reader.string(); - break; - case /* string color */ 17: - message.color = reader.string(); - break; - case /* uint32 num_pending_channels */ 3: - message.numPendingChannels = reader.uint32(); - break; - case /* uint32 num_active_channels */ 4: - message.numActiveChannels = reader.uint32(); - break; - case /* uint32 num_inactive_channels */ 15: - message.numInactiveChannels = reader.uint32(); - break; - case /* uint32 num_peers */ 5: - message.numPeers = reader.uint32(); - break; - case /* uint32 block_height */ 6: - message.blockHeight = reader.uint32(); - break; - case /* string block_hash */ 8: - message.blockHash = reader.string(); - break; - case /* int64 best_header_timestamp */ 13: - message.bestHeaderTimestamp = reader.int64().toBigInt(); - break; - case /* bool synced_to_chain */ 9: - message.syncedToChain = reader.bool(); - break; - case /* bool synced_to_graph */ 18: - message.syncedToGraph = reader.bool(); - break; - case /* bool testnet = 10 [deprecated = true];*/ 10: - message.testnet = reader.bool(); - break; - case /* repeated lnrpc.Chain chains */ 16: - message.chains.push(Chain.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated string uris */ 12: - message.uris.push(reader.string()); - break; - case /* map features */ 19: - this.binaryReadMap19(message.features, reader, options); - break; - case /* bool require_htlc_interceptor */ 21: - message.requireHtlcInterceptor = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap19(map: GetInfoResponse["features"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof GetInfoResponse["features"] | undefined, val: GetInfoResponse["features"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.GetInfoResponse.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message: GetInfoResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string version = 14; */ - if (message.version !== "") - writer.tag(14, WireType.LengthDelimited).string(message.version); - /* string commit_hash = 20; */ - if (message.commitHash !== "") - writer.tag(20, WireType.LengthDelimited).string(message.commitHash); - /* string identity_pubkey = 1; */ - if (message.identityPubkey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.identityPubkey); - /* string alias = 2; */ - if (message.alias !== "") - writer.tag(2, WireType.LengthDelimited).string(message.alias); - /* string color = 17; */ - if (message.color !== "") - writer.tag(17, WireType.LengthDelimited).string(message.color); - /* uint32 num_pending_channels = 3; */ - if (message.numPendingChannels !== 0) - writer.tag(3, WireType.Varint).uint32(message.numPendingChannels); - /* uint32 num_active_channels = 4; */ - if (message.numActiveChannels !== 0) - writer.tag(4, WireType.Varint).uint32(message.numActiveChannels); - /* uint32 num_inactive_channels = 15; */ - if (message.numInactiveChannels !== 0) - writer.tag(15, WireType.Varint).uint32(message.numInactiveChannels); - /* uint32 num_peers = 5; */ - if (message.numPeers !== 0) - writer.tag(5, WireType.Varint).uint32(message.numPeers); - /* uint32 block_height = 6; */ - if (message.blockHeight !== 0) - writer.tag(6, WireType.Varint).uint32(message.blockHeight); - /* string block_hash = 8; */ - if (message.blockHash !== "") - writer.tag(8, WireType.LengthDelimited).string(message.blockHash); - /* int64 best_header_timestamp = 13; */ - if (message.bestHeaderTimestamp !== 0n) - writer.tag(13, WireType.Varint).int64(message.bestHeaderTimestamp); - /* bool synced_to_chain = 9; */ - if (message.syncedToChain !== false) - writer.tag(9, WireType.Varint).bool(message.syncedToChain); - /* bool synced_to_graph = 18; */ - if (message.syncedToGraph !== false) - writer.tag(18, WireType.Varint).bool(message.syncedToGraph); - /* bool testnet = 10 [deprecated = true]; */ - if (message.testnet !== false) - writer.tag(10, WireType.Varint).bool(message.testnet); - /* repeated lnrpc.Chain chains = 16; */ - for (let i = 0; i < message.chains.length; i++) - Chain.internalBinaryWrite(message.chains[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join(); - /* repeated string uris = 12; */ - for (let i = 0; i < message.uris.length; i++) - writer.tag(12, WireType.LengthDelimited).string(message.uris[i]); - /* map features = 19; */ - for (let k of Object.keys(message.features)) { - writer.tag(19, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k as any], writer, options); - writer.join().join(); - } - /* bool require_htlc_interceptor = 21; */ - if (message.requireHtlcInterceptor !== false) - writer.tag(21, WireType.Varint).bool(message.requireHtlcInterceptor); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetInfoResponse - */ -export const GetInfoResponse = new GetInfoResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetRecoveryInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.GetRecoveryInfoRequest", []); - } - create(value?: PartialMessage): GetRecoveryInfoRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRecoveryInfoRequest): GetRecoveryInfoRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: GetRecoveryInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoRequest - */ -export const GetRecoveryInfoRequest = new GetRecoveryInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetRecoveryInfoResponse$Type extends MessageType { - constructor() { - super("lnrpc.GetRecoveryInfoResponse", [ - { no: 1, name: "recovery_mode", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "recovery_finished", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "progress", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value?: PartialMessage): GetRecoveryInfoResponse { - const message = { recoveryMode: false, recoveryFinished: false, progress: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRecoveryInfoResponse): GetRecoveryInfoResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool recovery_mode */ 1: - message.recoveryMode = reader.bool(); - break; - case /* bool recovery_finished */ 2: - message.recoveryFinished = reader.bool(); - break; - case /* double progress */ 3: - message.progress = reader.double(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetRecoveryInfoResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool recovery_mode = 1; */ - if (message.recoveryMode !== false) - writer.tag(1, WireType.Varint).bool(message.recoveryMode); - /* bool recovery_finished = 2; */ - if (message.recoveryFinished !== false) - writer.tag(2, WireType.Varint).bool(message.recoveryFinished); - /* double progress = 3; */ - if (message.progress !== 0) - writer.tag(3, WireType.Bit64).double(message.progress); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoResponse - */ -export const GetRecoveryInfoResponse = new GetRecoveryInfoResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Chain$Type extends MessageType { - constructor() { - super("lnrpc.Chain", [ - { no: 1, name: "chain", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "network", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): Chain { - const message = { chain: "", network: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Chain): Chain { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string chain */ 1: - message.chain = reader.string(); - break; - case /* string network */ 2: - message.network = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Chain, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string chain = 1; */ - if (message.chain !== "") - writer.tag(1, WireType.LengthDelimited).string(message.chain); - /* string network = 2; */ - if (message.network !== "") - writer.tag(2, WireType.LengthDelimited).string(message.network); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Chain - */ -export const Chain = new Chain$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConfirmationUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ConfirmationUpdate", [ - { no: 1, name: "block_sha", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "block_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "num_confs_left", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): ConfirmationUpdate { - const message = { blockSha: new Uint8Array(0), blockHeight: 0, numConfsLeft: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfirmationUpdate): ConfirmationUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes block_sha */ 1: - message.blockSha = reader.bytes(); - break; - case /* int32 block_height */ 2: - message.blockHeight = reader.int32(); - break; - case /* uint32 num_confs_left */ 3: - message.numConfsLeft = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ConfirmationUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes block_sha = 1; */ - if (message.blockSha.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.blockSha); - /* int32 block_height = 2; */ - if (message.blockHeight !== 0) - writer.tag(2, WireType.Varint).int32(message.blockHeight); - /* uint32 num_confs_left = 3; */ - if (message.numConfsLeft !== 0) - writer.tag(3, WireType.Varint).uint32(message.numConfsLeft); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ConfirmationUpdate - */ -export const ConfirmationUpdate = new ConfirmationUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelOpenUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelOpenUpdate", [ - { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint } - ]); - } - create(value?: PartialMessage): ChannelOpenUpdate { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelOpenUpdate): ChannelOpenUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint channel_point */ 1: - message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelOpenUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelPoint channel_point = 1; */ - if (message.channelPoint) - ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelOpenUpdate - */ -export const ChannelOpenUpdate = new ChannelOpenUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelCloseUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelCloseUpdate", [ - { no: 1, name: "closing_txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ChannelCloseUpdate { - const message = { closingTxid: new Uint8Array(0), success: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelCloseUpdate): ChannelCloseUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes closing_txid */ 1: - message.closingTxid = reader.bytes(); - break; - case /* bool success */ 2: - message.success = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelCloseUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes closing_txid = 1; */ - if (message.closingTxid.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.closingTxid); - /* bool success = 2; */ - if (message.success !== false) - writer.tag(2, WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelCloseUpdate - */ -export const ChannelCloseUpdate = new ChannelCloseUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CloseChannelRequest$Type extends MessageType { - constructor() { - super("lnrpc.CloseChannelRequest", [ - { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint }, - { no: 2, name: "force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "delivery_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "max_fee_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): CloseChannelRequest { - const message = { force: false, targetConf: 0, satPerByte: 0n, deliveryAddress: "", satPerVbyte: 0n, maxFeePerVbyte: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CloseChannelRequest): CloseChannelRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint channel_point */ 1: - message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); - break; - case /* bool force */ 2: - message.force = reader.bool(); - break; - case /* int32 target_conf */ 3: - message.targetConf = reader.int32(); - break; - case /* int64 sat_per_byte = 4 [deprecated = true];*/ 4: - message.satPerByte = reader.int64().toBigInt(); - break; - case /* string delivery_address */ 5: - message.deliveryAddress = reader.string(); - break; - case /* uint64 sat_per_vbyte */ 6: - message.satPerVbyte = reader.uint64().toBigInt(); - break; - case /* uint64 max_fee_per_vbyte */ 7: - message.maxFeePerVbyte = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CloseChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelPoint channel_point = 1; */ - if (message.channelPoint) - ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bool force = 2; */ - if (message.force !== false) - writer.tag(2, WireType.Varint).bool(message.force); - /* int32 target_conf = 3; */ - if (message.targetConf !== 0) - writer.tag(3, WireType.Varint).int32(message.targetConf); - /* int64 sat_per_byte = 4 [deprecated = true]; */ - if (message.satPerByte !== 0n) - writer.tag(4, WireType.Varint).int64(message.satPerByte); - /* string delivery_address = 5; */ - if (message.deliveryAddress !== "") - writer.tag(5, WireType.LengthDelimited).string(message.deliveryAddress); - /* uint64 sat_per_vbyte = 6; */ - if (message.satPerVbyte !== 0n) - writer.tag(6, WireType.Varint).uint64(message.satPerVbyte); - /* uint64 max_fee_per_vbyte = 7; */ - if (message.maxFeePerVbyte !== 0n) - writer.tag(7, WireType.Varint).uint64(message.maxFeePerVbyte); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.CloseChannelRequest - */ -export const CloseChannelRequest = new CloseChannelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CloseStatusUpdate$Type extends MessageType { - constructor() { - super("lnrpc.CloseStatusUpdate", [ - { no: 1, name: "close_pending", kind: "message", oneof: "update", T: () => PendingUpdate }, - { no: 3, name: "chan_close", kind: "message", oneof: "update", T: () => ChannelCloseUpdate } - ]); - } - create(value?: PartialMessage): CloseStatusUpdate { - const message = { update: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CloseStatusUpdate): CloseStatusUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingUpdate close_pending */ 1: - message.update = { - oneofKind: "closePending", - closePending: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).closePending) - }; - break; - case /* lnrpc.ChannelCloseUpdate chan_close */ 3: - message.update = { - oneofKind: "chanClose", - chanClose: ChannelCloseUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).chanClose) - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CloseStatusUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.PendingUpdate close_pending = 1; */ - if (message.update.oneofKind === "closePending") - PendingUpdate.internalBinaryWrite(message.update.closePending, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelCloseUpdate chan_close = 3; */ - if (message.update.oneofKind === "chanClose") - ChannelCloseUpdate.internalBinaryWrite(message.update.chanClose, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.CloseStatusUpdate - */ -export const CloseStatusUpdate = new CloseStatusUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingUpdate$Type extends MessageType { - constructor() { - super("lnrpc.PendingUpdate", [ - { no: 1, name: "txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): PendingUpdate { - const message = { txid: new Uint8Array(0), outputIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingUpdate): PendingUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes txid */ 1: - message.txid = reader.bytes(); - break; - case /* uint32 output_index */ 2: - message.outputIndex = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes txid = 1; */ - if (message.txid.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.txid); - /* uint32 output_index = 2; */ - if (message.outputIndex !== 0) - writer.tag(2, WireType.Varint).uint32(message.outputIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingUpdate - */ -export const PendingUpdate = new PendingUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ReadyForPsbtFunding$Type extends MessageType { - constructor() { - super("lnrpc.ReadyForPsbtFunding", [ - { no: 1, name: "funding_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): ReadyForPsbtFunding { - const message = { fundingAddress: "", fundingAmount: 0n, psbt: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReadyForPsbtFunding): ReadyForPsbtFunding { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string funding_address */ 1: - message.fundingAddress = reader.string(); - break; - case /* int64 funding_amount */ 2: - message.fundingAmount = reader.int64().toBigInt(); - break; - case /* bytes psbt */ 3: - message.psbt = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ReadyForPsbtFunding, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string funding_address = 1; */ - if (message.fundingAddress !== "") - writer.tag(1, WireType.LengthDelimited).string(message.fundingAddress); - /* int64 funding_amount = 2; */ - if (message.fundingAmount !== 0n) - writer.tag(2, WireType.Varint).int64(message.fundingAmount); - /* bytes psbt = 3; */ - if (message.psbt.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.psbt); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ReadyForPsbtFunding - */ -export const ReadyForPsbtFunding = new ReadyForPsbtFunding$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BatchOpenChannelRequest$Type extends MessageType { - constructor() { - super("lnrpc.BatchOpenChannelRequest", [ - { no: 1, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => BatchOpenChannel }, - { no: 2, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): BatchOpenChannelRequest { - const message = { channels: [], targetConf: 0, satPerVbyte: 0n, minConfs: 0, spendUnconfirmed: false, label: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelRequest): BatchOpenChannelRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.BatchOpenChannel channels */ 1: - message.channels.push(BatchOpenChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* int32 target_conf */ 2: - message.targetConf = reader.int32(); - break; - case /* int64 sat_per_vbyte */ 3: - message.satPerVbyte = reader.int64().toBigInt(); - break; - case /* int32 min_confs */ 4: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 5: - message.spendUnconfirmed = reader.bool(); - break; - case /* string label */ 6: - message.label = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BatchOpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.BatchOpenChannel channels = 1; */ - for (let i = 0; i < message.channels.length; i++) - BatchOpenChannel.internalBinaryWrite(message.channels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* int32 target_conf = 2; */ - if (message.targetConf !== 0) - writer.tag(2, WireType.Varint).int32(message.targetConf); - /* int64 sat_per_vbyte = 3; */ - if (message.satPerVbyte !== 0n) - writer.tag(3, WireType.Varint).int64(message.satPerVbyte); - /* int32 min_confs = 4; */ - if (message.minConfs !== 0) - writer.tag(4, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 5; */ - if (message.spendUnconfirmed !== false) - writer.tag(5, WireType.Varint).bool(message.spendUnconfirmed); - /* string label = 6; */ - if (message.label !== "") - writer.tag(6, WireType.LengthDelimited).string(message.label); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.BatchOpenChannelRequest - */ -export const BatchOpenChannelRequest = new BatchOpenChannelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BatchOpenChannel$Type extends MessageType { - constructor() { - super("lnrpc.BatchOpenChannel", [ - { no: 1, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "local_funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "remote_csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 7, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] } - ]); - } - create(value?: PartialMessage): BatchOpenChannel { - const message = { nodePubkey: new Uint8Array(0), localFundingAmount: 0n, pushSat: 0n, private: false, minHtlcMsat: 0n, remoteCsvDelay: 0, closeAddress: "", pendingChanId: new Uint8Array(0), commitmentType: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannel): BatchOpenChannel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes node_pubkey */ 1: - message.nodePubkey = reader.bytes(); - break; - case /* int64 local_funding_amount */ 2: - message.localFundingAmount = reader.int64().toBigInt(); - break; - case /* int64 push_sat */ 3: - message.pushSat = reader.int64().toBigInt(); - break; - case /* bool private */ 4: - message.private = reader.bool(); - break; - case /* int64 min_htlc_msat */ 5: - message.minHtlcMsat = reader.int64().toBigInt(); - break; - case /* uint32 remote_csv_delay */ 6: - message.remoteCsvDelay = reader.uint32(); - break; - case /* string close_address */ 7: - message.closeAddress = reader.string(); - break; - case /* bytes pending_chan_id */ 8: - message.pendingChanId = reader.bytes(); - break; - case /* lnrpc.CommitmentType commitment_type */ 9: - message.commitmentType = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BatchOpenChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes node_pubkey = 1; */ - if (message.nodePubkey.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); - /* int64 local_funding_amount = 2; */ - if (message.localFundingAmount !== 0n) - writer.tag(2, WireType.Varint).int64(message.localFundingAmount); - /* int64 push_sat = 3; */ - if (message.pushSat !== 0n) - writer.tag(3, WireType.Varint).int64(message.pushSat); - /* bool private = 4; */ - if (message.private !== false) - writer.tag(4, WireType.Varint).bool(message.private); - /* int64 min_htlc_msat = 5; */ - if (message.minHtlcMsat !== 0n) - writer.tag(5, WireType.Varint).int64(message.minHtlcMsat); - /* uint32 remote_csv_delay = 6; */ - if (message.remoteCsvDelay !== 0) - writer.tag(6, WireType.Varint).uint32(message.remoteCsvDelay); - /* string close_address = 7; */ - if (message.closeAddress !== "") - writer.tag(7, WireType.LengthDelimited).string(message.closeAddress); - /* bytes pending_chan_id = 8; */ - if (message.pendingChanId.length) - writer.tag(8, WireType.LengthDelimited).bytes(message.pendingChanId); - /* lnrpc.CommitmentType commitment_type = 9; */ - if (message.commitmentType !== 0) - writer.tag(9, WireType.Varint).int32(message.commitmentType); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.BatchOpenChannel - */ -export const BatchOpenChannel = new BatchOpenChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BatchOpenChannelResponse$Type extends MessageType { - constructor() { - super("lnrpc.BatchOpenChannelResponse", [ - { no: 1, name: "pending_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingUpdate } - ]); - } - create(value?: PartialMessage): BatchOpenChannelResponse { - const message = { pendingChannels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelResponse): BatchOpenChannelResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.PendingUpdate pending_channels */ 1: - message.pendingChannels.push(PendingUpdate.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BatchOpenChannelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.PendingUpdate pending_channels = 1; */ - for (let i = 0; i < message.pendingChannels.length; i++) - PendingUpdate.internalBinaryWrite(message.pendingChannels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.BatchOpenChannelResponse - */ -export const BatchOpenChannelResponse = new BatchOpenChannelResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class OpenChannelRequest$Type extends MessageType { - constructor() { - super("lnrpc.OpenChannelRequest", [ - { no: 1, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "node_pubkey_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "local_funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "remote_csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 11, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 12, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 13, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "funding_shim", kind: "message", T: () => FundingShim }, - { no: 15, name: "remote_max_value_in_flight_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 16, name: "remote_max_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 17, name: "max_local_csv", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 18, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, - { no: 19, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 20, name: "scid_alias", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 21, name: "base_fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 22, name: "fee_rate", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 23, name: "use_base_fee", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 24, name: "use_fee_rate", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 25, name: "remote_chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): OpenChannelRequest { - const message = { satPerVbyte: 0n, nodePubkey: new Uint8Array(0), nodePubkeyString: "", localFundingAmount: 0n, pushSat: 0n, targetConf: 0, satPerByte: 0n, private: false, minHtlcMsat: 0n, remoteCsvDelay: 0, minConfs: 0, spendUnconfirmed: false, closeAddress: "", remoteMaxValueInFlightMsat: 0n, remoteMaxHtlcs: 0, maxLocalCsv: 0, commitmentType: 0, zeroConf: false, scidAlias: false, baseFee: 0n, feeRate: 0n, useBaseFee: false, useFeeRate: false, remoteChanReserveSat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenChannelRequest): OpenChannelRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 sat_per_vbyte */ 1: - message.satPerVbyte = reader.uint64().toBigInt(); - break; - case /* bytes node_pubkey */ 2: - message.nodePubkey = reader.bytes(); - break; - case /* string node_pubkey_string = 3 [deprecated = true];*/ 3: - message.nodePubkeyString = reader.string(); - break; - case /* int64 local_funding_amount */ 4: - message.localFundingAmount = reader.int64().toBigInt(); - break; - case /* int64 push_sat */ 5: - message.pushSat = reader.int64().toBigInt(); - break; - case /* int32 target_conf */ 6: - message.targetConf = reader.int32(); - break; - case /* int64 sat_per_byte = 7 [deprecated = true];*/ 7: - message.satPerByte = reader.int64().toBigInt(); - break; - case /* bool private */ 8: - message.private = reader.bool(); - break; - case /* int64 min_htlc_msat */ 9: - message.minHtlcMsat = reader.int64().toBigInt(); - break; - case /* uint32 remote_csv_delay */ 10: - message.remoteCsvDelay = reader.uint32(); - break; - case /* int32 min_confs */ 11: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 12: - message.spendUnconfirmed = reader.bool(); - break; - case /* string close_address */ 13: - message.closeAddress = reader.string(); - break; - case /* lnrpc.FundingShim funding_shim */ 14: - message.fundingShim = FundingShim.internalBinaryRead(reader, reader.uint32(), options, message.fundingShim); - break; - case /* uint64 remote_max_value_in_flight_msat */ 15: - message.remoteMaxValueInFlightMsat = reader.uint64().toBigInt(); - break; - case /* uint32 remote_max_htlcs */ 16: - message.remoteMaxHtlcs = reader.uint32(); - break; - case /* uint32 max_local_csv */ 17: - message.maxLocalCsv = reader.uint32(); - break; - case /* lnrpc.CommitmentType commitment_type */ 18: - message.commitmentType = reader.int32(); - break; - case /* bool zero_conf */ 19: - message.zeroConf = reader.bool(); - break; - case /* bool scid_alias */ 20: - message.scidAlias = reader.bool(); - break; - case /* uint64 base_fee */ 21: - message.baseFee = reader.uint64().toBigInt(); - break; - case /* uint64 fee_rate */ 22: - message.feeRate = reader.uint64().toBigInt(); - break; - case /* bool use_base_fee */ 23: - message.useBaseFee = reader.bool(); - break; - case /* bool use_fee_rate */ 24: - message.useFeeRate = reader.bool(); - break; - case /* uint64 remote_chan_reserve_sat */ 25: - message.remoteChanReserveSat = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: OpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 sat_per_vbyte = 1; */ - if (message.satPerVbyte !== 0n) - writer.tag(1, WireType.Varint).uint64(message.satPerVbyte); - /* bytes node_pubkey = 2; */ - if (message.nodePubkey.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.nodePubkey); - /* string node_pubkey_string = 3 [deprecated = true]; */ - if (message.nodePubkeyString !== "") - writer.tag(3, WireType.LengthDelimited).string(message.nodePubkeyString); - /* int64 local_funding_amount = 4; */ - if (message.localFundingAmount !== 0n) - writer.tag(4, WireType.Varint).int64(message.localFundingAmount); - /* int64 push_sat = 5; */ - if (message.pushSat !== 0n) - writer.tag(5, WireType.Varint).int64(message.pushSat); - /* int32 target_conf = 6; */ - if (message.targetConf !== 0) - writer.tag(6, WireType.Varint).int32(message.targetConf); - /* int64 sat_per_byte = 7 [deprecated = true]; */ - if (message.satPerByte !== 0n) - writer.tag(7, WireType.Varint).int64(message.satPerByte); - /* bool private = 8; */ - if (message.private !== false) - writer.tag(8, WireType.Varint).bool(message.private); - /* int64 min_htlc_msat = 9; */ - if (message.minHtlcMsat !== 0n) - writer.tag(9, WireType.Varint).int64(message.minHtlcMsat); - /* uint32 remote_csv_delay = 10; */ - if (message.remoteCsvDelay !== 0) - writer.tag(10, WireType.Varint).uint32(message.remoteCsvDelay); - /* int32 min_confs = 11; */ - if (message.minConfs !== 0) - writer.tag(11, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 12; */ - if (message.spendUnconfirmed !== false) - writer.tag(12, WireType.Varint).bool(message.spendUnconfirmed); - /* string close_address = 13; */ - if (message.closeAddress !== "") - writer.tag(13, WireType.LengthDelimited).string(message.closeAddress); - /* lnrpc.FundingShim funding_shim = 14; */ - if (message.fundingShim) - FundingShim.internalBinaryWrite(message.fundingShim, writer.tag(14, WireType.LengthDelimited).fork(), options).join(); - /* uint64 remote_max_value_in_flight_msat = 15; */ - if (message.remoteMaxValueInFlightMsat !== 0n) - writer.tag(15, WireType.Varint).uint64(message.remoteMaxValueInFlightMsat); - /* uint32 remote_max_htlcs = 16; */ - if (message.remoteMaxHtlcs !== 0) - writer.tag(16, WireType.Varint).uint32(message.remoteMaxHtlcs); - /* uint32 max_local_csv = 17; */ - if (message.maxLocalCsv !== 0) - writer.tag(17, WireType.Varint).uint32(message.maxLocalCsv); - /* lnrpc.CommitmentType commitment_type = 18; */ - if (message.commitmentType !== 0) - writer.tag(18, WireType.Varint).int32(message.commitmentType); - /* bool zero_conf = 19; */ - if (message.zeroConf !== false) - writer.tag(19, WireType.Varint).bool(message.zeroConf); - /* bool scid_alias = 20; */ - if (message.scidAlias !== false) - writer.tag(20, WireType.Varint).bool(message.scidAlias); - /* uint64 base_fee = 21; */ - if (message.baseFee !== 0n) - writer.tag(21, WireType.Varint).uint64(message.baseFee); - /* uint64 fee_rate = 22; */ - if (message.feeRate !== 0n) - writer.tag(22, WireType.Varint).uint64(message.feeRate); - /* bool use_base_fee = 23; */ - if (message.useBaseFee !== false) - writer.tag(23, WireType.Varint).bool(message.useBaseFee); - /* bool use_fee_rate = 24; */ - if (message.useFeeRate !== false) - writer.tag(24, WireType.Varint).bool(message.useFeeRate); - /* uint64 remote_chan_reserve_sat = 25; */ - if (message.remoteChanReserveSat !== 0n) - writer.tag(25, WireType.Varint).uint64(message.remoteChanReserveSat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.OpenChannelRequest - */ -export const OpenChannelRequest = new OpenChannelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class OpenStatusUpdate$Type extends MessageType { - constructor() { - super("lnrpc.OpenStatusUpdate", [ - { no: 1, name: "chan_pending", kind: "message", oneof: "update", T: () => PendingUpdate }, - { no: 3, name: "chan_open", kind: "message", oneof: "update", T: () => ChannelOpenUpdate }, - { no: 5, name: "psbt_fund", kind: "message", oneof: "update", T: () => ReadyForPsbtFunding }, - { no: 4, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): OpenStatusUpdate { - const message = { update: { oneofKind: undefined }, pendingChanId: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenStatusUpdate): OpenStatusUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingUpdate chan_pending */ 1: - message.update = { - oneofKind: "chanPending", - chanPending: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).chanPending) - }; - break; - case /* lnrpc.ChannelOpenUpdate chan_open */ 3: - message.update = { - oneofKind: "chanOpen", - chanOpen: ChannelOpenUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).chanOpen) - }; - break; - case /* lnrpc.ReadyForPsbtFunding psbt_fund */ 5: - message.update = { - oneofKind: "psbtFund", - psbtFund: ReadyForPsbtFunding.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).psbtFund) - }; - break; - case /* bytes pending_chan_id */ 4: - message.pendingChanId = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: OpenStatusUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.PendingUpdate chan_pending = 1; */ - if (message.update.oneofKind === "chanPending") - PendingUpdate.internalBinaryWrite(message.update.chanPending, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelOpenUpdate chan_open = 3; */ - if (message.update.oneofKind === "chanOpen") - ChannelOpenUpdate.internalBinaryWrite(message.update.chanOpen, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ReadyForPsbtFunding psbt_fund = 5; */ - if (message.update.oneofKind === "psbtFund") - ReadyForPsbtFunding.internalBinaryWrite(message.update.psbtFund, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* bytes pending_chan_id = 4; */ - if (message.pendingChanId.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.pendingChanId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.OpenStatusUpdate - */ -export const OpenStatusUpdate = new OpenStatusUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class KeyLocator$Type extends MessageType { - constructor() { - super("lnrpc.KeyLocator", [ - { no: 1, name: "key_family", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): KeyLocator { - const message = { keyFamily: 0, keyIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: KeyLocator): KeyLocator { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 key_family */ 1: - message.keyFamily = reader.int32(); - break; - case /* int32 key_index */ 2: - message.keyIndex = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: KeyLocator, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int32 key_family = 1; */ - if (message.keyFamily !== 0) - writer.tag(1, WireType.Varint).int32(message.keyFamily); - /* int32 key_index = 2; */ - if (message.keyIndex !== 0) - writer.tag(2, WireType.Varint).int32(message.keyIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.KeyLocator - */ -export const KeyLocator = new KeyLocator$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class KeyDescriptor$Type extends MessageType { - constructor() { - super("lnrpc.KeyDescriptor", [ - { no: 1, name: "raw_key_bytes", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "key_loc", kind: "message", T: () => KeyLocator } - ]); - } - create(value?: PartialMessage): KeyDescriptor { - const message = { rawKeyBytes: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: KeyDescriptor): KeyDescriptor { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes raw_key_bytes */ 1: - message.rawKeyBytes = reader.bytes(); - break; - case /* lnrpc.KeyLocator key_loc */ 2: - message.keyLoc = KeyLocator.internalBinaryRead(reader, reader.uint32(), options, message.keyLoc); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: KeyDescriptor, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes raw_key_bytes = 1; */ - if (message.rawKeyBytes.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rawKeyBytes); - /* lnrpc.KeyLocator key_loc = 2; */ - if (message.keyLoc) - KeyLocator.internalBinaryWrite(message.keyLoc, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.KeyDescriptor - */ -export const KeyDescriptor = new KeyDescriptor$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanPointShim$Type extends MessageType { - constructor() { - super("lnrpc.ChanPointShim", [ - { no: 1, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "chan_point", kind: "message", T: () => ChannelPoint }, - { no: 3, name: "local_key", kind: "message", T: () => KeyDescriptor }, - { no: 4, name: "remote_key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 6, name: "thaw_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): ChanPointShim { - const message = { amt: 0n, remoteKey: new Uint8Array(0), pendingChanId: new Uint8Array(0), thawHeight: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanPointShim): ChanPointShim { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 amt */ 1: - message.amt = reader.int64().toBigInt(); - break; - case /* lnrpc.ChannelPoint chan_point */ 2: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* lnrpc.KeyDescriptor local_key */ 3: - message.localKey = KeyDescriptor.internalBinaryRead(reader, reader.uint32(), options, message.localKey); - break; - case /* bytes remote_key */ 4: - message.remoteKey = reader.bytes(); - break; - case /* bytes pending_chan_id */ 5: - message.pendingChanId = reader.bytes(); - break; - case /* uint32 thaw_height */ 6: - message.thawHeight = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChanPointShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 amt = 1; */ - if (message.amt !== 0n) - writer.tag(1, WireType.Varint).int64(message.amt); - /* lnrpc.ChannelPoint chan_point = 2; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.KeyDescriptor local_key = 3; */ - if (message.localKey) - KeyDescriptor.internalBinaryWrite(message.localKey, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* bytes remote_key = 4; */ - if (message.remoteKey.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.remoteKey); - /* bytes pending_chan_id = 5; */ - if (message.pendingChanId.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.pendingChanId); - /* uint32 thaw_height = 6; */ - if (message.thawHeight !== 0) - writer.tag(6, WireType.Varint).uint32(message.thawHeight); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChanPointShim - */ -export const ChanPointShim = new ChanPointShim$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PsbtShim$Type extends MessageType { - constructor() { - super("lnrpc.PsbtShim", [ - { no: 1, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "base_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "no_publish", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): PsbtShim { - const message = { pendingChanId: new Uint8Array(0), basePsbt: new Uint8Array(0), noPublish: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PsbtShim): PsbtShim { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes pending_chan_id */ 1: - message.pendingChanId = reader.bytes(); - break; - case /* bytes base_psbt */ 2: - message.basePsbt = reader.bytes(); - break; - case /* bool no_publish */ 3: - message.noPublish = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PsbtShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes pending_chan_id = 1; */ - if (message.pendingChanId.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.pendingChanId); - /* bytes base_psbt = 2; */ - if (message.basePsbt.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.basePsbt); - /* bool no_publish = 3; */ - if (message.noPublish !== false) - writer.tag(3, WireType.Varint).bool(message.noPublish); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PsbtShim - */ -export const PsbtShim = new PsbtShim$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingShim$Type extends MessageType { - constructor() { - super("lnrpc.FundingShim", [ - { no: 1, name: "chan_point_shim", kind: "message", oneof: "shim", T: () => ChanPointShim }, - { no: 2, name: "psbt_shim", kind: "message", oneof: "shim", T: () => PsbtShim } - ]); - } - create(value?: PartialMessage): FundingShim { - const message = { shim: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingShim): FundingShim { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChanPointShim chan_point_shim */ 1: - message.shim = { - oneofKind: "chanPointShim", - chanPointShim: ChanPointShim.internalBinaryRead(reader, reader.uint32(), options, (message.shim as any).chanPointShim) - }; - break; - case /* lnrpc.PsbtShim psbt_shim */ 2: - message.shim = { - oneofKind: "psbtShim", - psbtShim: PsbtShim.internalBinaryRead(reader, reader.uint32(), options, (message.shim as any).psbtShim) - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FundingShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChanPointShim chan_point_shim = 1; */ - if (message.shim.oneofKind === "chanPointShim") - ChanPointShim.internalBinaryWrite(message.shim.chanPointShim, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.PsbtShim psbt_shim = 2; */ - if (message.shim.oneofKind === "psbtShim") - PsbtShim.internalBinaryWrite(message.shim.psbtShim, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingShim - */ -export const FundingShim = new FundingShim$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingShimCancel$Type extends MessageType { - constructor() { - super("lnrpc.FundingShimCancel", [ - { no: 1, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): FundingShimCancel { - const message = { pendingChanId: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingShimCancel): FundingShimCancel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes pending_chan_id */ 1: - message.pendingChanId = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FundingShimCancel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes pending_chan_id = 1; */ - if (message.pendingChanId.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.pendingChanId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingShimCancel - */ -export const FundingShimCancel = new FundingShimCancel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingPsbtVerify$Type extends MessageType { - constructor() { - super("lnrpc.FundingPsbtVerify", [ - { no: 1, name: "funded_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "skip_finalize", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): FundingPsbtVerify { - const message = { fundedPsbt: new Uint8Array(0), pendingChanId: new Uint8Array(0), skipFinalize: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingPsbtVerify): FundingPsbtVerify { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes funded_psbt */ 1: - message.fundedPsbt = reader.bytes(); - break; - case /* bytes pending_chan_id */ 2: - message.pendingChanId = reader.bytes(); - break; - case /* bool skip_finalize */ 3: - message.skipFinalize = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FundingPsbtVerify, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes funded_psbt = 1; */ - if (message.fundedPsbt.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.fundedPsbt); - /* bytes pending_chan_id = 2; */ - if (message.pendingChanId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); - /* bool skip_finalize = 3; */ - if (message.skipFinalize !== false) - writer.tag(3, WireType.Varint).bool(message.skipFinalize); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingPsbtVerify - */ -export const FundingPsbtVerify = new FundingPsbtVerify$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingPsbtFinalize$Type extends MessageType { - constructor() { - super("lnrpc.FundingPsbtFinalize", [ - { no: 1, name: "signed_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "final_raw_tx", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): FundingPsbtFinalize { - const message = { signedPsbt: new Uint8Array(0), pendingChanId: new Uint8Array(0), finalRawTx: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingPsbtFinalize): FundingPsbtFinalize { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes signed_psbt */ 1: - message.signedPsbt = reader.bytes(); - break; - case /* bytes pending_chan_id */ 2: - message.pendingChanId = reader.bytes(); - break; - case /* bytes final_raw_tx */ 3: - message.finalRawTx = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FundingPsbtFinalize, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes signed_psbt = 1; */ - if (message.signedPsbt.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.signedPsbt); - /* bytes pending_chan_id = 2; */ - if (message.pendingChanId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); - /* bytes final_raw_tx = 3; */ - if (message.finalRawTx.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.finalRawTx); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingPsbtFinalize - */ -export const FundingPsbtFinalize = new FundingPsbtFinalize$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingTransitionMsg$Type extends MessageType { - constructor() { - super("lnrpc.FundingTransitionMsg", [ - { no: 1, name: "shim_register", kind: "message", oneof: "trigger", T: () => FundingShim }, - { no: 2, name: "shim_cancel", kind: "message", oneof: "trigger", T: () => FundingShimCancel }, - { no: 3, name: "psbt_verify", kind: "message", oneof: "trigger", T: () => FundingPsbtVerify }, - { no: 4, name: "psbt_finalize", kind: "message", oneof: "trigger", T: () => FundingPsbtFinalize } - ]); - } - create(value?: PartialMessage): FundingTransitionMsg { - const message = { trigger: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingTransitionMsg): FundingTransitionMsg { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.FundingShim shim_register */ 1: - message.trigger = { - oneofKind: "shimRegister", - shimRegister: FundingShim.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).shimRegister) - }; - break; - case /* lnrpc.FundingShimCancel shim_cancel */ 2: - message.trigger = { - oneofKind: "shimCancel", - shimCancel: FundingShimCancel.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).shimCancel) - }; - break; - case /* lnrpc.FundingPsbtVerify psbt_verify */ 3: - message.trigger = { - oneofKind: "psbtVerify", - psbtVerify: FundingPsbtVerify.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).psbtVerify) - }; - break; - case /* lnrpc.FundingPsbtFinalize psbt_finalize */ 4: - message.trigger = { - oneofKind: "psbtFinalize", - psbtFinalize: FundingPsbtFinalize.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).psbtFinalize) - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FundingTransitionMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.FundingShim shim_register = 1; */ - if (message.trigger.oneofKind === "shimRegister") - FundingShim.internalBinaryWrite(message.trigger.shimRegister, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.FundingShimCancel shim_cancel = 2; */ - if (message.trigger.oneofKind === "shimCancel") - FundingShimCancel.internalBinaryWrite(message.trigger.shimCancel, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.FundingPsbtVerify psbt_verify = 3; */ - if (message.trigger.oneofKind === "psbtVerify") - FundingPsbtVerify.internalBinaryWrite(message.trigger.psbtVerify, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.FundingPsbtFinalize psbt_finalize = 4; */ - if (message.trigger.oneofKind === "psbtFinalize") - FundingPsbtFinalize.internalBinaryWrite(message.trigger.psbtFinalize, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingTransitionMsg - */ -export const FundingTransitionMsg = new FundingTransitionMsg$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingStateStepResp$Type extends MessageType { - constructor() { - super("lnrpc.FundingStateStepResp", []); - } - create(value?: PartialMessage): FundingStateStepResp { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingStateStepResp): FundingStateStepResp { - return target ?? this.create(); - } - internalBinaryWrite(message: FundingStateStepResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingStateStepResp - */ -export const FundingStateStepResp = new FundingStateStepResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingHTLC$Type extends MessageType { - constructor() { - super("lnrpc.PendingHTLC", [ - { no: 1, name: "incoming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "outpoint", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "maturity_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "blocks_til_maturity", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 6, name: "stage", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): PendingHTLC { - const message = { incoming: false, amount: 0n, outpoint: "", maturityHeight: 0, blocksTilMaturity: 0, stage: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingHTLC): PendingHTLC { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool incoming */ 1: - message.incoming = reader.bool(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toBigInt(); - break; - case /* string outpoint */ 3: - message.outpoint = reader.string(); - break; - case /* uint32 maturity_height */ 4: - message.maturityHeight = reader.uint32(); - break; - case /* int32 blocks_til_maturity */ 5: - message.blocksTilMaturity = reader.int32(); - break; - case /* uint32 stage */ 6: - message.stage = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingHTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool incoming = 1; */ - if (message.incoming !== false) - writer.tag(1, WireType.Varint).bool(message.incoming); - /* int64 amount = 2; */ - if (message.amount !== 0n) - writer.tag(2, WireType.Varint).int64(message.amount); - /* string outpoint = 3; */ - if (message.outpoint !== "") - writer.tag(3, WireType.LengthDelimited).string(message.outpoint); - /* uint32 maturity_height = 4; */ - if (message.maturityHeight !== 0) - writer.tag(4, WireType.Varint).uint32(message.maturityHeight); - /* int32 blocks_til_maturity = 5; */ - if (message.blocksTilMaturity !== 0) - writer.tag(5, WireType.Varint).int32(message.blocksTilMaturity); - /* uint32 stage = 6; */ - if (message.stage !== 0) - writer.tag(6, WireType.Varint).uint32(message.stage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingHTLC - */ -export const PendingHTLC = new PendingHTLC$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsRequest$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsRequest", []); - } - create(value?: PartialMessage): PendingChannelsRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsRequest): PendingChannelsRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: PendingChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsRequest - */ -export const PendingChannelsRequest = new PendingChannelsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse", [ - { no: 1, name: "total_limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "pending_open_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_PendingOpenChannel }, - { no: 3, name: "pending_closing_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_ClosedChannel }, - { no: 4, name: "pending_force_closing_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_ForceClosedChannel }, - { no: 5, name: "waiting_close_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_WaitingCloseChannel } - ]); - } - create(value?: PartialMessage): PendingChannelsResponse { - const message = { totalLimboBalance: 0n, pendingOpenChannels: [], pendingClosingChannels: [], pendingForceClosingChannels: [], waitingCloseChannels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse): PendingChannelsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 total_limbo_balance */ 1: - message.totalLimboBalance = reader.int64().toBigInt(); - break; - case /* repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels */ 2: - message.pendingOpenChannels.push(PendingChannelsResponse_PendingOpenChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true];*/ 3: - message.pendingClosingChannels.push(PendingChannelsResponse_ClosedChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels */ 4: - message.pendingForceClosingChannels.push(PendingChannelsResponse_ForceClosedChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels */ 5: - message.waitingCloseChannels.push(PendingChannelsResponse_WaitingCloseChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 total_limbo_balance = 1; */ - if (message.totalLimboBalance !== 0n) - writer.tag(1, WireType.Varint).int64(message.totalLimboBalance); - /* repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels = 2; */ - for (let i = 0; i < message.pendingOpenChannels.length; i++) - PendingChannelsResponse_PendingOpenChannel.internalBinaryWrite(message.pendingOpenChannels[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true]; */ - for (let i = 0; i < message.pendingClosingChannels.length; i++) - PendingChannelsResponse_ClosedChannel.internalBinaryWrite(message.pendingClosingChannels[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels = 4; */ - for (let i = 0; i < message.pendingForceClosingChannels.length; i++) - PendingChannelsResponse_ForceClosedChannel.internalBinaryWrite(message.pendingForceClosingChannels[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels = 5; */ - for (let i = 0; i < message.waitingCloseChannels.length; i++) - PendingChannelsResponse_WaitingCloseChannel.internalBinaryWrite(message.waitingCloseChannels[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse - */ -export const PendingChannelsResponse = new PendingChannelsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_PendingChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.PendingChannel", [ - { no: 1, name: "remote_node_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "local_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, - { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, - { no: 10, name: "num_forwarding_packages", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 11, name: "chan_status_flags", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): PendingChannelsResponse_PendingChannel { - const message = { remoteNodePub: "", channelPoint: "", capacity: 0n, localBalance: 0n, remoteBalance: 0n, localChanReserveSat: 0n, remoteChanReserveSat: 0n, initiator: 0, commitmentType: 0, numForwardingPackages: 0n, chanStatusFlags: "", private: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_PendingChannel): PendingChannelsResponse_PendingChannel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string remote_node_pub */ 1: - message.remoteNodePub = reader.string(); - break; - case /* string channel_point */ 2: - message.channelPoint = reader.string(); - break; - case /* int64 capacity */ 3: - message.capacity = reader.int64().toBigInt(); - break; - case /* int64 local_balance */ 4: - message.localBalance = reader.int64().toBigInt(); - break; - case /* int64 remote_balance */ 5: - message.remoteBalance = reader.int64().toBigInt(); - break; - case /* int64 local_chan_reserve_sat */ 6: - message.localChanReserveSat = reader.int64().toBigInt(); - break; - case /* int64 remote_chan_reserve_sat */ 7: - message.remoteChanReserveSat = reader.int64().toBigInt(); - break; - case /* lnrpc.Initiator initiator */ 8: - message.initiator = reader.int32(); - break; - case /* lnrpc.CommitmentType commitment_type */ 9: - message.commitmentType = reader.int32(); - break; - case /* int64 num_forwarding_packages */ 10: - message.numForwardingPackages = reader.int64().toBigInt(); - break; - case /* string chan_status_flags */ 11: - message.chanStatusFlags = reader.string(); - break; - case /* bool private */ 12: - message.private = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingChannelsResponse_PendingChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string remote_node_pub = 1; */ - if (message.remoteNodePub !== "") - writer.tag(1, WireType.LengthDelimited).string(message.remoteNodePub); - /* string channel_point = 2; */ - if (message.channelPoint !== "") - writer.tag(2, WireType.LengthDelimited).string(message.channelPoint); - /* int64 capacity = 3; */ - if (message.capacity !== 0n) - writer.tag(3, WireType.Varint).int64(message.capacity); - /* int64 local_balance = 4; */ - if (message.localBalance !== 0n) - writer.tag(4, WireType.Varint).int64(message.localBalance); - /* int64 remote_balance = 5; */ - if (message.remoteBalance !== 0n) - writer.tag(5, WireType.Varint).int64(message.remoteBalance); - /* int64 local_chan_reserve_sat = 6; */ - if (message.localChanReserveSat !== 0n) - writer.tag(6, WireType.Varint).int64(message.localChanReserveSat); - /* int64 remote_chan_reserve_sat = 7; */ - if (message.remoteChanReserveSat !== 0n) - writer.tag(7, WireType.Varint).int64(message.remoteChanReserveSat); - /* lnrpc.Initiator initiator = 8; */ - if (message.initiator !== 0) - writer.tag(8, WireType.Varint).int32(message.initiator); - /* lnrpc.CommitmentType commitment_type = 9; */ - if (message.commitmentType !== 0) - writer.tag(9, WireType.Varint).int32(message.commitmentType); - /* int64 num_forwarding_packages = 10; */ - if (message.numForwardingPackages !== 0n) - writer.tag(10, WireType.Varint).int64(message.numForwardingPackages); - /* string chan_status_flags = 11; */ - if (message.chanStatusFlags !== "") - writer.tag(11, WireType.LengthDelimited).string(message.chanStatusFlags); - /* bool private = 12; */ - if (message.private !== false) - writer.tag(12, WireType.Varint).bool(message.private); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingChannel - */ -export const PendingChannelsResponse_PendingChannel = new PendingChannelsResponse_PendingChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_PendingOpenChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.PendingOpenChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 4, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): PendingChannelsResponse_PendingOpenChannel { - const message = { commitFee: 0n, commitWeight: 0n, feePerKw: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_PendingOpenChannel): PendingChannelsResponse_PendingOpenChannel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* int64 commit_fee */ 4: - message.commitFee = reader.int64().toBigInt(); - break; - case /* int64 commit_weight */ 5: - message.commitWeight = reader.int64().toBigInt(); - break; - case /* int64 fee_per_kw */ 6: - message.feePerKw = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingChannelsResponse_PendingOpenChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* int64 commit_fee = 4; */ - if (message.commitFee !== 0n) - writer.tag(4, WireType.Varint).int64(message.commitFee); - /* int64 commit_weight = 5; */ - if (message.commitWeight !== 0n) - writer.tag(5, WireType.Varint).int64(message.commitWeight); - /* int64 fee_per_kw = 6; */ - if (message.feePerKw !== 0n) - writer.tag(6, WireType.Varint).int64(message.feePerKw); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingOpenChannel - */ -export const PendingChannelsResponse_PendingOpenChannel = new PendingChannelsResponse_PendingOpenChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_WaitingCloseChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.WaitingCloseChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 2, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "commitments", kind: "message", T: () => PendingChannelsResponse_Commitments }, - { no: 4, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): PendingChannelsResponse_WaitingCloseChannel { - const message = { limboBalance: 0n, closingTxid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_WaitingCloseChannel): PendingChannelsResponse_WaitingCloseChannel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* int64 limbo_balance */ 2: - message.limboBalance = reader.int64().toBigInt(); - break; - case /* lnrpc.PendingChannelsResponse.Commitments commitments */ 3: - message.commitments = PendingChannelsResponse_Commitments.internalBinaryRead(reader, reader.uint32(), options, message.commitments); - break; - case /* string closing_txid */ 4: - message.closingTxid = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingChannelsResponse_WaitingCloseChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* int64 limbo_balance = 2; */ - if (message.limboBalance !== 0n) - writer.tag(2, WireType.Varint).int64(message.limboBalance); - /* lnrpc.PendingChannelsResponse.Commitments commitments = 3; */ - if (message.commitments) - PendingChannelsResponse_Commitments.internalBinaryWrite(message.commitments, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* string closing_txid = 4; */ - if (message.closingTxid !== "") - writer.tag(4, WireType.LengthDelimited).string(message.closingTxid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel - */ -export const PendingChannelsResponse_WaitingCloseChannel = new PendingChannelsResponse_WaitingCloseChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_Commitments$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.Commitments", [ - { no: 1, name: "local_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "remote_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "remote_pending_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "local_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "remote_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "remote_pending_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): PendingChannelsResponse_Commitments { - const message = { localTxid: "", remoteTxid: "", remotePendingTxid: "", localCommitFeeSat: 0n, remoteCommitFeeSat: 0n, remotePendingCommitFeeSat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_Commitments): PendingChannelsResponse_Commitments { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string local_txid */ 1: - message.localTxid = reader.string(); - break; - case /* string remote_txid */ 2: - message.remoteTxid = reader.string(); - break; - case /* string remote_pending_txid */ 3: - message.remotePendingTxid = reader.string(); - break; - case /* uint64 local_commit_fee_sat */ 4: - message.localCommitFeeSat = reader.uint64().toBigInt(); - break; - case /* uint64 remote_commit_fee_sat */ 5: - message.remoteCommitFeeSat = reader.uint64().toBigInt(); - break; - case /* uint64 remote_pending_commit_fee_sat */ 6: - message.remotePendingCommitFeeSat = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingChannelsResponse_Commitments, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string local_txid = 1; */ - if (message.localTxid !== "") - writer.tag(1, WireType.LengthDelimited).string(message.localTxid); - /* string remote_txid = 2; */ - if (message.remoteTxid !== "") - writer.tag(2, WireType.LengthDelimited).string(message.remoteTxid); - /* string remote_pending_txid = 3; */ - if (message.remotePendingTxid !== "") - writer.tag(3, WireType.LengthDelimited).string(message.remotePendingTxid); - /* uint64 local_commit_fee_sat = 4; */ - if (message.localCommitFeeSat !== 0n) - writer.tag(4, WireType.Varint).uint64(message.localCommitFeeSat); - /* uint64 remote_commit_fee_sat = 5; */ - if (message.remoteCommitFeeSat !== 0n) - writer.tag(5, WireType.Varint).uint64(message.remoteCommitFeeSat); - /* uint64 remote_pending_commit_fee_sat = 6; */ - if (message.remotePendingCommitFeeSat !== 0n) - writer.tag(6, WireType.Varint).uint64(message.remotePendingCommitFeeSat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.Commitments - */ -export const PendingChannelsResponse_Commitments = new PendingChannelsResponse_Commitments$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_ClosedChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.ClosedChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 2, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): PendingChannelsResponse_ClosedChannel { - const message = { closingTxid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_ClosedChannel): PendingChannelsResponse_ClosedChannel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* string closing_txid */ 2: - message.closingTxid = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingChannelsResponse_ClosedChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* string closing_txid = 2; */ - if (message.closingTxid !== "") - writer.tag(2, WireType.LengthDelimited).string(message.closingTxid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ClosedChannel - */ -export const PendingChannelsResponse_ClosedChannel = new PendingChannelsResponse_ClosedChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_ForceClosedChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.ForceClosedChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 2, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "maturity_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "blocks_til_maturity", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 6, name: "recovered_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "pending_htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingHTLC }, - { no: 9, name: "anchor", kind: "enum", T: () => ["lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState", PendingChannelsResponse_ForceClosedChannel_AnchorState] } - ]); - } - create(value?: PartialMessage): PendingChannelsResponse_ForceClosedChannel { - const message = { closingTxid: "", limboBalance: 0n, maturityHeight: 0, blocksTilMaturity: 0, recoveredBalance: 0n, pendingHtlcs: [], anchor: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_ForceClosedChannel): PendingChannelsResponse_ForceClosedChannel { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* string closing_txid */ 2: - message.closingTxid = reader.string(); - break; - case /* int64 limbo_balance */ 3: - message.limboBalance = reader.int64().toBigInt(); - break; - case /* uint32 maturity_height */ 4: - message.maturityHeight = reader.uint32(); - break; - case /* int32 blocks_til_maturity */ 5: - message.blocksTilMaturity = reader.int32(); - break; - case /* int64 recovered_balance */ 6: - message.recoveredBalance = reader.int64().toBigInt(); - break; - case /* repeated lnrpc.PendingHTLC pending_htlcs */ 8: - message.pendingHtlcs.push(PendingHTLC.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor */ 9: - message.anchor = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PendingChannelsResponse_ForceClosedChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* string closing_txid = 2; */ - if (message.closingTxid !== "") - writer.tag(2, WireType.LengthDelimited).string(message.closingTxid); - /* int64 limbo_balance = 3; */ - if (message.limboBalance !== 0n) - writer.tag(3, WireType.Varint).int64(message.limboBalance); - /* uint32 maturity_height = 4; */ - if (message.maturityHeight !== 0) - writer.tag(4, WireType.Varint).uint32(message.maturityHeight); - /* int32 blocks_til_maturity = 5; */ - if (message.blocksTilMaturity !== 0) - writer.tag(5, WireType.Varint).int32(message.blocksTilMaturity); - /* int64 recovered_balance = 6; */ - if (message.recoveredBalance !== 0n) - writer.tag(6, WireType.Varint).int64(message.recoveredBalance); - /* repeated lnrpc.PendingHTLC pending_htlcs = 8; */ - for (let i = 0; i < message.pendingHtlcs.length; i++) - PendingHTLC.internalBinaryWrite(message.pendingHtlcs[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor = 9; */ - if (message.anchor !== 0) - writer.tag(9, WireType.Varint).int32(message.anchor); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ForceClosedChannel - */ -export const PendingChannelsResponse_ForceClosedChannel = new PendingChannelsResponse_ForceClosedChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEventSubscription$Type extends MessageType { - constructor() { - super("lnrpc.ChannelEventSubscription", []); - } - create(value?: PartialMessage): ChannelEventSubscription { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEventSubscription): ChannelEventSubscription { - return target ?? this.create(); - } - internalBinaryWrite(message: ChannelEventSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEventSubscription - */ -export const ChannelEventSubscription = new ChannelEventSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEventUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelEventUpdate", [ - { no: 1, name: "open_channel", kind: "message", oneof: "channel", T: () => Channel }, - { no: 2, name: "closed_channel", kind: "message", oneof: "channel", T: () => ChannelCloseSummary }, - { no: 3, name: "active_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, - { no: 4, name: "inactive_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, - { no: 6, name: "pending_open_channel", kind: "message", oneof: "channel", T: () => PendingUpdate }, - { no: 7, name: "fully_resolved_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, - { no: 5, name: "type", kind: "enum", T: () => ["lnrpc.ChannelEventUpdate.UpdateType", ChannelEventUpdate_UpdateType] } - ]); - } - create(value?: PartialMessage): ChannelEventUpdate { - const message = { channel: { oneofKind: undefined }, type: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEventUpdate): ChannelEventUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.Channel open_channel */ 1: - message.channel = { - oneofKind: "openChannel", - openChannel: Channel.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).openChannel) - }; - break; - case /* lnrpc.ChannelCloseSummary closed_channel */ 2: - message.channel = { - oneofKind: "closedChannel", - closedChannel: ChannelCloseSummary.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).closedChannel) - }; - break; - case /* lnrpc.ChannelPoint active_channel */ 3: - message.channel = { - oneofKind: "activeChannel", - activeChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).activeChannel) - }; - break; - case /* lnrpc.ChannelPoint inactive_channel */ 4: - message.channel = { - oneofKind: "inactiveChannel", - inactiveChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).inactiveChannel) - }; - break; - case /* lnrpc.PendingUpdate pending_open_channel */ 6: - message.channel = { - oneofKind: "pendingOpenChannel", - pendingOpenChannel: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).pendingOpenChannel) - }; - break; - case /* lnrpc.ChannelPoint fully_resolved_channel */ 7: - message.channel = { - oneofKind: "fullyResolvedChannel", - fullyResolvedChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).fullyResolvedChannel) - }; - break; - case /* lnrpc.ChannelEventUpdate.UpdateType type */ 5: - message.type = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelEventUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.Channel open_channel = 1; */ - if (message.channel.oneofKind === "openChannel") - Channel.internalBinaryWrite(message.channel.openChannel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelCloseSummary closed_channel = 2; */ - if (message.channel.oneofKind === "closedChannel") - ChannelCloseSummary.internalBinaryWrite(message.channel.closedChannel, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelPoint active_channel = 3; */ - if (message.channel.oneofKind === "activeChannel") - ChannelPoint.internalBinaryWrite(message.channel.activeChannel, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelPoint inactive_channel = 4; */ - if (message.channel.oneofKind === "inactiveChannel") - ChannelPoint.internalBinaryWrite(message.channel.inactiveChannel, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.PendingUpdate pending_open_channel = 6; */ - if (message.channel.oneofKind === "pendingOpenChannel") - PendingUpdate.internalBinaryWrite(message.channel.pendingOpenChannel, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelPoint fully_resolved_channel = 7; */ - if (message.channel.oneofKind === "fullyResolvedChannel") - ChannelPoint.internalBinaryWrite(message.channel.fullyResolvedChannel, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelEventUpdate.UpdateType type = 5; */ - if (message.type !== 0) - writer.tag(5, WireType.Varint).int32(message.type); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEventUpdate - */ -export const ChannelEventUpdate = new ChannelEventUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class WalletAccountBalance$Type extends MessageType { - constructor() { - super("lnrpc.WalletAccountBalance", [ - { no: 1, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): WalletAccountBalance { - const message = { confirmedBalance: 0n, unconfirmedBalance: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletAccountBalance): WalletAccountBalance { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 confirmed_balance */ 1: - message.confirmedBalance = reader.int64().toBigInt(); - break; - case /* int64 unconfirmed_balance */ 2: - message.unconfirmedBalance = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: WalletAccountBalance, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 confirmed_balance = 1; */ - if (message.confirmedBalance !== 0n) - writer.tag(1, WireType.Varint).int64(message.confirmedBalance); - /* int64 unconfirmed_balance = 2; */ - if (message.unconfirmedBalance !== 0n) - writer.tag(2, WireType.Varint).int64(message.unconfirmedBalance); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.WalletAccountBalance - */ -export const WalletAccountBalance = new WalletAccountBalance$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class WalletBalanceRequest$Type extends MessageType { - constructor() { - super("lnrpc.WalletBalanceRequest", []); - } - create(value?: PartialMessage): WalletBalanceRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletBalanceRequest): WalletBalanceRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: WalletBalanceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.WalletBalanceRequest - */ -export const WalletBalanceRequest = new WalletBalanceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class WalletBalanceResponse$Type extends MessageType { - constructor() { - super("lnrpc.WalletBalanceResponse", [ - { no: 1, name: "total_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "reserved_balance_anchor_chan", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "account_balance", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => WalletAccountBalance } } - ]); - } - create(value?: PartialMessage): WalletBalanceResponse { - const message = { totalBalance: 0n, confirmedBalance: 0n, unconfirmedBalance: 0n, lockedBalance: 0n, reservedBalanceAnchorChan: 0n, accountBalance: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletBalanceResponse): WalletBalanceResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 total_balance */ 1: - message.totalBalance = reader.int64().toBigInt(); - break; - case /* int64 confirmed_balance */ 2: - message.confirmedBalance = reader.int64().toBigInt(); - break; - case /* int64 unconfirmed_balance */ 3: - message.unconfirmedBalance = reader.int64().toBigInt(); - break; - case /* int64 locked_balance */ 5: - message.lockedBalance = reader.int64().toBigInt(); - break; - case /* int64 reserved_balance_anchor_chan */ 6: - message.reservedBalanceAnchorChan = reader.int64().toBigInt(); - break; - case /* map account_balance */ 4: - this.binaryReadMap4(message.accountBalance, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap4(map: WalletBalanceResponse["accountBalance"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof WalletBalanceResponse["accountBalance"] | undefined, val: WalletBalanceResponse["accountBalance"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = WalletAccountBalance.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.WalletBalanceResponse.account_balance"); - } - } - map[key ?? ""] = val ?? WalletAccountBalance.create(); - } - internalBinaryWrite(message: WalletBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 total_balance = 1; */ - if (message.totalBalance !== 0n) - writer.tag(1, WireType.Varint).int64(message.totalBalance); - /* int64 confirmed_balance = 2; */ - if (message.confirmedBalance !== 0n) - writer.tag(2, WireType.Varint).int64(message.confirmedBalance); - /* int64 unconfirmed_balance = 3; */ - if (message.unconfirmedBalance !== 0n) - writer.tag(3, WireType.Varint).int64(message.unconfirmedBalance); - /* int64 locked_balance = 5; */ - if (message.lockedBalance !== 0n) - writer.tag(5, WireType.Varint).int64(message.lockedBalance); - /* int64 reserved_balance_anchor_chan = 6; */ - if (message.reservedBalanceAnchorChan !== 0n) - writer.tag(6, WireType.Varint).int64(message.reservedBalanceAnchorChan); - /* map account_balance = 4; */ - for (let k of Object.keys(message.accountBalance)) { - writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); - writer.tag(2, WireType.LengthDelimited).fork(); - WalletAccountBalance.internalBinaryWrite(message.accountBalance[k], writer, options); - writer.join().join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.WalletBalanceResponse - */ -export const WalletBalanceResponse = new WalletBalanceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Amount$Type extends MessageType { - constructor() { - super("lnrpc.Amount", [ - { no: 1, name: "sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): Amount { - const message = { sat: 0n, msat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Amount): Amount { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 sat */ 1: - message.sat = reader.uint64().toBigInt(); - break; - case /* uint64 msat */ 2: - message.msat = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Amount, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 sat = 1; */ - if (message.sat !== 0n) - writer.tag(1, WireType.Varint).uint64(message.sat); - /* uint64 msat = 2; */ - if (message.msat !== 0n) - writer.tag(2, WireType.Varint).uint64(message.msat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Amount - */ -export const Amount = new Amount$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBalanceRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBalanceRequest", []); - } - create(value?: PartialMessage): ChannelBalanceRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBalanceRequest): ChannelBalanceRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: ChannelBalanceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBalanceRequest - */ -export const ChannelBalanceRequest = new ChannelBalanceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBalanceResponse$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBalanceResponse", [ - { no: 1, name: "balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "pending_open_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "local_balance", kind: "message", T: () => Amount }, - { no: 4, name: "remote_balance", kind: "message", T: () => Amount }, - { no: 5, name: "unsettled_local_balance", kind: "message", T: () => Amount }, - { no: 6, name: "unsettled_remote_balance", kind: "message", T: () => Amount }, - { no: 7, name: "pending_open_local_balance", kind: "message", T: () => Amount }, - { no: 8, name: "pending_open_remote_balance", kind: "message", T: () => Amount } - ]); - } - create(value?: PartialMessage): ChannelBalanceResponse { - const message = { balance: 0n, pendingOpenBalance: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBalanceResponse): ChannelBalanceResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 balance = 1 [deprecated = true];*/ 1: - message.balance = reader.int64().toBigInt(); - break; - case /* int64 pending_open_balance = 2 [deprecated = true];*/ 2: - message.pendingOpenBalance = reader.int64().toBigInt(); - break; - case /* lnrpc.Amount local_balance */ 3: - message.localBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.localBalance); - break; - case /* lnrpc.Amount remote_balance */ 4: - message.remoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.remoteBalance); - break; - case /* lnrpc.Amount unsettled_local_balance */ 5: - message.unsettledLocalBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.unsettledLocalBalance); - break; - case /* lnrpc.Amount unsettled_remote_balance */ 6: - message.unsettledRemoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.unsettledRemoteBalance); - break; - case /* lnrpc.Amount pending_open_local_balance */ 7: - message.pendingOpenLocalBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.pendingOpenLocalBalance); - break; - case /* lnrpc.Amount pending_open_remote_balance */ 8: - message.pendingOpenRemoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.pendingOpenRemoteBalance); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 balance = 1 [deprecated = true]; */ - if (message.balance !== 0n) - writer.tag(1, WireType.Varint).int64(message.balance); - /* int64 pending_open_balance = 2 [deprecated = true]; */ - if (message.pendingOpenBalance !== 0n) - writer.tag(2, WireType.Varint).int64(message.pendingOpenBalance); - /* lnrpc.Amount local_balance = 3; */ - if (message.localBalance) - Amount.internalBinaryWrite(message.localBalance, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount remote_balance = 4; */ - if (message.remoteBalance) - Amount.internalBinaryWrite(message.remoteBalance, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount unsettled_local_balance = 5; */ - if (message.unsettledLocalBalance) - Amount.internalBinaryWrite(message.unsettledLocalBalance, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount unsettled_remote_balance = 6; */ - if (message.unsettledRemoteBalance) - Amount.internalBinaryWrite(message.unsettledRemoteBalance, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount pending_open_local_balance = 7; */ - if (message.pendingOpenLocalBalance) - Amount.internalBinaryWrite(message.pendingOpenLocalBalance, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount pending_open_remote_balance = 8; */ - if (message.pendingOpenRemoteBalance) - Amount.internalBinaryWrite(message.pendingOpenRemoteBalance, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBalanceResponse - */ -export const ChannelBalanceResponse = new ChannelBalanceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryRoutesRequest$Type extends MessageType { - constructor() { - super("lnrpc.QueryRoutesRequest", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "fee_limit", kind: "message", T: () => FeeLimit }, - { no: 6, name: "ignored_nodes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, - { no: 7, name: "ignored_edges", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EdgeLocator }, - { no: 8, name: "source_pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "use_mission_control", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 10, name: "ignored_pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodePair }, - { no: 11, name: "cltv_limit", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 13, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 14, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 15, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 16, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, - { no: 17, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, - { no: 18, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value?: PartialMessage): QueryRoutesRequest { - const message = { pubKey: "", amt: 0n, amtMsat: 0n, finalCltvDelta: 0, ignoredNodes: [], ignoredEdges: [], sourcePubKey: "", useMissionControl: false, ignoredPairs: [], cltvLimit: 0, destCustomRecords: {}, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), routeHints: [], destFeatures: [], timePref: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoutesRequest): QueryRoutesRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* int64 amt */ 2: - message.amt = reader.int64().toBigInt(); - break; - case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toBigInt(); - break; - case /* int32 final_cltv_delta */ 4: - message.finalCltvDelta = reader.int32(); - break; - case /* lnrpc.FeeLimit fee_limit */ 5: - message.feeLimit = FeeLimit.internalBinaryRead(reader, reader.uint32(), options, message.feeLimit); - break; - case /* repeated bytes ignored_nodes */ 6: - message.ignoredNodes.push(reader.bytes()); - break; - case /* repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true];*/ 7: - message.ignoredEdges.push(EdgeLocator.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* string source_pub_key */ 8: - message.sourcePubKey = reader.string(); - break; - case /* bool use_mission_control */ 9: - message.useMissionControl = reader.bool(); - break; - case /* repeated lnrpc.NodePair ignored_pairs */ 10: - message.ignoredPairs.push(NodePair.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint32 cltv_limit */ 11: - message.cltvLimit = reader.uint32(); - break; - case /* map dest_custom_records */ 13: - this.binaryReadMap13(message.destCustomRecords, reader, options); - break; - case /* uint64 outgoing_chan_id = 14 [jstype = JS_STRING];*/ 14: - message.outgoingChanId = reader.uint64().toString(); - break; - case /* bytes last_hop_pubkey */ 15: - message.lastHopPubkey = reader.bytes(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 16: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.FeatureBit dest_features */ 17: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.destFeatures.push(reader.int32()); - else - message.destFeatures.push(reader.int32()); - break; - case /* double time_pref */ 18: - message.timePref = reader.double(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap13(map: QueryRoutesRequest["destCustomRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof QueryRoutesRequest["destCustomRecords"] | undefined, val: QueryRoutesRequest["destCustomRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.QueryRoutesRequest.dest_custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: QueryRoutesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* int64 amt = 2; */ - if (message.amt !== 0n) - writer.tag(2, WireType.Varint).int64(message.amt); - /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0n) - writer.tag(12, WireType.Varint).int64(message.amtMsat); - /* int32 final_cltv_delta = 4; */ - if (message.finalCltvDelta !== 0) - writer.tag(4, WireType.Varint).int32(message.finalCltvDelta); - /* lnrpc.FeeLimit fee_limit = 5; */ - if (message.feeLimit) - FeeLimit.internalBinaryWrite(message.feeLimit, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* repeated bytes ignored_nodes = 6; */ - for (let i = 0; i < message.ignoredNodes.length; i++) - writer.tag(6, WireType.LengthDelimited).bytes(message.ignoredNodes[i]); - /* repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true]; */ - for (let i = 0; i < message.ignoredEdges.length; i++) - EdgeLocator.internalBinaryWrite(message.ignoredEdges[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* string source_pub_key = 8; */ - if (message.sourcePubKey !== "") - writer.tag(8, WireType.LengthDelimited).string(message.sourcePubKey); - /* bool use_mission_control = 9; */ - if (message.useMissionControl !== false) - writer.tag(9, WireType.Varint).bool(message.useMissionControl); - /* repeated lnrpc.NodePair ignored_pairs = 10; */ - for (let i = 0; i < message.ignoredPairs.length; i++) - NodePair.internalBinaryWrite(message.ignoredPairs[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* uint32 cltv_limit = 11; */ - if (message.cltvLimit !== 0) - writer.tag(11, WireType.Varint).uint32(message.cltvLimit); - /* map dest_custom_records = 13; */ - for (let k of Object.keys(message.destCustomRecords)) - writer.tag(13, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); - /* uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(14, WireType.Varint).uint64(message.outgoingChanId); - /* bytes last_hop_pubkey = 15; */ - if (message.lastHopPubkey.length) - writer.tag(15, WireType.LengthDelimited).bytes(message.lastHopPubkey); - /* repeated lnrpc.RouteHint route_hints = 16; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.FeatureBit dest_features = 17; */ - if (message.destFeatures.length) { - writer.tag(17, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.destFeatures.length; i++) - writer.int32(message.destFeatures[i]); - writer.join(); - } - /* double time_pref = 18; */ - if (message.timePref !== 0) - writer.tag(18, WireType.Bit64).double(message.timePref); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.QueryRoutesRequest - */ -export const QueryRoutesRequest = new QueryRoutesRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodePair$Type extends MessageType { - constructor() { - super("lnrpc.NodePair", [ - { no: 1, name: "from", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "to", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): NodePair { - const message = { from: new Uint8Array(0), to: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodePair): NodePair { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes from */ 1: - message.from = reader.bytes(); - break; - case /* bytes to */ 2: - message.to = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NodePair, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes from = 1; */ - if (message.from.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.from); - /* bytes to = 2; */ - if (message.to.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.to); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodePair - */ -export const NodePair = new NodePair$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class EdgeLocator$Type extends MessageType { - constructor() { - super("lnrpc.EdgeLocator", [ - { no: 1, name: "channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "direction_reverse", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): EdgeLocator { - const message = { channelId: "0", directionReverse: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EdgeLocator): EdgeLocator { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 channel_id = 1 [jstype = JS_STRING];*/ 1: - message.channelId = reader.uint64().toString(); - break; - case /* bool direction_reverse */ 2: - message.directionReverse = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: EdgeLocator, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 channel_id = 1 [jstype = JS_STRING]; */ - if (message.channelId !== "0") - writer.tag(1, WireType.Varint).uint64(message.channelId); - /* bool direction_reverse = 2; */ - if (message.directionReverse !== false) - writer.tag(2, WireType.Varint).bool(message.directionReverse); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.EdgeLocator - */ -export const EdgeLocator = new EdgeLocator$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryRoutesResponse$Type extends MessageType { - constructor() { - super("lnrpc.QueryRoutesResponse", [ - { no: 1, name: "routes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Route }, - { no: 2, name: "success_prob", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value?: PartialMessage): QueryRoutesResponse { - const message = { routes: [], successProb: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoutesResponse): QueryRoutesResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Route routes */ 1: - message.routes.push(Route.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* double success_prob */ 2: - message.successProb = reader.double(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: QueryRoutesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.Route routes = 1; */ - for (let i = 0; i < message.routes.length; i++) - Route.internalBinaryWrite(message.routes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* double success_prob = 2; */ - if (message.successProb !== 0) - writer.tag(2, WireType.Bit64).double(message.successProb); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.QueryRoutesResponse - */ -export const QueryRoutesResponse = new QueryRoutesResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Hop$Type extends MessageType { - constructor() { - super("lnrpc.Hop", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "chan_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "amt_to_forward", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "amt_to_forward_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "tlv_payload", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 10, name: "mpp_record", kind: "message", T: () => MPPRecord }, - { no: 12, name: "amp_record", kind: "message", T: () => AMPRecord }, - { no: 11, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 13, name: "metadata", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): Hop { - const message = { chanId: "0", chanCapacity: 0n, amtToForward: 0n, fee: 0n, expiry: 0, amtToForwardMsat: 0n, feeMsat: 0n, pubKey: "", tlvPayload: false, customRecords: {}, metadata: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Hop): Hop { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* int64 chan_capacity = 2 [deprecated = true];*/ 2: - message.chanCapacity = reader.int64().toBigInt(); - break; - case /* int64 amt_to_forward = 3 [deprecated = true];*/ 3: - message.amtToForward = reader.int64().toBigInt(); - break; - case /* int64 fee = 4 [deprecated = true];*/ 4: - message.fee = reader.int64().toBigInt(); - break; - case /* uint32 expiry */ 5: - message.expiry = reader.uint32(); - break; - case /* int64 amt_to_forward_msat */ 6: - message.amtToForwardMsat = reader.int64().toBigInt(); - break; - case /* int64 fee_msat */ 7: - message.feeMsat = reader.int64().toBigInt(); - break; - case /* string pub_key */ 8: - message.pubKey = reader.string(); - break; - case /* bool tlv_payload = 9 [deprecated = true];*/ 9: - message.tlvPayload = reader.bool(); - break; - case /* lnrpc.MPPRecord mpp_record */ 10: - message.mppRecord = MPPRecord.internalBinaryRead(reader, reader.uint32(), options, message.mppRecord); - break; - case /* lnrpc.AMPRecord amp_record */ 12: - message.ampRecord = AMPRecord.internalBinaryRead(reader, reader.uint32(), options, message.ampRecord); - break; - case /* map custom_records */ 11: - this.binaryReadMap11(message.customRecords, reader, options); - break; - case /* bytes metadata */ 13: - message.metadata = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap11(map: Hop["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof Hop["customRecords"] | undefined, val: Hop["customRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.Hop.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: Hop, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* int64 chan_capacity = 2 [deprecated = true]; */ - if (message.chanCapacity !== 0n) - writer.tag(2, WireType.Varint).int64(message.chanCapacity); - /* int64 amt_to_forward = 3 [deprecated = true]; */ - if (message.amtToForward !== 0n) - writer.tag(3, WireType.Varint).int64(message.amtToForward); - /* int64 fee = 4 [deprecated = true]; */ - if (message.fee !== 0n) - writer.tag(4, WireType.Varint).int64(message.fee); - /* uint32 expiry = 5; */ - if (message.expiry !== 0) - writer.tag(5, WireType.Varint).uint32(message.expiry); - /* int64 amt_to_forward_msat = 6; */ - if (message.amtToForwardMsat !== 0n) - writer.tag(6, WireType.Varint).int64(message.amtToForwardMsat); - /* int64 fee_msat = 7; */ - if (message.feeMsat !== 0n) - writer.tag(7, WireType.Varint).int64(message.feeMsat); - /* string pub_key = 8; */ - if (message.pubKey !== "") - writer.tag(8, WireType.LengthDelimited).string(message.pubKey); - /* bool tlv_payload = 9 [deprecated = true]; */ - if (message.tlvPayload !== false) - writer.tag(9, WireType.Varint).bool(message.tlvPayload); - /* lnrpc.MPPRecord mpp_record = 10; */ - if (message.mppRecord) - MPPRecord.internalBinaryWrite(message.mppRecord, writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.AMPRecord amp_record = 12; */ - if (message.ampRecord) - AMPRecord.internalBinaryWrite(message.ampRecord, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); - /* map custom_records = 11; */ - for (let k of Object.keys(message.customRecords)) - writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); - /* bytes metadata = 13; */ - if (message.metadata.length) - writer.tag(13, WireType.LengthDelimited).bytes(message.metadata); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Hop - */ -export const Hop = new Hop$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MPPRecord$Type extends MessageType { - constructor() { - super("lnrpc.MPPRecord", [ - { no: 11, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 10, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): MPPRecord { - const message = { paymentAddr: new Uint8Array(0), totalAmtMsat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MPPRecord): MPPRecord { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_addr */ 11: - message.paymentAddr = reader.bytes(); - break; - case /* int64 total_amt_msat */ 10: - message.totalAmtMsat = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MPPRecord, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes payment_addr = 11; */ - if (message.paymentAddr.length) - writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); - /* int64 total_amt_msat = 10; */ - if (message.totalAmtMsat !== 0n) - writer.tag(10, WireType.Varint).int64(message.totalAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MPPRecord - */ -export const MPPRecord = new MPPRecord$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AMPRecord$Type extends MessageType { - constructor() { - super("lnrpc.AMPRecord", [ - { no: 1, name: "root_share", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "child_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): AMPRecord { - const message = { rootShare: new Uint8Array(0), setId: new Uint8Array(0), childIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMPRecord): AMPRecord { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes root_share */ 1: - message.rootShare = reader.bytes(); - break; - case /* bytes set_id */ 2: - message.setId = reader.bytes(); - break; - case /* uint32 child_index */ 3: - message.childIndex = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AMPRecord, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes root_share = 1; */ - if (message.rootShare.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rootShare); - /* bytes set_id = 2; */ - if (message.setId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.setId); - /* uint32 child_index = 3; */ - if (message.childIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.childIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AMPRecord - */ -export const AMPRecord = new AMPRecord$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Route$Type extends MessageType { - constructor() { - super("lnrpc.Route", [ - { no: 1, name: "total_time_lock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "total_amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "hops", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Hop }, - { no: 5, name: "total_fees_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): Route { - const message = { totalTimeLock: 0, totalFees: 0n, totalAmt: 0n, hops: [], totalFeesMsat: 0n, totalAmtMsat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Route): Route { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 total_time_lock */ 1: - message.totalTimeLock = reader.uint32(); - break; - case /* int64 total_fees = 2 [deprecated = true];*/ 2: - message.totalFees = reader.int64().toBigInt(); - break; - case /* int64 total_amt = 3 [deprecated = true];*/ 3: - message.totalAmt = reader.int64().toBigInt(); - break; - case /* repeated lnrpc.Hop hops */ 4: - message.hops.push(Hop.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* int64 total_fees_msat */ 5: - message.totalFeesMsat = reader.int64().toBigInt(); - break; - case /* int64 total_amt_msat */ 6: - message.totalAmtMsat = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Route, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint32 total_time_lock = 1; */ - if (message.totalTimeLock !== 0) - writer.tag(1, WireType.Varint).uint32(message.totalTimeLock); - /* int64 total_fees = 2 [deprecated = true]; */ - if (message.totalFees !== 0n) - writer.tag(2, WireType.Varint).int64(message.totalFees); - /* int64 total_amt = 3 [deprecated = true]; */ - if (message.totalAmt !== 0n) - writer.tag(3, WireType.Varint).int64(message.totalAmt); - /* repeated lnrpc.Hop hops = 4; */ - for (let i = 0; i < message.hops.length; i++) - Hop.internalBinaryWrite(message.hops[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* int64 total_fees_msat = 5; */ - if (message.totalFeesMsat !== 0n) - writer.tag(5, WireType.Varint).int64(message.totalFeesMsat); - /* int64 total_amt_msat = 6; */ - if (message.totalAmtMsat !== 0n) - writer.tag(6, WireType.Varint).int64(message.totalAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Route - */ -export const Route = new Route$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.NodeInfoRequest", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "include_channels", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): NodeInfoRequest { - const message = { pubKey: "", includeChannels: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeInfoRequest): NodeInfoRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* bool include_channels */ 2: - message.includeChannels = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NodeInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* bool include_channels = 2; */ - if (message.includeChannels !== false) - writer.tag(2, WireType.Varint).bool(message.includeChannels); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeInfoRequest - */ -export const NodeInfoRequest = new NodeInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeInfo$Type extends MessageType { - constructor() { - super("lnrpc.NodeInfo", [ - { no: 1, name: "node", kind: "message", T: () => LightningNode }, - { no: 2, name: "num_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "total_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdge } - ]); - } - create(value?: PartialMessage): NodeInfo { - const message = { numChannels: 0, totalCapacity: 0n, channels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeInfo): NodeInfo { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.LightningNode node */ 1: - message.node = LightningNode.internalBinaryRead(reader, reader.uint32(), options, message.node); - break; - case /* uint32 num_channels */ 2: - message.numChannels = reader.uint32(); - break; - case /* int64 total_capacity */ 3: - message.totalCapacity = reader.int64().toBigInt(); - break; - case /* repeated lnrpc.ChannelEdge channels */ 4: - message.channels.push(ChannelEdge.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NodeInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.LightningNode node = 1; */ - if (message.node) - LightningNode.internalBinaryWrite(message.node, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint32 num_channels = 2; */ - if (message.numChannels !== 0) - writer.tag(2, WireType.Varint).uint32(message.numChannels); - /* int64 total_capacity = 3; */ - if (message.totalCapacity !== 0n) - writer.tag(3, WireType.Varint).int64(message.totalCapacity); - /* repeated lnrpc.ChannelEdge channels = 4; */ - for (let i = 0; i < message.channels.length; i++) - ChannelEdge.internalBinaryWrite(message.channels[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeInfo - */ -export const NodeInfo = new NodeInfo$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LightningNode$Type extends MessageType { - constructor() { - super("lnrpc.LightningNode", [ - { no: 1, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "addresses", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeAddress }, - { no: 5, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, - { no: 7, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } - ]); - } - create(value?: PartialMessage): LightningNode { - const message = { lastUpdate: 0, pubKey: "", alias: "", addresses: [], color: "", features: {}, customRecords: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LightningNode): LightningNode { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 last_update */ 1: - message.lastUpdate = reader.uint32(); - break; - case /* string pub_key */ 2: - message.pubKey = reader.string(); - break; - case /* string alias */ 3: - message.alias = reader.string(); - break; - case /* repeated lnrpc.NodeAddress addresses */ 4: - message.addresses.push(NodeAddress.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* string color */ 5: - message.color = reader.string(); - break; - case /* map features */ 6: - this.binaryReadMap6(message.features, reader, options); - break; - case /* map custom_records */ 7: - this.binaryReadMap7(message.customRecords, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap6(map: LightningNode["features"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof LightningNode["features"] | undefined, val: LightningNode["features"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.LightningNode.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - private binaryReadMap7(map: LightningNode["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof LightningNode["customRecords"] | undefined, val: LightningNode["customRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.LightningNode.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: LightningNode, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint32 last_update = 1; */ - if (message.lastUpdate !== 0) - writer.tag(1, WireType.Varint).uint32(message.lastUpdate); - /* string pub_key = 2; */ - if (message.pubKey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.pubKey); - /* string alias = 3; */ - if (message.alias !== "") - writer.tag(3, WireType.LengthDelimited).string(message.alias); - /* repeated lnrpc.NodeAddress addresses = 4; */ - for (let i = 0; i < message.addresses.length; i++) - NodeAddress.internalBinaryWrite(message.addresses[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* string color = 5; */ - if (message.color !== "") - writer.tag(5, WireType.LengthDelimited).string(message.color); - /* map features = 6; */ - for (let k of Object.keys(message.features)) { - writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k as any], writer, options); - writer.join().join(); - } - /* map custom_records = 7; */ - for (let k of Object.keys(message.customRecords)) - writer.tag(7, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.LightningNode - */ -export const LightningNode = new LightningNode$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeAddress$Type extends MessageType { - constructor() { - super("lnrpc.NodeAddress", [ - { no: 1, name: "network", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): NodeAddress { - const message = { network: "", addr: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeAddress): NodeAddress { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string network */ 1: - message.network = reader.string(); - break; - case /* string addr */ 2: - message.addr = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NodeAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string network = 1; */ - if (message.network !== "") - writer.tag(1, WireType.LengthDelimited).string(message.network); - /* string addr = 2; */ - if (message.addr !== "") - writer.tag(2, WireType.LengthDelimited).string(message.addr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeAddress - */ -export const NodeAddress = new NodeAddress$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RoutingPolicy$Type extends MessageType { - constructor() { - super("lnrpc.RoutingPolicy", [ - { no: 1, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "min_htlc", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "fee_base_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "fee_rate_milli_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "disabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 8, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } - ]); - } - create(value?: PartialMessage): RoutingPolicy { - const message = { timeLockDelta: 0, minHtlc: 0n, feeBaseMsat: 0n, feeRateMilliMsat: 0n, disabled: false, maxHtlcMsat: 0n, lastUpdate: 0, customRecords: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RoutingPolicy): RoutingPolicy { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 time_lock_delta */ 1: - message.timeLockDelta = reader.uint32(); - break; - case /* int64 min_htlc */ 2: - message.minHtlc = reader.int64().toBigInt(); - break; - case /* int64 fee_base_msat */ 3: - message.feeBaseMsat = reader.int64().toBigInt(); - break; - case /* int64 fee_rate_milli_msat */ 4: - message.feeRateMilliMsat = reader.int64().toBigInt(); - break; - case /* bool disabled */ 5: - message.disabled = reader.bool(); - break; - case /* uint64 max_htlc_msat */ 6: - message.maxHtlcMsat = reader.uint64().toBigInt(); - break; - case /* uint32 last_update */ 7: - message.lastUpdate = reader.uint32(); - break; - case /* map custom_records */ 8: - this.binaryReadMap8(message.customRecords, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap8(map: RoutingPolicy["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof RoutingPolicy["customRecords"] | undefined, val: RoutingPolicy["customRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.RoutingPolicy.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: RoutingPolicy, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint32 time_lock_delta = 1; */ - if (message.timeLockDelta !== 0) - writer.tag(1, WireType.Varint).uint32(message.timeLockDelta); - /* int64 min_htlc = 2; */ - if (message.minHtlc !== 0n) - writer.tag(2, WireType.Varint).int64(message.minHtlc); - /* int64 fee_base_msat = 3; */ - if (message.feeBaseMsat !== 0n) - writer.tag(3, WireType.Varint).int64(message.feeBaseMsat); - /* int64 fee_rate_milli_msat = 4; */ - if (message.feeRateMilliMsat !== 0n) - writer.tag(4, WireType.Varint).int64(message.feeRateMilliMsat); - /* bool disabled = 5; */ - if (message.disabled !== false) - writer.tag(5, WireType.Varint).bool(message.disabled); - /* uint64 max_htlc_msat = 6; */ - if (message.maxHtlcMsat !== 0n) - writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); - /* uint32 last_update = 7; */ - if (message.lastUpdate !== 0) - writer.tag(7, WireType.Varint).uint32(message.lastUpdate); - /* map custom_records = 8; */ - for (let k of Object.keys(message.customRecords)) - writer.tag(8, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RoutingPolicy - */ -export const RoutingPolicy = new RoutingPolicy$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEdge$Type extends MessageType { - constructor() { - super("lnrpc.ChannelEdge", [ - { no: 1, name: "channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "chan_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "node1_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "node2_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "node1_policy", kind: "message", T: () => RoutingPolicy }, - { no: 8, name: "node2_policy", kind: "message", T: () => RoutingPolicy }, - { no: 9, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } - ]); - } - create(value?: PartialMessage): ChannelEdge { - const message = { channelId: "0", chanPoint: "", lastUpdate: 0, node1Pub: "", node2Pub: "", capacity: 0n, customRecords: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEdge): ChannelEdge { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 channel_id = 1 [jstype = JS_STRING];*/ 1: - message.channelId = reader.uint64().toString(); - break; - case /* string chan_point */ 2: - message.chanPoint = reader.string(); - break; - case /* uint32 last_update = 3 [deprecated = true];*/ 3: - message.lastUpdate = reader.uint32(); - break; - case /* string node1_pub */ 4: - message.node1Pub = reader.string(); - break; - case /* string node2_pub */ 5: - message.node2Pub = reader.string(); - break; - case /* int64 capacity */ 6: - message.capacity = reader.int64().toBigInt(); - break; - case /* lnrpc.RoutingPolicy node1_policy */ 7: - message.node1Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node1Policy); - break; - case /* lnrpc.RoutingPolicy node2_policy */ 8: - message.node2Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node2Policy); - break; - case /* map custom_records */ 9: - this.binaryReadMap9(message.customRecords, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap9(map: ChannelEdge["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof ChannelEdge["customRecords"] | undefined, val: ChannelEdge["customRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.ChannelEdge.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: ChannelEdge, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 channel_id = 1 [jstype = JS_STRING]; */ - if (message.channelId !== "0") - writer.tag(1, WireType.Varint).uint64(message.channelId); - /* string chan_point = 2; */ - if (message.chanPoint !== "") - writer.tag(2, WireType.LengthDelimited).string(message.chanPoint); - /* uint32 last_update = 3 [deprecated = true]; */ - if (message.lastUpdate !== 0) - writer.tag(3, WireType.Varint).uint32(message.lastUpdate); - /* string node1_pub = 4; */ - if (message.node1Pub !== "") - writer.tag(4, WireType.LengthDelimited).string(message.node1Pub); - /* string node2_pub = 5; */ - if (message.node2Pub !== "") - writer.tag(5, WireType.LengthDelimited).string(message.node2Pub); - /* int64 capacity = 6; */ - if (message.capacity !== 0n) - writer.tag(6, WireType.Varint).int64(message.capacity); - /* lnrpc.RoutingPolicy node1_policy = 7; */ - if (message.node1Policy) - RoutingPolicy.internalBinaryWrite(message.node1Policy, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.RoutingPolicy node2_policy = 8; */ - if (message.node2Policy) - RoutingPolicy.internalBinaryWrite(message.node2Policy, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* map custom_records = 9; */ - for (let k of Object.keys(message.customRecords)) - writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEdge - */ -export const ChannelEdge = new ChannelEdge$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelGraphRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChannelGraphRequest", [ - { no: 1, name: "include_unannounced", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ChannelGraphRequest { - const message = { includeUnannounced: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelGraphRequest): ChannelGraphRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool include_unannounced */ 1: - message.includeUnannounced = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelGraphRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool include_unannounced = 1; */ - if (message.includeUnannounced !== false) - writer.tag(1, WireType.Varint).bool(message.includeUnannounced); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelGraphRequest - */ -export const ChannelGraphRequest = new ChannelGraphRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelGraph$Type extends MessageType { - constructor() { - super("lnrpc.ChannelGraph", [ - { no: 1, name: "nodes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => LightningNode }, - { no: 2, name: "edges", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdge } - ]); - } - create(value?: PartialMessage): ChannelGraph { - const message = { nodes: [], edges: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelGraph): ChannelGraph { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.LightningNode nodes */ 1: - message.nodes.push(LightningNode.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.ChannelEdge edges */ 2: - message.edges.push(ChannelEdge.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelGraph, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.LightningNode nodes = 1; */ - for (let i = 0; i < message.nodes.length; i++) - LightningNode.internalBinaryWrite(message.nodes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.ChannelEdge edges = 2; */ - for (let i = 0; i < message.edges.length; i++) - ChannelEdge.internalBinaryWrite(message.edges[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelGraph - */ -export const ChannelGraph = new ChannelGraph$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeMetricsRequest$Type extends MessageType { - constructor() { - super("lnrpc.NodeMetricsRequest", [ - { no: 1, name: "types", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.NodeMetricType", NodeMetricType] } - ]); - } - create(value?: PartialMessage): NodeMetricsRequest { - const message = { types: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeMetricsRequest): NodeMetricsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.NodeMetricType types */ 1: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.types.push(reader.int32()); - else - message.types.push(reader.int32()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NodeMetricsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.NodeMetricType types = 1; */ - if (message.types.length) { - writer.tag(1, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.types.length; i++) - writer.int32(message.types[i]); - writer.join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeMetricsRequest - */ -export const NodeMetricsRequest = new NodeMetricsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeMetricsResponse$Type extends MessageType { - constructor() { - super("lnrpc.NodeMetricsResponse", [ - { no: 1, name: "betweenness_centrality", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => FloatMetric } } - ]); - } - create(value?: PartialMessage): NodeMetricsResponse { - const message = { betweennessCentrality: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeMetricsResponse): NodeMetricsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map betweenness_centrality */ 1: - this.binaryReadMap1(message.betweennessCentrality, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap1(map: NodeMetricsResponse["betweennessCentrality"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof NodeMetricsResponse["betweennessCentrality"] | undefined, val: NodeMetricsResponse["betweennessCentrality"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = FloatMetric.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.NodeMetricsResponse.betweenness_centrality"); - } - } - map[key ?? ""] = val ?? FloatMetric.create(); - } - internalBinaryWrite(message: NodeMetricsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* map betweenness_centrality = 1; */ - for (let k of Object.keys(message.betweennessCentrality)) { - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); - writer.tag(2, WireType.LengthDelimited).fork(); - FloatMetric.internalBinaryWrite(message.betweennessCentrality[k], writer, options); - writer.join().join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeMetricsResponse - */ -export const NodeMetricsResponse = new NodeMetricsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FloatMetric$Type extends MessageType { - constructor() { - super("lnrpc.FloatMetric", [ - { no: 1, name: "value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 2, name: "normalized_value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value?: PartialMessage): FloatMetric { - const message = { value: 0, normalizedValue: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FloatMetric): FloatMetric { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* double value */ 1: - message.value = reader.double(); - break; - case /* double normalized_value */ 2: - message.normalizedValue = reader.double(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FloatMetric, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* double value = 1; */ - if (message.value !== 0) - writer.tag(1, WireType.Bit64).double(message.value); - /* double normalized_value = 2; */ - if (message.normalizedValue !== 0) - writer.tag(2, WireType.Bit64).double(message.normalizedValue); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FloatMetric - */ -export const FloatMetric = new FloatMetric$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChanInfoRequest", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } - ]); - } - create(value?: PartialMessage): ChanInfoRequest { - const message = { chanId: "0" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanInfoRequest): ChanInfoRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChanInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChanInfoRequest - */ -export const ChanInfoRequest = new ChanInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NetworkInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.NetworkInfoRequest", []); - } - create(value?: PartialMessage): NetworkInfoRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NetworkInfoRequest): NetworkInfoRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: NetworkInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NetworkInfoRequest - */ -export const NetworkInfoRequest = new NetworkInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NetworkInfo$Type extends MessageType { - constructor() { - super("lnrpc.NetworkInfo", [ - { no: 1, name: "graph_diameter", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "avg_out_degree", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 3, name: "max_out_degree", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "num_nodes", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "num_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "total_network_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "avg_channel_size", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 8, name: "min_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "max_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "median_channel_size_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 11, name: "num_zombie_chans", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): NetworkInfo { - const message = { graphDiameter: 0, avgOutDegree: 0, maxOutDegree: 0, numNodes: 0, numChannels: 0, totalNetworkCapacity: 0n, avgChannelSize: 0, minChannelSize: 0n, maxChannelSize: 0n, medianChannelSizeSat: 0n, numZombieChans: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NetworkInfo): NetworkInfo { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 graph_diameter */ 1: - message.graphDiameter = reader.uint32(); - break; - case /* double avg_out_degree */ 2: - message.avgOutDegree = reader.double(); - break; - case /* uint32 max_out_degree */ 3: - message.maxOutDegree = reader.uint32(); - break; - case /* uint32 num_nodes */ 4: - message.numNodes = reader.uint32(); - break; - case /* uint32 num_channels */ 5: - message.numChannels = reader.uint32(); - break; - case /* int64 total_network_capacity */ 6: - message.totalNetworkCapacity = reader.int64().toBigInt(); - break; - case /* double avg_channel_size */ 7: - message.avgChannelSize = reader.double(); - break; - case /* int64 min_channel_size */ 8: - message.minChannelSize = reader.int64().toBigInt(); - break; - case /* int64 max_channel_size */ 9: - message.maxChannelSize = reader.int64().toBigInt(); - break; - case /* int64 median_channel_size_sat */ 10: - message.medianChannelSizeSat = reader.int64().toBigInt(); - break; - case /* uint64 num_zombie_chans */ 11: - message.numZombieChans = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: NetworkInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint32 graph_diameter = 1; */ - if (message.graphDiameter !== 0) - writer.tag(1, WireType.Varint).uint32(message.graphDiameter); - /* double avg_out_degree = 2; */ - if (message.avgOutDegree !== 0) - writer.tag(2, WireType.Bit64).double(message.avgOutDegree); - /* uint32 max_out_degree = 3; */ - if (message.maxOutDegree !== 0) - writer.tag(3, WireType.Varint).uint32(message.maxOutDegree); - /* uint32 num_nodes = 4; */ - if (message.numNodes !== 0) - writer.tag(4, WireType.Varint).uint32(message.numNodes); - /* uint32 num_channels = 5; */ - if (message.numChannels !== 0) - writer.tag(5, WireType.Varint).uint32(message.numChannels); - /* int64 total_network_capacity = 6; */ - if (message.totalNetworkCapacity !== 0n) - writer.tag(6, WireType.Varint).int64(message.totalNetworkCapacity); - /* double avg_channel_size = 7; */ - if (message.avgChannelSize !== 0) - writer.tag(7, WireType.Bit64).double(message.avgChannelSize); - /* int64 min_channel_size = 8; */ - if (message.minChannelSize !== 0n) - writer.tag(8, WireType.Varint).int64(message.minChannelSize); - /* int64 max_channel_size = 9; */ - if (message.maxChannelSize !== 0n) - writer.tag(9, WireType.Varint).int64(message.maxChannelSize); - /* int64 median_channel_size_sat = 10; */ - if (message.medianChannelSizeSat !== 0n) - writer.tag(10, WireType.Varint).int64(message.medianChannelSizeSat); - /* uint64 num_zombie_chans = 11; */ - if (message.numZombieChans !== 0n) - writer.tag(11, WireType.Varint).uint64(message.numZombieChans); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NetworkInfo - */ -export const NetworkInfo = new NetworkInfo$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class StopRequest$Type extends MessageType { - constructor() { - super("lnrpc.StopRequest", []); - } - create(value?: PartialMessage): StopRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StopRequest): StopRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: StopRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.StopRequest - */ -export const StopRequest = new StopRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class StopResponse$Type extends MessageType { - constructor() { - super("lnrpc.StopResponse", []); - } - create(value?: PartialMessage): StopResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StopResponse): StopResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: StopResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.StopResponse - */ -export const StopResponse = new StopResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GraphTopologySubscription$Type extends MessageType { - constructor() { - super("lnrpc.GraphTopologySubscription", []); - } - create(value?: PartialMessage): GraphTopologySubscription { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GraphTopologySubscription): GraphTopologySubscription { - return target ?? this.create(); - } - internalBinaryWrite(message: GraphTopologySubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GraphTopologySubscription - */ -export const GraphTopologySubscription = new GraphTopologySubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GraphTopologyUpdate$Type extends MessageType { - constructor() { - super("lnrpc.GraphTopologyUpdate", [ - { no: 1, name: "node_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeUpdate }, - { no: 2, name: "channel_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdgeUpdate }, - { no: 3, name: "closed_chans", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ClosedChannelUpdate } - ]); - } - create(value?: PartialMessage): GraphTopologyUpdate { - const message = { nodeUpdates: [], channelUpdates: [], closedChans: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GraphTopologyUpdate): GraphTopologyUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.NodeUpdate node_updates */ 1: - message.nodeUpdates.push(NodeUpdate.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.ChannelEdgeUpdate channel_updates */ 2: - message.channelUpdates.push(ChannelEdgeUpdate.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.ClosedChannelUpdate closed_chans */ 3: - message.closedChans.push(ClosedChannelUpdate.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GraphTopologyUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.NodeUpdate node_updates = 1; */ - for (let i = 0; i < message.nodeUpdates.length; i++) - NodeUpdate.internalBinaryWrite(message.nodeUpdates[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.ChannelEdgeUpdate channel_updates = 2; */ - for (let i = 0; i < message.channelUpdates.length; i++) - ChannelEdgeUpdate.internalBinaryWrite(message.channelUpdates[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.ClosedChannelUpdate closed_chans = 3; */ - for (let i = 0; i < message.closedChans.length; i++) - ClosedChannelUpdate.internalBinaryWrite(message.closedChans[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GraphTopologyUpdate - */ -export const GraphTopologyUpdate = new GraphTopologyUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeUpdate$Type extends MessageType { - constructor() { - super("lnrpc.NodeUpdate", [ - { no: 1, name: "addresses", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "identity_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "global_features", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "node_addresses", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeAddress }, - { no: 6, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } - ]); - } - create(value?: PartialMessage): NodeUpdate { - const message = { addresses: [], identityKey: "", globalFeatures: new Uint8Array(0), alias: "", color: "", nodeAddresses: [], features: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeUpdate): NodeUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated string addresses = 1 [deprecated = true];*/ 1: - message.addresses.push(reader.string()); - break; - case /* string identity_key */ 2: - message.identityKey = reader.string(); - break; - case /* bytes global_features = 3 [deprecated = true];*/ 3: - message.globalFeatures = reader.bytes(); - break; - case /* string alias */ 4: - message.alias = reader.string(); - break; - case /* string color */ 5: - message.color = reader.string(); - break; - case /* repeated lnrpc.NodeAddress node_addresses */ 7: - message.nodeAddresses.push(NodeAddress.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* map features */ 6: - this.binaryReadMap6(message.features, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap6(map: NodeUpdate["features"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof NodeUpdate["features"] | undefined, val: NodeUpdate["features"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.NodeUpdate.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message: NodeUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated string addresses = 1 [deprecated = true]; */ - for (let i = 0; i < message.addresses.length; i++) - writer.tag(1, WireType.LengthDelimited).string(message.addresses[i]); - /* string identity_key = 2; */ - if (message.identityKey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.identityKey); - /* bytes global_features = 3 [deprecated = true]; */ - if (message.globalFeatures.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.globalFeatures); - /* string alias = 4; */ - if (message.alias !== "") - writer.tag(4, WireType.LengthDelimited).string(message.alias); - /* string color = 5; */ - if (message.color !== "") - writer.tag(5, WireType.LengthDelimited).string(message.color); - /* repeated lnrpc.NodeAddress node_addresses = 7; */ - for (let i = 0; i < message.nodeAddresses.length; i++) - NodeAddress.internalBinaryWrite(message.nodeAddresses[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* map features = 6; */ - for (let k of Object.keys(message.features)) { - writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k as any], writer, options); - writer.join().join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeUpdate - */ -export const NodeUpdate = new NodeUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEdgeUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelEdgeUpdate", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "chan_point", kind: "message", T: () => ChannelPoint }, - { no: 3, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "routing_policy", kind: "message", T: () => RoutingPolicy }, - { no: 5, name: "advertising_node", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "connecting_node", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): ChannelEdgeUpdate { - const message = { chanId: "0", capacity: 0n, advertisingNode: "", connectingNode: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEdgeUpdate): ChannelEdgeUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* lnrpc.ChannelPoint chan_point */ 2: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* int64 capacity */ 3: - message.capacity = reader.int64().toBigInt(); - break; - case /* lnrpc.RoutingPolicy routing_policy */ 4: - message.routingPolicy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.routingPolicy); - break; - case /* string advertising_node */ 5: - message.advertisingNode = reader.string(); - break; - case /* string connecting_node */ 6: - message.connectingNode = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelEdgeUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* lnrpc.ChannelPoint chan_point = 2; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* int64 capacity = 3; */ - if (message.capacity !== 0n) - writer.tag(3, WireType.Varint).int64(message.capacity); - /* lnrpc.RoutingPolicy routing_policy = 4; */ - if (message.routingPolicy) - RoutingPolicy.internalBinaryWrite(message.routingPolicy, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* string advertising_node = 5; */ - if (message.advertisingNode !== "") - writer.tag(5, WireType.LengthDelimited).string(message.advertisingNode); - /* string connecting_node = 6; */ - if (message.connectingNode !== "") - writer.tag(6, WireType.LengthDelimited).string(message.connectingNode); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEdgeUpdate - */ -export const ChannelEdgeUpdate = new ChannelEdgeUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ClosedChannelUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ClosedChannelUpdate", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "closed_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "chan_point", kind: "message", T: () => ChannelPoint } - ]); - } - create(value?: PartialMessage): ClosedChannelUpdate { - const message = { chanId: "0", capacity: 0n, closedHeight: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelUpdate): ClosedChannelUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* int64 capacity */ 2: - message.capacity = reader.int64().toBigInt(); - break; - case /* uint32 closed_height */ 3: - message.closedHeight = reader.uint32(); - break; - case /* lnrpc.ChannelPoint chan_point */ 4: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ClosedChannelUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* int64 capacity = 2; */ - if (message.capacity !== 0n) - writer.tag(2, WireType.Varint).int64(message.capacity); - /* uint32 closed_height = 3; */ - if (message.closedHeight !== 0) - writer.tag(3, WireType.Varint).uint32(message.closedHeight); - /* lnrpc.ChannelPoint chan_point = 4; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ClosedChannelUpdate - */ -export const ClosedChannelUpdate = new ClosedChannelUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HopHint$Type extends MessageType { - constructor() { - super("lnrpc.HopHint", [ - { no: 1, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "fee_base_msat", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "fee_proportional_millionths", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "cltv_expiry_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): HopHint { - const message = { nodeId: "", chanId: "0", feeBaseMsat: 0, feeProportionalMillionths: 0, cltvExpiryDelta: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HopHint): HopHint { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string node_id */ 1: - message.nodeId = reader.string(); - break; - case /* uint64 chan_id = 2 [jstype = JS_STRING];*/ 2: - message.chanId = reader.uint64().toString(); - break; - case /* uint32 fee_base_msat */ 3: - message.feeBaseMsat = reader.uint32(); - break; - case /* uint32 fee_proportional_millionths */ 4: - message.feeProportionalMillionths = reader.uint32(); - break; - case /* uint32 cltv_expiry_delta */ 5: - message.cltvExpiryDelta = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: HopHint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string node_id = 1; */ - if (message.nodeId !== "") - writer.tag(1, WireType.LengthDelimited).string(message.nodeId); - /* uint64 chan_id = 2 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(2, WireType.Varint).uint64(message.chanId); - /* uint32 fee_base_msat = 3; */ - if (message.feeBaseMsat !== 0) - writer.tag(3, WireType.Varint).uint32(message.feeBaseMsat); - /* uint32 fee_proportional_millionths = 4; */ - if (message.feeProportionalMillionths !== 0) - writer.tag(4, WireType.Varint).uint32(message.feeProportionalMillionths); - /* uint32 cltv_expiry_delta = 5; */ - if (message.cltvExpiryDelta !== 0) - writer.tag(5, WireType.Varint).uint32(message.cltvExpiryDelta); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.HopHint - */ -export const HopHint = new HopHint$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SetID$Type extends MessageType { - constructor() { - super("lnrpc.SetID", [ - { no: 1, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): SetID { - const message = { setId: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetID): SetID { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes set_id */ 1: - message.setId = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SetID, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes set_id = 1; */ - if (message.setId.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.setId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SetID - */ -export const SetID = new SetID$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RouteHint$Type extends MessageType { - constructor() { - super("lnrpc.RouteHint", [ - { no: 1, name: "hop_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HopHint } - ]); - } - create(value?: PartialMessage): RouteHint { - const message = { hopHints: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteHint): RouteHint { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.HopHint hop_hints */ 1: - message.hopHints.push(HopHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RouteHint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.HopHint hop_hints = 1; */ - for (let i = 0; i < message.hopHints.length; i++) - HopHint.internalBinaryWrite(message.hopHints[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RouteHint - */ -export const RouteHint = new RouteHint$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AMPInvoiceState$Type extends MessageType { - constructor() { - super("lnrpc.AMPInvoiceState", [ - { no: 1, name: "state", kind: "enum", T: () => ["lnrpc.InvoiceHTLCState", InvoiceHTLCState] }, - { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "settle_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): AMPInvoiceState { - const message = { state: 0, settleIndex: 0n, settleTime: 0n, amtPaidMsat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMPInvoiceState): AMPInvoiceState { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.InvoiceHTLCState state */ 1: - message.state = reader.int32(); - break; - case /* uint64 settle_index */ 2: - message.settleIndex = reader.uint64().toBigInt(); - break; - case /* int64 settle_time */ 3: - message.settleTime = reader.int64().toBigInt(); - break; - case /* int64 amt_paid_msat */ 5: - message.amtPaidMsat = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AMPInvoiceState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.InvoiceHTLCState state = 1; */ - if (message.state !== 0) - writer.tag(1, WireType.Varint).int32(message.state); - /* uint64 settle_index = 2; */ - if (message.settleIndex !== 0n) - writer.tag(2, WireType.Varint).uint64(message.settleIndex); - /* int64 settle_time = 3; */ - if (message.settleTime !== 0n) - writer.tag(3, WireType.Varint).int64(message.settleTime); - /* int64 amt_paid_msat = 5; */ - if (message.amtPaidMsat !== 0n) - writer.tag(5, WireType.Varint).int64(message.amtPaidMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AMPInvoiceState - */ -export const AMPInvoiceState = new AMPInvoiceState$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Invoice$Type extends MessageType { - constructor() { - super("lnrpc.Invoice", [ - { no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "r_preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 23, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 7, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "settle_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 11, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 14, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, - { no: 15, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 17, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 18, name: "amt_paid", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 19, name: "amt_paid_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 20, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 21, name: "state", kind: "enum", T: () => ["lnrpc.Invoice.InvoiceState", Invoice_InvoiceState] }, - { no: 22, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => InvoiceHTLC }, - { no: 24, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, - { no: 25, name: "is_keysend", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 26, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 27, name: "is_amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 28, name: "amp_invoice_state", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => AMPInvoiceState } } - ]); - } - create(value?: PartialMessage): Invoice { - const message = { memo: "", rPreimage: new Uint8Array(0), rHash: new Uint8Array(0), value: 0n, valueMsat: 0n, settled: false, creationDate: 0n, settleDate: 0n, paymentRequest: "", descriptionHash: new Uint8Array(0), expiry: 0n, fallbackAddr: "", cltvExpiry: 0n, routeHints: [], private: false, addIndex: 0n, settleIndex: 0n, amtPaid: 0n, amtPaidSat: 0n, amtPaidMsat: 0n, state: 0, htlcs: [], features: {}, isKeysend: false, paymentAddr: new Uint8Array(0), isAmp: false, ampInvoiceState: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Invoice): Invoice { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string memo */ 1: - message.memo = reader.string(); - break; - case /* bytes r_preimage */ 3: - message.rPreimage = reader.bytes(); - break; - case /* bytes r_hash */ 4: - message.rHash = reader.bytes(); - break; - case /* int64 value */ 5: - message.value = reader.int64().toBigInt(); - break; - case /* int64 value_msat */ 23: - message.valueMsat = reader.int64().toBigInt(); - break; - case /* bool settled = 6 [deprecated = true];*/ 6: - message.settled = reader.bool(); - break; - case /* int64 creation_date */ 7: - message.creationDate = reader.int64().toBigInt(); - break; - case /* int64 settle_date */ 8: - message.settleDate = reader.int64().toBigInt(); - break; - case /* string payment_request */ 9: - message.paymentRequest = reader.string(); - break; - case /* bytes description_hash */ 10: - message.descriptionHash = reader.bytes(); - break; - case /* int64 expiry */ 11: - message.expiry = reader.int64().toBigInt(); - break; - case /* string fallback_addr */ 12: - message.fallbackAddr = reader.string(); - break; - case /* uint64 cltv_expiry */ 13: - message.cltvExpiry = reader.uint64().toBigInt(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 14: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bool private */ 15: - message.private = reader.bool(); - break; - case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toBigInt(); - break; - case /* uint64 settle_index */ 17: - message.settleIndex = reader.uint64().toBigInt(); - break; - case /* int64 amt_paid = 18 [deprecated = true];*/ 18: - message.amtPaid = reader.int64().toBigInt(); - break; - case /* int64 amt_paid_sat */ 19: - message.amtPaidSat = reader.int64().toBigInt(); - break; - case /* int64 amt_paid_msat */ 20: - message.amtPaidMsat = reader.int64().toBigInt(); - break; - case /* lnrpc.Invoice.InvoiceState state */ 21: - message.state = reader.int32(); - break; - case /* repeated lnrpc.InvoiceHTLC htlcs */ 22: - message.htlcs.push(InvoiceHTLC.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* map features */ 24: - this.binaryReadMap24(message.features, reader, options); - break; - case /* bool is_keysend */ 25: - message.isKeysend = reader.bool(); - break; - case /* bytes payment_addr */ 26: - message.paymentAddr = reader.bytes(); - break; - case /* bool is_amp */ 27: - message.isAmp = reader.bool(); - break; - case /* map amp_invoice_state */ 28: - this.binaryReadMap28(message.ampInvoiceState, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap24(map: Invoice["features"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof Invoice["features"] | undefined, val: Invoice["features"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.Invoice.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - private binaryReadMap28(map: Invoice["ampInvoiceState"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof Invoice["ampInvoiceState"] | undefined, val: Invoice["ampInvoiceState"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = AMPInvoiceState.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.Invoice.amp_invoice_state"); - } - } - map[key ?? ""] = val ?? AMPInvoiceState.create(); - } - internalBinaryWrite(message: Invoice, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string memo = 1; */ - if (message.memo !== "") - writer.tag(1, WireType.LengthDelimited).string(message.memo); - /* bytes r_preimage = 3; */ - if (message.rPreimage.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.rPreimage); - /* bytes r_hash = 4; */ - if (message.rHash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.rHash); - /* int64 value = 5; */ - if (message.value !== 0n) - writer.tag(5, WireType.Varint).int64(message.value); - /* int64 value_msat = 23; */ - if (message.valueMsat !== 0n) - writer.tag(23, WireType.Varint).int64(message.valueMsat); - /* bool settled = 6 [deprecated = true]; */ - if (message.settled !== false) - writer.tag(6, WireType.Varint).bool(message.settled); - /* int64 creation_date = 7; */ - if (message.creationDate !== 0n) - writer.tag(7, WireType.Varint).int64(message.creationDate); - /* int64 settle_date = 8; */ - if (message.settleDate !== 0n) - writer.tag(8, WireType.Varint).int64(message.settleDate); - /* string payment_request = 9; */ - if (message.paymentRequest !== "") - writer.tag(9, WireType.LengthDelimited).string(message.paymentRequest); - /* bytes description_hash = 10; */ - if (message.descriptionHash.length) - writer.tag(10, WireType.LengthDelimited).bytes(message.descriptionHash); - /* int64 expiry = 11; */ - if (message.expiry !== 0n) - writer.tag(11, WireType.Varint).int64(message.expiry); - /* string fallback_addr = 12; */ - if (message.fallbackAddr !== "") - writer.tag(12, WireType.LengthDelimited).string(message.fallbackAddr); - /* uint64 cltv_expiry = 13; */ - if (message.cltvExpiry !== 0n) - writer.tag(13, WireType.Varint).uint64(message.cltvExpiry); - /* repeated lnrpc.RouteHint route_hints = 14; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join(); - /* bool private = 15; */ - if (message.private !== false) - writer.tag(15, WireType.Varint).bool(message.private); - /* uint64 add_index = 16; */ - if (message.addIndex !== 0n) - writer.tag(16, WireType.Varint).uint64(message.addIndex); - /* uint64 settle_index = 17; */ - if (message.settleIndex !== 0n) - writer.tag(17, WireType.Varint).uint64(message.settleIndex); - /* int64 amt_paid = 18 [deprecated = true]; */ - if (message.amtPaid !== 0n) - writer.tag(18, WireType.Varint).int64(message.amtPaid); - /* int64 amt_paid_sat = 19; */ - if (message.amtPaidSat !== 0n) - writer.tag(19, WireType.Varint).int64(message.amtPaidSat); - /* int64 amt_paid_msat = 20; */ - if (message.amtPaidMsat !== 0n) - writer.tag(20, WireType.Varint).int64(message.amtPaidMsat); - /* lnrpc.Invoice.InvoiceState state = 21; */ - if (message.state !== 0) - writer.tag(21, WireType.Varint).int32(message.state); - /* repeated lnrpc.InvoiceHTLC htlcs = 22; */ - for (let i = 0; i < message.htlcs.length; i++) - InvoiceHTLC.internalBinaryWrite(message.htlcs[i], writer.tag(22, WireType.LengthDelimited).fork(), options).join(); - /* map features = 24; */ - for (let k of Object.keys(message.features)) { - writer.tag(24, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k as any], writer, options); - writer.join().join(); - } - /* bool is_keysend = 25; */ - if (message.isKeysend !== false) - writer.tag(25, WireType.Varint).bool(message.isKeysend); - /* bytes payment_addr = 26; */ - if (message.paymentAddr.length) - writer.tag(26, WireType.LengthDelimited).bytes(message.paymentAddr); - /* bool is_amp = 27; */ - if (message.isAmp !== false) - writer.tag(27, WireType.Varint).bool(message.isAmp); - /* map amp_invoice_state = 28; */ - for (let k of Object.keys(message.ampInvoiceState)) { - writer.tag(28, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); - writer.tag(2, WireType.LengthDelimited).fork(); - AMPInvoiceState.internalBinaryWrite(message.ampInvoiceState[k], writer, options); - writer.join().join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Invoice - */ -export const Invoice = new Invoice$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InvoiceHTLC$Type extends MessageType { - constructor() { - super("lnrpc.InvoiceHTLC", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "accept_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "accept_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "resolve_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "expiry_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 8, name: "state", kind: "enum", T: () => ["lnrpc.InvoiceHTLCState", InvoiceHTLCState] }, - { no: 9, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 10, name: "mpp_total_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 11, name: "amp", kind: "message", T: () => AMP } - ]); - } - create(value?: PartialMessage): InvoiceHTLC { - const message = { chanId: "0", htlcIndex: 0n, amtMsat: 0n, acceptHeight: 0, acceptTime: 0n, resolveTime: 0n, expiryHeight: 0, state: 0, customRecords: {}, mppTotalAmtMsat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InvoiceHTLC): InvoiceHTLC { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* uint64 htlc_index */ 2: - message.htlcIndex = reader.uint64().toBigInt(); - break; - case /* uint64 amt_msat */ 3: - message.amtMsat = reader.uint64().toBigInt(); - break; - case /* int32 accept_height */ 4: - message.acceptHeight = reader.int32(); - break; - case /* int64 accept_time */ 5: - message.acceptTime = reader.int64().toBigInt(); - break; - case /* int64 resolve_time */ 6: - message.resolveTime = reader.int64().toBigInt(); - break; - case /* int32 expiry_height */ 7: - message.expiryHeight = reader.int32(); - break; - case /* lnrpc.InvoiceHTLCState state */ 8: - message.state = reader.int32(); - break; - case /* map custom_records */ 9: - this.binaryReadMap9(message.customRecords, reader, options); - break; - case /* uint64 mpp_total_amt_msat */ 10: - message.mppTotalAmtMsat = reader.uint64().toBigInt(); - break; - case /* lnrpc.AMP amp */ 11: - message.amp = AMP.internalBinaryRead(reader, reader.uint32(), options, message.amp); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap9(map: InvoiceHTLC["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof InvoiceHTLC["customRecords"] | undefined, val: InvoiceHTLC["customRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.InvoiceHTLC.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: InvoiceHTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* uint64 htlc_index = 2; */ - if (message.htlcIndex !== 0n) - writer.tag(2, WireType.Varint).uint64(message.htlcIndex); - /* uint64 amt_msat = 3; */ - if (message.amtMsat !== 0n) - writer.tag(3, WireType.Varint).uint64(message.amtMsat); - /* int32 accept_height = 4; */ - if (message.acceptHeight !== 0) - writer.tag(4, WireType.Varint).int32(message.acceptHeight); - /* int64 accept_time = 5; */ - if (message.acceptTime !== 0n) - writer.tag(5, WireType.Varint).int64(message.acceptTime); - /* int64 resolve_time = 6; */ - if (message.resolveTime !== 0n) - writer.tag(6, WireType.Varint).int64(message.resolveTime); - /* int32 expiry_height = 7; */ - if (message.expiryHeight !== 0) - writer.tag(7, WireType.Varint).int32(message.expiryHeight); - /* lnrpc.InvoiceHTLCState state = 8; */ - if (message.state !== 0) - writer.tag(8, WireType.Varint).int32(message.state); - /* map custom_records = 9; */ - for (let k of Object.keys(message.customRecords)) - writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); - /* uint64 mpp_total_amt_msat = 10; */ - if (message.mppTotalAmtMsat !== 0n) - writer.tag(10, WireType.Varint).uint64(message.mppTotalAmtMsat); - /* lnrpc.AMP amp = 11; */ - if (message.amp) - AMP.internalBinaryWrite(message.amp, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.InvoiceHTLC - */ -export const InvoiceHTLC = new InvoiceHTLC$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AMP$Type extends MessageType { - constructor() { - super("lnrpc.AMP", [ - { no: 1, name: "root_share", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "child_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): AMP { - const message = { rootShare: new Uint8Array(0), setId: new Uint8Array(0), childIndex: 0, hash: new Uint8Array(0), preimage: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMP): AMP { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes root_share */ 1: - message.rootShare = reader.bytes(); - break; - case /* bytes set_id */ 2: - message.setId = reader.bytes(); - break; - case /* uint32 child_index */ 3: - message.childIndex = reader.uint32(); - break; - case /* bytes hash */ 4: - message.hash = reader.bytes(); - break; - case /* bytes preimage */ 5: - message.preimage = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AMP, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes root_share = 1; */ - if (message.rootShare.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rootShare); - /* bytes set_id = 2; */ - if (message.setId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.setId); - /* uint32 child_index = 3; */ - if (message.childIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.childIndex); - /* bytes hash = 4; */ - if (message.hash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.hash); - /* bytes preimage = 5; */ - if (message.preimage.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.preimage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AMP - */ -export const AMP = new AMP$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AddInvoiceResponse$Type extends MessageType { - constructor() { - super("lnrpc.AddInvoiceResponse", [ - { no: 1, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 17, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): AddInvoiceResponse { - const message = { rHash: new Uint8Array(0), paymentRequest: "", addIndex: 0n, paymentAddr: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddInvoiceResponse): AddInvoiceResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes r_hash */ 1: - message.rHash = reader.bytes(); - break; - case /* string payment_request */ 2: - message.paymentRequest = reader.string(); - break; - case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toBigInt(); - break; - case /* bytes payment_addr */ 17: - message.paymentAddr = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AddInvoiceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes r_hash = 1; */ - if (message.rHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rHash); - /* string payment_request = 2; */ - if (message.paymentRequest !== "") - writer.tag(2, WireType.LengthDelimited).string(message.paymentRequest); - /* uint64 add_index = 16; */ - if (message.addIndex !== 0n) - writer.tag(16, WireType.Varint).uint64(message.addIndex); - /* bytes payment_addr = 17; */ - if (message.paymentAddr.length) - writer.tag(17, WireType.LengthDelimited).bytes(message.paymentAddr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AddInvoiceResponse - */ -export const AddInvoiceResponse = new AddInvoiceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PaymentHash$Type extends MessageType { - constructor() { - super("lnrpc.PaymentHash", [ - { no: 1, name: "r_hash_str", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): PaymentHash { - const message = { rHashStr: "", rHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PaymentHash): PaymentHash { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string r_hash_str = 1 [deprecated = true];*/ 1: - message.rHashStr = reader.string(); - break; - case /* bytes r_hash */ 2: - message.rHash = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PaymentHash, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string r_hash_str = 1 [deprecated = true]; */ - if (message.rHashStr !== "") - writer.tag(1, WireType.LengthDelimited).string(message.rHashStr); - /* bytes r_hash = 2; */ - if (message.rHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.rHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PaymentHash - */ -export const PaymentHash = new PaymentHash$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListInvoiceRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListInvoiceRequest", [ - { no: 1, name: "pending_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "num_max_invoices", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ListInvoiceRequest { - const message = { pendingOnly: false, indexOffset: 0n, numMaxInvoices: 0n, reversed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListInvoiceRequest): ListInvoiceRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool pending_only */ 1: - message.pendingOnly = reader.bool(); - break; - case /* uint64 index_offset */ 4: - message.indexOffset = reader.uint64().toBigInt(); - break; - case /* uint64 num_max_invoices */ 5: - message.numMaxInvoices = reader.uint64().toBigInt(); - break; - case /* bool reversed */ 6: - message.reversed = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool pending_only = 1; */ - if (message.pendingOnly !== false) - writer.tag(1, WireType.Varint).bool(message.pendingOnly); - /* uint64 index_offset = 4; */ - if (message.indexOffset !== 0n) - writer.tag(4, WireType.Varint).uint64(message.indexOffset); - /* uint64 num_max_invoices = 5; */ - if (message.numMaxInvoices !== 0n) - writer.tag(5, WireType.Varint).uint64(message.numMaxInvoices); - /* bool reversed = 6; */ - if (message.reversed !== false) - writer.tag(6, WireType.Varint).bool(message.reversed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListInvoiceRequest - */ -export const ListInvoiceRequest = new ListInvoiceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListInvoiceResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListInvoiceResponse", [ - { no: 1, name: "invoices", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Invoice }, - { no: 2, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): ListInvoiceResponse { - const message = { invoices: [], lastIndexOffset: 0n, firstIndexOffset: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListInvoiceResponse): ListInvoiceResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Invoice invoices */ 1: - message.invoices.push(Invoice.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 last_index_offset */ 2: - message.lastIndexOffset = reader.uint64().toBigInt(); - break; - case /* uint64 first_index_offset */ 3: - message.firstIndexOffset = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListInvoiceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.Invoice invoices = 1; */ - for (let i = 0; i < message.invoices.length; i++) - Invoice.internalBinaryWrite(message.invoices[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint64 last_index_offset = 2; */ - if (message.lastIndexOffset !== 0n) - writer.tag(2, WireType.Varint).uint64(message.lastIndexOffset); - /* uint64 first_index_offset = 3; */ - if (message.firstIndexOffset !== 0n) - writer.tag(3, WireType.Varint).uint64(message.firstIndexOffset); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListInvoiceResponse - */ -export const ListInvoiceResponse = new ListInvoiceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InvoiceSubscription$Type extends MessageType { - constructor() { - super("lnrpc.InvoiceSubscription", [ - { no: 1, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): InvoiceSubscription { - const message = { addIndex: 0n, settleIndex: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InvoiceSubscription): InvoiceSubscription { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 add_index */ 1: - message.addIndex = reader.uint64().toBigInt(); - break; - case /* uint64 settle_index */ 2: - message.settleIndex = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InvoiceSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 add_index = 1; */ - if (message.addIndex !== 0n) - writer.tag(1, WireType.Varint).uint64(message.addIndex); - /* uint64 settle_index = 2; */ - if (message.settleIndex !== 0n) - writer.tag(2, WireType.Varint).uint64(message.settleIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.InvoiceSubscription - */ -export const InvoiceSubscription = new InvoiceSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Payment$Type extends MessageType { - constructor() { - super("lnrpc.Payment", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "payment_preimage", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "value_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "status", kind: "enum", T: () => ["lnrpc.Payment.PaymentStatus", Payment_PaymentStatus] }, - { no: 11, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 13, name: "creation_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 14, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLCAttempt }, - { no: 15, name: "payment_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 16, name: "failure_reason", kind: "enum", T: () => ["lnrpc.PaymentFailureReason", PaymentFailureReason] } - ]); - } - create(value?: PartialMessage): Payment { - const message = { paymentHash: "", value: 0n, creationDate: 0n, fee: 0n, paymentPreimage: "", valueSat: 0n, valueMsat: 0n, paymentRequest: "", status: 0, feeSat: 0n, feeMsat: 0n, creationTimeNs: 0n, htlcs: [], paymentIndex: 0n, failureReason: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Payment): Payment { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string payment_hash */ 1: - message.paymentHash = reader.string(); - break; - case /* int64 value = 2 [deprecated = true];*/ 2: - message.value = reader.int64().toBigInt(); - break; - case /* int64 creation_date = 3 [deprecated = true];*/ 3: - message.creationDate = reader.int64().toBigInt(); - break; - case /* int64 fee = 5 [deprecated = true];*/ 5: - message.fee = reader.int64().toBigInt(); - break; - case /* string payment_preimage */ 6: - message.paymentPreimage = reader.string(); - break; - case /* int64 value_sat */ 7: - message.valueSat = reader.int64().toBigInt(); - break; - case /* int64 value_msat */ 8: - message.valueMsat = reader.int64().toBigInt(); - break; - case /* string payment_request */ 9: - message.paymentRequest = reader.string(); - break; - case /* lnrpc.Payment.PaymentStatus status */ 10: - message.status = reader.int32(); - break; - case /* int64 fee_sat */ 11: - message.feeSat = reader.int64().toBigInt(); - break; - case /* int64 fee_msat */ 12: - message.feeMsat = reader.int64().toBigInt(); - break; - case /* int64 creation_time_ns */ 13: - message.creationTimeNs = reader.int64().toBigInt(); - break; - case /* repeated lnrpc.HTLCAttempt htlcs */ 14: - message.htlcs.push(HTLCAttempt.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 payment_index */ 15: - message.paymentIndex = reader.uint64().toBigInt(); - break; - case /* lnrpc.PaymentFailureReason failure_reason */ 16: - message.failureReason = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Payment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string payment_hash = 1; */ - if (message.paymentHash !== "") - writer.tag(1, WireType.LengthDelimited).string(message.paymentHash); - /* int64 value = 2 [deprecated = true]; */ - if (message.value !== 0n) - writer.tag(2, WireType.Varint).int64(message.value); - /* int64 creation_date = 3 [deprecated = true]; */ - if (message.creationDate !== 0n) - writer.tag(3, WireType.Varint).int64(message.creationDate); - /* int64 fee = 5 [deprecated = true]; */ - if (message.fee !== 0n) - writer.tag(5, WireType.Varint).int64(message.fee); - /* string payment_preimage = 6; */ - if (message.paymentPreimage !== "") - writer.tag(6, WireType.LengthDelimited).string(message.paymentPreimage); - /* int64 value_sat = 7; */ - if (message.valueSat !== 0n) - writer.tag(7, WireType.Varint).int64(message.valueSat); - /* int64 value_msat = 8; */ - if (message.valueMsat !== 0n) - writer.tag(8, WireType.Varint).int64(message.valueMsat); - /* string payment_request = 9; */ - if (message.paymentRequest !== "") - writer.tag(9, WireType.LengthDelimited).string(message.paymentRequest); - /* lnrpc.Payment.PaymentStatus status = 10; */ - if (message.status !== 0) - writer.tag(10, WireType.Varint).int32(message.status); - /* int64 fee_sat = 11; */ - if (message.feeSat !== 0n) - writer.tag(11, WireType.Varint).int64(message.feeSat); - /* int64 fee_msat = 12; */ - if (message.feeMsat !== 0n) - writer.tag(12, WireType.Varint).int64(message.feeMsat); - /* int64 creation_time_ns = 13; */ - if (message.creationTimeNs !== 0n) - writer.tag(13, WireType.Varint).int64(message.creationTimeNs); - /* repeated lnrpc.HTLCAttempt htlcs = 14; */ - for (let i = 0; i < message.htlcs.length; i++) - HTLCAttempt.internalBinaryWrite(message.htlcs[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join(); - /* uint64 payment_index = 15; */ - if (message.paymentIndex !== 0n) - writer.tag(15, WireType.Varint).uint64(message.paymentIndex); - /* lnrpc.PaymentFailureReason failure_reason = 16; */ - if (message.failureReason !== 0) - writer.tag(16, WireType.Varint).int32(message.failureReason); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Payment - */ -export const Payment = new Payment$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HTLCAttempt$Type extends MessageType { - constructor() { - super("lnrpc.HTLCAttempt", [ - { no: 7, name: "attempt_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 1, name: "status", kind: "enum", T: () => ["lnrpc.HTLCAttempt.HTLCStatus", HTLCAttempt_HTLCStatus] }, - { no: 2, name: "route", kind: "message", T: () => Route }, - { no: 3, name: "attempt_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "resolve_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "failure", kind: "message", T: () => Failure }, - { no: 6, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): HTLCAttempt { - const message = { attemptId: 0n, status: 0, attemptTimeNs: 0n, resolveTimeNs: 0n, preimage: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HTLCAttempt): HTLCAttempt { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 attempt_id */ 7: - message.attemptId = reader.uint64().toBigInt(); - break; - case /* lnrpc.HTLCAttempt.HTLCStatus status */ 1: - message.status = reader.int32(); - break; - case /* lnrpc.Route route */ 2: - message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); - break; - case /* int64 attempt_time_ns */ 3: - message.attemptTimeNs = reader.int64().toBigInt(); - break; - case /* int64 resolve_time_ns */ 4: - message.resolveTimeNs = reader.int64().toBigInt(); - break; - case /* lnrpc.Failure failure */ 5: - message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); - break; - case /* bytes preimage */ 6: - message.preimage = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: HTLCAttempt, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 attempt_id = 7; */ - if (message.attemptId !== 0n) - writer.tag(7, WireType.Varint).uint64(message.attemptId); - /* lnrpc.HTLCAttempt.HTLCStatus status = 1; */ - if (message.status !== 0) - writer.tag(1, WireType.Varint).int32(message.status); - /* lnrpc.Route route = 2; */ - if (message.route) - Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* int64 attempt_time_ns = 3; */ - if (message.attemptTimeNs !== 0n) - writer.tag(3, WireType.Varint).int64(message.attemptTimeNs); - /* int64 resolve_time_ns = 4; */ - if (message.resolveTimeNs !== 0n) - writer.tag(4, WireType.Varint).int64(message.resolveTimeNs); - /* lnrpc.Failure failure = 5; */ - if (message.failure) - Failure.internalBinaryWrite(message.failure, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* bytes preimage = 6; */ - if (message.preimage.length) - writer.tag(6, WireType.LengthDelimited).bytes(message.preimage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.HTLCAttempt - */ -export const HTLCAttempt = new HTLCAttempt$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPaymentsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListPaymentsRequest", [ - { no: 1, name: "include_incomplete", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "max_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "count_total_payments", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ListPaymentsRequest { - const message = { includeIncomplete: false, indexOffset: 0n, maxPayments: 0n, reversed: false, countTotalPayments: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPaymentsRequest): ListPaymentsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool include_incomplete */ 1: - message.includeIncomplete = reader.bool(); - break; - case /* uint64 index_offset */ 2: - message.indexOffset = reader.uint64().toBigInt(); - break; - case /* uint64 max_payments */ 3: - message.maxPayments = reader.uint64().toBigInt(); - break; - case /* bool reversed */ 4: - message.reversed = reader.bool(); - break; - case /* bool count_total_payments */ 5: - message.countTotalPayments = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool include_incomplete = 1; */ - if (message.includeIncomplete !== false) - writer.tag(1, WireType.Varint).bool(message.includeIncomplete); - /* uint64 index_offset = 2; */ - if (message.indexOffset !== 0n) - writer.tag(2, WireType.Varint).uint64(message.indexOffset); - /* uint64 max_payments = 3; */ - if (message.maxPayments !== 0n) - writer.tag(3, WireType.Varint).uint64(message.maxPayments); - /* bool reversed = 4; */ - if (message.reversed !== false) - writer.tag(4, WireType.Varint).bool(message.reversed); - /* bool count_total_payments = 5; */ - if (message.countTotalPayments !== false) - writer.tag(5, WireType.Varint).bool(message.countTotalPayments); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPaymentsRequest - */ -export const ListPaymentsRequest = new ListPaymentsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPaymentsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListPaymentsResponse", [ - { no: 1, name: "payments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Payment }, - { no: 2, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "total_num_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): ListPaymentsResponse { - const message = { payments: [], firstIndexOffset: 0n, lastIndexOffset: 0n, totalNumPayments: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPaymentsResponse): ListPaymentsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Payment payments */ 1: - message.payments.push(Payment.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 first_index_offset */ 2: - message.firstIndexOffset = reader.uint64().toBigInt(); - break; - case /* uint64 last_index_offset */ 3: - message.lastIndexOffset = reader.uint64().toBigInt(); - break; - case /* uint64 total_num_payments */ 4: - message.totalNumPayments = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListPaymentsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.Payment payments = 1; */ - for (let i = 0; i < message.payments.length; i++) - Payment.internalBinaryWrite(message.payments[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint64 first_index_offset = 2; */ - if (message.firstIndexOffset !== 0n) - writer.tag(2, WireType.Varint).uint64(message.firstIndexOffset); - /* uint64 last_index_offset = 3; */ - if (message.lastIndexOffset !== 0n) - writer.tag(3, WireType.Varint).uint64(message.lastIndexOffset); - /* uint64 total_num_payments = 4; */ - if (message.totalNumPayments !== 0n) - writer.tag(4, WireType.Varint).uint64(message.totalNumPayments); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPaymentsResponse - */ -export const ListPaymentsResponse = new ListPaymentsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeletePaymentRequest$Type extends MessageType { - constructor() { - super("lnrpc.DeletePaymentRequest", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "failed_htlcs_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): DeletePaymentRequest { - const message = { paymentHash: new Uint8Array(0), failedHtlcsOnly: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentRequest): DeletePaymentRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_hash */ 1: - message.paymentHash = reader.bytes(); - break; - case /* bool failed_htlcs_only */ 2: - message.failedHtlcsOnly = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: DeletePaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - /* bool failed_htlcs_only = 2; */ - if (message.failedHtlcsOnly !== false) - writer.tag(2, WireType.Varint).bool(message.failedHtlcsOnly); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeletePaymentRequest - */ -export const DeletePaymentRequest = new DeletePaymentRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteAllPaymentsRequest$Type extends MessageType { - constructor() { - super("lnrpc.DeleteAllPaymentsRequest", [ - { no: 1, name: "failed_payments_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "failed_htlcs_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): DeleteAllPaymentsRequest { - const message = { failedPaymentsOnly: false, failedHtlcsOnly: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllPaymentsRequest): DeleteAllPaymentsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool failed_payments_only */ 1: - message.failedPaymentsOnly = reader.bool(); - break; - case /* bool failed_htlcs_only */ 2: - message.failedHtlcsOnly = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: DeleteAllPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool failed_payments_only = 1; */ - if (message.failedPaymentsOnly !== false) - writer.tag(1, WireType.Varint).bool(message.failedPaymentsOnly); - /* bool failed_htlcs_only = 2; */ - if (message.failedHtlcsOnly !== false) - writer.tag(2, WireType.Varint).bool(message.failedHtlcsOnly); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteAllPaymentsRequest - */ -export const DeleteAllPaymentsRequest = new DeleteAllPaymentsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeletePaymentResponse$Type extends MessageType { - constructor() { - super("lnrpc.DeletePaymentResponse", []); - } - create(value?: PartialMessage): DeletePaymentResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentResponse): DeletePaymentResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: DeletePaymentResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeletePaymentResponse - */ -export const DeletePaymentResponse = new DeletePaymentResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteAllPaymentsResponse$Type extends MessageType { - constructor() { - super("lnrpc.DeleteAllPaymentsResponse", []); - } - create(value?: PartialMessage): DeleteAllPaymentsResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllPaymentsResponse): DeleteAllPaymentsResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: DeleteAllPaymentsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteAllPaymentsResponse - */ -export const DeleteAllPaymentsResponse = new DeleteAllPaymentsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AbandonChannelRequest$Type extends MessageType { - constructor() { - super("lnrpc.AbandonChannelRequest", [ - { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint }, - { no: 2, name: "pending_funding_shim_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "i_know_what_i_am_doing", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): AbandonChannelRequest { - const message = { pendingFundingShimOnly: false, iKnowWhatIAmDoing: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AbandonChannelRequest): AbandonChannelRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint channel_point */ 1: - message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); - break; - case /* bool pending_funding_shim_only */ 2: - message.pendingFundingShimOnly = reader.bool(); - break; - case /* bool i_know_what_i_am_doing */ 3: - message.iKnowWhatIAmDoing = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: AbandonChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelPoint channel_point = 1; */ - if (message.channelPoint) - ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bool pending_funding_shim_only = 2; */ - if (message.pendingFundingShimOnly !== false) - writer.tag(2, WireType.Varint).bool(message.pendingFundingShimOnly); - /* bool i_know_what_i_am_doing = 3; */ - if (message.iKnowWhatIAmDoing !== false) - writer.tag(3, WireType.Varint).bool(message.iKnowWhatIAmDoing); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AbandonChannelRequest - */ -export const AbandonChannelRequest = new AbandonChannelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AbandonChannelResponse$Type extends MessageType { - constructor() { - super("lnrpc.AbandonChannelResponse", []); - } - create(value?: PartialMessage): AbandonChannelResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AbandonChannelResponse): AbandonChannelResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: AbandonChannelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AbandonChannelResponse - */ -export const AbandonChannelResponse = new AbandonChannelResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DebugLevelRequest$Type extends MessageType { - constructor() { - super("lnrpc.DebugLevelRequest", [ - { no: 1, name: "show", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "level_spec", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): DebugLevelRequest { - const message = { show: false, levelSpec: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DebugLevelRequest): DebugLevelRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool show */ 1: - message.show = reader.bool(); - break; - case /* string level_spec */ 2: - message.levelSpec = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: DebugLevelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool show = 1; */ - if (message.show !== false) - writer.tag(1, WireType.Varint).bool(message.show); - /* string level_spec = 2; */ - if (message.levelSpec !== "") - writer.tag(2, WireType.LengthDelimited).string(message.levelSpec); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DebugLevelRequest - */ -export const DebugLevelRequest = new DebugLevelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DebugLevelResponse$Type extends MessageType { - constructor() { - super("lnrpc.DebugLevelResponse", [ - { no: 1, name: "sub_systems", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): DebugLevelResponse { - const message = { subSystems: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DebugLevelResponse): DebugLevelResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string sub_systems */ 1: - message.subSystems = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: DebugLevelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string sub_systems = 1; */ - if (message.subSystems !== "") - writer.tag(1, WireType.LengthDelimited).string(message.subSystems); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DebugLevelResponse - */ -export const DebugLevelResponse = new DebugLevelResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PayReqString$Type extends MessageType { - constructor() { - super("lnrpc.PayReqString", [ - { no: 1, name: "pay_req", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): PayReqString { - const message = { payReq: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PayReqString): PayReqString { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pay_req */ 1: - message.payReq = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PayReqString, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string pay_req = 1; */ - if (message.payReq !== "") - writer.tag(1, WireType.LengthDelimited).string(message.payReq); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PayReqString - */ -export const PayReqString = new PayReqString$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PayReq$Type extends MessageType { - constructor() { - super("lnrpc.PayReq", [ - { no: 1, name: "destination", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "payment_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "num_satoshis", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "description_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "cltv_expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, - { no: 11, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 12, name: "num_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 13, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } - ]); - } - create(value?: PartialMessage): PayReq { - const message = { destination: "", paymentHash: "", numSatoshis: 0n, timestamp: 0n, expiry: 0n, description: "", descriptionHash: "", fallbackAddr: "", cltvExpiry: 0n, routeHints: [], paymentAddr: new Uint8Array(0), numMsat: 0n, features: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PayReq): PayReq { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string destination */ 1: - message.destination = reader.string(); - break; - case /* string payment_hash */ 2: - message.paymentHash = reader.string(); - break; - case /* int64 num_satoshis */ 3: - message.numSatoshis = reader.int64().toBigInt(); - break; - case /* int64 timestamp */ 4: - message.timestamp = reader.int64().toBigInt(); - break; - case /* int64 expiry */ 5: - message.expiry = reader.int64().toBigInt(); - break; - case /* string description */ 6: - message.description = reader.string(); - break; - case /* string description_hash */ 7: - message.descriptionHash = reader.string(); - break; - case /* string fallback_addr */ 8: - message.fallbackAddr = reader.string(); - break; - case /* int64 cltv_expiry */ 9: - message.cltvExpiry = reader.int64().toBigInt(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 10: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bytes payment_addr */ 11: - message.paymentAddr = reader.bytes(); - break; - case /* int64 num_msat */ 12: - message.numMsat = reader.int64().toBigInt(); - break; - case /* map features */ 13: - this.binaryReadMap13(message.features, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap13(map: PayReq["features"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof PayReq["features"] | undefined, val: PayReq["features"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.PayReq.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message: PayReq, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string destination = 1; */ - if (message.destination !== "") - writer.tag(1, WireType.LengthDelimited).string(message.destination); - /* string payment_hash = 2; */ - if (message.paymentHash !== "") - writer.tag(2, WireType.LengthDelimited).string(message.paymentHash); - /* int64 num_satoshis = 3; */ - if (message.numSatoshis !== 0n) - writer.tag(3, WireType.Varint).int64(message.numSatoshis); - /* int64 timestamp = 4; */ - if (message.timestamp !== 0n) - writer.tag(4, WireType.Varint).int64(message.timestamp); - /* int64 expiry = 5; */ - if (message.expiry !== 0n) - writer.tag(5, WireType.Varint).int64(message.expiry); - /* string description = 6; */ - if (message.description !== "") - writer.tag(6, WireType.LengthDelimited).string(message.description); - /* string description_hash = 7; */ - if (message.descriptionHash !== "") - writer.tag(7, WireType.LengthDelimited).string(message.descriptionHash); - /* string fallback_addr = 8; */ - if (message.fallbackAddr !== "") - writer.tag(8, WireType.LengthDelimited).string(message.fallbackAddr); - /* int64 cltv_expiry = 9; */ - if (message.cltvExpiry !== 0n) - writer.tag(9, WireType.Varint).int64(message.cltvExpiry); - /* repeated lnrpc.RouteHint route_hints = 10; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* bytes payment_addr = 11; */ - if (message.paymentAddr.length) - writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); - /* int64 num_msat = 12; */ - if (message.numMsat !== 0n) - writer.tag(12, WireType.Varint).int64(message.numMsat); - /* map features = 13; */ - for (let k of Object.keys(message.features)) { - writer.tag(13, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k as any], writer, options); - writer.join().join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PayReq - */ -export const PayReq = new PayReq$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Feature$Type extends MessageType { - constructor() { - super("lnrpc.Feature", [ - { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "is_required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "is_known", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): Feature { - const message = { name: "", isRequired: false, isKnown: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Feature): Feature { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string name */ 2: - message.name = reader.string(); - break; - case /* bool is_required */ 3: - message.isRequired = reader.bool(); - break; - case /* bool is_known */ 4: - message.isKnown = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Feature, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string name = 2; */ - if (message.name !== "") - writer.tag(2, WireType.LengthDelimited).string(message.name); - /* bool is_required = 3; */ - if (message.isRequired !== false) - writer.tag(3, WireType.Varint).bool(message.isRequired); - /* bool is_known = 4; */ - if (message.isKnown !== false) - writer.tag(4, WireType.Varint).bool(message.isKnown); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Feature - */ -export const Feature = new Feature$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FeeReportRequest$Type extends MessageType { - constructor() { - super("lnrpc.FeeReportRequest", []); - } - create(value?: PartialMessage): FeeReportRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeReportRequest): FeeReportRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: FeeReportRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FeeReportRequest - */ -export const FeeReportRequest = new FeeReportRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelFeeReport$Type extends MessageType { - constructor() { - super("lnrpc.ChannelFeeReport", [ - { no: 5, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 1, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "fee_per_mil", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "fee_rate", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value?: PartialMessage): ChannelFeeReport { - const message = { chanId: "0", channelPoint: "", baseFeeMsat: 0n, feePerMil: 0n, feeRate: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelFeeReport): ChannelFeeReport { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id = 5 [jstype = JS_STRING];*/ 5: - message.chanId = reader.uint64().toString(); - break; - case /* string channel_point */ 1: - message.channelPoint = reader.string(); - break; - case /* int64 base_fee_msat */ 2: - message.baseFeeMsat = reader.int64().toBigInt(); - break; - case /* int64 fee_per_mil */ 3: - message.feePerMil = reader.int64().toBigInt(); - break; - case /* double fee_rate */ 4: - message.feeRate = reader.double(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelFeeReport, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 5 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(5, WireType.Varint).uint64(message.chanId); - /* string channel_point = 1; */ - if (message.channelPoint !== "") - writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); - /* int64 base_fee_msat = 2; */ - if (message.baseFeeMsat !== 0n) - writer.tag(2, WireType.Varint).int64(message.baseFeeMsat); - /* int64 fee_per_mil = 3; */ - if (message.feePerMil !== 0n) - writer.tag(3, WireType.Varint).int64(message.feePerMil); - /* double fee_rate = 4; */ - if (message.feeRate !== 0) - writer.tag(4, WireType.Bit64).double(message.feeRate); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelFeeReport - */ -export const ChannelFeeReport = new ChannelFeeReport$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FeeReportResponse$Type extends MessageType { - constructor() { - super("lnrpc.FeeReportResponse", [ - { no: 1, name: "channel_fees", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelFeeReport }, - { no: 2, name: "day_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "week_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "month_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): FeeReportResponse { - const message = { channelFees: [], dayFeeSum: 0n, weekFeeSum: 0n, monthFeeSum: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeReportResponse): FeeReportResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelFeeReport channel_fees */ 1: - message.channelFees.push(ChannelFeeReport.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 day_fee_sum */ 2: - message.dayFeeSum = reader.uint64().toBigInt(); - break; - case /* uint64 week_fee_sum */ 3: - message.weekFeeSum = reader.uint64().toBigInt(); - break; - case /* uint64 month_fee_sum */ 4: - message.monthFeeSum = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FeeReportResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.ChannelFeeReport channel_fees = 1; */ - for (let i = 0; i < message.channelFees.length; i++) - ChannelFeeReport.internalBinaryWrite(message.channelFees[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint64 day_fee_sum = 2; */ - if (message.dayFeeSum !== 0n) - writer.tag(2, WireType.Varint).uint64(message.dayFeeSum); - /* uint64 week_fee_sum = 3; */ - if (message.weekFeeSum !== 0n) - writer.tag(3, WireType.Varint).uint64(message.weekFeeSum); - /* uint64 month_fee_sum = 4; */ - if (message.monthFeeSum !== 0n) - writer.tag(4, WireType.Varint).uint64(message.monthFeeSum); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FeeReportResponse - */ -export const FeeReportResponse = new FeeReportResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PolicyUpdateRequest$Type extends MessageType { - constructor() { - super("lnrpc.PolicyUpdateRequest", [ - { no: 1, name: "global", kind: "scalar", oneof: "scope", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "chan_point", kind: "message", oneof: "scope", T: () => ChannelPoint }, - { no: 3, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "fee_rate", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 9, name: "fee_rate_ppm", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "min_htlc_msat_specified", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): PolicyUpdateRequest { - const message = { scope: { oneofKind: undefined }, baseFeeMsat: 0n, feeRate: 0, feeRatePpm: 0, timeLockDelta: 0, maxHtlcMsat: 0n, minHtlcMsat: 0n, minHtlcMsatSpecified: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyUpdateRequest): PolicyUpdateRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool global */ 1: - message.scope = { - oneofKind: "global", - global: reader.bool() - }; - break; - case /* lnrpc.ChannelPoint chan_point */ 2: - message.scope = { - oneofKind: "chanPoint", - chanPoint: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.scope as any).chanPoint) - }; - break; - case /* int64 base_fee_msat */ 3: - message.baseFeeMsat = reader.int64().toBigInt(); - break; - case /* double fee_rate */ 4: - message.feeRate = reader.double(); - break; - case /* uint32 fee_rate_ppm */ 9: - message.feeRatePpm = reader.uint32(); - break; - case /* uint32 time_lock_delta */ 5: - message.timeLockDelta = reader.uint32(); - break; - case /* uint64 max_htlc_msat */ 6: - message.maxHtlcMsat = reader.uint64().toBigInt(); - break; - case /* uint64 min_htlc_msat */ 7: - message.minHtlcMsat = reader.uint64().toBigInt(); - break; - case /* bool min_htlc_msat_specified */ 8: - message.minHtlcMsatSpecified = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PolicyUpdateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool global = 1; */ - if (message.scope.oneofKind === "global") - writer.tag(1, WireType.Varint).bool(message.scope.global); - /* lnrpc.ChannelPoint chan_point = 2; */ - if (message.scope.oneofKind === "chanPoint") - ChannelPoint.internalBinaryWrite(message.scope.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* int64 base_fee_msat = 3; */ - if (message.baseFeeMsat !== 0n) - writer.tag(3, WireType.Varint).int64(message.baseFeeMsat); - /* double fee_rate = 4; */ - if (message.feeRate !== 0) - writer.tag(4, WireType.Bit64).double(message.feeRate); - /* uint32 fee_rate_ppm = 9; */ - if (message.feeRatePpm !== 0) - writer.tag(9, WireType.Varint).uint32(message.feeRatePpm); - /* uint32 time_lock_delta = 5; */ - if (message.timeLockDelta !== 0) - writer.tag(5, WireType.Varint).uint32(message.timeLockDelta); - /* uint64 max_htlc_msat = 6; */ - if (message.maxHtlcMsat !== 0n) - writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); - /* uint64 min_htlc_msat = 7; */ - if (message.minHtlcMsat !== 0n) - writer.tag(7, WireType.Varint).uint64(message.minHtlcMsat); - /* bool min_htlc_msat_specified = 8; */ - if (message.minHtlcMsatSpecified !== false) - writer.tag(8, WireType.Varint).bool(message.minHtlcMsatSpecified); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PolicyUpdateRequest - */ -export const PolicyUpdateRequest = new PolicyUpdateRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FailedUpdate$Type extends MessageType { - constructor() { - super("lnrpc.FailedUpdate", [ - { no: 1, name: "outpoint", kind: "message", T: () => OutPoint }, - { no: 2, name: "reason", kind: "enum", T: () => ["lnrpc.UpdateFailure", UpdateFailure, "UPDATE_FAILURE_"] }, - { no: 3, name: "update_error", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): FailedUpdate { - const message = { reason: 0, updateError: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FailedUpdate): FailedUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.OutPoint outpoint */ 1: - message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); - break; - case /* lnrpc.UpdateFailure reason */ 2: - message.reason = reader.int32(); - break; - case /* string update_error */ 3: - message.updateError = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FailedUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.OutPoint outpoint = 1; */ - if (message.outpoint) - OutPoint.internalBinaryWrite(message.outpoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.UpdateFailure reason = 2; */ - if (message.reason !== 0) - writer.tag(2, WireType.Varint).int32(message.reason); - /* string update_error = 3; */ - if (message.updateError !== "") - writer.tag(3, WireType.LengthDelimited).string(message.updateError); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FailedUpdate - */ -export const FailedUpdate = new FailedUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PolicyUpdateResponse$Type extends MessageType { - constructor() { - super("lnrpc.PolicyUpdateResponse", [ - { no: 1, name: "failed_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => FailedUpdate } - ]); - } - create(value?: PartialMessage): PolicyUpdateResponse { - const message = { failedUpdates: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyUpdateResponse): PolicyUpdateResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.FailedUpdate failed_updates */ 1: - message.failedUpdates.push(FailedUpdate.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PolicyUpdateResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.FailedUpdate failed_updates = 1; */ - for (let i = 0; i < message.failedUpdates.length; i++) - FailedUpdate.internalBinaryWrite(message.failedUpdates[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PolicyUpdateResponse - */ -export const PolicyUpdateResponse = new PolicyUpdateResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardingHistoryRequest$Type extends MessageType { - constructor() { - super("lnrpc.ForwardingHistoryRequest", [ - { no: 1, name: "start_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "end_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "index_offset", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "num_max_events", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "peer_alias_lookup", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): ForwardingHistoryRequest { - const message = { startTime: 0n, endTime: 0n, indexOffset: 0, numMaxEvents: 0, peerAliasLookup: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingHistoryRequest): ForwardingHistoryRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 start_time */ 1: - message.startTime = reader.uint64().toBigInt(); - break; - case /* uint64 end_time */ 2: - message.endTime = reader.uint64().toBigInt(); - break; - case /* uint32 index_offset */ 3: - message.indexOffset = reader.uint32(); - break; - case /* uint32 num_max_events */ 4: - message.numMaxEvents = reader.uint32(); - break; - case /* bool peer_alias_lookup */ 5: - message.peerAliasLookup = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ForwardingHistoryRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 start_time = 1; */ - if (message.startTime !== 0n) - writer.tag(1, WireType.Varint).uint64(message.startTime); - /* uint64 end_time = 2; */ - if (message.endTime !== 0n) - writer.tag(2, WireType.Varint).uint64(message.endTime); - /* uint32 index_offset = 3; */ - if (message.indexOffset !== 0) - writer.tag(3, WireType.Varint).uint32(message.indexOffset); - /* uint32 num_max_events = 4; */ - if (message.numMaxEvents !== 0) - writer.tag(4, WireType.Varint).uint32(message.numMaxEvents); - /* bool peer_alias_lookup = 5; */ - if (message.peerAliasLookup !== false) - writer.tag(5, WireType.Varint).bool(message.peerAliasLookup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingHistoryRequest - */ -export const ForwardingHistoryRequest = new ForwardingHistoryRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardingEvent$Type extends MessageType { - constructor() { - super("lnrpc.ForwardingEvent", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "chan_id_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "chan_id_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "amt_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "amt_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "fee_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 9, name: "amt_in_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "amt_out_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 11, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "peer_alias_in", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "peer_alias_out", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): ForwardingEvent { - const message = { timestamp: 0n, chanIdIn: "0", chanIdOut: "0", amtIn: 0n, amtOut: 0n, fee: 0n, feeMsat: 0n, amtInMsat: 0n, amtOutMsat: 0n, timestampNs: 0n, peerAliasIn: "", peerAliasOut: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingEvent): ForwardingEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 timestamp = 1 [deprecated = true];*/ 1: - message.timestamp = reader.uint64().toBigInt(); - break; - case /* uint64 chan_id_in = 2 [jstype = JS_STRING];*/ 2: - message.chanIdIn = reader.uint64().toString(); - break; - case /* uint64 chan_id_out = 4 [jstype = JS_STRING];*/ 4: - message.chanIdOut = reader.uint64().toString(); - break; - case /* uint64 amt_in */ 5: - message.amtIn = reader.uint64().toBigInt(); - break; - case /* uint64 amt_out */ 6: - message.amtOut = reader.uint64().toBigInt(); - break; - case /* uint64 fee */ 7: - message.fee = reader.uint64().toBigInt(); - break; - case /* uint64 fee_msat */ 8: - message.feeMsat = reader.uint64().toBigInt(); - break; - case /* uint64 amt_in_msat */ 9: - message.amtInMsat = reader.uint64().toBigInt(); - break; - case /* uint64 amt_out_msat */ 10: - message.amtOutMsat = reader.uint64().toBigInt(); - break; - case /* uint64 timestamp_ns */ 11: - message.timestampNs = reader.uint64().toBigInt(); - break; - case /* string peer_alias_in */ 12: - message.peerAliasIn = reader.string(); - break; - case /* string peer_alias_out */ 13: - message.peerAliasOut = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ForwardingEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 timestamp = 1 [deprecated = true]; */ - if (message.timestamp !== 0n) - writer.tag(1, WireType.Varint).uint64(message.timestamp); - /* uint64 chan_id_in = 2 [jstype = JS_STRING]; */ - if (message.chanIdIn !== "0") - writer.tag(2, WireType.Varint).uint64(message.chanIdIn); - /* uint64 chan_id_out = 4 [jstype = JS_STRING]; */ - if (message.chanIdOut !== "0") - writer.tag(4, WireType.Varint).uint64(message.chanIdOut); - /* uint64 amt_in = 5; */ - if (message.amtIn !== 0n) - writer.tag(5, WireType.Varint).uint64(message.amtIn); - /* uint64 amt_out = 6; */ - if (message.amtOut !== 0n) - writer.tag(6, WireType.Varint).uint64(message.amtOut); - /* uint64 fee = 7; */ - if (message.fee !== 0n) - writer.tag(7, WireType.Varint).uint64(message.fee); - /* uint64 fee_msat = 8; */ - if (message.feeMsat !== 0n) - writer.tag(8, WireType.Varint).uint64(message.feeMsat); - /* uint64 amt_in_msat = 9; */ - if (message.amtInMsat !== 0n) - writer.tag(9, WireType.Varint).uint64(message.amtInMsat); - /* uint64 amt_out_msat = 10; */ - if (message.amtOutMsat !== 0n) - writer.tag(10, WireType.Varint).uint64(message.amtOutMsat); - /* uint64 timestamp_ns = 11; */ - if (message.timestampNs !== 0n) - writer.tag(11, WireType.Varint).uint64(message.timestampNs); - /* string peer_alias_in = 12; */ - if (message.peerAliasIn !== "") - writer.tag(12, WireType.LengthDelimited).string(message.peerAliasIn); - /* string peer_alias_out = 13; */ - if (message.peerAliasOut !== "") - writer.tag(13, WireType.LengthDelimited).string(message.peerAliasOut); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingEvent - */ -export const ForwardingEvent = new ForwardingEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardingHistoryResponse$Type extends MessageType { - constructor() { - super("lnrpc.ForwardingHistoryResponse", [ - { no: 1, name: "forwarding_events", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ForwardingEvent }, - { no: 2, name: "last_offset_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): ForwardingHistoryResponse { - const message = { forwardingEvents: [], lastOffsetIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingHistoryResponse): ForwardingHistoryResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ForwardingEvent forwarding_events */ 1: - message.forwardingEvents.push(ForwardingEvent.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint32 last_offset_index */ 2: - message.lastOffsetIndex = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ForwardingHistoryResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.ForwardingEvent forwarding_events = 1; */ - for (let i = 0; i < message.forwardingEvents.length; i++) - ForwardingEvent.internalBinaryWrite(message.forwardingEvents[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint32 last_offset_index = 2; */ - if (message.lastOffsetIndex !== 0) - writer.tag(2, WireType.Varint).uint32(message.lastOffsetIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingHistoryResponse - */ -export const ForwardingHistoryResponse = new ForwardingHistoryResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ExportChannelBackupRequest$Type extends MessageType { - constructor() { - super("lnrpc.ExportChannelBackupRequest", [ - { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint } - ]); - } - create(value?: PartialMessage): ExportChannelBackupRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExportChannelBackupRequest): ExportChannelBackupRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint chan_point */ 1: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ExportChannelBackupRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelPoint chan_point = 1; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ExportChannelBackupRequest - */ -export const ExportChannelBackupRequest = new ExportChannelBackupRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBackup$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBackup", [ - { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint }, - { no: 2, name: "chan_backup", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): ChannelBackup { - const message = { chanBackup: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackup): ChannelBackup { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint chan_point */ 1: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* bytes chan_backup */ 2: - message.chanBackup = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelBackup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelPoint chan_point = 1; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes chan_backup = 2; */ - if (message.chanBackup.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.chanBackup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackup - */ -export const ChannelBackup = new ChannelBackup$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MultiChanBackup$Type extends MessageType { - constructor() { - super("lnrpc.MultiChanBackup", [ - { no: 1, name: "chan_points", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelPoint }, - { no: 2, name: "multi_chan_backup", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): MultiChanBackup { - const message = { chanPoints: [], multiChanBackup: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MultiChanBackup): MultiChanBackup { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelPoint chan_points */ 1: - message.chanPoints.push(ChannelPoint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bytes multi_chan_backup */ 2: - message.multiChanBackup = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MultiChanBackup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.ChannelPoint chan_points = 1; */ - for (let i = 0; i < message.chanPoints.length; i++) - ChannelPoint.internalBinaryWrite(message.chanPoints[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes multi_chan_backup = 2; */ - if (message.multiChanBackup.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.multiChanBackup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MultiChanBackup - */ -export const MultiChanBackup = new MultiChanBackup$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanBackupExportRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChanBackupExportRequest", []); - } - create(value?: PartialMessage): ChanBackupExportRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanBackupExportRequest): ChanBackupExportRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: ChanBackupExportRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChanBackupExportRequest - */ -export const ChanBackupExportRequest = new ChanBackupExportRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanBackupSnapshot$Type extends MessageType { - constructor() { - super("lnrpc.ChanBackupSnapshot", [ - { no: 1, name: "single_chan_backups", kind: "message", T: () => ChannelBackups }, - { no: 2, name: "multi_chan_backup", kind: "message", T: () => MultiChanBackup } - ]); - } - create(value?: PartialMessage): ChanBackupSnapshot { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanBackupSnapshot): ChanBackupSnapshot { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelBackups single_chan_backups */ 1: - message.singleChanBackups = ChannelBackups.internalBinaryRead(reader, reader.uint32(), options, message.singleChanBackups); - break; - case /* lnrpc.MultiChanBackup multi_chan_backup */ 2: - message.multiChanBackup = MultiChanBackup.internalBinaryRead(reader, reader.uint32(), options, message.multiChanBackup); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChanBackupSnapshot, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelBackups single_chan_backups = 1; */ - if (message.singleChanBackups) - ChannelBackups.internalBinaryWrite(message.singleChanBackups, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.MultiChanBackup multi_chan_backup = 2; */ - if (message.multiChanBackup) - MultiChanBackup.internalBinaryWrite(message.multiChanBackup, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChanBackupSnapshot - */ -export const ChanBackupSnapshot = new ChanBackupSnapshot$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBackups$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBackups", [ - { no: 1, name: "chan_backups", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelBackup } - ]); - } - create(value?: PartialMessage): ChannelBackups { - const message = { chanBackups: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackups): ChannelBackups { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelBackup chan_backups */ 1: - message.chanBackups.push(ChannelBackup.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelBackups, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.ChannelBackup chan_backups = 1; */ - for (let i = 0; i < message.chanBackups.length; i++) - ChannelBackup.internalBinaryWrite(message.chanBackups[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackups - */ -export const ChannelBackups = new ChannelBackups$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RestoreChanBackupRequest$Type extends MessageType { - constructor() { - super("lnrpc.RestoreChanBackupRequest", [ - { no: 1, name: "chan_backups", kind: "message", oneof: "backup", T: () => ChannelBackups }, - { no: 2, name: "multi_chan_backup", kind: "scalar", oneof: "backup", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): RestoreChanBackupRequest { - const message = { backup: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreChanBackupRequest): RestoreChanBackupRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelBackups chan_backups */ 1: - message.backup = { - oneofKind: "chanBackups", - chanBackups: ChannelBackups.internalBinaryRead(reader, reader.uint32(), options, (message.backup as any).chanBackups) - }; - break; - case /* bytes multi_chan_backup */ 2: - message.backup = { - oneofKind: "multiChanBackup", - multiChanBackup: reader.bytes() - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RestoreChanBackupRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelBackups chan_backups = 1; */ - if (message.backup.oneofKind === "chanBackups") - ChannelBackups.internalBinaryWrite(message.backup.chanBackups, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes multi_chan_backup = 2; */ - if (message.backup.oneofKind === "multiChanBackup") - writer.tag(2, WireType.LengthDelimited).bytes(message.backup.multiChanBackup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RestoreChanBackupRequest - */ -export const RestoreChanBackupRequest = new RestoreChanBackupRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RestoreBackupResponse$Type extends MessageType { - constructor() { - super("lnrpc.RestoreBackupResponse", []); - } - create(value?: PartialMessage): RestoreBackupResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreBackupResponse): RestoreBackupResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: RestoreBackupResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RestoreBackupResponse - */ -export const RestoreBackupResponse = new RestoreBackupResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBackupSubscription$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBackupSubscription", []); - } - create(value?: PartialMessage): ChannelBackupSubscription { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackupSubscription): ChannelBackupSubscription { - return target ?? this.create(); - } - internalBinaryWrite(message: ChannelBackupSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackupSubscription - */ -export const ChannelBackupSubscription = new ChannelBackupSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class VerifyChanBackupResponse$Type extends MessageType { - constructor() { - super("lnrpc.VerifyChanBackupResponse", []); - } - create(value?: PartialMessage): VerifyChanBackupResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyChanBackupResponse): VerifyChanBackupResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: VerifyChanBackupResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyChanBackupResponse - */ -export const VerifyChanBackupResponse = new VerifyChanBackupResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MacaroonPermission$Type extends MessageType { - constructor() { - super("lnrpc.MacaroonPermission", [ - { no: 1, name: "entity", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "action", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): MacaroonPermission { - const message = { entity: "", action: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonPermission): MacaroonPermission { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string entity */ 1: - message.entity = reader.string(); - break; - case /* string action */ 2: - message.action = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MacaroonPermission, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string entity = 1; */ - if (message.entity !== "") - writer.tag(1, WireType.LengthDelimited).string(message.entity); - /* string action = 2; */ - if (message.action !== "") - writer.tag(2, WireType.LengthDelimited).string(message.action); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MacaroonPermission - */ -export const MacaroonPermission = new MacaroonPermission$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BakeMacaroonRequest$Type extends MessageType { - constructor() { - super("lnrpc.BakeMacaroonRequest", [ - { no: 1, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission }, - { no: 2, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "allow_external_permissions", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): BakeMacaroonRequest { - const message = { permissions: [], rootKeyId: 0n, allowExternalPermissions: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BakeMacaroonRequest): BakeMacaroonRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.MacaroonPermission permissions */ 1: - message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 root_key_id */ 2: - message.rootKeyId = reader.uint64().toBigInt(); - break; - case /* bool allow_external_permissions */ 3: - message.allowExternalPermissions = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BakeMacaroonRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.MacaroonPermission permissions = 1; */ - for (let i = 0; i < message.permissions.length; i++) - MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint64 root_key_id = 2; */ - if (message.rootKeyId !== 0n) - writer.tag(2, WireType.Varint).uint64(message.rootKeyId); - /* bool allow_external_permissions = 3; */ - if (message.allowExternalPermissions !== false) - writer.tag(3, WireType.Varint).bool(message.allowExternalPermissions); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.BakeMacaroonRequest - */ -export const BakeMacaroonRequest = new BakeMacaroonRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BakeMacaroonResponse$Type extends MessageType { - constructor() { - super("lnrpc.BakeMacaroonResponse", [ - { no: 1, name: "macaroon", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): BakeMacaroonResponse { - const message = { macaroon: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BakeMacaroonResponse): BakeMacaroonResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string macaroon */ 1: - message.macaroon = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BakeMacaroonResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string macaroon = 1; */ - if (message.macaroon !== "") - writer.tag(1, WireType.LengthDelimited).string(message.macaroon); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.BakeMacaroonResponse - */ -export const BakeMacaroonResponse = new BakeMacaroonResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListMacaroonIDsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListMacaroonIDsRequest", []); - } - create(value?: PartialMessage): ListMacaroonIDsRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMacaroonIDsRequest): ListMacaroonIDsRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: ListMacaroonIDsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListMacaroonIDsRequest - */ -export const ListMacaroonIDsRequest = new ListMacaroonIDsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListMacaroonIDsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListMacaroonIDsResponse", [ - { no: 1, name: "root_key_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): ListMacaroonIDsResponse { - const message = { rootKeyIds: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMacaroonIDsResponse): ListMacaroonIDsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated uint64 root_key_ids */ 1: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.rootKeyIds.push(reader.uint64().toBigInt()); - else - message.rootKeyIds.push(reader.uint64().toBigInt()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ListMacaroonIDsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated uint64 root_key_ids = 1; */ - if (message.rootKeyIds.length) { - writer.tag(1, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.rootKeyIds.length; i++) - writer.uint64(message.rootKeyIds[i]); - writer.join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListMacaroonIDsResponse - */ -export const ListMacaroonIDsResponse = new ListMacaroonIDsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteMacaroonIDRequest$Type extends MessageType { - constructor() { - super("lnrpc.DeleteMacaroonIDRequest", [ - { no: 1, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): DeleteMacaroonIDRequest { - const message = { rootKeyId: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMacaroonIDRequest): DeleteMacaroonIDRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 root_key_id */ 1: - message.rootKeyId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: DeleteMacaroonIDRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 root_key_id = 1; */ - if (message.rootKeyId !== 0n) - writer.tag(1, WireType.Varint).uint64(message.rootKeyId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDRequest - */ -export const DeleteMacaroonIDRequest = new DeleteMacaroonIDRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteMacaroonIDResponse$Type extends MessageType { - constructor() { - super("lnrpc.DeleteMacaroonIDResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): DeleteMacaroonIDResponse { - const message = { deleted: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMacaroonIDResponse): DeleteMacaroonIDResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: - message.deleted = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: DeleteMacaroonIDResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, WireType.Varint).bool(message.deleted); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDResponse - */ -export const DeleteMacaroonIDResponse = new DeleteMacaroonIDResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MacaroonPermissionList$Type extends MessageType { - constructor() { - super("lnrpc.MacaroonPermissionList", [ - { no: 1, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission } - ]); - } - create(value?: PartialMessage): MacaroonPermissionList { - const message = { permissions: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonPermissionList): MacaroonPermissionList { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.MacaroonPermission permissions */ 1: - message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MacaroonPermissionList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated lnrpc.MacaroonPermission permissions = 1; */ - for (let i = 0; i < message.permissions.length; i++) - MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MacaroonPermissionList - */ -export const MacaroonPermissionList = new MacaroonPermissionList$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPermissionsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListPermissionsRequest", []); - } - create(value?: PartialMessage): ListPermissionsRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPermissionsRequest): ListPermissionsRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: ListPermissionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPermissionsRequest - */ -export const ListPermissionsRequest = new ListPermissionsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPermissionsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListPermissionsResponse", [ - { no: 1, name: "method_permissions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => MacaroonPermissionList } } - ]); - } - create(value?: PartialMessage): ListPermissionsResponse { - const message = { methodPermissions: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPermissionsResponse): ListPermissionsResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map method_permissions */ 1: - this.binaryReadMap1(message.methodPermissions, reader, options); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap1(map: ListPermissionsResponse["methodPermissions"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof ListPermissionsResponse["methodPermissions"] | undefined, val: ListPermissionsResponse["methodPermissions"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = MacaroonPermissionList.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.ListPermissionsResponse.method_permissions"); - } - } - map[key ?? ""] = val ?? MacaroonPermissionList.create(); - } - internalBinaryWrite(message: ListPermissionsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* map method_permissions = 1; */ - for (let k of Object.keys(message.methodPermissions)) { - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); - writer.tag(2, WireType.LengthDelimited).fork(); - MacaroonPermissionList.internalBinaryWrite(message.methodPermissions[k], writer, options); - writer.join().join(); - } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPermissionsResponse - */ -export const ListPermissionsResponse = new ListPermissionsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Failure$Type extends MessageType { - constructor() { - super("lnrpc.Failure", [ - { no: 1, name: "code", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] }, - { no: 3, name: "channel_update", kind: "message", T: () => ChannelUpdate }, - { no: 4, name: "htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "onion_sha_256", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 6, name: "cltv_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 7, name: "flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 8, name: "failure_source_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 9, name: "height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value?: PartialMessage): Failure { - const message = { code: 0, htlcMsat: 0n, onionSha256: new Uint8Array(0), cltvExpiry: 0, flags: 0, failureSourceIndex: 0, height: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Failure): Failure { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.Failure.FailureCode code */ 1: - message.code = reader.int32(); - break; - case /* lnrpc.ChannelUpdate channel_update */ 3: - message.channelUpdate = ChannelUpdate.internalBinaryRead(reader, reader.uint32(), options, message.channelUpdate); - break; - case /* uint64 htlc_msat */ 4: - message.htlcMsat = reader.uint64().toBigInt(); - break; - case /* bytes onion_sha_256 */ 5: - message.onionSha256 = reader.bytes(); - break; - case /* uint32 cltv_expiry */ 6: - message.cltvExpiry = reader.uint32(); - break; - case /* uint32 flags */ 7: - message.flags = reader.uint32(); - break; - case /* uint32 failure_source_index */ 8: - message.failureSourceIndex = reader.uint32(); - break; - case /* uint32 height */ 9: - message.height = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Failure, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.Failure.FailureCode code = 1; */ - if (message.code !== 0) - writer.tag(1, WireType.Varint).int32(message.code); - /* lnrpc.ChannelUpdate channel_update = 3; */ - if (message.channelUpdate) - ChannelUpdate.internalBinaryWrite(message.channelUpdate, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* uint64 htlc_msat = 4; */ - if (message.htlcMsat !== 0n) - writer.tag(4, WireType.Varint).uint64(message.htlcMsat); - /* bytes onion_sha_256 = 5; */ - if (message.onionSha256.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.onionSha256); - /* uint32 cltv_expiry = 6; */ - if (message.cltvExpiry !== 0) - writer.tag(6, WireType.Varint).uint32(message.cltvExpiry); - /* uint32 flags = 7; */ - if (message.flags !== 0) - writer.tag(7, WireType.Varint).uint32(message.flags); - /* uint32 failure_source_index = 8; */ - if (message.failureSourceIndex !== 0) - writer.tag(8, WireType.Varint).uint32(message.failureSourceIndex); - /* uint32 height = 9; */ - if (message.height !== 0) - writer.tag(9, WireType.Varint).uint32(message.height); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Failure - */ -export const Failure = new Failure$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelUpdate", [ - { no: 1, name: "signature", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "chain_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "timestamp", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 10, name: "message_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "channel_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 7, name: "htlc_minimum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "base_fee", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 9, name: "fee_rate", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 11, name: "htlc_maximum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "extra_opaque_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): ChannelUpdate { - const message = { signature: new Uint8Array(0), chainHash: new Uint8Array(0), chanId: "0", timestamp: 0, messageFlags: 0, channelFlags: 0, timeLockDelta: 0, htlcMinimumMsat: 0n, baseFee: 0, feeRate: 0, htlcMaximumMsat: 0n, extraOpaqueData: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelUpdate): ChannelUpdate { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes signature */ 1: - message.signature = reader.bytes(); - break; - case /* bytes chain_hash */ 2: - message.chainHash = reader.bytes(); - break; - case /* uint64 chan_id = 3 [jstype = JS_STRING];*/ 3: - message.chanId = reader.uint64().toString(); - break; - case /* uint32 timestamp */ 4: - message.timestamp = reader.uint32(); - break; - case /* uint32 message_flags */ 10: - message.messageFlags = reader.uint32(); - break; - case /* uint32 channel_flags */ 5: - message.channelFlags = reader.uint32(); - break; - case /* uint32 time_lock_delta */ 6: - message.timeLockDelta = reader.uint32(); - break; - case /* uint64 htlc_minimum_msat */ 7: - message.htlcMinimumMsat = reader.uint64().toBigInt(); - break; - case /* uint32 base_fee */ 8: - message.baseFee = reader.uint32(); - break; - case /* uint32 fee_rate */ 9: - message.feeRate = reader.uint32(); - break; - case /* uint64 htlc_maximum_msat */ 11: - message.htlcMaximumMsat = reader.uint64().toBigInt(); - break; - case /* bytes extra_opaque_data */ 12: - message.extraOpaqueData = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ChannelUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes signature = 1; */ - if (message.signature.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.signature); - /* bytes chain_hash = 2; */ - if (message.chainHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.chainHash); - /* uint64 chan_id = 3 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(3, WireType.Varint).uint64(message.chanId); - /* uint32 timestamp = 4; */ - if (message.timestamp !== 0) - writer.tag(4, WireType.Varint).uint32(message.timestamp); - /* uint32 message_flags = 10; */ - if (message.messageFlags !== 0) - writer.tag(10, WireType.Varint).uint32(message.messageFlags); - /* uint32 channel_flags = 5; */ - if (message.channelFlags !== 0) - writer.tag(5, WireType.Varint).uint32(message.channelFlags); - /* uint32 time_lock_delta = 6; */ - if (message.timeLockDelta !== 0) - writer.tag(6, WireType.Varint).uint32(message.timeLockDelta); - /* uint64 htlc_minimum_msat = 7; */ - if (message.htlcMinimumMsat !== 0n) - writer.tag(7, WireType.Varint).uint64(message.htlcMinimumMsat); - /* uint32 base_fee = 8; */ - if (message.baseFee !== 0) - writer.tag(8, WireType.Varint).uint32(message.baseFee); - /* uint32 fee_rate = 9; */ - if (message.feeRate !== 0) - writer.tag(9, WireType.Varint).uint32(message.feeRate); - /* uint64 htlc_maximum_msat = 11; */ - if (message.htlcMaximumMsat !== 0n) - writer.tag(11, WireType.Varint).uint64(message.htlcMaximumMsat); - /* bytes extra_opaque_data = 12; */ - if (message.extraOpaqueData.length) - writer.tag(12, WireType.LengthDelimited).bytes(message.extraOpaqueData); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelUpdate - */ -export const ChannelUpdate = new ChannelUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MacaroonId$Type extends MessageType { - constructor() { - super("lnrpc.MacaroonId", [ - { no: 1, name: "nonce", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "storageId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "ops", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Op } - ]); - } - create(value?: PartialMessage): MacaroonId { - const message = { nonce: new Uint8Array(0), storageId: new Uint8Array(0), ops: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonId): MacaroonId { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes nonce */ 1: - message.nonce = reader.bytes(); - break; - case /* bytes storageId */ 2: - message.storageId = reader.bytes(); - break; - case /* repeated lnrpc.Op ops */ 3: - message.ops.push(Op.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MacaroonId, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes nonce = 1; */ - if (message.nonce.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nonce); - /* bytes storageId = 2; */ - if (message.storageId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.storageId); - /* repeated lnrpc.Op ops = 3; */ - for (let i = 0; i < message.ops.length; i++) - Op.internalBinaryWrite(message.ops[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MacaroonId - */ -export const MacaroonId = new MacaroonId$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Op$Type extends MessageType { - constructor() { - super("lnrpc.Op", [ - { no: 1, name: "entity", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "actions", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): Op { - const message = { entity: "", actions: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Op): Op { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string entity */ 1: - message.entity = reader.string(); - break; - case /* repeated string actions */ 2: - message.actions.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Op, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string entity = 1; */ - if (message.entity !== "") - writer.tag(1, WireType.LengthDelimited).string(message.entity); - /* repeated string actions = 2; */ - for (let i = 0; i < message.actions.length; i++) - writer.tag(2, WireType.LengthDelimited).string(message.actions[i]); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Op - */ -export const Op = new Op$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CheckMacPermRequest$Type extends MessageType { - constructor() { - super("lnrpc.CheckMacPermRequest", [ - { no: 1, name: "macaroon", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission }, - { no: 3, name: "fullMethod", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): CheckMacPermRequest { - const message = { macaroon: new Uint8Array(0), permissions: [], fullMethod: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermRequest): CheckMacPermRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes macaroon */ 1: - message.macaroon = reader.bytes(); - break; - case /* repeated lnrpc.MacaroonPermission permissions */ 2: - message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* string fullMethod */ 3: - message.fullMethod = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CheckMacPermRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes macaroon = 1; */ - if (message.macaroon.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.macaroon); - /* repeated lnrpc.MacaroonPermission permissions = 2; */ - for (let i = 0; i < message.permissions.length; i++) - MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* string fullMethod = 3; */ - if (message.fullMethod !== "") - writer.tag(3, WireType.LengthDelimited).string(message.fullMethod); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.CheckMacPermRequest - */ -export const CheckMacPermRequest = new CheckMacPermRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CheckMacPermResponse$Type extends MessageType { - constructor() { - super("lnrpc.CheckMacPermResponse", [ - { no: 1, name: "valid", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): CheckMacPermResponse { - const message = { valid: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermResponse): CheckMacPermResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool valid */ 1: - message.valid = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CheckMacPermResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool valid = 1; */ - if (message.valid !== false) - writer.tag(1, WireType.Varint).bool(message.valid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.CheckMacPermResponse - */ -export const CheckMacPermResponse = new CheckMacPermResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RPCMiddlewareRequest$Type extends MessageType { - constructor() { - super("lnrpc.RPCMiddlewareRequest", [ - { no: 1, name: "request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "raw_macaroon", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "custom_caveat_condition", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "stream_auth", kind: "message", oneof: "interceptType", T: () => StreamAuth }, - { no: 5, name: "request", kind: "message", oneof: "interceptType", T: () => RPCMessage }, - { no: 6, name: "response", kind: "message", oneof: "interceptType", T: () => RPCMessage }, - { no: 8, name: "reg_complete", kind: "scalar", oneof: "interceptType", T: 8 /*ScalarType.BOOL*/ }, - { no: 7, name: "msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): RPCMiddlewareRequest { - const message = { requestId: 0n, rawMacaroon: new Uint8Array(0), customCaveatCondition: "", interceptType: { oneofKind: undefined }, msgId: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareRequest): RPCMiddlewareRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 request_id */ 1: - message.requestId = reader.uint64().toBigInt(); - break; - case /* bytes raw_macaroon */ 2: - message.rawMacaroon = reader.bytes(); - break; - case /* string custom_caveat_condition */ 3: - message.customCaveatCondition = reader.string(); - break; - case /* lnrpc.StreamAuth stream_auth */ 4: - message.interceptType = { - oneofKind: "streamAuth", - streamAuth: StreamAuth.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).streamAuth) - }; - break; - case /* lnrpc.RPCMessage request */ 5: - message.interceptType = { - oneofKind: "request", - request: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).request) - }; - break; - case /* lnrpc.RPCMessage response */ 6: - message.interceptType = { - oneofKind: "response", - response: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).response) - }; - break; - case /* bool reg_complete */ 8: - message.interceptType = { - oneofKind: "regComplete", - regComplete: reader.bool() - }; - break; - case /* uint64 msg_id */ 7: - message.msgId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RPCMiddlewareRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 request_id = 1; */ - if (message.requestId !== 0n) - writer.tag(1, WireType.Varint).uint64(message.requestId); - /* bytes raw_macaroon = 2; */ - if (message.rawMacaroon.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.rawMacaroon); - /* string custom_caveat_condition = 3; */ - if (message.customCaveatCondition !== "") - writer.tag(3, WireType.LengthDelimited).string(message.customCaveatCondition); - /* lnrpc.StreamAuth stream_auth = 4; */ - if (message.interceptType.oneofKind === "streamAuth") - StreamAuth.internalBinaryWrite(message.interceptType.streamAuth, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.RPCMessage request = 5; */ - if (message.interceptType.oneofKind === "request") - RPCMessage.internalBinaryWrite(message.interceptType.request, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.RPCMessage response = 6; */ - if (message.interceptType.oneofKind === "response") - RPCMessage.internalBinaryWrite(message.interceptType.response, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); - /* bool reg_complete = 8; */ - if (message.interceptType.oneofKind === "regComplete") - writer.tag(8, WireType.Varint).bool(message.interceptType.regComplete); - /* uint64 msg_id = 7; */ - if (message.msgId !== 0n) - writer.tag(7, WireType.Varint).uint64(message.msgId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RPCMiddlewareRequest - */ -export const RPCMiddlewareRequest = new RPCMiddlewareRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class StreamAuth$Type extends MessageType { - constructor() { - super("lnrpc.StreamAuth", [ - { no: 1, name: "method_full_uri", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): StreamAuth { - const message = { methodFullUri: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamAuth): StreamAuth { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string method_full_uri */ 1: - message.methodFullUri = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: StreamAuth, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string method_full_uri = 1; */ - if (message.methodFullUri !== "") - writer.tag(1, WireType.LengthDelimited).string(message.methodFullUri); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.StreamAuth - */ -export const StreamAuth = new StreamAuth$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RPCMessage$Type extends MessageType { - constructor() { - super("lnrpc.RPCMessage", [ - { no: 1, name: "method_full_uri", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "stream_rpc", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "type_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "serialized", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "is_error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): RPCMessage { - const message = { methodFullUri: "", streamRpc: false, typeName: "", serialized: new Uint8Array(0), isError: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMessage): RPCMessage { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string method_full_uri */ 1: - message.methodFullUri = reader.string(); - break; - case /* bool stream_rpc */ 2: - message.streamRpc = reader.bool(); - break; - case /* string type_name */ 3: - message.typeName = reader.string(); - break; - case /* bytes serialized */ 4: - message.serialized = reader.bytes(); - break; - case /* bool is_error */ 5: - message.isError = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RPCMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string method_full_uri = 1; */ - if (message.methodFullUri !== "") - writer.tag(1, WireType.LengthDelimited).string(message.methodFullUri); - /* bool stream_rpc = 2; */ - if (message.streamRpc !== false) - writer.tag(2, WireType.Varint).bool(message.streamRpc); - /* string type_name = 3; */ - if (message.typeName !== "") - writer.tag(3, WireType.LengthDelimited).string(message.typeName); - /* bytes serialized = 4; */ - if (message.serialized.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.serialized); - /* bool is_error = 5; */ - if (message.isError !== false) - writer.tag(5, WireType.Varint).bool(message.isError); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RPCMessage - */ -export const RPCMessage = new RPCMessage$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RPCMiddlewareResponse$Type extends MessageType { - constructor() { - super("lnrpc.RPCMiddlewareResponse", [ - { no: 1, name: "ref_msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "register", kind: "message", oneof: "middlewareMessage", T: () => MiddlewareRegistration }, - { no: 3, name: "feedback", kind: "message", oneof: "middlewareMessage", T: () => InterceptFeedback } - ]); - } - create(value?: PartialMessage): RPCMiddlewareResponse { - const message = { refMsgId: 0n, middlewareMessage: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareResponse): RPCMiddlewareResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 ref_msg_id */ 1: - message.refMsgId = reader.uint64().toBigInt(); - break; - case /* lnrpc.MiddlewareRegistration register */ 2: - message.middlewareMessage = { - oneofKind: "register", - register: MiddlewareRegistration.internalBinaryRead(reader, reader.uint32(), options, (message.middlewareMessage as any).register) - }; - break; - case /* lnrpc.InterceptFeedback feedback */ 3: - message.middlewareMessage = { - oneofKind: "feedback", - feedback: InterceptFeedback.internalBinaryRead(reader, reader.uint32(), options, (message.middlewareMessage as any).feedback) - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RPCMiddlewareResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 ref_msg_id = 1; */ - if (message.refMsgId !== 0n) - writer.tag(1, WireType.Varint).uint64(message.refMsgId); - /* lnrpc.MiddlewareRegistration register = 2; */ - if (message.middlewareMessage.oneofKind === "register") - MiddlewareRegistration.internalBinaryWrite(message.middlewareMessage.register, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.InterceptFeedback feedback = 3; */ - if (message.middlewareMessage.oneofKind === "feedback") - InterceptFeedback.internalBinaryWrite(message.middlewareMessage.feedback, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RPCMiddlewareResponse - */ -export const RPCMiddlewareResponse = new RPCMiddlewareResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MiddlewareRegistration$Type extends MessageType { - constructor() { - super("lnrpc.MiddlewareRegistration", [ - { no: 1, name: "middleware_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "custom_macaroon_caveat_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "read_only_mode", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): MiddlewareRegistration { - const message = { middlewareName: "", customMacaroonCaveatName: "", readOnlyMode: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MiddlewareRegistration): MiddlewareRegistration { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string middleware_name */ 1: - message.middlewareName = reader.string(); - break; - case /* string custom_macaroon_caveat_name */ 2: - message.customMacaroonCaveatName = reader.string(); - break; - case /* bool read_only_mode */ 3: - message.readOnlyMode = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MiddlewareRegistration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string middleware_name = 1; */ - if (message.middlewareName !== "") - writer.tag(1, WireType.LengthDelimited).string(message.middlewareName); - /* string custom_macaroon_caveat_name = 2; */ - if (message.customMacaroonCaveatName !== "") - writer.tag(2, WireType.LengthDelimited).string(message.customMacaroonCaveatName); - /* bool read_only_mode = 3; */ - if (message.readOnlyMode !== false) - writer.tag(3, WireType.Varint).bool(message.readOnlyMode); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MiddlewareRegistration - */ -export const MiddlewareRegistration = new MiddlewareRegistration$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InterceptFeedback$Type extends MessageType { - constructor() { - super("lnrpc.InterceptFeedback", [ - { no: 1, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "replace_response", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "replacement_serialized", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): InterceptFeedback { - const message = { error: "", replaceResponse: false, replacementSerialized: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InterceptFeedback): InterceptFeedback { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string error */ 1: - message.error = reader.string(); - break; - case /* bool replace_response */ 2: - message.replaceResponse = reader.bool(); - break; - case /* bytes replacement_serialized */ 3: - message.replacementSerialized = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: InterceptFeedback, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string error = 1; */ - if (message.error !== "") - writer.tag(1, WireType.LengthDelimited).string(message.error); - /* bool replace_response = 2; */ - if (message.replaceResponse !== false) - writer.tag(2, WireType.Varint).bool(message.replaceResponse); - /* bytes replacement_serialized = 3; */ - if (message.replacementSerialized.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.replacementSerialized); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.InterceptFeedback - */ -export const InterceptFeedback = new InterceptFeedback$Type(); -/** - * @generated ServiceType for protobuf service lnrpc.Lightning - */ -export const Lightning = new ServiceType("lnrpc.Lightning", [ - { name: "WalletBalance", options: {}, I: WalletBalanceRequest, O: WalletBalanceResponse }, - { name: "ChannelBalance", options: {}, I: ChannelBalanceRequest, O: ChannelBalanceResponse }, - { name: "GetTransactions", options: {}, I: GetTransactionsRequest, O: TransactionDetails }, - { name: "EstimateFee", options: {}, I: EstimateFeeRequest, O: EstimateFeeResponse }, - { name: "SendCoins", options: {}, I: SendCoinsRequest, O: SendCoinsResponse }, - { name: "ListUnspent", options: {}, I: ListUnspentRequest, O: ListUnspentResponse }, - { name: "SubscribeTransactions", serverStreaming: true, options: {}, I: GetTransactionsRequest, O: Transaction }, - { name: "SendMany", options: {}, I: SendManyRequest, O: SendManyResponse }, - { name: "NewAddress", options: {}, I: NewAddressRequest, O: NewAddressResponse }, - { name: "SignMessage", options: {}, I: SignMessageRequest, O: SignMessageResponse }, - { name: "VerifyMessage", options: {}, I: VerifyMessageRequest, O: VerifyMessageResponse }, - { name: "ConnectPeer", options: {}, I: ConnectPeerRequest, O: ConnectPeerResponse }, - { name: "DisconnectPeer", options: {}, I: DisconnectPeerRequest, O: DisconnectPeerResponse }, - { name: "ListPeers", options: {}, I: ListPeersRequest, O: ListPeersResponse }, - { name: "SubscribePeerEvents", serverStreaming: true, options: {}, I: PeerEventSubscription, O: PeerEvent }, - { name: "GetInfo", options: {}, I: GetInfoRequest, O: GetInfoResponse }, - { name: "GetRecoveryInfo", options: {}, I: GetRecoveryInfoRequest, O: GetRecoveryInfoResponse }, - { name: "PendingChannels", options: {}, I: PendingChannelsRequest, O: PendingChannelsResponse }, - { name: "ListChannels", options: {}, I: ListChannelsRequest, O: ListChannelsResponse }, - { name: "SubscribeChannelEvents", serverStreaming: true, options: {}, I: ChannelEventSubscription, O: ChannelEventUpdate }, - { name: "ClosedChannels", options: {}, I: ClosedChannelsRequest, O: ClosedChannelsResponse }, - { name: "OpenChannelSync", options: {}, I: OpenChannelRequest, O: ChannelPoint }, - { name: "OpenChannel", serverStreaming: true, options: {}, I: OpenChannelRequest, O: OpenStatusUpdate }, - { name: "BatchOpenChannel", options: {}, I: BatchOpenChannelRequest, O: BatchOpenChannelResponse }, - { name: "FundingStateStep", options: {}, I: FundingTransitionMsg, O: FundingStateStepResp }, - { name: "ChannelAcceptor", serverStreaming: true, clientStreaming: true, options: {}, I: ChannelAcceptResponse, O: ChannelAcceptRequest }, - { name: "CloseChannel", serverStreaming: true, options: {}, I: CloseChannelRequest, O: CloseStatusUpdate }, - { name: "AbandonChannel", options: {}, I: AbandonChannelRequest, O: AbandonChannelResponse }, - { name: "SendPayment", serverStreaming: true, clientStreaming: true, options: {}, I: SendRequest, O: SendResponse }, - { name: "SendPaymentSync", options: {}, I: SendRequest, O: SendResponse }, - { name: "SendToRoute", serverStreaming: true, clientStreaming: true, options: {}, I: SendToRouteRequest, O: SendResponse }, - { name: "SendToRouteSync", options: {}, I: SendToRouteRequest, O: SendResponse }, - { name: "AddInvoice", options: {}, I: Invoice, O: AddInvoiceResponse }, - { name: "ListInvoices", options: {}, I: ListInvoiceRequest, O: ListInvoiceResponse }, - { name: "LookupInvoice", options: {}, I: PaymentHash, O: Invoice }, - { name: "SubscribeInvoices", serverStreaming: true, options: {}, I: InvoiceSubscription, O: Invoice }, - { name: "DecodePayReq", options: {}, I: PayReqString, O: PayReq }, - { name: "ListPayments", options: {}, I: ListPaymentsRequest, O: ListPaymentsResponse }, - { name: "DeletePayment", options: {}, I: DeletePaymentRequest, O: DeletePaymentResponse }, - { name: "DeleteAllPayments", options: {}, I: DeleteAllPaymentsRequest, O: DeleteAllPaymentsResponse }, - { name: "DescribeGraph", options: {}, I: ChannelGraphRequest, O: ChannelGraph }, - { name: "GetNodeMetrics", options: {}, I: NodeMetricsRequest, O: NodeMetricsResponse }, - { name: "GetChanInfo", options: {}, I: ChanInfoRequest, O: ChannelEdge }, - { name: "GetNodeInfo", options: {}, I: NodeInfoRequest, O: NodeInfo }, - { name: "QueryRoutes", options: {}, I: QueryRoutesRequest, O: QueryRoutesResponse }, - { name: "GetNetworkInfo", options: {}, I: NetworkInfoRequest, O: NetworkInfo }, - { name: "StopDaemon", options: {}, I: StopRequest, O: StopResponse }, - { name: "SubscribeChannelGraph", serverStreaming: true, options: {}, I: GraphTopologySubscription, O: GraphTopologyUpdate }, - { name: "DebugLevel", options: {}, I: DebugLevelRequest, O: DebugLevelResponse }, - { name: "FeeReport", options: {}, I: FeeReportRequest, O: FeeReportResponse }, - { name: "UpdateChannelPolicy", options: {}, I: PolicyUpdateRequest, O: PolicyUpdateResponse }, - { name: "ForwardingHistory", options: {}, I: ForwardingHistoryRequest, O: ForwardingHistoryResponse }, - { name: "ExportChannelBackup", options: {}, I: ExportChannelBackupRequest, O: ChannelBackup }, - { name: "ExportAllChannelBackups", options: {}, I: ChanBackupExportRequest, O: ChanBackupSnapshot }, - { name: "VerifyChanBackup", options: {}, I: ChanBackupSnapshot, O: VerifyChanBackupResponse }, - { name: "RestoreChannelBackups", options: {}, I: RestoreChanBackupRequest, O: RestoreBackupResponse }, - { name: "SubscribeChannelBackups", serverStreaming: true, options: {}, I: ChannelBackupSubscription, O: ChanBackupSnapshot }, - { name: "BakeMacaroon", options: {}, I: BakeMacaroonRequest, O: BakeMacaroonResponse }, - { name: "ListMacaroonIDs", options: {}, I: ListMacaroonIDsRequest, O: ListMacaroonIDsResponse }, - { name: "DeleteMacaroonID", options: {}, I: DeleteMacaroonIDRequest, O: DeleteMacaroonIDResponse }, - { name: "ListPermissions", options: {}, I: ListPermissionsRequest, O: ListPermissionsResponse }, - { name: "CheckMacaroonPermissions", options: {}, I: CheckMacPermRequest, O: CheckMacPermResponse }, - { name: "RegisterRPCMiddleware", serverStreaming: true, clientStreaming: true, options: {}, I: RPCMiddlewareResponse, O: RPCMiddlewareRequest }, - { name: "SendCustomMessage", options: {}, I: SendCustomMessageRequest, O: SendCustomMessageResponse }, - { name: "SubscribeCustomMessages", serverStreaming: true, options: {}, I: SubscribeCustomMessagesRequest, O: CustomMessage }, - { name: "ListAliases", options: {}, I: ListAliasesRequest, O: ListAliasesResponse }, - { name: "LookupHtlc", options: {}, I: LookupHtlcRequest, O: LookupHtlcResponse } -]); +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) +// tslint:disable +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +/** + * @generated from protobuf message lnrpc.LookupHtlcRequest + */ +export interface LookupHtlcRequest { + /** + * @generated from protobuf field: uint64 chan_id = 1; + */ + chanId: bigint; + /** + * @generated from protobuf field: uint64 htlc_index = 2; + */ + htlcIndex: bigint; +} +/** + * @generated from protobuf message lnrpc.LookupHtlcResponse + */ +export interface LookupHtlcResponse { + /** + * @generated from protobuf field: bool settled = 1; + */ + settled: boolean; + /** + * @generated from protobuf field: bool offchain = 2; + */ + offchain: boolean; +} +/** + * @generated from protobuf message lnrpc.SubscribeCustomMessagesRequest + */ +export interface SubscribeCustomMessagesRequest { +} +/** + * @generated from protobuf message lnrpc.CustomMessage + */ +export interface CustomMessage { + /** + * Peer from which the message originates + * + * @generated from protobuf field: bytes peer = 1; + */ + peer: Uint8Array; + /** + * Message type. This value will be in the custom range (>= 32768). + * + * @generated from protobuf field: uint32 type = 2; + */ + type: number; + /** + * Raw message data + * + * @generated from protobuf field: bytes data = 3; + */ + data: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.SendCustomMessageRequest + */ +export interface SendCustomMessageRequest { + /** + * Peer to send the message to + * + * @generated from protobuf field: bytes peer = 1; + */ + peer: Uint8Array; + /** + * Message type. This value needs to be in the custom range (>= 32768). + * + * @generated from protobuf field: uint32 type = 2; + */ + type: number; + /** + * Raw message data. + * + * @generated from protobuf field: bytes data = 3; + */ + data: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.SendCustomMessageResponse + */ +export interface SendCustomMessageResponse { +} +/** + * @generated from protobuf message lnrpc.Utxo + */ +export interface Utxo { + /** + * The type of address + * + * @generated from protobuf field: lnrpc.AddressType address_type = 1; + */ + addressType: AddressType; + /** + * The address + * + * @generated from protobuf field: string address = 2; + */ + address: string; + /** + * The value of the unspent coin in satoshis + * + * @generated from protobuf field: int64 amount_sat = 3; + */ + amountSat: bigint; + /** + * The pkscript in hex + * + * @generated from protobuf field: string pk_script = 4; + */ + pkScript: string; + /** + * The outpoint in format txid:n + * + * @generated from protobuf field: lnrpc.OutPoint outpoint = 5; + */ + outpoint?: OutPoint; + /** + * The number of confirmations for the Utxo + * + * @generated from protobuf field: int64 confirmations = 6; + */ + confirmations: bigint; +} +/** + * @generated from protobuf message lnrpc.OutputDetail + */ +export interface OutputDetail { + /** + * The type of the output + * + * @generated from protobuf field: lnrpc.OutputScriptType output_type = 1; + */ + outputType: OutputScriptType; + /** + * The address + * + * @generated from protobuf field: string address = 2; + */ + address: string; + /** + * The pkscript in hex + * + * @generated from protobuf field: string pk_script = 3; + */ + pkScript: string; + /** + * The output index used in the raw transaction + * + * @generated from protobuf field: int64 output_index = 4; + */ + outputIndex: bigint; + /** + * The value of the output coin in satoshis + * + * @generated from protobuf field: int64 amount = 5; + */ + amount: bigint; + /** + * Denotes if the output is controlled by the internal wallet + * + * @generated from protobuf field: bool is_our_address = 6; + */ + isOurAddress: boolean; +} +/** + * @generated from protobuf message lnrpc.Transaction + */ +export interface Transaction { + /** + * The transaction hash + * + * @generated from protobuf field: string tx_hash = 1; + */ + txHash: string; + /** + * The transaction amount, denominated in satoshis + * + * @generated from protobuf field: int64 amount = 2; + */ + amount: bigint; + /** + * The number of confirmations + * + * @generated from protobuf field: int32 num_confirmations = 3; + */ + numConfirmations: number; + /** + * The hash of the block this transaction was included in + * + * @generated from protobuf field: string block_hash = 4; + */ + blockHash: string; + /** + * The height of the block this transaction was included in + * + * @generated from protobuf field: int32 block_height = 5; + */ + blockHeight: number; + /** + * Timestamp of this transaction + * + * @generated from protobuf field: int64 time_stamp = 6; + */ + timeStamp: bigint; + /** + * Fees paid for this transaction + * + * @generated from protobuf field: int64 total_fees = 7; + */ + totalFees: bigint; + /** + * Addresses that received funds for this transaction. Deprecated as it is + * now incorporated in the output_details field. + * + * @deprecated + * @generated from protobuf field: repeated string dest_addresses = 8 [deprecated = true]; + */ + destAddresses: string[]; + /** + * Outputs that received funds for this transaction + * + * @generated from protobuf field: repeated lnrpc.OutputDetail output_details = 11; + */ + outputDetails: OutputDetail[]; + /** + * The raw transaction hex. + * + * @generated from protobuf field: string raw_tx_hex = 9; + */ + rawTxHex: string; + /** + * A label that was optionally set on transaction broadcast. + * + * @generated from protobuf field: string label = 10; + */ + label: string; + /** + * PreviousOutpoints/Inputs of this transaction. + * + * @generated from protobuf field: repeated lnrpc.PreviousOutPoint previous_outpoints = 12; + */ + previousOutpoints: PreviousOutPoint[]; +} +/** + * @generated from protobuf message lnrpc.GetTransactionsRequest + */ +export interface GetTransactionsRequest { + /** + * + * The height from which to list transactions, inclusive. If this value is + * greater than end_height, transactions will be read in reverse. + * + * @generated from protobuf field: int32 start_height = 1; + */ + startHeight: number; + /** + * + * The height until which to list transactions, inclusive. To include + * unconfirmed transactions, this value should be set to -1, which will + * return transactions from start_height until the current chain tip and + * unconfirmed transactions. If no end_height is provided, the call will + * default to this option. + * + * @generated from protobuf field: int32 end_height = 2; + */ + endHeight: number; + /** + * An optional filter to only include transactions relevant to an account. + * + * @generated from protobuf field: string account = 3; + */ + account: string; +} +/** + * @generated from protobuf message lnrpc.TransactionDetails + */ +export interface TransactionDetails { + /** + * The list of transactions relevant to the wallet. + * + * @generated from protobuf field: repeated lnrpc.Transaction transactions = 1; + */ + transactions: Transaction[]; +} +/** + * @generated from protobuf message lnrpc.FeeLimit + */ +export interface FeeLimit { + /** + * @generated from protobuf oneof: limit + */ + limit: { + oneofKind: "fixed"; + /** + * + * The fee limit expressed as a fixed amount of satoshis. + * + * The fields fixed and fixed_msat are mutually exclusive. + * + * @generated from protobuf field: int64 fixed = 1; + */ + fixed: bigint; + } | { + oneofKind: "fixedMsat"; + /** + * + * The fee limit expressed as a fixed amount of millisatoshis. + * + * The fields fixed and fixed_msat are mutually exclusive. + * + * @generated from protobuf field: int64 fixed_msat = 3; + */ + fixedMsat: bigint; + } | { + oneofKind: "percent"; + /** + * The fee limit expressed as a percentage of the payment amount. + * + * @generated from protobuf field: int64 percent = 2; + */ + percent: bigint; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message lnrpc.SendRequest + */ +export interface SendRequest { + /** + * + * The identity pubkey of the payment recipient. When using REST, this field + * must be encoded as base64. + * + * @generated from protobuf field: bytes dest = 1; + */ + dest: Uint8Array; + /** + * + * The hex-encoded identity pubkey of the payment recipient. Deprecated now + * that the REST gateway supports base64 encoding of bytes fields. + * + * @deprecated + * @generated from protobuf field: string dest_string = 2 [deprecated = true]; + */ + destString: string; + /** + * + * The amount to send expressed in satoshis. + * + * The fields amt and amt_msat are mutually exclusive. + * + * @generated from protobuf field: int64 amt = 3; + */ + amt: bigint; + /** + * + * The amount to send expressed in millisatoshis. + * + * The fields amt and amt_msat are mutually exclusive. + * + * @generated from protobuf field: int64 amt_msat = 12; + */ + amtMsat: bigint; + /** + * + * The hash to use within the payment's HTLC. When using REST, this field + * must be encoded as base64. + * + * @generated from protobuf field: bytes payment_hash = 4; + */ + paymentHash: Uint8Array; + /** + * + * The hex-encoded hash to use within the payment's HTLC. Deprecated now + * that the REST gateway supports base64 encoding of bytes fields. + * + * @deprecated + * @generated from protobuf field: string payment_hash_string = 5 [deprecated = true]; + */ + paymentHashString: string; + /** + * + * A bare-bones invoice for a payment within the Lightning Network. With the + * details of the invoice, the sender has all the data necessary to send a + * payment to the recipient. + * + * @generated from protobuf field: string payment_request = 6; + */ + paymentRequest: string; + /** + * + * The CLTV delta from the current height that should be used to set the + * timelock for the final hop. + * + * @generated from protobuf field: int32 final_cltv_delta = 7; + */ + finalCltvDelta: number; + /** + * + * The maximum number of satoshis that will be paid as a fee of the payment. + * This value can be represented either as a percentage of the amount being + * sent, or as a fixed amount of the maximum fee the user is willing the pay to + * send the payment. If not specified, lnd will use a default value of 100% + * fees for small amounts (<=1k sat) or 5% fees for larger amounts. + * + * @generated from protobuf field: lnrpc.FeeLimit fee_limit = 8; + */ + feeLimit?: FeeLimit; + /** + * + * The channel id of the channel that must be taken to the first hop. If zero, + * any channel may be used. + * + * @generated from protobuf field: uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; + */ + outgoingChanId: string; + /** + * + * The pubkey of the last hop of the route. If empty, any hop may be used. + * + * @generated from protobuf field: bytes last_hop_pubkey = 13; + */ + lastHopPubkey: Uint8Array; + /** + * + * An optional maximum total time lock for the route. This should not exceed + * lnd's `--max-cltv-expiry` setting. If zero, then the value of + * `--max-cltv-expiry` is enforced. + * + * @generated from protobuf field: uint32 cltv_limit = 10; + */ + cltvLimit: number; + /** + * + * An optional field that can be used to pass an arbitrary set of TLV records + * to a peer which understands the new records. This can be used to pass + * application specific data during the payment attempt. Record types are + * required to be in the custom range >= 65536. When using REST, the values + * must be encoded as base64. + * + * @generated from protobuf field: map dest_custom_records = 11; + */ + destCustomRecords: { + [key: string]: Uint8Array; + }; + /** + * If set, circular payments to self are permitted. + * + * @generated from protobuf field: bool allow_self_payment = 14; + */ + allowSelfPayment: boolean; + /** + * + * Features assumed to be supported by the final node. All transitive feature + * dependencies must also be set properly. For a given feature bit pair, either + * optional or remote may be set, but not both. If this field is nil or empty, + * the router will try to load destination features from the graph as a + * fallback. + * + * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 15; + */ + destFeatures: FeatureBit[]; + /** + * + * The payment address of the generated invoice. + * + * @generated from protobuf field: bytes payment_addr = 16; + */ + paymentAddr: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.SendResponse + */ +export interface SendResponse { + /** + * @generated from protobuf field: string payment_error = 1; + */ + paymentError: string; + /** + * @generated from protobuf field: bytes payment_preimage = 2; + */ + paymentPreimage: Uint8Array; + /** + * @generated from protobuf field: lnrpc.Route payment_route = 3; + */ + paymentRoute?: Route; + /** + * @generated from protobuf field: bytes payment_hash = 4; + */ + paymentHash: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.SendToRouteRequest + */ +export interface SendToRouteRequest { + /** + * + * The payment hash to use for the HTLC. When using REST, this field must be + * encoded as base64. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; + /** + * + * An optional hex-encoded payment hash to be used for the HTLC. Deprecated now + * that the REST gateway supports base64 encoding of bytes fields. + * + * @deprecated + * @generated from protobuf field: string payment_hash_string = 2 [deprecated = true]; + */ + paymentHashString: string; + /** + * Route that should be used to attempt to complete the payment. + * + * @generated from protobuf field: lnrpc.Route route = 4; + */ + route?: Route; +} +/** + * @generated from protobuf message lnrpc.ChannelAcceptRequest + */ +export interface ChannelAcceptRequest { + /** + * The pubkey of the node that wishes to open an inbound channel. + * + * @generated from protobuf field: bytes node_pubkey = 1; + */ + nodePubkey: Uint8Array; + /** + * The hash of the genesis block that the proposed channel resides in. + * + * @generated from protobuf field: bytes chain_hash = 2; + */ + chainHash: Uint8Array; + /** + * The pending channel id. + * + * @generated from protobuf field: bytes pending_chan_id = 3; + */ + pendingChanId: Uint8Array; + /** + * The funding amount in satoshis that initiator wishes to use in the + * channel. + * + * @generated from protobuf field: uint64 funding_amt = 4; + */ + fundingAmt: bigint; + /** + * The push amount of the proposed channel in millisatoshis. + * + * @generated from protobuf field: uint64 push_amt = 5; + */ + pushAmt: bigint; + /** + * The dust limit of the initiator's commitment tx. + * + * @generated from protobuf field: uint64 dust_limit = 6; + */ + dustLimit: bigint; + /** + * The maximum amount of coins in millisatoshis that can be pending in this + * channel. + * + * @generated from protobuf field: uint64 max_value_in_flight = 7; + */ + maxValueInFlight: bigint; + /** + * The minimum amount of satoshis the initiator requires us to have at all + * times. + * + * @generated from protobuf field: uint64 channel_reserve = 8; + */ + channelReserve: bigint; + /** + * The smallest HTLC in millisatoshis that the initiator will accept. + * + * @generated from protobuf field: uint64 min_htlc = 9; + */ + minHtlc: bigint; + /** + * The initial fee rate that the initiator suggests for both commitment + * transactions. + * + * @generated from protobuf field: uint64 fee_per_kw = 10; + */ + feePerKw: bigint; + /** + * + * The number of blocks to use for the relative time lock in the pay-to-self + * output of both commitment transactions. + * + * @generated from protobuf field: uint32 csv_delay = 11; + */ + csvDelay: number; + /** + * The total number of incoming HTLC's that the initiator will accept. + * + * @generated from protobuf field: uint32 max_accepted_htlcs = 12; + */ + maxAcceptedHtlcs: number; + /** + * A bit-field which the initiator uses to specify proposed channel + * behavior. + * + * @generated from protobuf field: uint32 channel_flags = 13; + */ + channelFlags: number; + /** + * The commitment type the initiator wishes to use for the proposed channel. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 14; + */ + commitmentType: CommitmentType; + /** + * Whether the initiator wants to open a zero-conf channel via the channel + * type. + * + * @generated from protobuf field: bool wants_zero_conf = 15; + */ + wantsZeroConf: boolean; + /** + * Whether the initiator wants to use the scid-alias channel type. This is + * separate from the feature bit. + * + * @generated from protobuf field: bool wants_scid_alias = 16; + */ + wantsScidAlias: boolean; +} +/** + * @generated from protobuf message lnrpc.ChannelAcceptResponse + */ +export interface ChannelAcceptResponse { + /** + * Whether or not the client accepts the channel. + * + * @generated from protobuf field: bool accept = 1; + */ + accept: boolean; + /** + * The pending channel id to which this response applies. + * + * @generated from protobuf field: bytes pending_chan_id = 2; + */ + pendingChanId: Uint8Array; + /** + * + * An optional error to send the initiating party to indicate why the channel + * was rejected. This field *should not* contain sensitive information, it will + * be sent to the initiating party. This field should only be set if accept is + * false, the channel will be rejected if an error is set with accept=true + * because the meaning of this response is ambiguous. Limited to 500 + * characters. + * + * @generated from protobuf field: string error = 3; + */ + error: string; + /** + * + * The upfront shutdown address to use if the initiating peer supports option + * upfront shutdown script (see ListPeers for the features supported). Note + * that the channel open will fail if this value is set for a peer that does + * not support this feature bit. + * + * @generated from protobuf field: string upfront_shutdown = 4; + */ + upfrontShutdown: string; + /** + * + * The csv delay (in blocks) that we require for the remote party. + * + * @generated from protobuf field: uint32 csv_delay = 5; + */ + csvDelay: number; + /** + * + * The reserve amount in satoshis that we require the remote peer to adhere to. + * We require that the remote peer always have some reserve amount allocated to + * them so that there is always a disincentive to broadcast old state (if they + * hold 0 sats on their side of the channel, there is nothing to lose). + * + * @generated from protobuf field: uint64 reserve_sat = 6; + */ + reserveSat: bigint; + /** + * + * The maximum amount of funds in millisatoshis that we allow the remote peer + * to have in outstanding htlcs. + * + * @generated from protobuf field: uint64 in_flight_max_msat = 7; + */ + inFlightMaxMsat: bigint; + /** + * + * The maximum number of htlcs that the remote peer can offer us. + * + * @generated from protobuf field: uint32 max_htlc_count = 8; + */ + maxHtlcCount: number; + /** + * + * The minimum value in millisatoshis for incoming htlcs on the channel. + * + * @generated from protobuf field: uint64 min_htlc_in = 9; + */ + minHtlcIn: bigint; + /** + * + * The number of confirmations we require before we consider the channel open. + * + * @generated from protobuf field: uint32 min_accept_depth = 10; + */ + minAcceptDepth: number; + /** + * + * Whether the responder wants this to be a zero-conf channel. This will fail + * if either side does not have the scid-alias feature bit set. The minimum + * depth field must be zero if this is true. + * + * @generated from protobuf field: bool zero_conf = 11; + */ + zeroConf: boolean; +} +/** + * @generated from protobuf message lnrpc.ChannelPoint + */ +export interface ChannelPoint { + /** + * @generated from protobuf oneof: funding_txid + */ + fundingTxid: { + oneofKind: "fundingTxidBytes"; + /** + * + * Txid of the funding transaction. When using REST, this field must be + * encoded as base64. + * + * @generated from protobuf field: bytes funding_txid_bytes = 1; + */ + fundingTxidBytes: Uint8Array; + } | { + oneofKind: "fundingTxidStr"; + /** + * + * Hex-encoded string representing the byte-reversed hash of the funding + * transaction. + * + * @generated from protobuf field: string funding_txid_str = 2; + */ + fundingTxidStr: string; + } | { + oneofKind: undefined; + }; + /** + * The index of the output of the funding transaction + * + * @generated from protobuf field: uint32 output_index = 3; + */ + outputIndex: number; +} +/** + * @generated from protobuf message lnrpc.OutPoint + */ +export interface OutPoint { + /** + * Raw bytes representing the transaction id. + * + * @generated from protobuf field: bytes txid_bytes = 1; + */ + txidBytes: Uint8Array; + /** + * Reversed, hex-encoded string representing the transaction id. + * + * @generated from protobuf field: string txid_str = 2; + */ + txidStr: string; + /** + * The index of the output on the transaction. + * + * @generated from protobuf field: uint32 output_index = 3; + */ + outputIndex: number; +} +/** + * @generated from protobuf message lnrpc.PreviousOutPoint + */ +export interface PreviousOutPoint { + /** + * The outpoint in format txid:n. + * + * @generated from protobuf field: string outpoint = 1; + */ + outpoint: string; + /** + * Denotes if the outpoint is controlled by the internal wallet. + * The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. + * + * @generated from protobuf field: bool is_our_output = 2; + */ + isOurOutput: boolean; +} +/** + * @generated from protobuf message lnrpc.LightningAddress + */ +export interface LightningAddress { + /** + * The identity pubkey of the Lightning node. + * + * @generated from protobuf field: string pubkey = 1; + */ + pubkey: string; + /** + * The network location of the lightning node, e.g. `69.69.69.69:1337` or + * `localhost:10011`. + * + * @generated from protobuf field: string host = 2; + */ + host: string; +} +/** + * @generated from protobuf message lnrpc.EstimateFeeRequest + */ +export interface EstimateFeeRequest { + /** + * The map from addresses to amounts for the transaction. + * + * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; + */ + addrToAmount: { + [key: string]: bigint; + }; + /** + * The target number of blocks that this transaction should be confirmed + * by. + * + * @generated from protobuf field: int32 target_conf = 2; + */ + targetConf: number; + /** + * The minimum number of confirmations each one of your outputs used for + * the transaction must satisfy. + * + * @generated from protobuf field: int32 min_confs = 3; + */ + minConfs: number; + /** + * Whether unconfirmed outputs should be used as inputs for the transaction. + * + * @generated from protobuf field: bool spend_unconfirmed = 4; + */ + spendUnconfirmed: boolean; +} +/** + * @generated from protobuf message lnrpc.EstimateFeeResponse + */ +export interface EstimateFeeResponse { + /** + * The total fee in satoshis. + * + * @generated from protobuf field: int64 fee_sat = 1; + */ + feeSat: bigint; + /** + * Deprecated, use sat_per_vbyte. + * The fee rate in satoshi/vbyte. + * + * @deprecated + * @generated from protobuf field: int64 feerate_sat_per_byte = 2 [deprecated = true]; + */ + feerateSatPerByte: bigint; + /** + * The fee rate in satoshi/vbyte. + * + * @generated from protobuf field: uint64 sat_per_vbyte = 3; + */ + satPerVbyte: bigint; +} +/** + * @generated from protobuf message lnrpc.SendManyRequest + */ +export interface SendManyRequest { + /** + * The map from addresses to amounts + * + * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; + */ + addrToAmount: { + [key: string]: bigint; + }; + /** + * The target number of blocks that this transaction should be confirmed + * by. + * + * @generated from protobuf field: int32 target_conf = 3; + */ + targetConf: number; + /** + * A manual fee rate set in sat/vbyte that should be used when crafting the + * transaction. + * + * @generated from protobuf field: uint64 sat_per_vbyte = 4; + */ + satPerVbyte: bigint; + /** + * Deprecated, use sat_per_vbyte. + * A manual fee rate set in sat/vbyte that should be used when crafting the + * transaction. + * + * @deprecated + * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; + */ + satPerByte: bigint; + /** + * An optional label for the transaction, limited to 500 characters. + * + * @generated from protobuf field: string label = 6; + */ + label: string; + /** + * The minimum number of confirmations each one of your outputs used for + * the transaction must satisfy. + * + * @generated from protobuf field: int32 min_confs = 7; + */ + minConfs: number; + /** + * Whether unconfirmed outputs should be used as inputs for the transaction. + * + * @generated from protobuf field: bool spend_unconfirmed = 8; + */ + spendUnconfirmed: boolean; +} +/** + * @generated from protobuf message lnrpc.SendManyResponse + */ +export interface SendManyResponse { + /** + * The id of the transaction + * + * @generated from protobuf field: string txid = 1; + */ + txid: string; +} +/** + * @generated from protobuf message lnrpc.SendCoinsRequest + */ +export interface SendCoinsRequest { + /** + * The address to send coins to + * + * @generated from protobuf field: string addr = 1; + */ + addr: string; + /** + * The amount in satoshis to send + * + * @generated from protobuf field: int64 amount = 2; + */ + amount: bigint; + /** + * The target number of blocks that this transaction should be confirmed + * by. + * + * @generated from protobuf field: int32 target_conf = 3; + */ + targetConf: number; + /** + * A manual fee rate set in sat/vbyte that should be used when crafting the + * transaction. + * + * @generated from protobuf field: uint64 sat_per_vbyte = 4; + */ + satPerVbyte: bigint; + /** + * Deprecated, use sat_per_vbyte. + * A manual fee rate set in sat/vbyte that should be used when crafting the + * transaction. + * + * @deprecated + * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; + */ + satPerByte: bigint; + /** + * + * If set, then the amount field will be ignored, and lnd will attempt to + * send all the coins under control of the internal wallet to the specified + * address. + * + * @generated from protobuf field: bool send_all = 6; + */ + sendAll: boolean; + /** + * An optional label for the transaction, limited to 500 characters. + * + * @generated from protobuf field: string label = 7; + */ + label: string; + /** + * The minimum number of confirmations each one of your outputs used for + * the transaction must satisfy. + * + * @generated from protobuf field: int32 min_confs = 8; + */ + minConfs: number; + /** + * Whether unconfirmed outputs should be used as inputs for the transaction. + * + * @generated from protobuf field: bool spend_unconfirmed = 9; + */ + spendUnconfirmed: boolean; +} +/** + * @generated from protobuf message lnrpc.SendCoinsResponse + */ +export interface SendCoinsResponse { + /** + * The transaction ID of the transaction + * + * @generated from protobuf field: string txid = 1; + */ + txid: string; +} +/** + * @generated from protobuf message lnrpc.ListUnspentRequest + */ +export interface ListUnspentRequest { + /** + * The minimum number of confirmations to be included. + * + * @generated from protobuf field: int32 min_confs = 1; + */ + minConfs: number; + /** + * The maximum number of confirmations to be included. + * + * @generated from protobuf field: int32 max_confs = 2; + */ + maxConfs: number; + /** + * An optional filter to only include outputs belonging to an account. + * + * @generated from protobuf field: string account = 3; + */ + account: string; +} +/** + * @generated from protobuf message lnrpc.ListUnspentResponse + */ +export interface ListUnspentResponse { + /** + * A list of utxos + * + * @generated from protobuf field: repeated lnrpc.Utxo utxos = 1; + */ + utxos: Utxo[]; +} +/** + * @generated from protobuf message lnrpc.NewAddressRequest + */ +export interface NewAddressRequest { + /** + * The type of address to generate. + * + * @generated from protobuf field: lnrpc.AddressType type = 1; + */ + type: AddressType; + /** + * + * The name of the account to generate a new address for. If empty, the + * default wallet account is used. + * + * @generated from protobuf field: string account = 2; + */ + account: string; +} +/** + * @generated from protobuf message lnrpc.NewAddressResponse + */ +export interface NewAddressResponse { + /** + * The newly generated wallet address + * + * @generated from protobuf field: string address = 1; + */ + address: string; +} +/** + * @generated from protobuf message lnrpc.SignMessageRequest + */ +export interface SignMessageRequest { + /** + * + * The message to be signed. When using REST, this field must be encoded as + * base64. + * + * @generated from protobuf field: bytes msg = 1; + */ + msg: Uint8Array; + /** + * + * Instead of the default double-SHA256 hashing of the message before signing, + * only use one round of hashing instead. + * + * @generated from protobuf field: bool single_hash = 2; + */ + singleHash: boolean; +} +/** + * @generated from protobuf message lnrpc.SignMessageResponse + */ +export interface SignMessageResponse { + /** + * The signature for the given message + * + * @generated from protobuf field: string signature = 1; + */ + signature: string; +} +/** + * @generated from protobuf message lnrpc.VerifyMessageRequest + */ +export interface VerifyMessageRequest { + /** + * + * The message over which the signature is to be verified. When using REST, + * this field must be encoded as base64. + * + * @generated from protobuf field: bytes msg = 1; + */ + msg: Uint8Array; + /** + * The signature to be verified over the given message + * + * @generated from protobuf field: string signature = 2; + */ + signature: string; +} +/** + * @generated from protobuf message lnrpc.VerifyMessageResponse + */ +export interface VerifyMessageResponse { + /** + * Whether the signature was valid over the given message + * + * @generated from protobuf field: bool valid = 1; + */ + valid: boolean; + /** + * The pubkey recovered from the signature + * + * @generated from protobuf field: string pubkey = 2; + */ + pubkey: string; +} +/** + * @generated from protobuf message lnrpc.ConnectPeerRequest + */ +export interface ConnectPeerRequest { + /** + * + * Lightning address of the peer to connect to. + * + * @generated from protobuf field: lnrpc.LightningAddress addr = 1; + */ + addr?: LightningAddress; + /** + * + * If set, the daemon will attempt to persistently connect to the target + * peer. Otherwise, the call will be synchronous. + * + * @generated from protobuf field: bool perm = 2; + */ + perm: boolean; + /** + * + * The connection timeout value (in seconds) for this request. It won't affect + * other requests. + * + * @generated from protobuf field: uint64 timeout = 3; + */ + timeout: bigint; +} +/** + * @generated from protobuf message lnrpc.ConnectPeerResponse + */ +export interface ConnectPeerResponse { +} +/** + * @generated from protobuf message lnrpc.DisconnectPeerRequest + */ +export interface DisconnectPeerRequest { + /** + * The pubkey of the node to disconnect from + * + * @generated from protobuf field: string pub_key = 1; + */ + pubKey: string; +} +/** + * @generated from protobuf message lnrpc.DisconnectPeerResponse + */ +export interface DisconnectPeerResponse { +} +/** + * @generated from protobuf message lnrpc.HTLC + */ +export interface HTLC { + /** + * @generated from protobuf field: bool incoming = 1; + */ + incoming: boolean; + /** + * @generated from protobuf field: int64 amount = 2; + */ + amount: bigint; + /** + * @generated from protobuf field: bytes hash_lock = 3; + */ + hashLock: Uint8Array; + /** + * @generated from protobuf field: uint32 expiration_height = 4; + */ + expirationHeight: number; + /** + * Index identifying the htlc on the channel. + * + * @generated from protobuf field: uint64 htlc_index = 5; + */ + htlcIndex: bigint; + /** + * If this HTLC is involved in a forwarding operation, this field indicates + * the forwarding channel. For an outgoing htlc, it is the incoming channel. + * For an incoming htlc, it is the outgoing channel. When the htlc + * originates from this node or this node is the final destination, + * forwarding_channel will be zero. The forwarding channel will also be zero + * for htlcs that need to be forwarded but don't have a forwarding decision + * persisted yet. + * + * @generated from protobuf field: uint64 forwarding_channel = 6; + */ + forwardingChannel: bigint; + /** + * Index identifying the htlc on the forwarding channel. + * + * @generated from protobuf field: uint64 forwarding_htlc_index = 7; + */ + forwardingHtlcIndex: bigint; +} +/** + * @generated from protobuf message lnrpc.ChannelConstraints + */ +export interface ChannelConstraints { + /** + * + * The CSV delay expressed in relative blocks. If the channel is force closed, + * we will need to wait for this many blocks before we can regain our funds. + * + * @generated from protobuf field: uint32 csv_delay = 1; + */ + csvDelay: number; + /** + * The minimum satoshis this node is required to reserve in its balance. + * + * @generated from protobuf field: uint64 chan_reserve_sat = 2; + */ + chanReserveSat: bigint; + /** + * The dust limit (in satoshis) of the initiator's commitment tx. + * + * @generated from protobuf field: uint64 dust_limit_sat = 3; + */ + dustLimitSat: bigint; + /** + * The maximum amount of coins in millisatoshis that can be pending in this + * channel. + * + * @generated from protobuf field: uint64 max_pending_amt_msat = 4; + */ + maxPendingAmtMsat: bigint; + /** + * The smallest HTLC in millisatoshis that the initiator will accept. + * + * @generated from protobuf field: uint64 min_htlc_msat = 5; + */ + minHtlcMsat: bigint; + /** + * The total number of incoming HTLC's that the initiator will accept. + * + * @generated from protobuf field: uint32 max_accepted_htlcs = 6; + */ + maxAcceptedHtlcs: number; +} +/** + * @generated from protobuf message lnrpc.Channel + */ +export interface Channel { + /** + * Whether this channel is active or not + * + * @generated from protobuf field: bool active = 1; + */ + active: boolean; + /** + * The identity pubkey of the remote node + * + * @generated from protobuf field: string remote_pubkey = 2; + */ + remotePubkey: string; + /** + * + * The outpoint (txid:index) of the funding transaction. With this value, Bob + * will be able to generate a signature for Alice's version of the commitment + * transaction. + * + * @generated from protobuf field: string channel_point = 3; + */ + channelPoint: string; + /** + * + * The unique channel ID for the channel. The first 3 bytes are the block + * height, the next 3 the index within the block, and the last 2 bytes are the + * output index for the channel. + * + * @generated from protobuf field: uint64 chan_id = 4 [jstype = JS_STRING]; + */ + chanId: string; + /** + * The total amount of funds held in this channel + * + * @generated from protobuf field: int64 capacity = 5; + */ + capacity: bigint; + /** + * This node's current balance in this channel + * + * @generated from protobuf field: int64 local_balance = 6; + */ + localBalance: bigint; + /** + * The counterparty's current balance in this channel + * + * @generated from protobuf field: int64 remote_balance = 7; + */ + remoteBalance: bigint; + /** + * + * The amount calculated to be paid in fees for the current set of commitment + * transactions. The fee amount is persisted with the channel in order to + * allow the fee amount to be removed and recalculated with each channel state + * update, including updates that happen after a system restart. + * + * @generated from protobuf field: int64 commit_fee = 8; + */ + commitFee: bigint; + /** + * The weight of the commitment transaction + * + * @generated from protobuf field: int64 commit_weight = 9; + */ + commitWeight: bigint; + /** + * + * The required number of satoshis per kilo-weight that the requester will pay + * at all times, for both the funding transaction and commitment transaction. + * This value can later be updated once the channel is open. + * + * @generated from protobuf field: int64 fee_per_kw = 10; + */ + feePerKw: bigint; + /** + * The unsettled balance in this channel + * + * @generated from protobuf field: int64 unsettled_balance = 11; + */ + unsettledBalance: bigint; + /** + * + * The total number of satoshis we've sent within this channel. + * + * @generated from protobuf field: int64 total_satoshis_sent = 12; + */ + totalSatoshisSent: bigint; + /** + * + * The total number of satoshis we've received within this channel. + * + * @generated from protobuf field: int64 total_satoshis_received = 13; + */ + totalSatoshisReceived: bigint; + /** + * + * The total number of updates conducted within this channel. + * + * @generated from protobuf field: uint64 num_updates = 14; + */ + numUpdates: bigint; + /** + * + * The list of active, uncleared HTLCs currently pending within the channel. + * + * @generated from protobuf field: repeated lnrpc.HTLC pending_htlcs = 15; + */ + pendingHtlcs: HTLC[]; + /** + * + * Deprecated. The CSV delay expressed in relative blocks. If the channel is + * force closed, we will need to wait for this many blocks before we can regain + * our funds. + * + * @deprecated + * @generated from protobuf field: uint32 csv_delay = 16 [deprecated = true]; + */ + csvDelay: number; + /** + * Whether this channel is advertised to the network or not. + * + * @generated from protobuf field: bool private = 17; + */ + private: boolean; + /** + * True if we were the ones that created the channel. + * + * @generated from protobuf field: bool initiator = 18; + */ + initiator: boolean; + /** + * A set of flags showing the current state of the channel. + * + * @generated from protobuf field: string chan_status_flags = 19; + */ + chanStatusFlags: string; + /** + * Deprecated. The minimum satoshis this node is required to reserve in its + * balance. + * + * @deprecated + * @generated from protobuf field: int64 local_chan_reserve_sat = 20 [deprecated = true]; + */ + localChanReserveSat: bigint; + /** + * + * Deprecated. The minimum satoshis the other node is required to reserve in + * its balance. + * + * @deprecated + * @generated from protobuf field: int64 remote_chan_reserve_sat = 21 [deprecated = true]; + */ + remoteChanReserveSat: bigint; + /** + * Deprecated. Use commitment_type. + * + * @deprecated + * @generated from protobuf field: bool static_remote_key = 22 [deprecated = true]; + */ + staticRemoteKey: boolean; + /** + * The commitment type used by this channel. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 26; + */ + commitmentType: CommitmentType; + /** + * + * The number of seconds that the channel has been monitored by the channel + * scoring system. Scores are currently not persisted, so this value may be + * less than the lifetime of the channel [EXPERIMENTAL]. + * + * @generated from protobuf field: int64 lifetime = 23; + */ + lifetime: bigint; + /** + * + * The number of seconds that the remote peer has been observed as being online + * by the channel scoring system over the lifetime of the channel + * [EXPERIMENTAL]. + * + * @generated from protobuf field: int64 uptime = 24; + */ + uptime: bigint; + /** + * + * Close address is the address that we will enforce payout to on cooperative + * close if the channel was opened utilizing option upfront shutdown. This + * value can be set on channel open by setting close_address in an open channel + * request. If this value is not set, you can still choose a payout address by + * cooperatively closing with the delivery_address field set. + * + * @generated from protobuf field: string close_address = 25; + */ + closeAddress: string; + /** + * + * The amount that the initiator of the channel optionally pushed to the remote + * party on channel open. This amount will be zero if the channel initiator did + * not push any funds to the remote peer. If the initiator field is true, we + * pushed this amount to our peer, if it is false, the remote peer pushed this + * amount to us. + * + * @generated from protobuf field: uint64 push_amount_sat = 27; + */ + pushAmountSat: bigint; + /** + * + * This uint32 indicates if this channel is to be considered 'frozen'. A + * frozen channel doest not allow a cooperative channel close by the + * initiator. The thaw_height is the height that this restriction stops + * applying to the channel. This field is optional, not setting it or using a + * value of zero will mean the channel has no additional restrictions. The + * height can be interpreted in two ways: as a relative height if the value is + * less than 500,000, or as an absolute height otherwise. + * + * @generated from protobuf field: uint32 thaw_height = 28; + */ + thawHeight: number; + /** + * List constraints for the local node. + * + * @generated from protobuf field: lnrpc.ChannelConstraints local_constraints = 29; + */ + localConstraints?: ChannelConstraints; + /** + * List constraints for the remote node. + * + * @generated from protobuf field: lnrpc.ChannelConstraints remote_constraints = 30; + */ + remoteConstraints?: ChannelConstraints; + /** + * + * This lists out the set of alias short channel ids that exist for a channel. + * This may be empty. + * + * @generated from protobuf field: repeated uint64 alias_scids = 31; + */ + aliasScids: bigint[]; + /** + * Whether or not this is a zero-conf channel. + * + * @generated from protobuf field: bool zero_conf = 32; + */ + zeroConf: boolean; + /** + * This is the confirmed / on-chain zero-conf SCID. + * + * @generated from protobuf field: uint64 zero_conf_confirmed_scid = 33; + */ + zeroConfConfirmedScid: bigint; +} +/** + * @generated from protobuf message lnrpc.ListChannelsRequest + */ +export interface ListChannelsRequest { + /** + * @generated from protobuf field: bool active_only = 1; + */ + activeOnly: boolean; + /** + * @generated from protobuf field: bool inactive_only = 2; + */ + inactiveOnly: boolean; + /** + * @generated from protobuf field: bool public_only = 3; + */ + publicOnly: boolean; + /** + * @generated from protobuf field: bool private_only = 4; + */ + privateOnly: boolean; + /** + * + * Filters the response for channels with a target peer's pubkey. If peer is + * empty, all channels will be returned. + * + * @generated from protobuf field: bytes peer = 5; + */ + peer: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.ListChannelsResponse + */ +export interface ListChannelsResponse { + /** + * The list of active channels + * + * @generated from protobuf field: repeated lnrpc.Channel channels = 11; + */ + channels: Channel[]; +} +/** + * @generated from protobuf message lnrpc.AliasMap + */ +export interface AliasMap { + /** + * + * For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is + * the first assigned "base" alias. + * + * @generated from protobuf field: uint64 base_scid = 1; + */ + baseScid: bigint; + /** + * The set of all aliases stored for the base SCID. + * + * @generated from protobuf field: repeated uint64 aliases = 2; + */ + aliases: bigint[]; +} +/** + * @generated from protobuf message lnrpc.ListAliasesRequest + */ +export interface ListAliasesRequest { +} +/** + * @generated from protobuf message lnrpc.ListAliasesResponse + */ +export interface ListAliasesResponse { + /** + * @generated from protobuf field: repeated lnrpc.AliasMap alias_maps = 1; + */ + aliasMaps: AliasMap[]; +} +/** + * @generated from protobuf message lnrpc.ChannelCloseSummary + */ +export interface ChannelCloseSummary { + /** + * The outpoint (txid:index) of the funding transaction. + * + * @generated from protobuf field: string channel_point = 1; + */ + channelPoint: string; + /** + * The unique channel ID for the channel. + * + * @generated from protobuf field: uint64 chan_id = 2 [jstype = JS_STRING]; + */ + chanId: string; + /** + * The hash of the genesis block that this channel resides within. + * + * @generated from protobuf field: string chain_hash = 3; + */ + chainHash: string; + /** + * The txid of the transaction which ultimately closed this channel. + * + * @generated from protobuf field: string closing_tx_hash = 4; + */ + closingTxHash: string; + /** + * Public key of the remote peer that we formerly had a channel with. + * + * @generated from protobuf field: string remote_pubkey = 5; + */ + remotePubkey: string; + /** + * Total capacity of the channel. + * + * @generated from protobuf field: int64 capacity = 6; + */ + capacity: bigint; + /** + * Height at which the funding transaction was spent. + * + * @generated from protobuf field: uint32 close_height = 7; + */ + closeHeight: number; + /** + * Settled balance at the time of channel closure + * + * @generated from protobuf field: int64 settled_balance = 8; + */ + settledBalance: bigint; + /** + * The sum of all the time-locked outputs at the time of channel closure + * + * @generated from protobuf field: int64 time_locked_balance = 9; + */ + timeLockedBalance: bigint; + /** + * Details on how the channel was closed. + * + * @generated from protobuf field: lnrpc.ChannelCloseSummary.ClosureType close_type = 10; + */ + closeType: ChannelCloseSummary_ClosureType; + /** + * + * Open initiator is the party that initiated opening the channel. Note that + * this value may be unknown if the channel was closed before we migrated to + * store open channel information after close. + * + * @generated from protobuf field: lnrpc.Initiator open_initiator = 11; + */ + openInitiator: Initiator; + /** + * + * Close initiator indicates which party initiated the close. This value will + * be unknown for channels that were cooperatively closed before we started + * tracking cooperative close initiators. Note that this indicates which party + * initiated a close, and it is possible for both to initiate cooperative or + * force closes, although only one party's close will be confirmed on chain. + * + * @generated from protobuf field: lnrpc.Initiator close_initiator = 12; + */ + closeInitiator: Initiator; + /** + * @generated from protobuf field: repeated lnrpc.Resolution resolutions = 13; + */ + resolutions: Resolution[]; + /** + * + * This lists out the set of alias short channel ids that existed for the + * closed channel. This may be empty. + * + * @generated from protobuf field: repeated uint64 alias_scids = 14; + */ + aliasScids: bigint[]; + /** + * The confirmed SCID for a zero-conf channel. + * + * @generated from protobuf field: uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; + */ + zeroConfConfirmedScid: string; +} +/** + * @generated from protobuf enum lnrpc.ChannelCloseSummary.ClosureType + */ +export enum ChannelCloseSummary_ClosureType { + /** + * @generated from protobuf enum value: COOPERATIVE_CLOSE = 0; + */ + COOPERATIVE_CLOSE = 0, + /** + * @generated from protobuf enum value: LOCAL_FORCE_CLOSE = 1; + */ + LOCAL_FORCE_CLOSE = 1, + /** + * @generated from protobuf enum value: REMOTE_FORCE_CLOSE = 2; + */ + REMOTE_FORCE_CLOSE = 2, + /** + * @generated from protobuf enum value: BREACH_CLOSE = 3; + */ + BREACH_CLOSE = 3, + /** + * @generated from protobuf enum value: FUNDING_CANCELED = 4; + */ + FUNDING_CANCELED = 4, + /** + * @generated from protobuf enum value: ABANDONED = 5; + */ + ABANDONED = 5 +} +/** + * @generated from protobuf message lnrpc.Resolution + */ +export interface Resolution { + /** + * The type of output we are resolving. + * + * @generated from protobuf field: lnrpc.ResolutionType resolution_type = 1; + */ + resolutionType: ResolutionType; + /** + * The outcome of our on chain action that resolved the outpoint. + * + * @generated from protobuf field: lnrpc.ResolutionOutcome outcome = 2; + */ + outcome: ResolutionOutcome; + /** + * The outpoint that was spent by the resolution. + * + * @generated from protobuf field: lnrpc.OutPoint outpoint = 3; + */ + outpoint?: OutPoint; + /** + * The amount that was claimed by the resolution. + * + * @generated from protobuf field: uint64 amount_sat = 4; + */ + amountSat: bigint; + /** + * The hex-encoded transaction ID of the sweep transaction that spent the + * output. + * + * @generated from protobuf field: string sweep_txid = 5; + */ + sweepTxid: string; +} +/** + * @generated from protobuf message lnrpc.ClosedChannelsRequest + */ +export interface ClosedChannelsRequest { + /** + * @generated from protobuf field: bool cooperative = 1; + */ + cooperative: boolean; + /** + * @generated from protobuf field: bool local_force = 2; + */ + localForce: boolean; + /** + * @generated from protobuf field: bool remote_force = 3; + */ + remoteForce: boolean; + /** + * @generated from protobuf field: bool breach = 4; + */ + breach: boolean; + /** + * @generated from protobuf field: bool funding_canceled = 5; + */ + fundingCanceled: boolean; + /** + * @generated from protobuf field: bool abandoned = 6; + */ + abandoned: boolean; +} +/** + * @generated from protobuf message lnrpc.ClosedChannelsResponse + */ +export interface ClosedChannelsResponse { + /** + * @generated from protobuf field: repeated lnrpc.ChannelCloseSummary channels = 1; + */ + channels: ChannelCloseSummary[]; +} +/** + * @generated from protobuf message lnrpc.Peer + */ +export interface Peer { + /** + * The identity pubkey of the peer + * + * @generated from protobuf field: string pub_key = 1; + */ + pubKey: string; + /** + * Network address of the peer; eg `127.0.0.1:10011` + * + * @generated from protobuf field: string address = 3; + */ + address: string; + /** + * Bytes of data transmitted to this peer + * + * @generated from protobuf field: uint64 bytes_sent = 4; + */ + bytesSent: bigint; + /** + * Bytes of data transmitted from this peer + * + * @generated from protobuf field: uint64 bytes_recv = 5; + */ + bytesRecv: bigint; + /** + * Satoshis sent to this peer + * + * @generated from protobuf field: int64 sat_sent = 6; + */ + satSent: bigint; + /** + * Satoshis received from this peer + * + * @generated from protobuf field: int64 sat_recv = 7; + */ + satRecv: bigint; + /** + * A channel is inbound if the counterparty initiated the channel + * + * @generated from protobuf field: bool inbound = 8; + */ + inbound: boolean; + /** + * Ping time to this peer + * + * @generated from protobuf field: int64 ping_time = 9; + */ + pingTime: bigint; + /** + * The type of sync we are currently performing with this peer. + * + * @generated from protobuf field: lnrpc.Peer.SyncType sync_type = 10; + */ + syncType: Peer_SyncType; + /** + * Features advertised by the remote peer in their init message. + * + * @generated from protobuf field: map features = 11; + */ + features: { + [key: number]: Feature; + }; + /** + * + * The latest errors received from our peer with timestamps, limited to the 10 + * most recent errors. These errors are tracked across peer connections, but + * are not persisted across lnd restarts. Note that these errors are only + * stored for peers that we have channels open with, to prevent peers from + * spamming us with errors at no cost. + * + * @generated from protobuf field: repeated lnrpc.TimestampedError errors = 12; + */ + errors: TimestampedError[]; + /** + * + * The number of times we have recorded this peer going offline or coming + * online, recorded across restarts. Note that this value is decreased over + * time if the peer has not recently flapped, so that we can forgive peers + * with historically high flap counts. + * + * @generated from protobuf field: int32 flap_count = 13; + */ + flapCount: number; + /** + * + * The timestamp of the last flap we observed for this peer. If this value is + * zero, we have not observed any flaps for this peer. + * + * @generated from protobuf field: int64 last_flap_ns = 14; + */ + lastFlapNs: bigint; + /** + * + * The last ping payload the peer has sent to us. + * + * @generated from protobuf field: bytes last_ping_payload = 15; + */ + lastPingPayload: Uint8Array; +} +/** + * @generated from protobuf enum lnrpc.Peer.SyncType + */ +export enum Peer_SyncType { + /** + * + * Denotes that we cannot determine the peer's current sync type. + * + * @generated from protobuf enum value: UNKNOWN_SYNC = 0; + */ + UNKNOWN_SYNC = 0, + /** + * + * Denotes that we are actively receiving new graph updates from the peer. + * + * @generated from protobuf enum value: ACTIVE_SYNC = 1; + */ + ACTIVE_SYNC = 1, + /** + * + * Denotes that we are not receiving new graph updates from the peer. + * + * @generated from protobuf enum value: PASSIVE_SYNC = 2; + */ + PASSIVE_SYNC = 2, + /** + * + * Denotes that this peer is pinned into an active sync. + * + * @generated from protobuf enum value: PINNED_SYNC = 3; + */ + PINNED_SYNC = 3 +} +/** + * @generated from protobuf message lnrpc.TimestampedError + */ +export interface TimestampedError { + /** + * The unix timestamp in seconds when the error occurred. + * + * @generated from protobuf field: uint64 timestamp = 1; + */ + timestamp: bigint; + /** + * The string representation of the error sent by our peer. + * + * @generated from protobuf field: string error = 2; + */ + error: string; +} +/** + * @generated from protobuf message lnrpc.ListPeersRequest + */ +export interface ListPeersRequest { + /** + * + * If true, only the last error that our peer sent us will be returned with + * the peer's information, rather than the full set of historic errors we have + * stored. + * + * @generated from protobuf field: bool latest_error = 1; + */ + latestError: boolean; +} +/** + * @generated from protobuf message lnrpc.ListPeersResponse + */ +export interface ListPeersResponse { + /** + * The list of currently connected peers + * + * @generated from protobuf field: repeated lnrpc.Peer peers = 1; + */ + peers: Peer[]; +} +/** + * @generated from protobuf message lnrpc.PeerEventSubscription + */ +export interface PeerEventSubscription { +} +/** + * @generated from protobuf message lnrpc.PeerEvent + */ +export interface PeerEvent { + /** + * The identity pubkey of the peer. + * + * @generated from protobuf field: string pub_key = 1; + */ + pubKey: string; + /** + * @generated from protobuf field: lnrpc.PeerEvent.EventType type = 2; + */ + type: PeerEvent_EventType; +} +/** + * @generated from protobuf enum lnrpc.PeerEvent.EventType + */ +export enum PeerEvent_EventType { + /** + * @generated from protobuf enum value: PEER_ONLINE = 0; + */ + PEER_ONLINE = 0, + /** + * @generated from protobuf enum value: PEER_OFFLINE = 1; + */ + PEER_OFFLINE = 1 +} +/** + * @generated from protobuf message lnrpc.GetInfoRequest + */ +export interface GetInfoRequest { +} +/** + * @generated from protobuf message lnrpc.GetInfoResponse + */ +export interface GetInfoResponse { + /** + * The version of the LND software that the node is running. + * + * @generated from protobuf field: string version = 14; + */ + version: string; + /** + * The SHA1 commit hash that the daemon is compiled with. + * + * @generated from protobuf field: string commit_hash = 20; + */ + commitHash: string; + /** + * The identity pubkey of the current node. + * + * @generated from protobuf field: string identity_pubkey = 1; + */ + identityPubkey: string; + /** + * If applicable, the alias of the current node, e.g. "bob" + * + * @generated from protobuf field: string alias = 2; + */ + alias: string; + /** + * The color of the current node in hex code format + * + * @generated from protobuf field: string color = 17; + */ + color: string; + /** + * Number of pending channels + * + * @generated from protobuf field: uint32 num_pending_channels = 3; + */ + numPendingChannels: number; + /** + * Number of active channels + * + * @generated from protobuf field: uint32 num_active_channels = 4; + */ + numActiveChannels: number; + /** + * Number of inactive channels + * + * @generated from protobuf field: uint32 num_inactive_channels = 15; + */ + numInactiveChannels: number; + /** + * Number of peers + * + * @generated from protobuf field: uint32 num_peers = 5; + */ + numPeers: number; + /** + * The node's current view of the height of the best block + * + * @generated from protobuf field: uint32 block_height = 6; + */ + blockHeight: number; + /** + * The node's current view of the hash of the best block + * + * @generated from protobuf field: string block_hash = 8; + */ + blockHash: string; + /** + * Timestamp of the block best known to the wallet + * + * @generated from protobuf field: int64 best_header_timestamp = 13; + */ + bestHeaderTimestamp: bigint; + /** + * Whether the wallet's view is synced to the main chain + * + * @generated from protobuf field: bool synced_to_chain = 9; + */ + syncedToChain: boolean; + /** + * Whether we consider ourselves synced with the public channel graph. + * + * @generated from protobuf field: bool synced_to_graph = 18; + */ + syncedToGraph: boolean; + /** + * + * Whether the current node is connected to testnet. This field is + * deprecated and the network field should be used instead + * + * @deprecated + * @generated from protobuf field: bool testnet = 10 [deprecated = true]; + */ + testnet: boolean; + /** + * A list of active chains the node is connected to + * + * @generated from protobuf field: repeated lnrpc.Chain chains = 16; + */ + chains: Chain[]; + /** + * The URIs of the current node. + * + * @generated from protobuf field: repeated string uris = 12; + */ + uris: string[]; + /** + * + * Features that our node has advertised in our init message, node + * announcements and invoices. + * + * @generated from protobuf field: map features = 19; + */ + features: { + [key: number]: Feature; + }; + /** + * + * Indicates whether the HTLC interceptor API is in always-on mode. + * + * @generated from protobuf field: bool require_htlc_interceptor = 21; + */ + requireHtlcInterceptor: boolean; +} +/** + * @generated from protobuf message lnrpc.GetRecoveryInfoRequest + */ +export interface GetRecoveryInfoRequest { +} +/** + * @generated from protobuf message lnrpc.GetRecoveryInfoResponse + */ +export interface GetRecoveryInfoResponse { + /** + * Whether the wallet is in recovery mode + * + * @generated from protobuf field: bool recovery_mode = 1; + */ + recoveryMode: boolean; + /** + * Whether the wallet recovery progress is finished + * + * @generated from protobuf field: bool recovery_finished = 2; + */ + recoveryFinished: boolean; + /** + * The recovery progress, ranging from 0 to 1. + * + * @generated from protobuf field: double progress = 3; + */ + progress: number; +} +/** + * @generated from protobuf message lnrpc.Chain + */ +export interface Chain { + /** + * The blockchain the node is on (eg bitcoin, litecoin) + * + * @generated from protobuf field: string chain = 1; + */ + chain: string; + /** + * The network the node is on (eg regtest, testnet, mainnet) + * + * @generated from protobuf field: string network = 2; + */ + network: string; +} +/** + * @generated from protobuf message lnrpc.ConfirmationUpdate + */ +export interface ConfirmationUpdate { + /** + * @generated from protobuf field: bytes block_sha = 1; + */ + blockSha: Uint8Array; + /** + * @generated from protobuf field: int32 block_height = 2; + */ + blockHeight: number; + /** + * @generated from protobuf field: uint32 num_confs_left = 3; + */ + numConfsLeft: number; +} +/** + * @generated from protobuf message lnrpc.ChannelOpenUpdate + */ +export interface ChannelOpenUpdate { + /** + * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; + */ + channelPoint?: ChannelPoint; +} +/** + * @generated from protobuf message lnrpc.ChannelCloseUpdate + */ +export interface ChannelCloseUpdate { + /** + * @generated from protobuf field: bytes closing_txid = 1; + */ + closingTxid: Uint8Array; + /** + * @generated from protobuf field: bool success = 2; + */ + success: boolean; +} +/** + * @generated from protobuf message lnrpc.CloseChannelRequest + */ +export interface CloseChannelRequest { + /** + * + * The outpoint (txid:index) of the funding transaction. With this value, Bob + * will be able to generate a signature for Alice's version of the commitment + * transaction. + * + * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; + */ + channelPoint?: ChannelPoint; + /** + * If true, then the channel will be closed forcibly. This means the + * current commitment transaction will be signed and broadcast. + * + * @generated from protobuf field: bool force = 2; + */ + force: boolean; + /** + * The target number of blocks that the closure transaction should be + * confirmed by. + * + * @generated from protobuf field: int32 target_conf = 3; + */ + targetConf: number; + /** + * Deprecated, use sat_per_vbyte. + * A manual fee rate set in sat/vbyte that should be used when crafting the + * closure transaction. + * + * @deprecated + * @generated from protobuf field: int64 sat_per_byte = 4 [deprecated = true]; + */ + satPerByte: bigint; + /** + * + * An optional address to send funds to in the case of a cooperative close. + * If the channel was opened with an upfront shutdown script and this field + * is set, the request to close will fail because the channel must pay out + * to the upfront shutdown addresss. + * + * @generated from protobuf field: string delivery_address = 5; + */ + deliveryAddress: string; + /** + * A manual fee rate set in sat/vbyte that should be used when crafting the + * closure transaction. + * + * @generated from protobuf field: uint64 sat_per_vbyte = 6; + */ + satPerVbyte: bigint; + /** + * The maximum fee rate the closer is willing to pay. + * + * NOTE: This field is only respected if we're the initiator of the channel. + * + * @generated from protobuf field: uint64 max_fee_per_vbyte = 7; + */ + maxFeePerVbyte: bigint; +} +/** + * @generated from protobuf message lnrpc.CloseStatusUpdate + */ +export interface CloseStatusUpdate { + /** + * @generated from protobuf oneof: update + */ + update: { + oneofKind: "closePending"; + /** + * @generated from protobuf field: lnrpc.PendingUpdate close_pending = 1; + */ + closePending: PendingUpdate; + } | { + oneofKind: "chanClose"; + /** + * @generated from protobuf field: lnrpc.ChannelCloseUpdate chan_close = 3; + */ + chanClose: ChannelCloseUpdate; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message lnrpc.PendingUpdate + */ +export interface PendingUpdate { + /** + * @generated from protobuf field: bytes txid = 1; + */ + txid: Uint8Array; + /** + * @generated from protobuf field: uint32 output_index = 2; + */ + outputIndex: number; +} +/** + * @generated from protobuf message lnrpc.ReadyForPsbtFunding + */ +export interface ReadyForPsbtFunding { + /** + * + * The P2WSH address of the channel funding multisig address that the below + * specified amount in satoshis needs to be sent to. + * + * @generated from protobuf field: string funding_address = 1; + */ + fundingAddress: string; + /** + * + * The exact amount in satoshis that needs to be sent to the above address to + * fund the pending channel. + * + * @generated from protobuf field: int64 funding_amount = 2; + */ + fundingAmount: bigint; + /** + * + * A raw PSBT that contains the pending channel output. If a base PSBT was + * provided in the PsbtShim, this is the base PSBT with one additional output. + * If no base PSBT was specified, this is an otherwise empty PSBT with exactly + * one output. + * + * @generated from protobuf field: bytes psbt = 3; + */ + psbt: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.BatchOpenChannelRequest + */ +export interface BatchOpenChannelRequest { + /** + * The list of channels to open. + * + * @generated from protobuf field: repeated lnrpc.BatchOpenChannel channels = 1; + */ + channels: BatchOpenChannel[]; + /** + * The target number of blocks that the funding transaction should be + * confirmed by. + * + * @generated from protobuf field: int32 target_conf = 2; + */ + targetConf: number; + /** + * A manual fee rate set in sat/vByte that should be used when crafting the + * funding transaction. + * + * @generated from protobuf field: int64 sat_per_vbyte = 3; + */ + satPerVbyte: bigint; + /** + * The minimum number of confirmations each one of your outputs used for + * the funding transaction must satisfy. + * + * @generated from protobuf field: int32 min_confs = 4; + */ + minConfs: number; + /** + * Whether unconfirmed outputs should be used as inputs for the funding + * transaction. + * + * @generated from protobuf field: bool spend_unconfirmed = 5; + */ + spendUnconfirmed: boolean; + /** + * An optional label for the batch transaction, limited to 500 characters. + * + * @generated from protobuf field: string label = 6; + */ + label: string; +} +/** + * @generated from protobuf message lnrpc.BatchOpenChannel + */ +export interface BatchOpenChannel { + /** + * The pubkey of the node to open a channel with. When using REST, this + * field must be encoded as base64. + * + * @generated from protobuf field: bytes node_pubkey = 1; + */ + nodePubkey: Uint8Array; + /** + * The number of satoshis the wallet should commit to the channel. + * + * @generated from protobuf field: int64 local_funding_amount = 2; + */ + localFundingAmount: bigint; + /** + * The number of satoshis to push to the remote side as part of the initial + * commitment state. + * + * @generated from protobuf field: int64 push_sat = 3; + */ + pushSat: bigint; + /** + * Whether this channel should be private, not announced to the greater + * network. + * + * @generated from protobuf field: bool private = 4; + */ + private: boolean; + /** + * The minimum value in millisatoshi we will require for incoming HTLCs on + * the channel. + * + * @generated from protobuf field: int64 min_htlc_msat = 5; + */ + minHtlcMsat: bigint; + /** + * The delay we require on the remote's commitment transaction. If this is + * not set, it will be scaled automatically with the channel size. + * + * @generated from protobuf field: uint32 remote_csv_delay = 6; + */ + remoteCsvDelay: number; + /** + * + * Close address is an optional address which specifies the address to which + * funds should be paid out to upon cooperative close. This field may only be + * set if the peer supports the option upfront feature bit (call listpeers + * to check). The remote peer will only accept cooperative closes to this + * address if it is set. + * + * Note: If this value is set on channel creation, you will *not* be able to + * cooperatively close out to a different address. + * + * @generated from protobuf field: string close_address = 7; + */ + closeAddress: string; + /** + * + * An optional, unique identifier of 32 random bytes that will be used as the + * pending channel ID to identify the channel while it is in the pre-pending + * state. + * + * @generated from protobuf field: bytes pending_chan_id = 8; + */ + pendingChanId: Uint8Array; + /** + * + * The explicit commitment type to use. Note this field will only be used if + * the remote peer supports explicit channel negotiation. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 9; + */ + commitmentType: CommitmentType; +} +/** + * @generated from protobuf message lnrpc.BatchOpenChannelResponse + */ +export interface BatchOpenChannelResponse { + /** + * @generated from protobuf field: repeated lnrpc.PendingUpdate pending_channels = 1; + */ + pendingChannels: PendingUpdate[]; +} +/** + * @generated from protobuf message lnrpc.OpenChannelRequest + */ +export interface OpenChannelRequest { + /** + * A manual fee rate set in sat/vbyte that should be used when crafting the + * funding transaction. + * + * @generated from protobuf field: uint64 sat_per_vbyte = 1; + */ + satPerVbyte: bigint; + /** + * + * The pubkey of the node to open a channel with. When using REST, this field + * must be encoded as base64. + * + * @generated from protobuf field: bytes node_pubkey = 2; + */ + nodePubkey: Uint8Array; + /** + * + * The hex encoded pubkey of the node to open a channel with. Deprecated now + * that the REST gateway supports base64 encoding of bytes fields. + * + * @deprecated + * @generated from protobuf field: string node_pubkey_string = 3 [deprecated = true]; + */ + nodePubkeyString: string; + /** + * The number of satoshis the wallet should commit to the channel + * + * @generated from protobuf field: int64 local_funding_amount = 4; + */ + localFundingAmount: bigint; + /** + * The number of satoshis to push to the remote side as part of the initial + * commitment state + * + * @generated from protobuf field: int64 push_sat = 5; + */ + pushSat: bigint; + /** + * The target number of blocks that the funding transaction should be + * confirmed by. + * + * @generated from protobuf field: int32 target_conf = 6; + */ + targetConf: number; + /** + * Deprecated, use sat_per_vbyte. + * A manual fee rate set in sat/vbyte that should be used when crafting the + * funding transaction. + * + * @deprecated + * @generated from protobuf field: int64 sat_per_byte = 7 [deprecated = true]; + */ + satPerByte: bigint; + /** + * Whether this channel should be private, not announced to the greater + * network. + * + * @generated from protobuf field: bool private = 8; + */ + private: boolean; + /** + * The minimum value in millisatoshi we will require for incoming HTLCs on + * the channel. + * + * @generated from protobuf field: int64 min_htlc_msat = 9; + */ + minHtlcMsat: bigint; + /** + * The delay we require on the remote's commitment transaction. If this is + * not set, it will be scaled automatically with the channel size. + * + * @generated from protobuf field: uint32 remote_csv_delay = 10; + */ + remoteCsvDelay: number; + /** + * The minimum number of confirmations each one of your outputs used for + * the funding transaction must satisfy. + * + * @generated from protobuf field: int32 min_confs = 11; + */ + minConfs: number; + /** + * Whether unconfirmed outputs should be used as inputs for the funding + * transaction. + * + * @generated from protobuf field: bool spend_unconfirmed = 12; + */ + spendUnconfirmed: boolean; + /** + * + * Close address is an optional address which specifies the address to which + * funds should be paid out to upon cooperative close. This field may only be + * set if the peer supports the option upfront feature bit (call listpeers + * to check). The remote peer will only accept cooperative closes to this + * address if it is set. + * + * Note: If this value is set on channel creation, you will *not* be able to + * cooperatively close out to a different address. + * + * @generated from protobuf field: string close_address = 13; + */ + closeAddress: string; + /** + * + * Funding shims are an optional argument that allow the caller to intercept + * certain funding functionality. For example, a shim can be provided to use a + * particular key for the commitment key (ideally cold) rather than use one + * that is generated by the wallet as normal, or signal that signing will be + * carried out in an interactive manner (PSBT based). + * + * @generated from protobuf field: lnrpc.FundingShim funding_shim = 14; + */ + fundingShim?: FundingShim; + /** + * + * The maximum amount of coins in millisatoshi that can be pending within + * the channel. It only applies to the remote party. + * + * @generated from protobuf field: uint64 remote_max_value_in_flight_msat = 15; + */ + remoteMaxValueInFlightMsat: bigint; + /** + * + * The maximum number of concurrent HTLCs we will allow the remote party to add + * to the commitment transaction. + * + * @generated from protobuf field: uint32 remote_max_htlcs = 16; + */ + remoteMaxHtlcs: number; + /** + * + * Max local csv is the maximum csv delay we will allow for our own commitment + * transaction. + * + * @generated from protobuf field: uint32 max_local_csv = 17; + */ + maxLocalCsv: number; + /** + * + * The explicit commitment type to use. Note this field will only be used if + * the remote peer supports explicit channel negotiation. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 18; + */ + commitmentType: CommitmentType; + /** + * + * If this is true, then a zero-conf channel open will be attempted. + * + * @generated from protobuf field: bool zero_conf = 19; + */ + zeroConf: boolean; + /** + * + * If this is true, then an option-scid-alias channel-type open will be + * attempted. + * + * @generated from protobuf field: bool scid_alias = 20; + */ + scidAlias: boolean; + /** + * + * The base fee charged regardless of the number of milli-satoshis sent. + * + * @generated from protobuf field: uint64 base_fee = 21; + */ + baseFee: bigint; + /** + * + * The fee rate in ppm (parts per million) that will be charged in + * proportion of the value of each forwarded HTLC. + * + * @generated from protobuf field: uint64 fee_rate = 22; + */ + feeRate: bigint; + /** + * + * If use_base_fee is true the open channel announcement will update the + * channel base fee with the value specified in base_fee. In the case of + * a base_fee of 0 use_base_fee is needed downstream to distinguish whether + * to use the default base fee value specified in the config or 0. + * + * @generated from protobuf field: bool use_base_fee = 23; + */ + useBaseFee: boolean; + /** + * + * If use_fee_rate is true the open channel announcement will update the + * channel fee rate with the value specified in fee_rate. In the case of + * a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether + * to use the default fee rate value specified in the config or 0. + * + * @generated from protobuf field: bool use_fee_rate = 24; + */ + useFeeRate: boolean; + /** + * + * The number of satoshis we require the remote peer to reserve. This value, + * if specified, must be above the dust limit and below 20% of the channel + * capacity. + * + * @generated from protobuf field: uint64 remote_chan_reserve_sat = 25; + */ + remoteChanReserveSat: bigint; +} +/** + * @generated from protobuf message lnrpc.OpenStatusUpdate + */ +export interface OpenStatusUpdate { + /** + * @generated from protobuf oneof: update + */ + update: { + oneofKind: "chanPending"; + /** + * + * Signals that the channel is now fully negotiated and the funding + * transaction published. + * + * @generated from protobuf field: lnrpc.PendingUpdate chan_pending = 1; + */ + chanPending: PendingUpdate; + } | { + oneofKind: "chanOpen"; + /** + * + * Signals that the channel's funding transaction has now reached the + * required number of confirmations on chain and can be used. + * + * @generated from protobuf field: lnrpc.ChannelOpenUpdate chan_open = 3; + */ + chanOpen: ChannelOpenUpdate; + } | { + oneofKind: "psbtFund"; + /** + * + * Signals that the funding process has been suspended and the construction + * of a PSBT that funds the channel PK script is now required. + * + * @generated from protobuf field: lnrpc.ReadyForPsbtFunding psbt_fund = 5; + */ + psbtFund: ReadyForPsbtFunding; + } | { + oneofKind: undefined; + }; + /** + * + * The pending channel ID of the created channel. This value may be used to + * further the funding flow manually via the FundingStateStep method. + * + * @generated from protobuf field: bytes pending_chan_id = 4; + */ + pendingChanId: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.KeyLocator + */ +export interface KeyLocator { + /** + * The family of key being identified. + * + * @generated from protobuf field: int32 key_family = 1; + */ + keyFamily: number; + /** + * The precise index of the key being identified. + * + * @generated from protobuf field: int32 key_index = 2; + */ + keyIndex: number; +} +/** + * @generated from protobuf message lnrpc.KeyDescriptor + */ +export interface KeyDescriptor { + /** + * + * The raw bytes of the key being identified. + * + * @generated from protobuf field: bytes raw_key_bytes = 1; + */ + rawKeyBytes: Uint8Array; + /** + * + * The key locator that identifies which key to use for signing. + * + * @generated from protobuf field: lnrpc.KeyLocator key_loc = 2; + */ + keyLoc?: KeyLocator; +} +/** + * @generated from protobuf message lnrpc.ChanPointShim + */ +export interface ChanPointShim { + /** + * + * The size of the pre-crafted output to be used as the channel point for this + * channel funding. + * + * @generated from protobuf field: int64 amt = 1; + */ + amt: bigint; + /** + * The target channel point to refrence in created commitment transactions. + * + * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; + */ + chanPoint?: ChannelPoint; + /** + * Our local key to use when creating the multi-sig output. + * + * @generated from protobuf field: lnrpc.KeyDescriptor local_key = 3; + */ + localKey?: KeyDescriptor; + /** + * The key of the remote party to use when creating the multi-sig output. + * + * @generated from protobuf field: bytes remote_key = 4; + */ + remoteKey: Uint8Array; + /** + * + * If non-zero, then this will be used as the pending channel ID on the wire + * protocol to initate the funding request. This is an optional field, and + * should only be set if the responder is already expecting a specific pending + * channel ID. + * + * @generated from protobuf field: bytes pending_chan_id = 5; + */ + pendingChanId: Uint8Array; + /** + * + * This uint32 indicates if this channel is to be considered 'frozen'. A frozen + * channel does not allow a cooperative channel close by the initiator. The + * thaw_height is the height that this restriction stops applying to the + * channel. The height can be interpreted in two ways: as a relative height if + * the value is less than 500,000, or as an absolute height otherwise. + * + * @generated from protobuf field: uint32 thaw_height = 6; + */ + thawHeight: number; +} +/** + * @generated from protobuf message lnrpc.PsbtShim + */ +export interface PsbtShim { + /** + * + * A unique identifier of 32 random bytes that will be used as the pending + * channel ID to identify the PSBT state machine when interacting with it and + * on the wire protocol to initiate the funding request. + * + * @generated from protobuf field: bytes pending_chan_id = 1; + */ + pendingChanId: Uint8Array; + /** + * + * An optional base PSBT the new channel output will be added to. If this is + * non-empty, it must be a binary serialized PSBT. + * + * @generated from protobuf field: bytes base_psbt = 2; + */ + basePsbt: Uint8Array; + /** + * + * If a channel should be part of a batch (multiple channel openings in one + * transaction), it can be dangerous if the whole batch transaction is + * published too early before all channel opening negotiations are completed. + * This flag prevents this particular channel from broadcasting the transaction + * after the negotiation with the remote peer. In a batch of channel openings + * this flag should be set to true for every channel but the very last. + * + * @generated from protobuf field: bool no_publish = 3; + */ + noPublish: boolean; +} +/** + * @generated from protobuf message lnrpc.FundingShim + */ +export interface FundingShim { + /** + * @generated from protobuf oneof: shim + */ + shim: { + oneofKind: "chanPointShim"; + /** + * + * A channel shim where the channel point was fully constructed outside + * of lnd's wallet and the transaction might already be published. + * + * @generated from protobuf field: lnrpc.ChanPointShim chan_point_shim = 1; + */ + chanPointShim: ChanPointShim; + } | { + oneofKind: "psbtShim"; + /** + * + * A channel shim that uses a PSBT to fund and sign the channel funding + * transaction. + * + * @generated from protobuf field: lnrpc.PsbtShim psbt_shim = 2; + */ + psbtShim: PsbtShim; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message lnrpc.FundingShimCancel + */ +export interface FundingShimCancel { + /** + * The pending channel ID of the channel to cancel the funding shim for. + * + * @generated from protobuf field: bytes pending_chan_id = 1; + */ + pendingChanId: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.FundingPsbtVerify + */ +export interface FundingPsbtVerify { + /** + * + * The funded but not yet signed PSBT that sends the exact channel capacity + * amount to the PK script returned in the open channel message in a previous + * step. + * + * @generated from protobuf field: bytes funded_psbt = 1; + */ + fundedPsbt: Uint8Array; + /** + * The pending channel ID of the channel to get the PSBT for. + * + * @generated from protobuf field: bytes pending_chan_id = 2; + */ + pendingChanId: Uint8Array; + /** + * + * Can only be used if the no_publish flag was set to true in the OpenChannel + * call meaning that the caller is solely responsible for publishing the final + * funding transaction. If skip_finalize is set to true then lnd will not wait + * for a FundingPsbtFinalize state step and instead assumes that a transaction + * with the same TXID as the passed in PSBT will eventually confirm. + * IT IS ABSOLUTELY IMPERATIVE that the TXID of the transaction that is + * eventually published does have the _same TXID_ as the verified PSBT. That + * means no inputs or outputs can change, only signatures can be added. If the + * TXID changes between this call and the publish step then the channel will + * never be created and the funds will be in limbo. + * + * @generated from protobuf field: bool skip_finalize = 3; + */ + skipFinalize: boolean; +} +/** + * @generated from protobuf message lnrpc.FundingPsbtFinalize + */ +export interface FundingPsbtFinalize { + /** + * + * The funded PSBT that contains all witness data to send the exact channel + * capacity amount to the PK script returned in the open channel message in a + * previous step. Cannot be set at the same time as final_raw_tx. + * + * @generated from protobuf field: bytes signed_psbt = 1; + */ + signedPsbt: Uint8Array; + /** + * The pending channel ID of the channel to get the PSBT for. + * + * @generated from protobuf field: bytes pending_chan_id = 2; + */ + pendingChanId: Uint8Array; + /** + * + * As an alternative to the signed PSBT with all witness data, the final raw + * wire format transaction can also be specified directly. Cannot be set at the + * same time as signed_psbt. + * + * @generated from protobuf field: bytes final_raw_tx = 3; + */ + finalRawTx: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.FundingTransitionMsg + */ +export interface FundingTransitionMsg { + /** + * @generated from protobuf oneof: trigger + */ + trigger: { + oneofKind: "shimRegister"; + /** + * + * The funding shim to register. This should be used before any + * channel funding has began by the remote party, as it is intended as a + * preparatory step for the full channel funding. + * + * @generated from protobuf field: lnrpc.FundingShim shim_register = 1; + */ + shimRegister: FundingShim; + } | { + oneofKind: "shimCancel"; + /** + * Used to cancel an existing registered funding shim. + * + * @generated from protobuf field: lnrpc.FundingShimCancel shim_cancel = 2; + */ + shimCancel: FundingShimCancel; + } | { + oneofKind: "psbtVerify"; + /** + * + * Used to continue a funding flow that was initiated to be executed + * through a PSBT. This step verifies that the PSBT contains the correct + * outputs to fund the channel. + * + * @generated from protobuf field: lnrpc.FundingPsbtVerify psbt_verify = 3; + */ + psbtVerify: FundingPsbtVerify; + } | { + oneofKind: "psbtFinalize"; + /** + * + * Used to continue a funding flow that was initiated to be executed + * through a PSBT. This step finalizes the funded and signed PSBT, finishes + * negotiation with the peer and finally publishes the resulting funding + * transaction. + * + * @generated from protobuf field: lnrpc.FundingPsbtFinalize psbt_finalize = 4; + */ + psbtFinalize: FundingPsbtFinalize; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message lnrpc.FundingStateStepResp + */ +export interface FundingStateStepResp { +} +/** + * @generated from protobuf message lnrpc.PendingHTLC + */ +export interface PendingHTLC { + /** + * The direction within the channel that the htlc was sent + * + * @generated from protobuf field: bool incoming = 1; + */ + incoming: boolean; + /** + * The total value of the htlc + * + * @generated from protobuf field: int64 amount = 2; + */ + amount: bigint; + /** + * The final output to be swept back to the user's wallet + * + * @generated from protobuf field: string outpoint = 3; + */ + outpoint: string; + /** + * The next block height at which we can spend the current stage + * + * @generated from protobuf field: uint32 maturity_height = 4; + */ + maturityHeight: number; + /** + * + * The number of blocks remaining until the current stage can be swept. + * Negative values indicate how many blocks have passed since becoming + * mature. + * + * @generated from protobuf field: int32 blocks_til_maturity = 5; + */ + blocksTilMaturity: number; + /** + * Indicates whether the htlc is in its first or second stage of recovery + * + * @generated from protobuf field: uint32 stage = 6; + */ + stage: number; +} +/** + * @generated from protobuf message lnrpc.PendingChannelsRequest + */ +export interface PendingChannelsRequest { +} +/** + * @generated from protobuf message lnrpc.PendingChannelsResponse + */ +export interface PendingChannelsResponse { + /** + * The balance in satoshis encumbered in pending channels + * + * @generated from protobuf field: int64 total_limbo_balance = 1; + */ + totalLimboBalance: bigint; + /** + * Channels pending opening + * + * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels = 2; + */ + pendingOpenChannels: PendingChannelsResponse_PendingOpenChannel[]; + /** + * + * Deprecated: Channels pending closing previously contained cooperatively + * closed channels with a single confirmation. These channels are now + * considered closed from the time we see them on chain. + * + * @deprecated + * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true]; + */ + pendingClosingChannels: PendingChannelsResponse_ClosedChannel[]; + /** + * Channels pending force closing + * + * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels = 4; + */ + pendingForceClosingChannels: PendingChannelsResponse_ForceClosedChannel[]; + /** + * Channels waiting for closing tx to confirm + * + * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels = 5; + */ + waitingCloseChannels: PendingChannelsResponse_WaitingCloseChannel[]; +} +/** + * @generated from protobuf message lnrpc.PendingChannelsResponse.PendingChannel + */ +export interface PendingChannelsResponse_PendingChannel { + /** + * @generated from protobuf field: string remote_node_pub = 1; + */ + remoteNodePub: string; + /** + * @generated from protobuf field: string channel_point = 2; + */ + channelPoint: string; + /** + * @generated from protobuf field: int64 capacity = 3; + */ + capacity: bigint; + /** + * @generated from protobuf field: int64 local_balance = 4; + */ + localBalance: bigint; + /** + * @generated from protobuf field: int64 remote_balance = 5; + */ + remoteBalance: bigint; + /** + * The minimum satoshis this node is required to reserve in its + * balance. + * + * @generated from protobuf field: int64 local_chan_reserve_sat = 6; + */ + localChanReserveSat: bigint; + /** + * + * The minimum satoshis the other node is required to reserve in its + * balance. + * + * @generated from protobuf field: int64 remote_chan_reserve_sat = 7; + */ + remoteChanReserveSat: bigint; + /** + * The party that initiated opening the channel. + * + * @generated from protobuf field: lnrpc.Initiator initiator = 8; + */ + initiator: Initiator; + /** + * The commitment type used by this channel. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 9; + */ + commitmentType: CommitmentType; + /** + * Total number of forwarding packages created in this channel. + * + * @generated from protobuf field: int64 num_forwarding_packages = 10; + */ + numForwardingPackages: bigint; + /** + * A set of flags showing the current state of the channel. + * + * @generated from protobuf field: string chan_status_flags = 11; + */ + chanStatusFlags: string; + /** + * Whether this channel is advertised to the network or not. + * + * @generated from protobuf field: bool private = 12; + */ + private: boolean; +} +/** + * @generated from protobuf message lnrpc.PendingChannelsResponse.PendingOpenChannel + */ +export interface PendingChannelsResponse_PendingOpenChannel { + /** + * The pending channel + * + * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; + */ + channel?: PendingChannelsResponse_PendingChannel; + /** + * + * The amount calculated to be paid in fees for the current set of + * commitment transactions. The fee amount is persisted with the channel + * in order to allow the fee amount to be removed and recalculated with + * each channel state update, including updates that happen after a system + * restart. + * + * @generated from protobuf field: int64 commit_fee = 4; + */ + commitFee: bigint; + /** + * The weight of the commitment transaction + * + * @generated from protobuf field: int64 commit_weight = 5; + */ + commitWeight: bigint; + /** + * + * The required number of satoshis per kilo-weight that the requester will + * pay at all times, for both the funding transaction and commitment + * transaction. This value can later be updated once the channel is open. + * + * @generated from protobuf field: int64 fee_per_kw = 6; + */ + feePerKw: bigint; +} +/** + * @generated from protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel + */ +export interface PendingChannelsResponse_WaitingCloseChannel { + /** + * The pending channel waiting for closing tx to confirm + * + * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; + */ + channel?: PendingChannelsResponse_PendingChannel; + /** + * The balance in satoshis encumbered in this channel + * + * @generated from protobuf field: int64 limbo_balance = 2; + */ + limboBalance: bigint; + /** + * + * A list of valid commitment transactions. Any of these can confirm at + * this point. + * + * @generated from protobuf field: lnrpc.PendingChannelsResponse.Commitments commitments = 3; + */ + commitments?: PendingChannelsResponse_Commitments; + /** + * The transaction id of the closing transaction + * + * @generated from protobuf field: string closing_txid = 4; + */ + closingTxid: string; +} +/** + * @generated from protobuf message lnrpc.PendingChannelsResponse.Commitments + */ +export interface PendingChannelsResponse_Commitments { + /** + * Hash of the local version of the commitment tx. + * + * @generated from protobuf field: string local_txid = 1; + */ + localTxid: string; + /** + * Hash of the remote version of the commitment tx. + * + * @generated from protobuf field: string remote_txid = 2; + */ + remoteTxid: string; + /** + * Hash of the remote pending version of the commitment tx. + * + * @generated from protobuf field: string remote_pending_txid = 3; + */ + remotePendingTxid: string; + /** + * + * The amount in satoshis calculated to be paid in fees for the local + * commitment. + * + * @generated from protobuf field: uint64 local_commit_fee_sat = 4; + */ + localCommitFeeSat: bigint; + /** + * + * The amount in satoshis calculated to be paid in fees for the remote + * commitment. + * + * @generated from protobuf field: uint64 remote_commit_fee_sat = 5; + */ + remoteCommitFeeSat: bigint; + /** + * + * The amount in satoshis calculated to be paid in fees for the remote + * pending commitment. + * + * @generated from protobuf field: uint64 remote_pending_commit_fee_sat = 6; + */ + remotePendingCommitFeeSat: bigint; +} +/** + * @generated from protobuf message lnrpc.PendingChannelsResponse.ClosedChannel + */ +export interface PendingChannelsResponse_ClosedChannel { + /** + * The pending channel to be closed + * + * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; + */ + channel?: PendingChannelsResponse_PendingChannel; + /** + * The transaction id of the closing transaction + * + * @generated from protobuf field: string closing_txid = 2; + */ + closingTxid: string; +} +/** + * @generated from protobuf message lnrpc.PendingChannelsResponse.ForceClosedChannel + */ +export interface PendingChannelsResponse_ForceClosedChannel { + /** + * The pending channel to be force closed + * + * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; + */ + channel?: PendingChannelsResponse_PendingChannel; + /** + * The transaction id of the closing transaction + * + * @generated from protobuf field: string closing_txid = 2; + */ + closingTxid: string; + /** + * The balance in satoshis encumbered in this pending channel + * + * @generated from protobuf field: int64 limbo_balance = 3; + */ + limboBalance: bigint; + /** + * The height at which funds can be swept into the wallet + * + * @generated from protobuf field: uint32 maturity_height = 4; + */ + maturityHeight: number; + /** + * + * Remaining # of blocks until the commitment output can be swept. + * Negative values indicate how many blocks have passed since becoming + * mature. + * + * @generated from protobuf field: int32 blocks_til_maturity = 5; + */ + blocksTilMaturity: number; + /** + * The total value of funds successfully recovered from this channel + * + * @generated from protobuf field: int64 recovered_balance = 6; + */ + recoveredBalance: bigint; + /** + * @generated from protobuf field: repeated lnrpc.PendingHTLC pending_htlcs = 8; + */ + pendingHtlcs: PendingHTLC[]; + /** + * @generated from protobuf field: lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor = 9; + */ + anchor: PendingChannelsResponse_ForceClosedChannel_AnchorState; +} +/** + * + * There are three resolution states for the anchor: + * limbo, lost and recovered. Derive the current state + * from the limbo and recovered balances. + * + * @generated from protobuf enum lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState + */ +export enum PendingChannelsResponse_ForceClosedChannel_AnchorState { + /** + * The recovered_balance is zero and limbo_balance is non-zero. + * + * @generated from protobuf enum value: LIMBO = 0; + */ + LIMBO = 0, + /** + * The recovered_balance is non-zero. + * + * @generated from protobuf enum value: RECOVERED = 1; + */ + RECOVERED = 1, + /** + * A state that is neither LIMBO nor RECOVERED. + * + * @generated from protobuf enum value: LOST = 2; + */ + LOST = 2 +} +/** + * @generated from protobuf message lnrpc.ChannelEventSubscription + */ +export interface ChannelEventSubscription { +} +/** + * @generated from protobuf message lnrpc.ChannelEventUpdate + */ +export interface ChannelEventUpdate { + /** + * @generated from protobuf oneof: channel + */ + channel: { + oneofKind: "openChannel"; + /** + * @generated from protobuf field: lnrpc.Channel open_channel = 1; + */ + openChannel: Channel; + } | { + oneofKind: "closedChannel"; + /** + * @generated from protobuf field: lnrpc.ChannelCloseSummary closed_channel = 2; + */ + closedChannel: ChannelCloseSummary; + } | { + oneofKind: "activeChannel"; + /** + * @generated from protobuf field: lnrpc.ChannelPoint active_channel = 3; + */ + activeChannel: ChannelPoint; + } | { + oneofKind: "inactiveChannel"; + /** + * @generated from protobuf field: lnrpc.ChannelPoint inactive_channel = 4; + */ + inactiveChannel: ChannelPoint; + } | { + oneofKind: "pendingOpenChannel"; + /** + * @generated from protobuf field: lnrpc.PendingUpdate pending_open_channel = 6; + */ + pendingOpenChannel: PendingUpdate; + } | { + oneofKind: "fullyResolvedChannel"; + /** + * @generated from protobuf field: lnrpc.ChannelPoint fully_resolved_channel = 7; + */ + fullyResolvedChannel: ChannelPoint; + } | { + oneofKind: undefined; + }; + /** + * @generated from protobuf field: lnrpc.ChannelEventUpdate.UpdateType type = 5; + */ + type: ChannelEventUpdate_UpdateType; +} +/** + * @generated from protobuf enum lnrpc.ChannelEventUpdate.UpdateType + */ +export enum ChannelEventUpdate_UpdateType { + /** + * @generated from protobuf enum value: OPEN_CHANNEL = 0; + */ + OPEN_CHANNEL = 0, + /** + * @generated from protobuf enum value: CLOSED_CHANNEL = 1; + */ + CLOSED_CHANNEL = 1, + /** + * @generated from protobuf enum value: ACTIVE_CHANNEL = 2; + */ + ACTIVE_CHANNEL = 2, + /** + * @generated from protobuf enum value: INACTIVE_CHANNEL = 3; + */ + INACTIVE_CHANNEL = 3, + /** + * @generated from protobuf enum value: PENDING_OPEN_CHANNEL = 4; + */ + PENDING_OPEN_CHANNEL = 4, + /** + * @generated from protobuf enum value: FULLY_RESOLVED_CHANNEL = 5; + */ + FULLY_RESOLVED_CHANNEL = 5 +} +/** + * @generated from protobuf message lnrpc.WalletAccountBalance + */ +export interface WalletAccountBalance { + /** + * The confirmed balance of the account (with >= 1 confirmations). + * + * @generated from protobuf field: int64 confirmed_balance = 1; + */ + confirmedBalance: bigint; + /** + * The unconfirmed balance of the account (with 0 confirmations). + * + * @generated from protobuf field: int64 unconfirmed_balance = 2; + */ + unconfirmedBalance: bigint; +} +/** + * @generated from protobuf message lnrpc.WalletBalanceRequest + */ +export interface WalletBalanceRequest { +} +/** + * @generated from protobuf message lnrpc.WalletBalanceResponse + */ +export interface WalletBalanceResponse { + /** + * The balance of the wallet + * + * @generated from protobuf field: int64 total_balance = 1; + */ + totalBalance: bigint; + /** + * The confirmed balance of a wallet(with >= 1 confirmations) + * + * @generated from protobuf field: int64 confirmed_balance = 2; + */ + confirmedBalance: bigint; + /** + * The unconfirmed balance of a wallet(with 0 confirmations) + * + * @generated from protobuf field: int64 unconfirmed_balance = 3; + */ + unconfirmedBalance: bigint; + /** + * The total amount of wallet UTXOs held in outputs that are locked for + * other usage. + * + * @generated from protobuf field: int64 locked_balance = 5; + */ + lockedBalance: bigint; + /** + * The amount of reserve required. + * + * @generated from protobuf field: int64 reserved_balance_anchor_chan = 6; + */ + reservedBalanceAnchorChan: bigint; + /** + * A mapping of each wallet account's name to its balance. + * + * @generated from protobuf field: map account_balance = 4; + */ + accountBalance: { + [key: string]: WalletAccountBalance; + }; +} +/** + * @generated from protobuf message lnrpc.Amount + */ +export interface Amount { + /** + * Value denominated in satoshis. + * + * @generated from protobuf field: uint64 sat = 1; + */ + sat: bigint; + /** + * Value denominated in milli-satoshis. + * + * @generated from protobuf field: uint64 msat = 2; + */ + msat: bigint; +} +/** + * @generated from protobuf message lnrpc.ChannelBalanceRequest + */ +export interface ChannelBalanceRequest { +} +/** + * @generated from protobuf message lnrpc.ChannelBalanceResponse + */ +export interface ChannelBalanceResponse { + /** + * Deprecated. Sum of channels balances denominated in satoshis + * + * @deprecated + * @generated from protobuf field: int64 balance = 1 [deprecated = true]; + */ + balance: bigint; + /** + * Deprecated. Sum of channels pending balances denominated in satoshis + * + * @deprecated + * @generated from protobuf field: int64 pending_open_balance = 2 [deprecated = true]; + */ + pendingOpenBalance: bigint; + /** + * Sum of channels local balances. + * + * @generated from protobuf field: lnrpc.Amount local_balance = 3; + */ + localBalance?: Amount; + /** + * Sum of channels remote balances. + * + * @generated from protobuf field: lnrpc.Amount remote_balance = 4; + */ + remoteBalance?: Amount; + /** + * Sum of channels local unsettled balances. + * + * @generated from protobuf field: lnrpc.Amount unsettled_local_balance = 5; + */ + unsettledLocalBalance?: Amount; + /** + * Sum of channels remote unsettled balances. + * + * @generated from protobuf field: lnrpc.Amount unsettled_remote_balance = 6; + */ + unsettledRemoteBalance?: Amount; + /** + * Sum of channels pending local balances. + * + * @generated from protobuf field: lnrpc.Amount pending_open_local_balance = 7; + */ + pendingOpenLocalBalance?: Amount; + /** + * Sum of channels pending remote balances. + * + * @generated from protobuf field: lnrpc.Amount pending_open_remote_balance = 8; + */ + pendingOpenRemoteBalance?: Amount; +} +/** + * @generated from protobuf message lnrpc.QueryRoutesRequest + */ +export interface QueryRoutesRequest { + /** + * The 33-byte hex-encoded public key for the payment destination + * + * @generated from protobuf field: string pub_key = 1; + */ + pubKey: string; + /** + * + * The amount to send expressed in satoshis. + * + * The fields amt and amt_msat are mutually exclusive. + * + * @generated from protobuf field: int64 amt = 2; + */ + amt: bigint; + /** + * + * The amount to send expressed in millisatoshis. + * + * The fields amt and amt_msat are mutually exclusive. + * + * @generated from protobuf field: int64 amt_msat = 12; + */ + amtMsat: bigint; + /** + * + * An optional CLTV delta from the current height that should be used for the + * timelock of the final hop. Note that unlike SendPayment, QueryRoutes does + * not add any additional block padding on top of final_ctlv_delta. This + * padding of a few blocks needs to be added manually or otherwise failures may + * happen when a block comes in while the payment is in flight. + * + * @generated from protobuf field: int32 final_cltv_delta = 4; + */ + finalCltvDelta: number; + /** + * + * The maximum number of satoshis that will be paid as a fee of the payment. + * This value can be represented either as a percentage of the amount being + * sent, or as a fixed amount of the maximum fee the user is willing the pay to + * send the payment. If not specified, lnd will use a default value of 100% + * fees for small amounts (<=1k sat) or 5% fees for larger amounts. + * + * @generated from protobuf field: lnrpc.FeeLimit fee_limit = 5; + */ + feeLimit?: FeeLimit; + /** + * + * A list of nodes to ignore during path finding. When using REST, these fields + * must be encoded as base64. + * + * @generated from protobuf field: repeated bytes ignored_nodes = 6; + */ + ignoredNodes: Uint8Array[]; + /** + * + * Deprecated. A list of edges to ignore during path finding. + * + * @deprecated + * @generated from protobuf field: repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true]; + */ + ignoredEdges: EdgeLocator[]; + /** + * + * The source node where the request route should originated from. If empty, + * self is assumed. + * + * @generated from protobuf field: string source_pub_key = 8; + */ + sourcePubKey: string; + /** + * + * If set to true, edge probabilities from mission control will be used to get + * the optimal route. + * + * @generated from protobuf field: bool use_mission_control = 9; + */ + useMissionControl: boolean; + /** + * + * A list of directed node pairs that will be ignored during path finding. + * + * @generated from protobuf field: repeated lnrpc.NodePair ignored_pairs = 10; + */ + ignoredPairs: NodePair[]; + /** + * + * An optional maximum total time lock for the route. If the source is empty or + * ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If + * zero, then the value of `--max-cltv-expiry` is used as the limit. + * + * @generated from protobuf field: uint32 cltv_limit = 11; + */ + cltvLimit: number; + /** + * + * An optional field that can be used to pass an arbitrary set of TLV records + * to a peer which understands the new records. This can be used to pass + * application specific data during the payment attempt. If the destination + * does not support the specified records, an error will be returned. + * Record types are required to be in the custom range >= 65536. When using + * REST, the values must be encoded as base64. + * + * @generated from protobuf field: map dest_custom_records = 13; + */ + destCustomRecords: { + [key: string]: Uint8Array; + }; + /** + * + * The channel id of the channel that must be taken to the first hop. If zero, + * any channel may be used. + * + * @generated from protobuf field: uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; + */ + outgoingChanId: string; + /** + * + * The pubkey of the last hop of the route. If empty, any hop may be used. + * + * @generated from protobuf field: bytes last_hop_pubkey = 15; + */ + lastHopPubkey: Uint8Array; + /** + * + * Optional route hints to reach the destination through private channels. + * + * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 16; + */ + routeHints: RouteHint[]; + /** + * + * Features assumed to be supported by the final node. All transitive feature + * dependencies must also be set properly. For a given feature bit pair, either + * optional or remote may be set, but not both. If this field is nil or empty, + * the router will try to load destination features from the graph as a + * fallback. + * + * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 17; + */ + destFeatures: FeatureBit[]; + /** + * + * The time preference for this payment. Set to -1 to optimize for fees + * only, to 1 to optimize for reliability only or a value inbetween for a mix. + * + * @generated from protobuf field: double time_pref = 18; + */ + timePref: number; +} +/** + * @generated from protobuf message lnrpc.NodePair + */ +export interface NodePair { + /** + * + * The sending node of the pair. When using REST, this field must be encoded as + * base64. + * + * @generated from protobuf field: bytes from = 1; + */ + from: Uint8Array; + /** + * + * The receiving node of the pair. When using REST, this field must be encoded + * as base64. + * + * @generated from protobuf field: bytes to = 2; + */ + to: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.EdgeLocator + */ +export interface EdgeLocator { + /** + * The short channel id of this edge. + * + * @generated from protobuf field: uint64 channel_id = 1 [jstype = JS_STRING]; + */ + channelId: string; + /** + * + * The direction of this edge. If direction_reverse is false, the direction + * of this edge is from the channel endpoint with the lexicographically smaller + * pub key to the endpoint with the larger pub key. If direction_reverse is + * is true, the edge goes the other way. + * + * @generated from protobuf field: bool direction_reverse = 2; + */ + directionReverse: boolean; +} +/** + * @generated from protobuf message lnrpc.QueryRoutesResponse + */ +export interface QueryRoutesResponse { + /** + * + * The route that results from the path finding operation. This is still a + * repeated field to retain backwards compatibility. + * + * @generated from protobuf field: repeated lnrpc.Route routes = 1; + */ + routes: Route[]; + /** + * + * The success probability of the returned route based on the current mission + * control state. [EXPERIMENTAL] + * + * @generated from protobuf field: double success_prob = 2; + */ + successProb: number; +} +/** + * @generated from protobuf message lnrpc.Hop + */ +export interface Hop { + /** + * + * The unique channel ID for the channel. The first 3 bytes are the block + * height, the next 3 the index within the block, and the last 2 bytes are the + * output index for the channel. + * + * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; + */ + chanId: string; + /** + * @deprecated + * @generated from protobuf field: int64 chan_capacity = 2 [deprecated = true]; + */ + chanCapacity: bigint; + /** + * @deprecated + * @generated from protobuf field: int64 amt_to_forward = 3 [deprecated = true]; + */ + amtToForward: bigint; + /** + * @deprecated + * @generated from protobuf field: int64 fee = 4 [deprecated = true]; + */ + fee: bigint; + /** + * @generated from protobuf field: uint32 expiry = 5; + */ + expiry: number; + /** + * @generated from protobuf field: int64 amt_to_forward_msat = 6; + */ + amtToForwardMsat: bigint; + /** + * @generated from protobuf field: int64 fee_msat = 7; + */ + feeMsat: bigint; + /** + * + * An optional public key of the hop. If the public key is given, the payment + * can be executed without relying on a copy of the channel graph. + * + * @generated from protobuf field: string pub_key = 8; + */ + pubKey: string; + /** + * + * If set to true, then this hop will be encoded using the new variable length + * TLV format. Note that if any custom tlv_records below are specified, then + * this field MUST be set to true for them to be encoded properly. + * + * @deprecated + * @generated from protobuf field: bool tlv_payload = 9 [deprecated = true]; + */ + tlvPayload: boolean; + /** + * + * An optional TLV record that signals the use of an MPP payment. If present, + * the receiver will enforce that the same mpp_record is included in the final + * hop payload of all non-zero payments in the HTLC set. If empty, a regular + * single-shot payment is or was attempted. + * + * @generated from protobuf field: lnrpc.MPPRecord mpp_record = 10; + */ + mppRecord?: MPPRecord; + /** + * + * An optional TLV record that signals the use of an AMP payment. If present, + * the receiver will treat all received payments including the same + * (payment_addr, set_id) pair as being part of one logical payment. The + * payment will be settled by XORing the root_share's together and deriving the + * child hashes and preimages according to BOLT XX. Must be used in conjunction + * with mpp_record. + * + * @generated from protobuf field: lnrpc.AMPRecord amp_record = 12; + */ + ampRecord?: AMPRecord; + /** + * + * An optional set of key-value TLV records. This is useful within the context + * of the SendToRoute call as it allows callers to specify arbitrary K-V pairs + * to drop off at each hop within the onion. + * + * @generated from protobuf field: map custom_records = 11; + */ + customRecords: { + [key: string]: Uint8Array; + }; + /** + * The payment metadata to send along with the payment to the payee. + * + * @generated from protobuf field: bytes metadata = 13; + */ + metadata: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.MPPRecord + */ +export interface MPPRecord { + /** + * + * A unique, random identifier used to authenticate the sender as the intended + * payer of a multi-path payment. The payment_addr must be the same for all + * subpayments, and match the payment_addr provided in the receiver's invoice. + * The same payment_addr must be used on all subpayments. + * + * @generated from protobuf field: bytes payment_addr = 11; + */ + paymentAddr: Uint8Array; + /** + * + * The total amount in milli-satoshis being sent as part of a larger multi-path + * payment. The caller is responsible for ensuring subpayments to the same node + * and payment_hash sum exactly to total_amt_msat. The same + * total_amt_msat must be used on all subpayments. + * + * @generated from protobuf field: int64 total_amt_msat = 10; + */ + totalAmtMsat: bigint; +} +/** + * @generated from protobuf message lnrpc.AMPRecord + */ +export interface AMPRecord { + /** + * @generated from protobuf field: bytes root_share = 1; + */ + rootShare: Uint8Array; + /** + * @generated from protobuf field: bytes set_id = 2; + */ + setId: Uint8Array; + /** + * @generated from protobuf field: uint32 child_index = 3; + */ + childIndex: number; +} +/** + * + * A path through the channel graph which runs over one or more channels in + * succession. This struct carries all the information required to craft the + * Sphinx onion packet, and send the payment along the first hop in the path. A + * route is only selected as valid if all the channels have sufficient capacity to + * carry the initial payment amount after fees are accounted for. + * + * @generated from protobuf message lnrpc.Route + */ +export interface Route { + /** + * + * The cumulative (final) time lock across the entire route. This is the CLTV + * value that should be extended to the first hop in the route. All other hops + * will decrement the time-lock as advertised, leaving enough time for all + * hops to wait for or present the payment preimage to complete the payment. + * + * @generated from protobuf field: uint32 total_time_lock = 1; + */ + totalTimeLock: number; + /** + * + * The sum of the fees paid at each hop within the final route. In the case + * of a one-hop payment, this value will be zero as we don't need to pay a fee + * to ourselves. + * + * @deprecated + * @generated from protobuf field: int64 total_fees = 2 [deprecated = true]; + */ + totalFees: bigint; + /** + * + * The total amount of funds required to complete a payment over this route. + * This value includes the cumulative fees at each hop. As a result, the HTLC + * extended to the first-hop in the route will need to have at least this many + * satoshis, otherwise the route will fail at an intermediate node due to an + * insufficient amount of fees. + * + * @deprecated + * @generated from protobuf field: int64 total_amt = 3 [deprecated = true]; + */ + totalAmt: bigint; + /** + * + * Contains details concerning the specific forwarding details at each hop. + * + * @generated from protobuf field: repeated lnrpc.Hop hops = 4; + */ + hops: Hop[]; + /** + * + * The total fees in millisatoshis. + * + * @generated from protobuf field: int64 total_fees_msat = 5; + */ + totalFeesMsat: bigint; + /** + * + * The total amount in millisatoshis. + * + * @generated from protobuf field: int64 total_amt_msat = 6; + */ + totalAmtMsat: bigint; +} +/** + * @generated from protobuf message lnrpc.NodeInfoRequest + */ +export interface NodeInfoRequest { + /** + * The 33-byte hex-encoded compressed public of the target node + * + * @generated from protobuf field: string pub_key = 1; + */ + pubKey: string; + /** + * If true, will include all known channels associated with the node. + * + * @generated from protobuf field: bool include_channels = 2; + */ + includeChannels: boolean; +} +/** + * @generated from protobuf message lnrpc.NodeInfo + */ +export interface NodeInfo { + /** + * + * An individual vertex/node within the channel graph. A node is + * connected to other nodes by one or more channel edges emanating from it. As + * the graph is directed, a node will also have an incoming edge attached to + * it for each outgoing edge. + * + * @generated from protobuf field: lnrpc.LightningNode node = 1; + */ + node?: LightningNode; + /** + * The total number of channels for the node. + * + * @generated from protobuf field: uint32 num_channels = 2; + */ + numChannels: number; + /** + * The sum of all channels capacity for the node, denominated in satoshis. + * + * @generated from protobuf field: int64 total_capacity = 3; + */ + totalCapacity: bigint; + /** + * A list of all public channels for the node. + * + * @generated from protobuf field: repeated lnrpc.ChannelEdge channels = 4; + */ + channels: ChannelEdge[]; +} +/** + * + * An individual vertex/node within the channel graph. A node is + * connected to other nodes by one or more channel edges emanating from it. As the + * graph is directed, a node will also have an incoming edge attached to it for + * each outgoing edge. + * + * @generated from protobuf message lnrpc.LightningNode + */ +export interface LightningNode { + /** + * @generated from protobuf field: uint32 last_update = 1; + */ + lastUpdate: number; + /** + * @generated from protobuf field: string pub_key = 2; + */ + pubKey: string; + /** + * @generated from protobuf field: string alias = 3; + */ + alias: string; + /** + * @generated from protobuf field: repeated lnrpc.NodeAddress addresses = 4; + */ + addresses: NodeAddress[]; + /** + * @generated from protobuf field: string color = 5; + */ + color: string; + /** + * @generated from protobuf field: map features = 6; + */ + features: { + [key: number]: Feature; + }; + /** + * Custom node announcement tlv records. + * + * @generated from protobuf field: map custom_records = 7; + */ + customRecords: { + [key: string]: Uint8Array; + }; +} +/** + * @generated from protobuf message lnrpc.NodeAddress + */ +export interface NodeAddress { + /** + * @generated from protobuf field: string network = 1; + */ + network: string; + /** + * @generated from protobuf field: string addr = 2; + */ + addr: string; +} +/** + * @generated from protobuf message lnrpc.RoutingPolicy + */ +export interface RoutingPolicy { + /** + * @generated from protobuf field: uint32 time_lock_delta = 1; + */ + timeLockDelta: number; + /** + * @generated from protobuf field: int64 min_htlc = 2; + */ + minHtlc: bigint; + /** + * @generated from protobuf field: int64 fee_base_msat = 3; + */ + feeBaseMsat: bigint; + /** + * @generated from protobuf field: int64 fee_rate_milli_msat = 4; + */ + feeRateMilliMsat: bigint; + /** + * @generated from protobuf field: bool disabled = 5; + */ + disabled: boolean; + /** + * @generated from protobuf field: uint64 max_htlc_msat = 6; + */ + maxHtlcMsat: bigint; + /** + * @generated from protobuf field: uint32 last_update = 7; + */ + lastUpdate: number; + /** + * Custom channel update tlv records. + * + * @generated from protobuf field: map custom_records = 8; + */ + customRecords: { + [key: string]: Uint8Array; + }; +} +/** + * + * A fully authenticated channel along with all its unique attributes. + * Once an authenticated channel announcement has been processed on the network, + * then an instance of ChannelEdgeInfo encapsulating the channels attributes is + * stored. The other portions relevant to routing policy of a channel are stored + * within a ChannelEdgePolicy for each direction of the channel. + * + * @generated from protobuf message lnrpc.ChannelEdge + */ +export interface ChannelEdge { + /** + * + * The unique channel ID for the channel. The first 3 bytes are the block + * height, the next 3 the index within the block, and the last 2 bytes are the + * output index for the channel. + * + * @generated from protobuf field: uint64 channel_id = 1 [jstype = JS_STRING]; + */ + channelId: string; + /** + * @generated from protobuf field: string chan_point = 2; + */ + chanPoint: string; + /** + * @deprecated + * @generated from protobuf field: uint32 last_update = 3 [deprecated = true]; + */ + lastUpdate: number; + /** + * @generated from protobuf field: string node1_pub = 4; + */ + node1Pub: string; + /** + * @generated from protobuf field: string node2_pub = 5; + */ + node2Pub: string; + /** + * @generated from protobuf field: int64 capacity = 6; + */ + capacity: bigint; + /** + * @generated from protobuf field: lnrpc.RoutingPolicy node1_policy = 7; + */ + node1Policy?: RoutingPolicy; + /** + * @generated from protobuf field: lnrpc.RoutingPolicy node2_policy = 8; + */ + node2Policy?: RoutingPolicy; + /** + * Custom channel announcement tlv records. + * + * @generated from protobuf field: map custom_records = 9; + */ + customRecords: { + [key: string]: Uint8Array; + }; +} +/** + * @generated from protobuf message lnrpc.ChannelGraphRequest + */ +export interface ChannelGraphRequest { + /** + * + * Whether unannounced channels are included in the response or not. If set, + * unannounced channels are included. Unannounced channels are both private + * channels, and public channels that are not yet announced to the network. + * + * @generated from protobuf field: bool include_unannounced = 1; + */ + includeUnannounced: boolean; +} +/** + * Returns a new instance of the directed channel graph. + * + * @generated from protobuf message lnrpc.ChannelGraph + */ +export interface ChannelGraph { + /** + * The list of `LightningNode`s in this channel graph + * + * @generated from protobuf field: repeated lnrpc.LightningNode nodes = 1; + */ + nodes: LightningNode[]; + /** + * The list of `ChannelEdge`s in this channel graph + * + * @generated from protobuf field: repeated lnrpc.ChannelEdge edges = 2; + */ + edges: ChannelEdge[]; +} +/** + * @generated from protobuf message lnrpc.NodeMetricsRequest + */ +export interface NodeMetricsRequest { + /** + * The requested node metrics. + * + * @generated from protobuf field: repeated lnrpc.NodeMetricType types = 1; + */ + types: NodeMetricType[]; +} +/** + * @generated from protobuf message lnrpc.NodeMetricsResponse + */ +export interface NodeMetricsResponse { + /** + * + * Betweenness centrality is the sum of the ratio of shortest paths that pass + * through the node for each pair of nodes in the graph (not counting paths + * starting or ending at this node). + * Map of node pubkey to betweenness centrality of the node. Normalized + * values are in the [0,1] closed interval. + * + * @generated from protobuf field: map betweenness_centrality = 1; + */ + betweennessCentrality: { + [key: string]: FloatMetric; + }; +} +/** + * @generated from protobuf message lnrpc.FloatMetric + */ +export interface FloatMetric { + /** + * Arbitrary float value. + * + * @generated from protobuf field: double value = 1; + */ + value: number; + /** + * The value normalized to [0,1] or [-1,1]. + * + * @generated from protobuf field: double normalized_value = 2; + */ + normalizedValue: number; +} +/** + * @generated from protobuf message lnrpc.ChanInfoRequest + */ +export interface ChanInfoRequest { + /** + * + * The unique channel ID for the channel. The first 3 bytes are the block + * height, the next 3 the index within the block, and the last 2 bytes are the + * output index for the channel. + * + * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; + */ + chanId: string; +} +/** + * @generated from protobuf message lnrpc.NetworkInfoRequest + */ +export interface NetworkInfoRequest { +} +/** + * @generated from protobuf message lnrpc.NetworkInfo + */ +export interface NetworkInfo { + /** + * @generated from protobuf field: uint32 graph_diameter = 1; + */ + graphDiameter: number; + /** + * @generated from protobuf field: double avg_out_degree = 2; + */ + avgOutDegree: number; + /** + * @generated from protobuf field: uint32 max_out_degree = 3; + */ + maxOutDegree: number; + /** + * @generated from protobuf field: uint32 num_nodes = 4; + */ + numNodes: number; + /** + * @generated from protobuf field: uint32 num_channels = 5; + */ + numChannels: number; + /** + * @generated from protobuf field: int64 total_network_capacity = 6; + */ + totalNetworkCapacity: bigint; + /** + * @generated from protobuf field: double avg_channel_size = 7; + */ + avgChannelSize: number; + /** + * @generated from protobuf field: int64 min_channel_size = 8; + */ + minChannelSize: bigint; + /** + * @generated from protobuf field: int64 max_channel_size = 9; + */ + maxChannelSize: bigint; + /** + * @generated from protobuf field: int64 median_channel_size_sat = 10; + */ + medianChannelSizeSat: bigint; + /** + * The number of edges marked as zombies. + * + * @generated from protobuf field: uint64 num_zombie_chans = 11; + */ + numZombieChans: bigint; +} +/** + * @generated from protobuf message lnrpc.StopRequest + */ +export interface StopRequest { +} +/** + * @generated from protobuf message lnrpc.StopResponse + */ +export interface StopResponse { +} +/** + * @generated from protobuf message lnrpc.GraphTopologySubscription + */ +export interface GraphTopologySubscription { +} +/** + * @generated from protobuf message lnrpc.GraphTopologyUpdate + */ +export interface GraphTopologyUpdate { + /** + * @generated from protobuf field: repeated lnrpc.NodeUpdate node_updates = 1; + */ + nodeUpdates: NodeUpdate[]; + /** + * @generated from protobuf field: repeated lnrpc.ChannelEdgeUpdate channel_updates = 2; + */ + channelUpdates: ChannelEdgeUpdate[]; + /** + * @generated from protobuf field: repeated lnrpc.ClosedChannelUpdate closed_chans = 3; + */ + closedChans: ClosedChannelUpdate[]; +} +/** + * @generated from protobuf message lnrpc.NodeUpdate + */ +export interface NodeUpdate { + /** + * + * Deprecated, use node_addresses. + * + * @deprecated + * @generated from protobuf field: repeated string addresses = 1 [deprecated = true]; + */ + addresses: string[]; + /** + * @generated from protobuf field: string identity_key = 2; + */ + identityKey: string; + /** + * + * Deprecated, use features. + * + * @deprecated + * @generated from protobuf field: bytes global_features = 3 [deprecated = true]; + */ + globalFeatures: Uint8Array; + /** + * @generated from protobuf field: string alias = 4; + */ + alias: string; + /** + * @generated from protobuf field: string color = 5; + */ + color: string; + /** + * @generated from protobuf field: repeated lnrpc.NodeAddress node_addresses = 7; + */ + nodeAddresses: NodeAddress[]; + /** + * + * Features that the node has advertised in the init message, node + * announcements and invoices. + * + * @generated from protobuf field: map features = 6; + */ + features: { + [key: number]: Feature; + }; +} +/** + * @generated from protobuf message lnrpc.ChannelEdgeUpdate + */ +export interface ChannelEdgeUpdate { + /** + * + * The unique channel ID for the channel. The first 3 bytes are the block + * height, the next 3 the index within the block, and the last 2 bytes are the + * output index for the channel. + * + * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; + */ + chanId: string; + /** + * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; + */ + chanPoint?: ChannelPoint; + /** + * @generated from protobuf field: int64 capacity = 3; + */ + capacity: bigint; + /** + * @generated from protobuf field: lnrpc.RoutingPolicy routing_policy = 4; + */ + routingPolicy?: RoutingPolicy; + /** + * @generated from protobuf field: string advertising_node = 5; + */ + advertisingNode: string; + /** + * @generated from protobuf field: string connecting_node = 6; + */ + connectingNode: string; +} +/** + * @generated from protobuf message lnrpc.ClosedChannelUpdate + */ +export interface ClosedChannelUpdate { + /** + * + * The unique channel ID for the channel. The first 3 bytes are the block + * height, the next 3 the index within the block, and the last 2 bytes are the + * output index for the channel. + * + * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; + */ + chanId: string; + /** + * @generated from protobuf field: int64 capacity = 2; + */ + capacity: bigint; + /** + * @generated from protobuf field: uint32 closed_height = 3; + */ + closedHeight: number; + /** + * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 4; + */ + chanPoint?: ChannelPoint; +} +/** + * @generated from protobuf message lnrpc.HopHint + */ +export interface HopHint { + /** + * The public key of the node at the start of the channel. + * + * @generated from protobuf field: string node_id = 1; + */ + nodeId: string; + /** + * The unique identifier of the channel. + * + * @generated from protobuf field: uint64 chan_id = 2 [jstype = JS_STRING]; + */ + chanId: string; + /** + * The base fee of the channel denominated in millisatoshis. + * + * @generated from protobuf field: uint32 fee_base_msat = 3; + */ + feeBaseMsat: number; + /** + * + * The fee rate of the channel for sending one satoshi across it denominated in + * millionths of a satoshi. + * + * @generated from protobuf field: uint32 fee_proportional_millionths = 4; + */ + feeProportionalMillionths: number; + /** + * The time-lock delta of the channel. + * + * @generated from protobuf field: uint32 cltv_expiry_delta = 5; + */ + cltvExpiryDelta: number; +} +/** + * @generated from protobuf message lnrpc.SetID + */ +export interface SetID { + /** + * @generated from protobuf field: bytes set_id = 1; + */ + setId: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.RouteHint + */ +export interface RouteHint { + /** + * + * A list of hop hints that when chained together can assist in reaching a + * specific destination. + * + * @generated from protobuf field: repeated lnrpc.HopHint hop_hints = 1; + */ + hopHints: HopHint[]; +} +/** + * @generated from protobuf message lnrpc.AMPInvoiceState + */ +export interface AMPInvoiceState { + /** + * The state the HTLCs associated with this setID are in. + * + * @generated from protobuf field: lnrpc.InvoiceHTLCState state = 1; + */ + state: InvoiceHTLCState; + /** + * The settle index of this HTLC set, if the invoice state is settled. + * + * @generated from protobuf field: uint64 settle_index = 2; + */ + settleIndex: bigint; + /** + * The time this HTLC set was settled expressed in unix epoch. + * + * @generated from protobuf field: int64 settle_time = 3; + */ + settleTime: bigint; + /** + * The total amount paid for the sub-invoice expressed in milli satoshis. + * + * @generated from protobuf field: int64 amt_paid_msat = 5; + */ + amtPaidMsat: bigint; +} +/** + * @generated from protobuf message lnrpc.Invoice + */ +export interface Invoice { + /** + * + * An optional memo to attach along with the invoice. Used for record keeping + * purposes for the invoice's creator, and will also be set in the description + * field of the encoded payment request if the description_hash field is not + * being used. + * + * @generated from protobuf field: string memo = 1; + */ + memo: string; + /** + * + * The hex-encoded preimage (32 byte) which will allow settling an incoming + * HTLC payable to this preimage. When using REST, this field must be encoded + * as base64. + * + * @generated from protobuf field: bytes r_preimage = 3; + */ + rPreimage: Uint8Array; + /** + * + * The hash of the preimage. When using REST, this field must be encoded as + * base64. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: bytes r_hash = 4; + */ + rHash: Uint8Array; + /** + * + * The value of this invoice in satoshis + * + * The fields value and value_msat are mutually exclusive. + * + * @generated from protobuf field: int64 value = 5; + */ + value: bigint; + /** + * + * The value of this invoice in millisatoshis + * + * The fields value and value_msat are mutually exclusive. + * + * @generated from protobuf field: int64 value_msat = 23; + */ + valueMsat: bigint; + /** + * + * Whether this invoice has been fulfilled + * + * The field is deprecated. Use the state field instead (compare to SETTLED). + * + * @deprecated + * @generated from protobuf field: bool settled = 6 [deprecated = true]; + */ + settled: boolean; + /** + * + * When this invoice was created. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: int64 creation_date = 7; + */ + creationDate: bigint; + /** + * + * When this invoice was settled. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: int64 settle_date = 8; + */ + settleDate: bigint; + /** + * + * A bare-bones invoice for a payment within the Lightning Network. With the + * details of the invoice, the sender has all the data necessary to send a + * payment to the recipient. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: string payment_request = 9; + */ + paymentRequest: string; + /** + * + * Hash (SHA-256) of a description of the payment. Used if the description of + * payment (memo) is too long to naturally fit within the description field + * of an encoded payment request. When using REST, this field must be encoded + * as base64. + * + * @generated from protobuf field: bytes description_hash = 10; + */ + descriptionHash: Uint8Array; + /** + * Payment request expiry time in seconds. Default is 3600 (1 hour). + * + * @generated from protobuf field: int64 expiry = 11; + */ + expiry: bigint; + /** + * Fallback on-chain address. + * + * @generated from protobuf field: string fallback_addr = 12; + */ + fallbackAddr: string; + /** + * Delta to use for the time-lock of the CLTV extended to the final hop. + * + * @generated from protobuf field: uint64 cltv_expiry = 13; + */ + cltvExpiry: bigint; + /** + * + * Route hints that can each be individually used to assist in reaching the + * invoice's destination. + * + * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 14; + */ + routeHints: RouteHint[]; + /** + * Whether this invoice should include routing hints for private channels. + * + * @generated from protobuf field: bool private = 15; + */ + private: boolean; + /** + * + * The "add" index of this invoice. Each newly created invoice will increment + * this index making it monotonically increasing. Callers to the + * SubscribeInvoices call can use this to instantly get notified of all added + * invoices with an add_index greater than this one. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: uint64 add_index = 16; + */ + addIndex: bigint; + /** + * + * The "settle" index of this invoice. Each newly settled invoice will + * increment this index making it monotonically increasing. Callers to the + * SubscribeInvoices call can use this to instantly get notified of all + * settled invoices with an settle_index greater than this one. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: uint64 settle_index = 17; + */ + settleIndex: bigint; + /** + * Deprecated, use amt_paid_sat or amt_paid_msat. + * + * @deprecated + * @generated from protobuf field: int64 amt_paid = 18 [deprecated = true]; + */ + amtPaid: bigint; + /** + * + * The amount that was accepted for this invoice, in satoshis. This will ONLY + * be set if this invoice has been settled. We provide this field as if the + * invoice was created with a zero value, then we need to record what amount + * was ultimately accepted. Additionally, it's possible that the sender paid + * MORE that was specified in the original invoice. So we'll record that here + * as well. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: int64 amt_paid_sat = 19; + */ + amtPaidSat: bigint; + /** + * + * The amount that was accepted for this invoice, in millisatoshis. This will + * ONLY be set if this invoice has been settled. We provide this field as if + * the invoice was created with a zero value, then we need to record what + * amount was ultimately accepted. Additionally, it's possible that the sender + * paid MORE that was specified in the original invoice. So we'll record that + * here as well. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: int64 amt_paid_msat = 20; + */ + amtPaidMsat: bigint; + /** + * + * The state the invoice is in. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: lnrpc.Invoice.InvoiceState state = 21; + */ + state: Invoice_InvoiceState; + /** + * + * List of HTLCs paying to this invoice [EXPERIMENTAL]. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: repeated lnrpc.InvoiceHTLC htlcs = 22; + */ + htlcs: InvoiceHTLC[]; + /** + * + * List of features advertised on the invoice. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: map features = 24; + */ + features: { + [key: number]: Feature; + }; + /** + * + * Indicates if this invoice was a spontaneous payment that arrived via keysend + * [EXPERIMENTAL]. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: bool is_keysend = 25; + */ + isKeysend: boolean; + /** + * + * The payment address of this invoice. This value will be used in MPP + * payments, and also for newer invoices that always require the MPP payload + * for added end-to-end security. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: bytes payment_addr = 26; + */ + paymentAddr: Uint8Array; + /** + * + * Signals whether or not this is an AMP invoice. + * + * @generated from protobuf field: bool is_amp = 27; + */ + isAmp: boolean; + /** + * + * [EXPERIMENTAL]: + * + * Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the + * given set ID. This field is always populated for AMP invoices, and can be + * used along side LookupInvoice to obtain the HTLC information related to a + * given sub-invoice. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: map amp_invoice_state = 28; + */ + ampInvoiceState: { + [key: string]: AMPInvoiceState; + }; +} +/** + * @generated from protobuf enum lnrpc.Invoice.InvoiceState + */ +export enum Invoice_InvoiceState { + /** + * @generated from protobuf enum value: OPEN = 0; + */ + OPEN = 0, + /** + * @generated from protobuf enum value: SETTLED = 1; + */ + SETTLED = 1, + /** + * @generated from protobuf enum value: CANCELED = 2; + */ + CANCELED = 2, + /** + * @generated from protobuf enum value: ACCEPTED = 3; + */ + ACCEPTED = 3 +} +/** + * Details of an HTLC that paid to an invoice + * + * @generated from protobuf message lnrpc.InvoiceHTLC + */ +export interface InvoiceHTLC { + /** + * Short channel id over which the htlc was received. + * + * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; + */ + chanId: string; + /** + * Index identifying the htlc on the channel. + * + * @generated from protobuf field: uint64 htlc_index = 2; + */ + htlcIndex: bigint; + /** + * The amount of the htlc in msat. + * + * @generated from protobuf field: uint64 amt_msat = 3; + */ + amtMsat: bigint; + /** + * Block height at which this htlc was accepted. + * + * @generated from protobuf field: int32 accept_height = 4; + */ + acceptHeight: number; + /** + * Time at which this htlc was accepted. + * + * @generated from protobuf field: int64 accept_time = 5; + */ + acceptTime: bigint; + /** + * Time at which this htlc was settled or canceled. + * + * @generated from protobuf field: int64 resolve_time = 6; + */ + resolveTime: bigint; + /** + * Block height at which this htlc expires. + * + * @generated from protobuf field: int32 expiry_height = 7; + */ + expiryHeight: number; + /** + * Current state the htlc is in. + * + * @generated from protobuf field: lnrpc.InvoiceHTLCState state = 8; + */ + state: InvoiceHTLCState; + /** + * Custom tlv records. + * + * @generated from protobuf field: map custom_records = 9; + */ + customRecords: { + [key: string]: Uint8Array; + }; + /** + * The total amount of the mpp payment in msat. + * + * @generated from protobuf field: uint64 mpp_total_amt_msat = 10; + */ + mppTotalAmtMsat: bigint; + /** + * Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. + * + * @generated from protobuf field: lnrpc.AMP amp = 11; + */ + amp?: AMP; +} +/** + * Details specific to AMP HTLCs. + * + * @generated from protobuf message lnrpc.AMP + */ +export interface AMP { + /** + * An n-of-n secret share of the root seed from which child payment hashes + * and preimages are derived. + * + * @generated from protobuf field: bytes root_share = 1; + */ + rootShare: Uint8Array; + /** + * An identifier for the HTLC set that this HTLC belongs to. + * + * @generated from protobuf field: bytes set_id = 2; + */ + setId: Uint8Array; + /** + * A nonce used to randomize the child preimage and child hash from a given + * root_share. + * + * @generated from protobuf field: uint32 child_index = 3; + */ + childIndex: number; + /** + * The payment hash of the AMP HTLC. + * + * @generated from protobuf field: bytes hash = 4; + */ + hash: Uint8Array; + /** + * The preimage used to settle this AMP htlc. This field will only be + * populated if the invoice is in InvoiceState_ACCEPTED or + * InvoiceState_SETTLED. + * + * @generated from protobuf field: bytes preimage = 5; + */ + preimage: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.AddInvoiceResponse + */ +export interface AddInvoiceResponse { + /** + * @generated from protobuf field: bytes r_hash = 1; + */ + rHash: Uint8Array; + /** + * + * A bare-bones invoice for a payment within the Lightning Network. With the + * details of the invoice, the sender has all the data necessary to send a + * payment to the recipient. + * + * @generated from protobuf field: string payment_request = 2; + */ + paymentRequest: string; + /** + * + * The "add" index of this invoice. Each newly created invoice will increment + * this index making it monotonically increasing. Callers to the + * SubscribeInvoices call can use this to instantly get notified of all added + * invoices with an add_index greater than this one. + * + * @generated from protobuf field: uint64 add_index = 16; + */ + addIndex: bigint; + /** + * + * The payment address of the generated invoice. This value should be used + * in all payments for this invoice as we require it for end to end + * security. + * + * @generated from protobuf field: bytes payment_addr = 17; + */ + paymentAddr: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.PaymentHash + */ +export interface PaymentHash { + /** + * + * The hex-encoded payment hash of the invoice to be looked up. The passed + * payment hash must be exactly 32 bytes, otherwise an error is returned. + * Deprecated now that the REST gateway supports base64 encoding of bytes + * fields. + * + * @deprecated + * @generated from protobuf field: string r_hash_str = 1 [deprecated = true]; + */ + rHashStr: string; + /** + * + * The payment hash of the invoice to be looked up. When using REST, this field + * must be encoded as base64. + * + * @generated from protobuf field: bytes r_hash = 2; + */ + rHash: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.ListInvoiceRequest + */ +export interface ListInvoiceRequest { + /** + * + * If set, only invoices that are not settled and not canceled will be returned + * in the response. + * + * @generated from protobuf field: bool pending_only = 1; + */ + pendingOnly: boolean; + /** + * + * The index of an invoice that will be used as either the start or end of a + * query to determine which invoices should be returned in the response. + * + * @generated from protobuf field: uint64 index_offset = 4; + */ + indexOffset: bigint; + /** + * The max number of invoices to return in the response to this query. + * + * @generated from protobuf field: uint64 num_max_invoices = 5; + */ + numMaxInvoices: bigint; + /** + * + * If set, the invoices returned will result from seeking backwards from the + * specified index offset. This can be used to paginate backwards. + * + * @generated from protobuf field: bool reversed = 6; + */ + reversed: boolean; +} +/** + * @generated from protobuf message lnrpc.ListInvoiceResponse + */ +export interface ListInvoiceResponse { + /** + * + * A list of invoices from the time slice of the time series specified in the + * request. + * + * @generated from protobuf field: repeated lnrpc.Invoice invoices = 1; + */ + invoices: Invoice[]; + /** + * + * The index of the last item in the set of returned invoices. This can be used + * to seek further, pagination style. + * + * @generated from protobuf field: uint64 last_index_offset = 2; + */ + lastIndexOffset: bigint; + /** + * + * The index of the last item in the set of returned invoices. This can be used + * to seek backwards, pagination style. + * + * @generated from protobuf field: uint64 first_index_offset = 3; + */ + firstIndexOffset: bigint; +} +/** + * @generated from protobuf message lnrpc.InvoiceSubscription + */ +export interface InvoiceSubscription { + /** + * + * If specified (non-zero), then we'll first start by sending out + * notifications for all added indexes with an add_index greater than this + * value. This allows callers to catch up on any events they missed while they + * weren't connected to the streaming RPC. + * + * @generated from protobuf field: uint64 add_index = 1; + */ + addIndex: bigint; + /** + * + * If specified (non-zero), then we'll first start by sending out + * notifications for all settled indexes with an settle_index greater than + * this value. This allows callers to catch up on any events they missed while + * they weren't connected to the streaming RPC. + * + * @generated from protobuf field: uint64 settle_index = 2; + */ + settleIndex: bigint; +} +/** + * @generated from protobuf message lnrpc.Payment + */ +export interface Payment { + /** + * The payment hash + * + * @generated from protobuf field: string payment_hash = 1; + */ + paymentHash: string; + /** + * Deprecated, use value_sat or value_msat. + * + * @deprecated + * @generated from protobuf field: int64 value = 2 [deprecated = true]; + */ + value: bigint; + /** + * Deprecated, use creation_time_ns + * + * @deprecated + * @generated from protobuf field: int64 creation_date = 3 [deprecated = true]; + */ + creationDate: bigint; + /** + * Deprecated, use fee_sat or fee_msat. + * + * @deprecated + * @generated from protobuf field: int64 fee = 5 [deprecated = true]; + */ + fee: bigint; + /** + * The payment preimage + * + * @generated from protobuf field: string payment_preimage = 6; + */ + paymentPreimage: string; + /** + * The value of the payment in satoshis + * + * @generated from protobuf field: int64 value_sat = 7; + */ + valueSat: bigint; + /** + * The value of the payment in milli-satoshis + * + * @generated from protobuf field: int64 value_msat = 8; + */ + valueMsat: bigint; + /** + * The optional payment request being fulfilled. + * + * @generated from protobuf field: string payment_request = 9; + */ + paymentRequest: string; + /** + * The status of the payment. + * + * @generated from protobuf field: lnrpc.Payment.PaymentStatus status = 10; + */ + status: Payment_PaymentStatus; + /** + * The fee paid for this payment in satoshis + * + * @generated from protobuf field: int64 fee_sat = 11; + */ + feeSat: bigint; + /** + * The fee paid for this payment in milli-satoshis + * + * @generated from protobuf field: int64 fee_msat = 12; + */ + feeMsat: bigint; + /** + * The time in UNIX nanoseconds at which the payment was created. + * + * @generated from protobuf field: int64 creation_time_ns = 13; + */ + creationTimeNs: bigint; + /** + * The HTLCs made in attempt to settle the payment. + * + * @generated from protobuf field: repeated lnrpc.HTLCAttempt htlcs = 14; + */ + htlcs: HTLCAttempt[]; + /** + * + * The creation index of this payment. Each payment can be uniquely identified + * by this index, which may not strictly increment by 1 for payments made in + * older versions of lnd. + * + * @generated from protobuf field: uint64 payment_index = 15; + */ + paymentIndex: bigint; + /** + * @generated from protobuf field: lnrpc.PaymentFailureReason failure_reason = 16; + */ + failureReason: PaymentFailureReason; +} +/** + * @generated from protobuf enum lnrpc.Payment.PaymentStatus + */ +export enum Payment_PaymentStatus { + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: IN_FLIGHT = 1; + */ + IN_FLIGHT = 1, + /** + * @generated from protobuf enum value: SUCCEEDED = 2; + */ + SUCCEEDED = 2, + /** + * @generated from protobuf enum value: FAILED = 3; + */ + FAILED = 3 +} +/** + * @generated from protobuf message lnrpc.HTLCAttempt + */ +export interface HTLCAttempt { + /** + * The unique ID that is used for this attempt. + * + * @generated from protobuf field: uint64 attempt_id = 7; + */ + attemptId: bigint; + /** + * The status of the HTLC. + * + * @generated from protobuf field: lnrpc.HTLCAttempt.HTLCStatus status = 1; + */ + status: HTLCAttempt_HTLCStatus; + /** + * The route taken by this HTLC. + * + * @generated from protobuf field: lnrpc.Route route = 2; + */ + route?: Route; + /** + * The time in UNIX nanoseconds at which this HTLC was sent. + * + * @generated from protobuf field: int64 attempt_time_ns = 3; + */ + attemptTimeNs: bigint; + /** + * + * The time in UNIX nanoseconds at which this HTLC was settled or failed. + * This value will not be set if the HTLC is still IN_FLIGHT. + * + * @generated from protobuf field: int64 resolve_time_ns = 4; + */ + resolveTimeNs: bigint; + /** + * Detailed htlc failure info. + * + * @generated from protobuf field: lnrpc.Failure failure = 5; + */ + failure?: Failure; + /** + * The preimage that was used to settle the HTLC. + * + * @generated from protobuf field: bytes preimage = 6; + */ + preimage: Uint8Array; +} +/** + * @generated from protobuf enum lnrpc.HTLCAttempt.HTLCStatus + */ +export enum HTLCAttempt_HTLCStatus { + /** + * @generated from protobuf enum value: IN_FLIGHT = 0; + */ + IN_FLIGHT = 0, + /** + * @generated from protobuf enum value: SUCCEEDED = 1; + */ + SUCCEEDED = 1, + /** + * @generated from protobuf enum value: FAILED = 2; + */ + FAILED = 2 +} +/** + * @generated from protobuf message lnrpc.ListPaymentsRequest + */ +export interface ListPaymentsRequest { + /** + * + * If true, then return payments that have not yet fully completed. This means + * that pending payments, as well as failed payments will show up if this + * field is set to true. This flag doesn't change the meaning of the indices, + * which are tied to individual payments. + * + * @generated from protobuf field: bool include_incomplete = 1; + */ + includeIncomplete: boolean; + /** + * + * The index of a payment that will be used as either the start or end of a + * query to determine which payments should be returned in the response. The + * index_offset is exclusive. In the case of a zero index_offset, the query + * will start with the oldest payment when paginating forwards, or will end + * with the most recent payment when paginating backwards. + * + * @generated from protobuf field: uint64 index_offset = 2; + */ + indexOffset: bigint; + /** + * The maximal number of payments returned in the response to this query. + * + * @generated from protobuf field: uint64 max_payments = 3; + */ + maxPayments: bigint; + /** + * + * If set, the payments returned will result from seeking backwards from the + * specified index offset. This can be used to paginate backwards. The order + * of the returned payments is always oldest first (ascending index order). + * + * @generated from protobuf field: bool reversed = 4; + */ + reversed: boolean; + /** + * + * If set, all payments (complete and incomplete, independent of the + * max_payments parameter) will be counted. Note that setting this to true will + * increase the run time of the call significantly on systems that have a lot + * of payments, as all of them have to be iterated through to be counted. + * + * @generated from protobuf field: bool count_total_payments = 5; + */ + countTotalPayments: boolean; +} +/** + * @generated from protobuf message lnrpc.ListPaymentsResponse + */ +export interface ListPaymentsResponse { + /** + * The list of payments + * + * @generated from protobuf field: repeated lnrpc.Payment payments = 1; + */ + payments: Payment[]; + /** + * + * The index of the first item in the set of returned payments. This can be + * used as the index_offset to continue seeking backwards in the next request. + * + * @generated from protobuf field: uint64 first_index_offset = 2; + */ + firstIndexOffset: bigint; + /** + * + * The index of the last item in the set of returned payments. This can be used + * as the index_offset to continue seeking forwards in the next request. + * + * @generated from protobuf field: uint64 last_index_offset = 3; + */ + lastIndexOffset: bigint; + /** + * + * Will only be set if count_total_payments in the request was set. Represents + * the total number of payments (complete and incomplete, independent of the + * number of payments requested in the query) currently present in the payments + * database. + * + * @generated from protobuf field: uint64 total_num_payments = 4; + */ + totalNumPayments: bigint; +} +/** + * @generated from protobuf message lnrpc.DeletePaymentRequest + */ +export interface DeletePaymentRequest { + /** + * Payment hash to delete. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; + /** + * + * Only delete failed HTLCs from the payment, not the payment itself. + * + * @generated from protobuf field: bool failed_htlcs_only = 2; + */ + failedHtlcsOnly: boolean; +} +/** + * @generated from protobuf message lnrpc.DeleteAllPaymentsRequest + */ +export interface DeleteAllPaymentsRequest { + /** + * Only delete failed payments. + * + * @generated from protobuf field: bool failed_payments_only = 1; + */ + failedPaymentsOnly: boolean; + /** + * + * Only delete failed HTLCs from payments, not the payment itself. + * + * @generated from protobuf field: bool failed_htlcs_only = 2; + */ + failedHtlcsOnly: boolean; +} +/** + * @generated from protobuf message lnrpc.DeletePaymentResponse + */ +export interface DeletePaymentResponse { +} +/** + * @generated from protobuf message lnrpc.DeleteAllPaymentsResponse + */ +export interface DeleteAllPaymentsResponse { +} +/** + * @generated from protobuf message lnrpc.AbandonChannelRequest + */ +export interface AbandonChannelRequest { + /** + * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; + */ + channelPoint?: ChannelPoint; + /** + * @generated from protobuf field: bool pending_funding_shim_only = 2; + */ + pendingFundingShimOnly: boolean; + /** + * + * Override the requirement for being in dev mode by setting this to true and + * confirming the user knows what they are doing and this is a potential foot + * gun to lose funds if used on active channels. + * + * @generated from protobuf field: bool i_know_what_i_am_doing = 3; + */ + iKnowWhatIAmDoing: boolean; +} +/** + * @generated from protobuf message lnrpc.AbandonChannelResponse + */ +export interface AbandonChannelResponse { +} +/** + * @generated from protobuf message lnrpc.DebugLevelRequest + */ +export interface DebugLevelRequest { + /** + * @generated from protobuf field: bool show = 1; + */ + show: boolean; + /** + * @generated from protobuf field: string level_spec = 2; + */ + levelSpec: string; +} +/** + * @generated from protobuf message lnrpc.DebugLevelResponse + */ +export interface DebugLevelResponse { + /** + * @generated from protobuf field: string sub_systems = 1; + */ + subSystems: string; +} +/** + * @generated from protobuf message lnrpc.PayReqString + */ +export interface PayReqString { + /** + * The payment request string to be decoded + * + * @generated from protobuf field: string pay_req = 1; + */ + payReq: string; +} +/** + * @generated from protobuf message lnrpc.PayReq + */ +export interface PayReq { + /** + * @generated from protobuf field: string destination = 1; + */ + destination: string; + /** + * @generated from protobuf field: string payment_hash = 2; + */ + paymentHash: string; + /** + * @generated from protobuf field: int64 num_satoshis = 3; + */ + numSatoshis: bigint; + /** + * @generated from protobuf field: int64 timestamp = 4; + */ + timestamp: bigint; + /** + * @generated from protobuf field: int64 expiry = 5; + */ + expiry: bigint; + /** + * @generated from protobuf field: string description = 6; + */ + description: string; + /** + * @generated from protobuf field: string description_hash = 7; + */ + descriptionHash: string; + /** + * @generated from protobuf field: string fallback_addr = 8; + */ + fallbackAddr: string; + /** + * @generated from protobuf field: int64 cltv_expiry = 9; + */ + cltvExpiry: bigint; + /** + * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; + */ + routeHints: RouteHint[]; + /** + * @generated from protobuf field: bytes payment_addr = 11; + */ + paymentAddr: Uint8Array; + /** + * @generated from protobuf field: int64 num_msat = 12; + */ + numMsat: bigint; + /** + * @generated from protobuf field: map features = 13; + */ + features: { + [key: number]: Feature; + }; +} +/** + * @generated from protobuf message lnrpc.Feature + */ +export interface Feature { + /** + * @generated from protobuf field: string name = 2; + */ + name: string; + /** + * @generated from protobuf field: bool is_required = 3; + */ + isRequired: boolean; + /** + * @generated from protobuf field: bool is_known = 4; + */ + isKnown: boolean; +} +/** + * @generated from protobuf message lnrpc.FeeReportRequest + */ +export interface FeeReportRequest { +} +/** + * @generated from protobuf message lnrpc.ChannelFeeReport + */ +export interface ChannelFeeReport { + /** + * The short channel id that this fee report belongs to. + * + * @generated from protobuf field: uint64 chan_id = 5 [jstype = JS_STRING]; + */ + chanId: string; + /** + * The channel that this fee report belongs to. + * + * @generated from protobuf field: string channel_point = 1; + */ + channelPoint: string; + /** + * The base fee charged regardless of the number of milli-satoshis sent. + * + * @generated from protobuf field: int64 base_fee_msat = 2; + */ + baseFeeMsat: bigint; + /** + * The amount charged per milli-satoshis transferred expressed in + * millionths of a satoshi. + * + * @generated from protobuf field: int64 fee_per_mil = 3; + */ + feePerMil: bigint; + /** + * The effective fee rate in milli-satoshis. Computed by dividing the + * fee_per_mil value by 1 million. + * + * @generated from protobuf field: double fee_rate = 4; + */ + feeRate: number; +} +/** + * @generated from protobuf message lnrpc.FeeReportResponse + */ +export interface FeeReportResponse { + /** + * An array of channel fee reports which describes the current fee schedule + * for each channel. + * + * @generated from protobuf field: repeated lnrpc.ChannelFeeReport channel_fees = 1; + */ + channelFees: ChannelFeeReport[]; + /** + * The total amount of fee revenue (in satoshis) the switch has collected + * over the past 24 hrs. + * + * @generated from protobuf field: uint64 day_fee_sum = 2; + */ + dayFeeSum: bigint; + /** + * The total amount of fee revenue (in satoshis) the switch has collected + * over the past 1 week. + * + * @generated from protobuf field: uint64 week_fee_sum = 3; + */ + weekFeeSum: bigint; + /** + * The total amount of fee revenue (in satoshis) the switch has collected + * over the past 1 month. + * + * @generated from protobuf field: uint64 month_fee_sum = 4; + */ + monthFeeSum: bigint; +} +/** + * @generated from protobuf message lnrpc.PolicyUpdateRequest + */ +export interface PolicyUpdateRequest { + /** + * @generated from protobuf oneof: scope + */ + scope: { + oneofKind: "global"; + /** + * If set, then this update applies to all currently active channels. + * + * @generated from protobuf field: bool global = 1; + */ + global: boolean; + } | { + oneofKind: "chanPoint"; + /** + * If set, this update will target a specific channel. + * + * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; + */ + chanPoint: ChannelPoint; + } | { + oneofKind: undefined; + }; + /** + * The base fee charged regardless of the number of milli-satoshis sent. + * + * @generated from protobuf field: int64 base_fee_msat = 3; + */ + baseFeeMsat: bigint; + /** + * The effective fee rate in milli-satoshis. The precision of this value + * goes up to 6 decimal places, so 1e-6. + * + * @generated from protobuf field: double fee_rate = 4; + */ + feeRate: number; + /** + * The effective fee rate in micro-satoshis (parts per million). + * + * @generated from protobuf field: uint32 fee_rate_ppm = 9; + */ + feeRatePpm: number; + /** + * The required timelock delta for HTLCs forwarded over the channel. + * + * @generated from protobuf field: uint32 time_lock_delta = 5; + */ + timeLockDelta: number; + /** + * If set, the maximum HTLC size in milli-satoshis. If unset, the maximum + * HTLC will be unchanged. + * + * @generated from protobuf field: uint64 max_htlc_msat = 6; + */ + maxHtlcMsat: bigint; + /** + * The minimum HTLC size in milli-satoshis. Only applied if + * min_htlc_msat_specified is true. + * + * @generated from protobuf field: uint64 min_htlc_msat = 7; + */ + minHtlcMsat: bigint; + /** + * If true, min_htlc_msat is applied. + * + * @generated from protobuf field: bool min_htlc_msat_specified = 8; + */ + minHtlcMsatSpecified: boolean; +} +/** + * @generated from protobuf message lnrpc.FailedUpdate + */ +export interface FailedUpdate { + /** + * The outpoint in format txid:n + * + * @generated from protobuf field: lnrpc.OutPoint outpoint = 1; + */ + outpoint?: OutPoint; + /** + * Reason for the policy update failure. + * + * @generated from protobuf field: lnrpc.UpdateFailure reason = 2; + */ + reason: UpdateFailure; + /** + * A string representation of the policy update error. + * + * @generated from protobuf field: string update_error = 3; + */ + updateError: string; +} +/** + * @generated from protobuf message lnrpc.PolicyUpdateResponse + */ +export interface PolicyUpdateResponse { + /** + * List of failed policy updates. + * + * @generated from protobuf field: repeated lnrpc.FailedUpdate failed_updates = 1; + */ + failedUpdates: FailedUpdate[]; +} +/** + * @generated from protobuf message lnrpc.ForwardingHistoryRequest + */ +export interface ForwardingHistoryRequest { + /** + * Start time is the starting point of the forwarding history request. All + * records beyond this point will be included, respecting the end time, and + * the index offset. + * + * @generated from protobuf field: uint64 start_time = 1; + */ + startTime: bigint; + /** + * End time is the end point of the forwarding history request. The + * response will carry at most 50k records between the start time and the + * end time. The index offset can be used to implement pagination. + * + * @generated from protobuf field: uint64 end_time = 2; + */ + endTime: bigint; + /** + * Index offset is the offset in the time series to start at. As each + * response can only contain 50k records, callers can use this to skip + * around within a packed time series. + * + * @generated from protobuf field: uint32 index_offset = 3; + */ + indexOffset: number; + /** + * The max number of events to return in the response to this query. + * + * @generated from protobuf field: uint32 num_max_events = 4; + */ + numMaxEvents: number; + /** + * Informs the server if the peer alias should be looked up for each + * forwarding event. + * + * @generated from protobuf field: bool peer_alias_lookup = 5; + */ + peerAliasLookup: boolean; +} +/** + * @generated from protobuf message lnrpc.ForwardingEvent + */ +export interface ForwardingEvent { + /** + * Timestamp is the time (unix epoch offset) that this circuit was + * completed. Deprecated by timestamp_ns. + * + * @deprecated + * @generated from protobuf field: uint64 timestamp = 1 [deprecated = true]; + */ + timestamp: bigint; + /** + * The incoming channel ID that carried the HTLC that created the circuit. + * + * @generated from protobuf field: uint64 chan_id_in = 2 [jstype = JS_STRING]; + */ + chanIdIn: string; + /** + * The outgoing channel ID that carried the preimage that completed the + * circuit. + * + * @generated from protobuf field: uint64 chan_id_out = 4 [jstype = JS_STRING]; + */ + chanIdOut: string; + /** + * The total amount (in satoshis) of the incoming HTLC that created half + * the circuit. + * + * @generated from protobuf field: uint64 amt_in = 5; + */ + amtIn: bigint; + /** + * The total amount (in satoshis) of the outgoing HTLC that created the + * second half of the circuit. + * + * @generated from protobuf field: uint64 amt_out = 6; + */ + amtOut: bigint; + /** + * The total fee (in satoshis) that this payment circuit carried. + * + * @generated from protobuf field: uint64 fee = 7; + */ + fee: bigint; + /** + * The total fee (in milli-satoshis) that this payment circuit carried. + * + * @generated from protobuf field: uint64 fee_msat = 8; + */ + feeMsat: bigint; + /** + * The total amount (in milli-satoshis) of the incoming HTLC that created + * half the circuit. + * + * @generated from protobuf field: uint64 amt_in_msat = 9; + */ + amtInMsat: bigint; + /** + * The total amount (in milli-satoshis) of the outgoing HTLC that created + * the second half of the circuit. + * + * @generated from protobuf field: uint64 amt_out_msat = 10; + */ + amtOutMsat: bigint; + /** + * The number of nanoseconds elapsed since January 1, 1970 UTC when this + * circuit was completed. + * + * @generated from protobuf field: uint64 timestamp_ns = 11; + */ + timestampNs: bigint; + /** + * The peer alias of the incoming channel. + * + * @generated from protobuf field: string peer_alias_in = 12; + */ + peerAliasIn: string; + /** + * The peer alias of the outgoing channel. + * + * @generated from protobuf field: string peer_alias_out = 13; + */ + peerAliasOut: string; +} +/** + * @generated from protobuf message lnrpc.ForwardingHistoryResponse + */ +export interface ForwardingHistoryResponse { + /** + * A list of forwarding events from the time slice of the time series + * specified in the request. + * + * @generated from protobuf field: repeated lnrpc.ForwardingEvent forwarding_events = 1; + */ + forwardingEvents: ForwardingEvent[]; + /** + * The index of the last time in the set of returned forwarding events. Can + * be used to seek further, pagination style. + * + * @generated from protobuf field: uint32 last_offset_index = 2; + */ + lastOffsetIndex: number; +} +/** + * @generated from protobuf message lnrpc.ExportChannelBackupRequest + */ +export interface ExportChannelBackupRequest { + /** + * The target channel point to obtain a back up for. + * + * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; + */ + chanPoint?: ChannelPoint; +} +/** + * @generated from protobuf message lnrpc.ChannelBackup + */ +export interface ChannelBackup { + /** + * + * Identifies the channel that this backup belongs to. + * + * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; + */ + chanPoint?: ChannelPoint; + /** + * + * Is an encrypted single-chan backup. this can be passed to + * RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in + * order to trigger the recovery protocol. When using REST, this field must be + * encoded as base64. + * + * @generated from protobuf field: bytes chan_backup = 2; + */ + chanBackup: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.MultiChanBackup + */ +export interface MultiChanBackup { + /** + * + * Is the set of all channels that are included in this multi-channel backup. + * + * @generated from protobuf field: repeated lnrpc.ChannelPoint chan_points = 1; + */ + chanPoints: ChannelPoint[]; + /** + * + * A single encrypted blob containing all the static channel backups of the + * channel listed above. This can be stored as a single file or blob, and + * safely be replaced with any prior/future versions. When using REST, this + * field must be encoded as base64. + * + * @generated from protobuf field: bytes multi_chan_backup = 2; + */ + multiChanBackup: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.ChanBackupExportRequest + */ +export interface ChanBackupExportRequest { +} +/** + * @generated from protobuf message lnrpc.ChanBackupSnapshot + */ +export interface ChanBackupSnapshot { + /** + * + * The set of new channels that have been added since the last channel backup + * snapshot was requested. + * + * @generated from protobuf field: lnrpc.ChannelBackups single_chan_backups = 1; + */ + singleChanBackups?: ChannelBackups; + /** + * + * A multi-channel backup that covers all open channels currently known to + * lnd. + * + * @generated from protobuf field: lnrpc.MultiChanBackup multi_chan_backup = 2; + */ + multiChanBackup?: MultiChanBackup; +} +/** + * @generated from protobuf message lnrpc.ChannelBackups + */ +export interface ChannelBackups { + /** + * + * A set of single-chan static channel backups. + * + * @generated from protobuf field: repeated lnrpc.ChannelBackup chan_backups = 1; + */ + chanBackups: ChannelBackup[]; +} +/** + * @generated from protobuf message lnrpc.RestoreChanBackupRequest + */ +export interface RestoreChanBackupRequest { + /** + * @generated from protobuf oneof: backup + */ + backup: { + oneofKind: "chanBackups"; + /** + * + * The channels to restore as a list of channel/backup pairs. + * + * @generated from protobuf field: lnrpc.ChannelBackups chan_backups = 1; + */ + chanBackups: ChannelBackups; + } | { + oneofKind: "multiChanBackup"; + /** + * + * The channels to restore in the packed multi backup format. When using + * REST, this field must be encoded as base64. + * + * @generated from protobuf field: bytes multi_chan_backup = 2; + */ + multiChanBackup: Uint8Array; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message lnrpc.RestoreBackupResponse + */ +export interface RestoreBackupResponse { +} +/** + * @generated from protobuf message lnrpc.ChannelBackupSubscription + */ +export interface ChannelBackupSubscription { +} +/** + * @generated from protobuf message lnrpc.VerifyChanBackupResponse + */ +export interface VerifyChanBackupResponse { +} +/** + * @generated from protobuf message lnrpc.MacaroonPermission + */ +export interface MacaroonPermission { + /** + * The entity a permission grants access to. + * + * @generated from protobuf field: string entity = 1; + */ + entity: string; + /** + * The action that is granted. + * + * @generated from protobuf field: string action = 2; + */ + action: string; +} +/** + * @generated from protobuf message lnrpc.BakeMacaroonRequest + */ +export interface BakeMacaroonRequest { + /** + * The list of permissions the new macaroon should grant. + * + * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 1; + */ + permissions: MacaroonPermission[]; + /** + * The root key ID used to create the macaroon, must be a positive integer. + * + * @generated from protobuf field: uint64 root_key_id = 2; + */ + rootKeyId: bigint; + /** + * + * Informs the RPC on whether to allow external permissions that LND is not + * aware of. + * + * @generated from protobuf field: bool allow_external_permissions = 3; + */ + allowExternalPermissions: boolean; +} +/** + * @generated from protobuf message lnrpc.BakeMacaroonResponse + */ +export interface BakeMacaroonResponse { + /** + * The hex encoded macaroon, serialized in binary format. + * + * @generated from protobuf field: string macaroon = 1; + */ + macaroon: string; +} +/** + * @generated from protobuf message lnrpc.ListMacaroonIDsRequest + */ +export interface ListMacaroonIDsRequest { +} +/** + * @generated from protobuf message lnrpc.ListMacaroonIDsResponse + */ +export interface ListMacaroonIDsResponse { + /** + * The list of root key IDs that are in use. + * + * @generated from protobuf field: repeated uint64 root_key_ids = 1; + */ + rootKeyIds: bigint[]; +} +/** + * @generated from protobuf message lnrpc.DeleteMacaroonIDRequest + */ +export interface DeleteMacaroonIDRequest { + /** + * The root key ID to be removed. + * + * @generated from protobuf field: uint64 root_key_id = 1; + */ + rootKeyId: bigint; +} +/** + * @generated from protobuf message lnrpc.DeleteMacaroonIDResponse + */ +export interface DeleteMacaroonIDResponse { + /** + * A boolean indicates that the deletion is successful. + * + * @generated from protobuf field: bool deleted = 1; + */ + deleted: boolean; +} +/** + * @generated from protobuf message lnrpc.MacaroonPermissionList + */ +export interface MacaroonPermissionList { + /** + * A list of macaroon permissions. + * + * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 1; + */ + permissions: MacaroonPermission[]; +} +/** + * @generated from protobuf message lnrpc.ListPermissionsRequest + */ +export interface ListPermissionsRequest { +} +/** + * @generated from protobuf message lnrpc.ListPermissionsResponse + */ +export interface ListPermissionsResponse { + /** + * + * A map between all RPC method URIs and their required macaroon permissions to + * access them. + * + * @generated from protobuf field: map method_permissions = 1; + */ + methodPermissions: { + [key: string]: MacaroonPermissionList; + }; +} +/** + * @generated from protobuf message lnrpc.Failure + */ +export interface Failure { + /** + * Failure code as defined in the Lightning spec + * + * @generated from protobuf field: lnrpc.Failure.FailureCode code = 1; + */ + code: Failure_FailureCode; + /** + * An optional channel update message. + * + * @generated from protobuf field: lnrpc.ChannelUpdate channel_update = 3; + */ + channelUpdate?: ChannelUpdate; + /** + * A failure type-dependent htlc value. + * + * @generated from protobuf field: uint64 htlc_msat = 4; + */ + htlcMsat: bigint; + /** + * The sha256 sum of the onion payload. + * + * @generated from protobuf field: bytes onion_sha_256 = 5; + */ + onionSha256: Uint8Array; + /** + * A failure type-dependent cltv expiry value. + * + * @generated from protobuf field: uint32 cltv_expiry = 6; + */ + cltvExpiry: number; + /** + * A failure type-dependent flags value. + * + * @generated from protobuf field: uint32 flags = 7; + */ + flags: number; + /** + * + * The position in the path of the intermediate or final node that generated + * the failure message. Position zero is the sender node. + * + * @generated from protobuf field: uint32 failure_source_index = 8; + */ + failureSourceIndex: number; + /** + * A failure type-dependent block height. + * + * @generated from protobuf field: uint32 height = 9; + */ + height: number; +} +/** + * @generated from protobuf enum lnrpc.Failure.FailureCode + */ +export enum Failure_FailureCode { + /** + * + * The numbers assigned in this enumeration match the failure codes as + * defined in BOLT #4. Because protobuf 3 requires enums to start with 0, + * a RESERVED value is added. + * + * @generated from protobuf enum value: RESERVED = 0; + */ + RESERVED = 0, + /** + * @generated from protobuf enum value: INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; + */ + INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1, + /** + * @generated from protobuf enum value: INCORRECT_PAYMENT_AMOUNT = 2; + */ + INCORRECT_PAYMENT_AMOUNT = 2, + /** + * @generated from protobuf enum value: FINAL_INCORRECT_CLTV_EXPIRY = 3; + */ + FINAL_INCORRECT_CLTV_EXPIRY = 3, + /** + * @generated from protobuf enum value: FINAL_INCORRECT_HTLC_AMOUNT = 4; + */ + FINAL_INCORRECT_HTLC_AMOUNT = 4, + /** + * @generated from protobuf enum value: FINAL_EXPIRY_TOO_SOON = 5; + */ + FINAL_EXPIRY_TOO_SOON = 5, + /** + * @generated from protobuf enum value: INVALID_REALM = 6; + */ + INVALID_REALM = 6, + /** + * @generated from protobuf enum value: EXPIRY_TOO_SOON = 7; + */ + EXPIRY_TOO_SOON = 7, + /** + * @generated from protobuf enum value: INVALID_ONION_VERSION = 8; + */ + INVALID_ONION_VERSION = 8, + /** + * @generated from protobuf enum value: INVALID_ONION_HMAC = 9; + */ + INVALID_ONION_HMAC = 9, + /** + * @generated from protobuf enum value: INVALID_ONION_KEY = 10; + */ + INVALID_ONION_KEY = 10, + /** + * @generated from protobuf enum value: AMOUNT_BELOW_MINIMUM = 11; + */ + AMOUNT_BELOW_MINIMUM = 11, + /** + * @generated from protobuf enum value: FEE_INSUFFICIENT = 12; + */ + FEE_INSUFFICIENT = 12, + /** + * @generated from protobuf enum value: INCORRECT_CLTV_EXPIRY = 13; + */ + INCORRECT_CLTV_EXPIRY = 13, + /** + * @generated from protobuf enum value: CHANNEL_DISABLED = 14; + */ + CHANNEL_DISABLED = 14, + /** + * @generated from protobuf enum value: TEMPORARY_CHANNEL_FAILURE = 15; + */ + TEMPORARY_CHANNEL_FAILURE = 15, + /** + * @generated from protobuf enum value: REQUIRED_NODE_FEATURE_MISSING = 16; + */ + REQUIRED_NODE_FEATURE_MISSING = 16, + /** + * @generated from protobuf enum value: REQUIRED_CHANNEL_FEATURE_MISSING = 17; + */ + REQUIRED_CHANNEL_FEATURE_MISSING = 17, + /** + * @generated from protobuf enum value: UNKNOWN_NEXT_PEER = 18; + */ + UNKNOWN_NEXT_PEER = 18, + /** + * @generated from protobuf enum value: TEMPORARY_NODE_FAILURE = 19; + */ + TEMPORARY_NODE_FAILURE = 19, + /** + * @generated from protobuf enum value: PERMANENT_NODE_FAILURE = 20; + */ + PERMANENT_NODE_FAILURE = 20, + /** + * @generated from protobuf enum value: PERMANENT_CHANNEL_FAILURE = 21; + */ + PERMANENT_CHANNEL_FAILURE = 21, + /** + * @generated from protobuf enum value: EXPIRY_TOO_FAR = 22; + */ + EXPIRY_TOO_FAR = 22, + /** + * @generated from protobuf enum value: MPP_TIMEOUT = 23; + */ + MPP_TIMEOUT = 23, + /** + * @generated from protobuf enum value: INVALID_ONION_PAYLOAD = 24; + */ + INVALID_ONION_PAYLOAD = 24, + /** + * + * An internal error occurred. + * + * @generated from protobuf enum value: INTERNAL_FAILURE = 997; + */ + INTERNAL_FAILURE = 997, + /** + * + * The error source is known, but the failure itself couldn't be decoded. + * + * @generated from protobuf enum value: UNKNOWN_FAILURE = 998; + */ + UNKNOWN_FAILURE = 998, + /** + * + * An unreadable failure result is returned if the received failure message + * cannot be decrypted. In that case the error source is unknown. + * + * @generated from protobuf enum value: UNREADABLE_FAILURE = 999; + */ + UNREADABLE_FAILURE = 999 +} +/** + * @generated from protobuf message lnrpc.ChannelUpdate + */ +export interface ChannelUpdate { + /** + * + * The signature that validates the announced data and proves the ownership + * of node id. + * + * @generated from protobuf field: bytes signature = 1; + */ + signature: Uint8Array; + /** + * + * The target chain that this channel was opened within. This value + * should be the genesis hash of the target chain. Along with the short + * channel ID, this uniquely identifies the channel globally in a + * blockchain. + * + * @generated from protobuf field: bytes chain_hash = 2; + */ + chainHash: Uint8Array; + /** + * + * The unique description of the funding transaction. + * + * @generated from protobuf field: uint64 chan_id = 3 [jstype = JS_STRING]; + */ + chanId: string; + /** + * + * A timestamp that allows ordering in the case of multiple announcements. + * We should ignore the message if timestamp is not greater than the + * last-received. + * + * @generated from protobuf field: uint32 timestamp = 4; + */ + timestamp: number; + /** + * + * The bitfield that describes whether optional fields are present in this + * update. Currently, the least-significant bit must be set to 1 if the + * optional field MaxHtlc is present. + * + * @generated from protobuf field: uint32 message_flags = 10; + */ + messageFlags: number; + /** + * + * The bitfield that describes additional meta-data concerning how the + * update is to be interpreted. Currently, the least-significant bit must be + * set to 0 if the creating node corresponds to the first node in the + * previously sent channel announcement and 1 otherwise. If the second bit + * is set, then the channel is set to be disabled. + * + * @generated from protobuf field: uint32 channel_flags = 5; + */ + channelFlags: number; + /** + * + * The minimum number of blocks this node requires to be added to the expiry + * of HTLCs. This is a security parameter determined by the node operator. + * This value represents the required gap between the time locks of the + * incoming and outgoing HTLC's set to this node. + * + * @generated from protobuf field: uint32 time_lock_delta = 6; + */ + timeLockDelta: number; + /** + * + * The minimum HTLC value which will be accepted. + * + * @generated from protobuf field: uint64 htlc_minimum_msat = 7; + */ + htlcMinimumMsat: bigint; + /** + * + * The base fee that must be used for incoming HTLC's to this particular + * channel. This value will be tacked onto the required for a payment + * independent of the size of the payment. + * + * @generated from protobuf field: uint32 base_fee = 8; + */ + baseFee: number; + /** + * + * The fee rate that will be charged per millionth of a satoshi. + * + * @generated from protobuf field: uint32 fee_rate = 9; + */ + feeRate: number; + /** + * + * The maximum HTLC value which will be accepted. + * + * @generated from protobuf field: uint64 htlc_maximum_msat = 11; + */ + htlcMaximumMsat: bigint; + /** + * + * The set of data that was appended to this message, some of which we may + * not actually know how to iterate or parse. By holding onto this data, we + * ensure that we're able to properly validate the set of signatures that + * cover these new fields, and ensure we're able to make upgrades to the + * network in a forwards compatible manner. + * + * @generated from protobuf field: bytes extra_opaque_data = 12; + */ + extraOpaqueData: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.MacaroonId + */ +export interface MacaroonId { + /** + * @generated from protobuf field: bytes nonce = 1; + */ + nonce: Uint8Array; + /** + * @generated from protobuf field: bytes storageId = 2; + */ + storageId: Uint8Array; + /** + * @generated from protobuf field: repeated lnrpc.Op ops = 3; + */ + ops: Op[]; +} +/** + * @generated from protobuf message lnrpc.Op + */ +export interface Op { + /** + * @generated from protobuf field: string entity = 1; + */ + entity: string; + /** + * @generated from protobuf field: repeated string actions = 2; + */ + actions: string[]; +} +/** + * @generated from protobuf message lnrpc.CheckMacPermRequest + */ +export interface CheckMacPermRequest { + /** + * @generated from protobuf field: bytes macaroon = 1; + */ + macaroon: Uint8Array; + /** + * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 2; + */ + permissions: MacaroonPermission[]; + /** + * @generated from protobuf field: string fullMethod = 3; + */ + fullMethod: string; +} +/** + * @generated from protobuf message lnrpc.CheckMacPermResponse + */ +export interface CheckMacPermResponse { + /** + * @generated from protobuf field: bool valid = 1; + */ + valid: boolean; +} +/** + * @generated from protobuf message lnrpc.RPCMiddlewareRequest + */ +export interface RPCMiddlewareRequest { + /** + * + * The unique ID of the intercepted original gRPC request. Useful for mapping + * request to response when implementing full duplex message interception. For + * streaming requests, this will be the same ID for all incoming and outgoing + * middleware intercept messages of the _same_ stream. + * + * @generated from protobuf field: uint64 request_id = 1; + */ + requestId: bigint; + /** + * + * The raw bytes of the complete macaroon as sent by the gRPC client in the + * original request. This might be empty for a request that doesn't require + * macaroons such as the wallet unlocker RPCs. + * + * @generated from protobuf field: bytes raw_macaroon = 2; + */ + rawMacaroon: Uint8Array; + /** + * + * The parsed condition of the macaroon's custom caveat for convenient access. + * This field only contains the value of the custom caveat that the handling + * middleware has registered itself for. The condition _must_ be validated for + * messages of intercept_type stream_auth and request! + * + * @generated from protobuf field: string custom_caveat_condition = 3; + */ + customCaveatCondition: string; + /** + * @generated from protobuf oneof: intercept_type + */ + interceptType: { + oneofKind: "streamAuth"; + /** + * + * Intercept stream authentication: each new streaming RPC call that is + * initiated against lnd and contains the middleware's custom macaroon + * caveat can be approved or denied based upon the macaroon in the stream + * header. This message will only be sent for streaming RPCs, unary RPCs + * must handle the macaroon authentication in the request interception to + * avoid an additional message round trip between lnd and the middleware. + * + * @generated from protobuf field: lnrpc.StreamAuth stream_auth = 4; + */ + streamAuth: StreamAuth; + } | { + oneofKind: "request"; + /** + * + * Intercept incoming gRPC client request message: all incoming messages, + * both on streaming and unary RPCs, are forwarded to the middleware for + * inspection. For unary RPC messages the middleware is also expected to + * validate the custom macaroon caveat of the request. + * + * @generated from protobuf field: lnrpc.RPCMessage request = 5; + */ + request: RPCMessage; + } | { + oneofKind: "response"; + /** + * + * Intercept outgoing gRPC response message: all outgoing messages, both on + * streaming and unary RPCs, are forwarded to the middleware for inspection + * and amendment. The response in this message is the original response as + * it was generated by the main RPC server. It can either be accepted + * (=forwarded to the client), replaced/overwritten with a new message of + * the same type, or replaced by an error message. + * + * @generated from protobuf field: lnrpc.RPCMessage response = 6; + */ + response: RPCMessage; + } | { + oneofKind: "regComplete"; + /** + * + * This is used to indicate to the client that the server has successfully + * registered the interceptor. This is only used in the very first message + * that the server sends to the client after the client sends the server + * the middleware registration message. + * + * @generated from protobuf field: bool reg_complete = 8; + */ + regComplete: boolean; + } | { + oneofKind: undefined; + }; + /** + * + * The unique message ID of this middleware intercept message. There can be + * multiple middleware intercept messages per single gRPC request (one for the + * incoming request and one for the outgoing response) or gRPC stream (one for + * each incoming message and one for each outgoing response). This message ID + * must be referenced when responding (accepting/rejecting/modifying) to an + * intercept message. + * + * @generated from protobuf field: uint64 msg_id = 7; + */ + msgId: bigint; +} +/** + * @generated from protobuf message lnrpc.StreamAuth + */ +export interface StreamAuth { + /** + * + * The full URI (in the format /./MethodName, for + * example /lnrpc.Lightning/GetInfo) of the streaming RPC method that was just + * established. + * + * @generated from protobuf field: string method_full_uri = 1; + */ + methodFullUri: string; +} +/** + * @generated from protobuf message lnrpc.RPCMessage + */ +export interface RPCMessage { + /** + * + * The full URI (in the format /./MethodName, for + * example /lnrpc.Lightning/GetInfo) of the RPC method the message was sent + * to/from. + * + * @generated from protobuf field: string method_full_uri = 1; + */ + methodFullUri: string; + /** + * + * Indicates whether the message was sent over a streaming RPC method or not. + * + * @generated from protobuf field: bool stream_rpc = 2; + */ + streamRpc: boolean; + /** + * + * The full canonical gRPC name of the message type (in the format + * .TypeName, for example lnrpc.GetInfoRequest). In case of an + * error being returned from lnd, this simply contains the string "error". + * + * @generated from protobuf field: string type_name = 3; + */ + typeName: string; + /** + * + * The full content of the gRPC message, serialized in the binary protobuf + * format. + * + * @generated from protobuf field: bytes serialized = 4; + */ + serialized: Uint8Array; + /** + * + * Indicates that the response from lnd was an error, not a gRPC response. If + * this is set to true then the type_name contains the string "error" and + * serialized contains the error string. + * + * @generated from protobuf field: bool is_error = 5; + */ + isError: boolean; +} +/** + * @generated from protobuf message lnrpc.RPCMiddlewareResponse + */ +export interface RPCMiddlewareResponse { + /** + * + * The request message ID this response refers to. Must always be set when + * giving feedback to an intercept but is ignored for the initial registration + * message. + * + * @generated from protobuf field: uint64 ref_msg_id = 1; + */ + refMsgId: bigint; + /** + * @generated from protobuf oneof: middleware_message + */ + middlewareMessage: { + oneofKind: "register"; + /** + * + * The registration message identifies the middleware that's being + * registered in lnd. The registration message must be sent immediately + * after initiating the RegisterRpcMiddleware stream, otherwise lnd will + * time out the attempt and terminate the request. NOTE: The middleware + * will only receive interception messages for requests that contain a + * macaroon with the custom caveat that the middleware declares it is + * responsible for handling in the registration message! As a security + * measure, _no_ middleware can intercept requests made with _unencumbered_ + * macaroons! + * + * @generated from protobuf field: lnrpc.MiddlewareRegistration register = 2; + */ + register: MiddlewareRegistration; + } | { + oneofKind: "feedback"; + /** + * + * The middleware received an interception request and gives feedback to + * it. The request_id indicates what message the feedback refers to. + * + * @generated from protobuf field: lnrpc.InterceptFeedback feedback = 3; + */ + feedback: InterceptFeedback; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message lnrpc.MiddlewareRegistration + */ +export interface MiddlewareRegistration { + /** + * + * The name of the middleware to register. The name should be as informative + * as possible and is logged on registration. + * + * @generated from protobuf field: string middleware_name = 1; + */ + middlewareName: string; + /** + * + * The name of the custom macaroon caveat that this middleware is responsible + * for. Only requests/responses that contain a macaroon with the registered + * custom caveat are forwarded for interception to the middleware. The + * exception being the read-only mode: All requests/responses are forwarded to + * a middleware that requests read-only access but such a middleware won't be + * allowed to _alter_ responses. As a security measure, _no_ middleware can + * change responses to requests made with _unencumbered_ macaroons! + * NOTE: Cannot be used at the same time as read_only_mode. + * + * @generated from protobuf field: string custom_macaroon_caveat_name = 2; + */ + customMacaroonCaveatName: string; + /** + * + * Instead of defining a custom macaroon caveat name a middleware can register + * itself for read-only access only. In that mode all requests/responses are + * forwarded to the middleware but the middleware isn't allowed to alter any of + * the responses. + * NOTE: Cannot be used at the same time as custom_macaroon_caveat_name. + * + * @generated from protobuf field: bool read_only_mode = 3; + */ + readOnlyMode: boolean; +} +/** + * @generated from protobuf message lnrpc.InterceptFeedback + */ +export interface InterceptFeedback { + /** + * + * The error to return to the user. If this is non-empty, the incoming gRPC + * stream/request is aborted and the error is returned to the gRPC client. If + * this value is empty, it means the middleware accepts the stream/request/ + * response and the processing of it can continue. + * + * @generated from protobuf field: string error = 1; + */ + error: string; + /** + * + * A boolean indicating that the gRPC message should be replaced/overwritten. + * This boolean is needed because in protobuf an empty message is serialized as + * a 0-length or nil byte slice and we wouldn't be able to distinguish between + * an empty replacement message and the "don't replace anything" case. + * + * @generated from protobuf field: bool replace_response = 2; + */ + replaceResponse: boolean; + /** + * + * If the replace_response field is set to true, this field must contain the + * binary serialized gRPC message in the protobuf format. + * + * @generated from protobuf field: bytes replacement_serialized = 3; + */ + replacementSerialized: Uint8Array; +} +/** + * @generated from protobuf enum lnrpc.OutputScriptType + */ +export enum OutputScriptType { + /** + * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY_HASH = 0; + */ + SCRIPT_TYPE_PUBKEY_HASH = 0, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_SCRIPT_HASH = 1; + */ + SCRIPT_TYPE_SCRIPT_HASH = 1, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; + */ + SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; + */ + SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY = 4; + */ + SCRIPT_TYPE_PUBKEY = 4, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_MULTISIG = 5; + */ + SCRIPT_TYPE_MULTISIG = 5, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_NULLDATA = 6; + */ + SCRIPT_TYPE_NULLDATA = 6, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_NON_STANDARD = 7; + */ + SCRIPT_TYPE_NON_STANDARD = 7, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_UNKNOWN = 8; + */ + SCRIPT_TYPE_WITNESS_UNKNOWN = 8, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9; + */ + SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9 +} +/** + * + * `AddressType` has to be one of: + * + * - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) + * - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) + * - `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) + * + * @generated from protobuf enum lnrpc.AddressType + */ +export enum AddressType { + /** + * @generated from protobuf enum value: WITNESS_PUBKEY_HASH = 0; + */ + WITNESS_PUBKEY_HASH = 0, + /** + * @generated from protobuf enum value: NESTED_PUBKEY_HASH = 1; + */ + NESTED_PUBKEY_HASH = 1, + /** + * @generated from protobuf enum value: UNUSED_WITNESS_PUBKEY_HASH = 2; + */ + UNUSED_WITNESS_PUBKEY_HASH = 2, + /** + * @generated from protobuf enum value: UNUSED_NESTED_PUBKEY_HASH = 3; + */ + UNUSED_NESTED_PUBKEY_HASH = 3, + /** + * @generated from protobuf enum value: TAPROOT_PUBKEY = 4; + */ + TAPROOT_PUBKEY = 4, + /** + * @generated from protobuf enum value: UNUSED_TAPROOT_PUBKEY = 5; + */ + UNUSED_TAPROOT_PUBKEY = 5 +} +/** + * @generated from protobuf enum lnrpc.CommitmentType + */ +export enum CommitmentType { + /** + * + * Returned when the commitment type isn't known or unavailable. + * + * @generated from protobuf enum value: UNKNOWN_COMMITMENT_TYPE = 0; + */ + UNKNOWN_COMMITMENT_TYPE = 0, + /** + * + * A channel using the legacy commitment format having tweaked to_remote + * keys. + * + * @generated from protobuf enum value: LEGACY = 1; + */ + LEGACY = 1, + /** + * + * A channel that uses the modern commitment format where the key in the + * output of the remote party does not change each state. This makes back + * up and recovery easier as when the channel is closed, the funds go + * directly to that key. + * + * @generated from protobuf enum value: STATIC_REMOTE_KEY = 2; + */ + STATIC_REMOTE_KEY = 2, + /** + * + * A channel that uses a commitment format that has anchor outputs on the + * commitments, allowing fee bumping after a force close transaction has + * been broadcast. + * + * @generated from protobuf enum value: ANCHORS = 3; + */ + ANCHORS = 3, + /** + * + * A channel that uses a commitment type that builds upon the anchors + * commitment format, but in addition requires a CLTV clause to spend outputs + * paying to the channel initiator. This is intended for use on leased channels + * to guarantee that the channel initiator has no incentives to close a leased + * channel before its maturity date. + * + * @generated from protobuf enum value: SCRIPT_ENFORCED_LEASE = 4; + */ + SCRIPT_ENFORCED_LEASE = 4 +} +/** + * @generated from protobuf enum lnrpc.Initiator + */ +export enum Initiator { + /** + * @generated from protobuf enum value: INITIATOR_UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: INITIATOR_LOCAL = 1; + */ + LOCAL = 1, + /** + * @generated from protobuf enum value: INITIATOR_REMOTE = 2; + */ + REMOTE = 2, + /** + * @generated from protobuf enum value: INITIATOR_BOTH = 3; + */ + BOTH = 3 +} +/** + * @generated from protobuf enum lnrpc.ResolutionType + */ +export enum ResolutionType { + /** + * @generated from protobuf enum value: TYPE_UNKNOWN = 0; + */ + TYPE_UNKNOWN = 0, + /** + * We resolved an anchor output. + * + * @generated from protobuf enum value: ANCHOR = 1; + */ + ANCHOR = 1, + /** + * + * We are resolving an incoming htlc on chain. This if this htlc is + * claimed, we swept the incoming htlc with the preimage. If it is timed + * out, our peer swept the timeout path. + * + * @generated from protobuf enum value: INCOMING_HTLC = 2; + */ + INCOMING_HTLC = 2, + /** + * + * We are resolving an outgoing htlc on chain. If this htlc is claimed, + * the remote party swept the htlc with the preimage. If it is timed out, + * we swept it with the timeout path. + * + * @generated from protobuf enum value: OUTGOING_HTLC = 3; + */ + OUTGOING_HTLC = 3, + /** + * We force closed and need to sweep our time locked commitment output. + * + * @generated from protobuf enum value: COMMIT = 4; + */ + COMMIT = 4 +} +/** + * @generated from protobuf enum lnrpc.ResolutionOutcome + */ +export enum ResolutionOutcome { + /** + * Outcome unknown. + * + * @generated from protobuf enum value: OUTCOME_UNKNOWN = 0; + */ + OUTCOME_UNKNOWN = 0, + /** + * An output was claimed on chain. + * + * @generated from protobuf enum value: CLAIMED = 1; + */ + CLAIMED = 1, + /** + * An output was left unclaimed on chain. + * + * @generated from protobuf enum value: UNCLAIMED = 2; + */ + UNCLAIMED = 2, + /** + * + * ResolverOutcomeAbandoned indicates that an output that we did not + * claim on chain, for example an anchor that we did not sweep and a + * third party claimed on chain, or a htlc that we could not decode + * so left unclaimed. + * + * @generated from protobuf enum value: ABANDONED = 3; + */ + ABANDONED = 3, + /** + * + * If we force closed our channel, our htlcs need to be claimed in two + * stages. This outcome represents the broadcast of a timeout or success + * transaction for this two stage htlc claim. + * + * @generated from protobuf enum value: FIRST_STAGE = 4; + */ + FIRST_STAGE = 4, + /** + * A htlc was timed out on chain. + * + * @generated from protobuf enum value: TIMEOUT = 5; + */ + TIMEOUT = 5 +} +/** + * @generated from protobuf enum lnrpc.NodeMetricType + */ +export enum NodeMetricType { + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: BETWEENNESS_CENTRALITY = 1; + */ + BETWEENNESS_CENTRALITY = 1 +} +/** + * @generated from protobuf enum lnrpc.InvoiceHTLCState + */ +export enum InvoiceHTLCState { + /** + * @generated from protobuf enum value: ACCEPTED = 0; + */ + ACCEPTED = 0, + /** + * @generated from protobuf enum value: SETTLED = 1; + */ + SETTLED = 1, + /** + * @generated from protobuf enum value: CANCELED = 2; + */ + CANCELED = 2 +} +/** + * @generated from protobuf enum lnrpc.PaymentFailureReason + */ +export enum PaymentFailureReason { + /** + * + * Payment isn't failed (yet). + * + * @generated from protobuf enum value: FAILURE_REASON_NONE = 0; + */ + FAILURE_REASON_NONE = 0, + /** + * + * There are more routes to try, but the payment timeout was exceeded. + * + * @generated from protobuf enum value: FAILURE_REASON_TIMEOUT = 1; + */ + FAILURE_REASON_TIMEOUT = 1, + /** + * + * All possible routes were tried and failed permanently. Or were no + * routes to the destination at all. + * + * @generated from protobuf enum value: FAILURE_REASON_NO_ROUTE = 2; + */ + FAILURE_REASON_NO_ROUTE = 2, + /** + * + * A non-recoverable error has occured. + * + * @generated from protobuf enum value: FAILURE_REASON_ERROR = 3; + */ + FAILURE_REASON_ERROR = 3, + /** + * + * Payment details incorrect (unknown hash, invalid amt or + * invalid final cltv delta) + * + * @generated from protobuf enum value: FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; + */ + FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4, + /** + * + * Insufficient local balance. + * + * @generated from protobuf enum value: FAILURE_REASON_INSUFFICIENT_BALANCE = 5; + */ + FAILURE_REASON_INSUFFICIENT_BALANCE = 5 +} +/** + * @generated from protobuf enum lnrpc.FeatureBit + */ +export enum FeatureBit { + /** + * @generated from protobuf enum value: DATALOSS_PROTECT_REQ = 0; + */ + DATALOSS_PROTECT_REQ = 0, + /** + * @generated from protobuf enum value: DATALOSS_PROTECT_OPT = 1; + */ + DATALOSS_PROTECT_OPT = 1, + /** + * @generated from protobuf enum value: INITIAL_ROUING_SYNC = 3; + */ + INITIAL_ROUING_SYNC = 3, + /** + * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; + */ + UPFRONT_SHUTDOWN_SCRIPT_REQ = 4, + /** + * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; + */ + UPFRONT_SHUTDOWN_SCRIPT_OPT = 5, + /** + * @generated from protobuf enum value: GOSSIP_QUERIES_REQ = 6; + */ + GOSSIP_QUERIES_REQ = 6, + /** + * @generated from protobuf enum value: GOSSIP_QUERIES_OPT = 7; + */ + GOSSIP_QUERIES_OPT = 7, + /** + * @generated from protobuf enum value: TLV_ONION_REQ = 8; + */ + TLV_ONION_REQ = 8, + /** + * @generated from protobuf enum value: TLV_ONION_OPT = 9; + */ + TLV_ONION_OPT = 9, + /** + * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_REQ = 10; + */ + EXT_GOSSIP_QUERIES_REQ = 10, + /** + * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_OPT = 11; + */ + EXT_GOSSIP_QUERIES_OPT = 11, + /** + * @generated from protobuf enum value: STATIC_REMOTE_KEY_REQ = 12; + */ + STATIC_REMOTE_KEY_REQ = 12, + /** + * @generated from protobuf enum value: STATIC_REMOTE_KEY_OPT = 13; + */ + STATIC_REMOTE_KEY_OPT = 13, + /** + * @generated from protobuf enum value: PAYMENT_ADDR_REQ = 14; + */ + PAYMENT_ADDR_REQ = 14, + /** + * @generated from protobuf enum value: PAYMENT_ADDR_OPT = 15; + */ + PAYMENT_ADDR_OPT = 15, + /** + * @generated from protobuf enum value: MPP_REQ = 16; + */ + MPP_REQ = 16, + /** + * @generated from protobuf enum value: MPP_OPT = 17; + */ + MPP_OPT = 17, + /** + * @generated from protobuf enum value: WUMBO_CHANNELS_REQ = 18; + */ + WUMBO_CHANNELS_REQ = 18, + /** + * @generated from protobuf enum value: WUMBO_CHANNELS_OPT = 19; + */ + WUMBO_CHANNELS_OPT = 19, + /** + * @generated from protobuf enum value: ANCHORS_REQ = 20; + */ + ANCHORS_REQ = 20, + /** + * @generated from protobuf enum value: ANCHORS_OPT = 21; + */ + ANCHORS_OPT = 21, + /** + * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_REQ = 22; + */ + ANCHORS_ZERO_FEE_HTLC_REQ = 22, + /** + * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_OPT = 23; + */ + ANCHORS_ZERO_FEE_HTLC_OPT = 23, + /** + * @generated from protobuf enum value: AMP_REQ = 30; + */ + AMP_REQ = 30, + /** + * @generated from protobuf enum value: AMP_OPT = 31; + */ + AMP_OPT = 31 +} +/** + * @generated from protobuf enum lnrpc.UpdateFailure + */ +export enum UpdateFailure { + /** + * @generated from protobuf enum value: UPDATE_FAILURE_UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_PENDING = 1; + */ + PENDING = 1, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_NOT_FOUND = 2; + */ + NOT_FOUND = 2, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_INTERNAL_ERR = 3; + */ + INTERNAL_ERR = 3, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_INVALID_PARAMETER = 4; + */ + INVALID_PARAMETER = 4 +} +// @generated message type with reflection information, may provide speed optimized methods +class LookupHtlcRequest$Type extends MessageType { + constructor() { + super("lnrpc.LookupHtlcRequest", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): LookupHtlcRequest { + const message = { chanId: 0n, htlcIndex: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcRequest): LookupHtlcRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id */ 1: + message.chanId = reader.uint64().toBigInt(); + break; + case /* uint64 htlc_index */ 2: + message.htlcIndex = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LookupHtlcRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1; */ + if (message.chanId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.chanId); + /* uint64 htlc_index = 2; */ + if (message.htlcIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.htlcIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.LookupHtlcRequest + */ +export const LookupHtlcRequest = new LookupHtlcRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LookupHtlcResponse$Type extends MessageType { + constructor() { + super("lnrpc.LookupHtlcResponse", [ + { no: 1, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "offchain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): LookupHtlcResponse { + const message = { settled: false, offchain: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcResponse): LookupHtlcResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool settled */ 1: + message.settled = reader.bool(); + break; + case /* bool offchain */ 2: + message.offchain = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LookupHtlcResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool settled = 1; */ + if (message.settled !== false) + writer.tag(1, WireType.Varint).bool(message.settled); + /* bool offchain = 2; */ + if (message.offchain !== false) + writer.tag(2, WireType.Varint).bool(message.offchain); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.LookupHtlcResponse + */ +export const LookupHtlcResponse = new LookupHtlcResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubscribeCustomMessagesRequest$Type extends MessageType { + constructor() { + super("lnrpc.SubscribeCustomMessagesRequest", []); + } + create(value?: PartialMessage): SubscribeCustomMessagesRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeCustomMessagesRequest): SubscribeCustomMessagesRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: SubscribeCustomMessagesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SubscribeCustomMessagesRequest + */ +export const SubscribeCustomMessagesRequest = new SubscribeCustomMessagesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CustomMessage$Type extends MessageType { + constructor() { + super("lnrpc.CustomMessage", [ + { no: 1, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "type", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): CustomMessage { + const message = { peer: new Uint8Array(0), type: 0, data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CustomMessage): CustomMessage { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes peer */ 1: + message.peer = reader.bytes(); + break; + case /* uint32 type */ 2: + message.type = reader.uint32(); + break; + case /* bytes data */ 3: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CustomMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes peer = 1; */ + if (message.peer.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.peer); + /* uint32 type = 2; */ + if (message.type !== 0) + writer.tag(2, WireType.Varint).uint32(message.type); + /* bytes data = 3; */ + if (message.data.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CustomMessage + */ +export const CustomMessage = new CustomMessage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendCustomMessageRequest$Type extends MessageType { + constructor() { + super("lnrpc.SendCustomMessageRequest", [ + { no: 1, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "type", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SendCustomMessageRequest { + const message = { peer: new Uint8Array(0), type: 0, data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageRequest): SendCustomMessageRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes peer */ 1: + message.peer = reader.bytes(); + break; + case /* uint32 type */ 2: + message.type = reader.uint32(); + break; + case /* bytes data */ 3: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendCustomMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes peer = 1; */ + if (message.peer.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.peer); + /* uint32 type = 2; */ + if (message.type !== 0) + writer.tag(2, WireType.Varint).uint32(message.type); + /* bytes data = 3; */ + if (message.data.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendCustomMessageRequest + */ +export const SendCustomMessageRequest = new SendCustomMessageRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendCustomMessageResponse$Type extends MessageType { + constructor() { + super("lnrpc.SendCustomMessageResponse", []); + } + create(value?: PartialMessage): SendCustomMessageResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageResponse): SendCustomMessageResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: SendCustomMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendCustomMessageResponse + */ +export const SendCustomMessageResponse = new SendCustomMessageResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Utxo$Type extends MessageType { + constructor() { + super("lnrpc.Utxo", [ + { no: 1, name: "address_type", kind: "enum", T: () => ["lnrpc.AddressType", AddressType] }, + { no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "amount_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "pk_script", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "outpoint", kind: "message", T: () => OutPoint }, + { no: 6, name: "confirmations", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): Utxo { + const message = { addressType: 0, address: "", amountSat: 0n, pkScript: "", confirmations: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Utxo): Utxo { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.AddressType address_type */ 1: + message.addressType = reader.int32(); + break; + case /* string address */ 2: + message.address = reader.string(); + break; + case /* int64 amount_sat */ 3: + message.amountSat = reader.int64().toBigInt(); + break; + case /* string pk_script */ 4: + message.pkScript = reader.string(); + break; + case /* lnrpc.OutPoint outpoint */ 5: + message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); + break; + case /* int64 confirmations */ 6: + message.confirmations = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Utxo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.AddressType address_type = 1; */ + if (message.addressType !== 0) + writer.tag(1, WireType.Varint).int32(message.addressType); + /* string address = 2; */ + if (message.address !== "") + writer.tag(2, WireType.LengthDelimited).string(message.address); + /* int64 amount_sat = 3; */ + if (message.amountSat !== 0n) + writer.tag(3, WireType.Varint).int64(message.amountSat); + /* string pk_script = 4; */ + if (message.pkScript !== "") + writer.tag(4, WireType.LengthDelimited).string(message.pkScript); + /* lnrpc.OutPoint outpoint = 5; */ + if (message.outpoint) + OutPoint.internalBinaryWrite(message.outpoint, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* int64 confirmations = 6; */ + if (message.confirmations !== 0n) + writer.tag(6, WireType.Varint).int64(message.confirmations); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Utxo + */ +export const Utxo = new Utxo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OutputDetail$Type extends MessageType { + constructor() { + super("lnrpc.OutputDetail", [ + { no: 1, name: "output_type", kind: "enum", T: () => ["lnrpc.OutputScriptType", OutputScriptType] }, + { no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "pk_script", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "output_index", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "is_our_address", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): OutputDetail { + const message = { outputType: 0, address: "", pkScript: "", outputIndex: 0n, amount: 0n, isOurAddress: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OutputDetail): OutputDetail { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.OutputScriptType output_type */ 1: + message.outputType = reader.int32(); + break; + case /* string address */ 2: + message.address = reader.string(); + break; + case /* string pk_script */ 3: + message.pkScript = reader.string(); + break; + case /* int64 output_index */ 4: + message.outputIndex = reader.int64().toBigInt(); + break; + case /* int64 amount */ 5: + message.amount = reader.int64().toBigInt(); + break; + case /* bool is_our_address */ 6: + message.isOurAddress = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: OutputDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.OutputScriptType output_type = 1; */ + if (message.outputType !== 0) + writer.tag(1, WireType.Varint).int32(message.outputType); + /* string address = 2; */ + if (message.address !== "") + writer.tag(2, WireType.LengthDelimited).string(message.address); + /* string pk_script = 3; */ + if (message.pkScript !== "") + writer.tag(3, WireType.LengthDelimited).string(message.pkScript); + /* int64 output_index = 4; */ + if (message.outputIndex !== 0n) + writer.tag(4, WireType.Varint).int64(message.outputIndex); + /* int64 amount = 5; */ + if (message.amount !== 0n) + writer.tag(5, WireType.Varint).int64(message.amount); + /* bool is_our_address = 6; */ + if (message.isOurAddress !== false) + writer.tag(6, WireType.Varint).bool(message.isOurAddress); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.OutputDetail + */ +export const OutputDetail = new OutputDetail$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Transaction$Type extends MessageType { + constructor() { + super("lnrpc.Transaction", [ + { no: 1, name: "tx_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "num_confirmations", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "block_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "block_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: "time_stamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "dest_addresses", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "output_details", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => OutputDetail }, + { no: 9, name: "raw_tx_hex", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "previous_outpoints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PreviousOutPoint } + ]); + } + create(value?: PartialMessage): Transaction { + const message = { txHash: "", amount: 0n, numConfirmations: 0, blockHash: "", blockHeight: 0, timeStamp: 0n, totalFees: 0n, destAddresses: [], outputDetails: [], rawTxHex: "", label: "", previousOutpoints: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Transaction): Transaction { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tx_hash */ 1: + message.txHash = reader.string(); + break; + case /* int64 amount */ 2: + message.amount = reader.int64().toBigInt(); + break; + case /* int32 num_confirmations */ 3: + message.numConfirmations = reader.int32(); + break; + case /* string block_hash */ 4: + message.blockHash = reader.string(); + break; + case /* int32 block_height */ 5: + message.blockHeight = reader.int32(); + break; + case /* int64 time_stamp */ 6: + message.timeStamp = reader.int64().toBigInt(); + break; + case /* int64 total_fees */ 7: + message.totalFees = reader.int64().toBigInt(); + break; + case /* repeated string dest_addresses = 8 [deprecated = true];*/ 8: + message.destAddresses.push(reader.string()); + break; + case /* repeated lnrpc.OutputDetail output_details */ 11: + message.outputDetails.push(OutputDetail.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string raw_tx_hex */ 9: + message.rawTxHex = reader.string(); + break; + case /* string label */ 10: + message.label = reader.string(); + break; + case /* repeated lnrpc.PreviousOutPoint previous_outpoints */ 12: + message.previousOutpoints.push(PreviousOutPoint.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Transaction, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tx_hash = 1; */ + if (message.txHash !== "") + writer.tag(1, WireType.LengthDelimited).string(message.txHash); + /* int64 amount = 2; */ + if (message.amount !== 0n) + writer.tag(2, WireType.Varint).int64(message.amount); + /* int32 num_confirmations = 3; */ + if (message.numConfirmations !== 0) + writer.tag(3, WireType.Varint).int32(message.numConfirmations); + /* string block_hash = 4; */ + if (message.blockHash !== "") + writer.tag(4, WireType.LengthDelimited).string(message.blockHash); + /* int32 block_height = 5; */ + if (message.blockHeight !== 0) + writer.tag(5, WireType.Varint).int32(message.blockHeight); + /* int64 time_stamp = 6; */ + if (message.timeStamp !== 0n) + writer.tag(6, WireType.Varint).int64(message.timeStamp); + /* int64 total_fees = 7; */ + if (message.totalFees !== 0n) + writer.tag(7, WireType.Varint).int64(message.totalFees); + /* repeated string dest_addresses = 8 [deprecated = true]; */ + for (let i = 0; i < message.destAddresses.length; i++) + writer.tag(8, WireType.LengthDelimited).string(message.destAddresses[i]); + /* repeated lnrpc.OutputDetail output_details = 11; */ + for (let i = 0; i < message.outputDetails.length; i++) + OutputDetail.internalBinaryWrite(message.outputDetails[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + /* string raw_tx_hex = 9; */ + if (message.rawTxHex !== "") + writer.tag(9, WireType.LengthDelimited).string(message.rawTxHex); + /* string label = 10; */ + if (message.label !== "") + writer.tag(10, WireType.LengthDelimited).string(message.label); + /* repeated lnrpc.PreviousOutPoint previous_outpoints = 12; */ + for (let i = 0; i < message.previousOutpoints.length; i++) + PreviousOutPoint.internalBinaryWrite(message.previousOutpoints[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Transaction + */ +export const Transaction = new Transaction$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetTransactionsRequest$Type extends MessageType { + constructor() { + super("lnrpc.GetTransactionsRequest", [ + { no: 1, name: "start_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "end_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): GetTransactionsRequest { + const message = { startHeight: 0, endHeight: 0, account: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetTransactionsRequest): GetTransactionsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 start_height */ 1: + message.startHeight = reader.int32(); + break; + case /* int32 end_height */ 2: + message.endHeight = reader.int32(); + break; + case /* string account */ 3: + message.account = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetTransactionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int32 start_height = 1; */ + if (message.startHeight !== 0) + writer.tag(1, WireType.Varint).int32(message.startHeight); + /* int32 end_height = 2; */ + if (message.endHeight !== 0) + writer.tag(2, WireType.Varint).int32(message.endHeight); + /* string account = 3; */ + if (message.account !== "") + writer.tag(3, WireType.LengthDelimited).string(message.account); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.GetTransactionsRequest + */ +export const GetTransactionsRequest = new GetTransactionsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TransactionDetails$Type extends MessageType { + constructor() { + super("lnrpc.TransactionDetails", [ + { no: 1, name: "transactions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Transaction } + ]); + } + create(value?: PartialMessage): TransactionDetails { + const message = { transactions: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TransactionDetails): TransactionDetails { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.Transaction transactions */ 1: + message.transactions.push(Transaction.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TransactionDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.Transaction transactions = 1; */ + for (let i = 0; i < message.transactions.length; i++) + Transaction.internalBinaryWrite(message.transactions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.TransactionDetails + */ +export const TransactionDetails = new TransactionDetails$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FeeLimit$Type extends MessageType { + constructor() { + super("lnrpc.FeeLimit", [ + { no: 1, name: "fixed", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "fixed_msat", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "percent", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): FeeLimit { + const message = { limit: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeLimit): FeeLimit { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 fixed */ 1: + message.limit = { + oneofKind: "fixed", + fixed: reader.int64().toBigInt() + }; + break; + case /* int64 fixed_msat */ 3: + message.limit = { + oneofKind: "fixedMsat", + fixedMsat: reader.int64().toBigInt() + }; + break; + case /* int64 percent */ 2: + message.limit = { + oneofKind: "percent", + percent: reader.int64().toBigInt() + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FeeLimit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 fixed = 1; */ + if (message.limit.oneofKind === "fixed") + writer.tag(1, WireType.Varint).int64(message.limit.fixed); + /* int64 fixed_msat = 3; */ + if (message.limit.oneofKind === "fixedMsat") + writer.tag(3, WireType.Varint).int64(message.limit.fixedMsat); + /* int64 percent = 2; */ + if (message.limit.oneofKind === "percent") + writer.tag(2, WireType.Varint).int64(message.limit.percent); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FeeLimit + */ +export const FeeLimit = new FeeLimit$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendRequest$Type extends MessageType { + constructor() { + super("lnrpc.SendRequest", [ + { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "dest_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "payment_hash_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: "fee_limit", kind: "message", T: () => FeeLimit }, + { no: 9, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 13, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 10, name: "cltv_limit", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 11, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, + { no: 14, name: "allow_self_payment", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 15, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, + { no: 16, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SendRequest { + const message = { dest: new Uint8Array(0), destString: "", amt: 0n, amtMsat: 0n, paymentHash: new Uint8Array(0), paymentHashString: "", paymentRequest: "", finalCltvDelta: 0, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), cltvLimit: 0, destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], paymentAddr: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendRequest): SendRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes dest */ 1: + message.dest = reader.bytes(); + break; + case /* string dest_string = 2 [deprecated = true];*/ 2: + message.destString = reader.string(); + break; + case /* int64 amt */ 3: + message.amt = reader.int64().toBigInt(); + break; + case /* int64 amt_msat */ 12: + message.amtMsat = reader.int64().toBigInt(); + break; + case /* bytes payment_hash */ 4: + message.paymentHash = reader.bytes(); + break; + case /* string payment_hash_string = 5 [deprecated = true];*/ 5: + message.paymentHashString = reader.string(); + break; + case /* string payment_request */ 6: + message.paymentRequest = reader.string(); + break; + case /* int32 final_cltv_delta */ 7: + message.finalCltvDelta = reader.int32(); + break; + case /* lnrpc.FeeLimit fee_limit */ 8: + message.feeLimit = FeeLimit.internalBinaryRead(reader, reader.uint32(), options, message.feeLimit); + break; + case /* uint64 outgoing_chan_id = 9 [jstype = JS_STRING];*/ 9: + message.outgoingChanId = reader.uint64().toString(); + break; + case /* bytes last_hop_pubkey */ 13: + message.lastHopPubkey = reader.bytes(); + break; + case /* uint32 cltv_limit */ 10: + message.cltvLimit = reader.uint32(); + break; + case /* map dest_custom_records */ 11: + this.binaryReadMap11(message.destCustomRecords, reader, options); + break; + case /* bool allow_self_payment */ 14: + message.allowSelfPayment = reader.bool(); + break; + case /* repeated lnrpc.FeatureBit dest_features */ 15: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.destFeatures.push(reader.int32()); + else + message.destFeatures.push(reader.int32()); + break; + case /* bytes payment_addr */ 16: + message.paymentAddr = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap11(map: SendRequest["destCustomRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SendRequest["destCustomRecords"] | undefined, val: SendRequest["destCustomRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.SendRequest.dest_custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: SendRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes dest = 1; */ + if (message.dest.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.dest); + /* string dest_string = 2 [deprecated = true]; */ + if (message.destString !== "") + writer.tag(2, WireType.LengthDelimited).string(message.destString); + /* int64 amt = 3; */ + if (message.amt !== 0n) + writer.tag(3, WireType.Varint).int64(message.amt); + /* int64 amt_msat = 12; */ + if (message.amtMsat !== 0n) + writer.tag(12, WireType.Varint).int64(message.amtMsat); + /* bytes payment_hash = 4; */ + if (message.paymentHash.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.paymentHash); + /* string payment_hash_string = 5 [deprecated = true]; */ + if (message.paymentHashString !== "") + writer.tag(5, WireType.LengthDelimited).string(message.paymentHashString); + /* string payment_request = 6; */ + if (message.paymentRequest !== "") + writer.tag(6, WireType.LengthDelimited).string(message.paymentRequest); + /* int32 final_cltv_delta = 7; */ + if (message.finalCltvDelta !== 0) + writer.tag(7, WireType.Varint).int32(message.finalCltvDelta); + /* lnrpc.FeeLimit fee_limit = 8; */ + if (message.feeLimit) + FeeLimit.internalBinaryWrite(message.feeLimit, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; */ + if (message.outgoingChanId !== "0") + writer.tag(9, WireType.Varint).uint64(message.outgoingChanId); + /* bytes last_hop_pubkey = 13; */ + if (message.lastHopPubkey.length) + writer.tag(13, WireType.LengthDelimited).bytes(message.lastHopPubkey); + /* uint32 cltv_limit = 10; */ + if (message.cltvLimit !== 0) + writer.tag(10, WireType.Varint).uint32(message.cltvLimit); + /* map dest_custom_records = 11; */ + for (let k of Object.keys(message.destCustomRecords)) + writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); + /* bool allow_self_payment = 14; */ + if (message.allowSelfPayment !== false) + writer.tag(14, WireType.Varint).bool(message.allowSelfPayment); + /* repeated lnrpc.FeatureBit dest_features = 15; */ + if (message.destFeatures.length) { + writer.tag(15, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.destFeatures.length; i++) + writer.int32(message.destFeatures[i]); + writer.join(); + } + /* bytes payment_addr = 16; */ + if (message.paymentAddr.length) + writer.tag(16, WireType.LengthDelimited).bytes(message.paymentAddr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendRequest + */ +export const SendRequest = new SendRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendResponse$Type extends MessageType { + constructor() { + super("lnrpc.SendResponse", [ + { no: 1, name: "payment_error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "payment_preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "payment_route", kind: "message", T: () => Route }, + { no: 4, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SendResponse { + const message = { paymentError: "", paymentPreimage: new Uint8Array(0), paymentHash: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendResponse): SendResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string payment_error */ 1: + message.paymentError = reader.string(); + break; + case /* bytes payment_preimage */ 2: + message.paymentPreimage = reader.bytes(); + break; + case /* lnrpc.Route payment_route */ 3: + message.paymentRoute = Route.internalBinaryRead(reader, reader.uint32(), options, message.paymentRoute); + break; + case /* bytes payment_hash */ 4: + message.paymentHash = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string payment_error = 1; */ + if (message.paymentError !== "") + writer.tag(1, WireType.LengthDelimited).string(message.paymentError); + /* bytes payment_preimage = 2; */ + if (message.paymentPreimage.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.paymentPreimage); + /* lnrpc.Route payment_route = 3; */ + if (message.paymentRoute) + Route.internalBinaryWrite(message.paymentRoute, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* bytes payment_hash = 4; */ + if (message.paymentHash.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.paymentHash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendResponse + */ +export const SendResponse = new SendResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendToRouteRequest$Type extends MessageType { + constructor() { + super("lnrpc.SendToRouteRequest", [ + { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "payment_hash_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "route", kind: "message", T: () => Route } + ]); + } + create(value?: PartialMessage): SendToRouteRequest { + const message = { paymentHash: new Uint8Array(0), paymentHashString: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteRequest): SendToRouteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.paymentHash = reader.bytes(); + break; + case /* string payment_hash_string = 2 [deprecated = true];*/ 2: + message.paymentHashString = reader.string(); + break; + case /* lnrpc.Route route */ 4: + message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendToRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.paymentHash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); + /* string payment_hash_string = 2 [deprecated = true]; */ + if (message.paymentHashString !== "") + writer.tag(2, WireType.LengthDelimited).string(message.paymentHashString); + /* lnrpc.Route route = 4; */ + if (message.route) + Route.internalBinaryWrite(message.route, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendToRouteRequest + */ +export const SendToRouteRequest = new SendToRouteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelAcceptRequest$Type extends MessageType { + constructor() { + super("lnrpc.ChannelAcceptRequest", [ + { no: 1, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "chain_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "funding_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "push_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "dust_limit", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "max_value_in_flight", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "channel_reserve", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "min_htlc", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "fee_per_kw", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 12, name: "max_accepted_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 13, name: "channel_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 14, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, + { no: 15, name: "wants_zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: "wants_scid_alias", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ChannelAcceptRequest { + const message = { nodePubkey: new Uint8Array(0), chainHash: new Uint8Array(0), pendingChanId: new Uint8Array(0), fundingAmt: 0n, pushAmt: 0n, dustLimit: 0n, maxValueInFlight: 0n, channelReserve: 0n, minHtlc: 0n, feePerKw: 0n, csvDelay: 0, maxAcceptedHtlcs: 0, channelFlags: 0, commitmentType: 0, wantsZeroConf: false, wantsScidAlias: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAcceptRequest): ChannelAcceptRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes node_pubkey */ 1: + message.nodePubkey = reader.bytes(); + break; + case /* bytes chain_hash */ 2: + message.chainHash = reader.bytes(); + break; + case /* bytes pending_chan_id */ 3: + message.pendingChanId = reader.bytes(); + break; + case /* uint64 funding_amt */ 4: + message.fundingAmt = reader.uint64().toBigInt(); + break; + case /* uint64 push_amt */ 5: + message.pushAmt = reader.uint64().toBigInt(); + break; + case /* uint64 dust_limit */ 6: + message.dustLimit = reader.uint64().toBigInt(); + break; + case /* uint64 max_value_in_flight */ 7: + message.maxValueInFlight = reader.uint64().toBigInt(); + break; + case /* uint64 channel_reserve */ 8: + message.channelReserve = reader.uint64().toBigInt(); + break; + case /* uint64 min_htlc */ 9: + message.minHtlc = reader.uint64().toBigInt(); + break; + case /* uint64 fee_per_kw */ 10: + message.feePerKw = reader.uint64().toBigInt(); + break; + case /* uint32 csv_delay */ 11: + message.csvDelay = reader.uint32(); + break; + case /* uint32 max_accepted_htlcs */ 12: + message.maxAcceptedHtlcs = reader.uint32(); + break; + case /* uint32 channel_flags */ 13: + message.channelFlags = reader.uint32(); + break; + case /* lnrpc.CommitmentType commitment_type */ 14: + message.commitmentType = reader.int32(); + break; + case /* bool wants_zero_conf */ 15: + message.wantsZeroConf = reader.bool(); + break; + case /* bool wants_scid_alias */ 16: + message.wantsScidAlias = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelAcceptRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes node_pubkey = 1; */ + if (message.nodePubkey.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); + /* bytes chain_hash = 2; */ + if (message.chainHash.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.chainHash); + /* bytes pending_chan_id = 3; */ + if (message.pendingChanId.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.pendingChanId); + /* uint64 funding_amt = 4; */ + if (message.fundingAmt !== 0n) + writer.tag(4, WireType.Varint).uint64(message.fundingAmt); + /* uint64 push_amt = 5; */ + if (message.pushAmt !== 0n) + writer.tag(5, WireType.Varint).uint64(message.pushAmt); + /* uint64 dust_limit = 6; */ + if (message.dustLimit !== 0n) + writer.tag(6, WireType.Varint).uint64(message.dustLimit); + /* uint64 max_value_in_flight = 7; */ + if (message.maxValueInFlight !== 0n) + writer.tag(7, WireType.Varint).uint64(message.maxValueInFlight); + /* uint64 channel_reserve = 8; */ + if (message.channelReserve !== 0n) + writer.tag(8, WireType.Varint).uint64(message.channelReserve); + /* uint64 min_htlc = 9; */ + if (message.minHtlc !== 0n) + writer.tag(9, WireType.Varint).uint64(message.minHtlc); + /* uint64 fee_per_kw = 10; */ + if (message.feePerKw !== 0n) + writer.tag(10, WireType.Varint).uint64(message.feePerKw); + /* uint32 csv_delay = 11; */ + if (message.csvDelay !== 0) + writer.tag(11, WireType.Varint).uint32(message.csvDelay); + /* uint32 max_accepted_htlcs = 12; */ + if (message.maxAcceptedHtlcs !== 0) + writer.tag(12, WireType.Varint).uint32(message.maxAcceptedHtlcs); + /* uint32 channel_flags = 13; */ + if (message.channelFlags !== 0) + writer.tag(13, WireType.Varint).uint32(message.channelFlags); + /* lnrpc.CommitmentType commitment_type = 14; */ + if (message.commitmentType !== 0) + writer.tag(14, WireType.Varint).int32(message.commitmentType); + /* bool wants_zero_conf = 15; */ + if (message.wantsZeroConf !== false) + writer.tag(15, WireType.Varint).bool(message.wantsZeroConf); + /* bool wants_scid_alias = 16; */ + if (message.wantsScidAlias !== false) + writer.tag(16, WireType.Varint).bool(message.wantsScidAlias); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelAcceptRequest + */ +export const ChannelAcceptRequest = new ChannelAcceptRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelAcceptResponse$Type extends MessageType { + constructor() { + super("lnrpc.ChannelAcceptResponse", [ + { no: 1, name: "accept", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "upfront_shutdown", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 6, name: "reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "in_flight_max_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "max_htlc_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 9, name: "min_htlc_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "min_accept_depth", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 11, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ChannelAcceptResponse { + const message = { accept: false, pendingChanId: new Uint8Array(0), error: "", upfrontShutdown: "", csvDelay: 0, reserveSat: 0n, inFlightMaxMsat: 0n, maxHtlcCount: 0, minHtlcIn: 0n, minAcceptDepth: 0, zeroConf: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAcceptResponse): ChannelAcceptResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool accept */ 1: + message.accept = reader.bool(); + break; + case /* bytes pending_chan_id */ 2: + message.pendingChanId = reader.bytes(); + break; + case /* string error */ 3: + message.error = reader.string(); + break; + case /* string upfront_shutdown */ 4: + message.upfrontShutdown = reader.string(); + break; + case /* uint32 csv_delay */ 5: + message.csvDelay = reader.uint32(); + break; + case /* uint64 reserve_sat */ 6: + message.reserveSat = reader.uint64().toBigInt(); + break; + case /* uint64 in_flight_max_msat */ 7: + message.inFlightMaxMsat = reader.uint64().toBigInt(); + break; + case /* uint32 max_htlc_count */ 8: + message.maxHtlcCount = reader.uint32(); + break; + case /* uint64 min_htlc_in */ 9: + message.minHtlcIn = reader.uint64().toBigInt(); + break; + case /* uint32 min_accept_depth */ 10: + message.minAcceptDepth = reader.uint32(); + break; + case /* bool zero_conf */ 11: + message.zeroConf = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelAcceptResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool accept = 1; */ + if (message.accept !== false) + writer.tag(1, WireType.Varint).bool(message.accept); + /* bytes pending_chan_id = 2; */ + if (message.pendingChanId.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); + /* string error = 3; */ + if (message.error !== "") + writer.tag(3, WireType.LengthDelimited).string(message.error); + /* string upfront_shutdown = 4; */ + if (message.upfrontShutdown !== "") + writer.tag(4, WireType.LengthDelimited).string(message.upfrontShutdown); + /* uint32 csv_delay = 5; */ + if (message.csvDelay !== 0) + writer.tag(5, WireType.Varint).uint32(message.csvDelay); + /* uint64 reserve_sat = 6; */ + if (message.reserveSat !== 0n) + writer.tag(6, WireType.Varint).uint64(message.reserveSat); + /* uint64 in_flight_max_msat = 7; */ + if (message.inFlightMaxMsat !== 0n) + writer.tag(7, WireType.Varint).uint64(message.inFlightMaxMsat); + /* uint32 max_htlc_count = 8; */ + if (message.maxHtlcCount !== 0) + writer.tag(8, WireType.Varint).uint32(message.maxHtlcCount); + /* uint64 min_htlc_in = 9; */ + if (message.minHtlcIn !== 0n) + writer.tag(9, WireType.Varint).uint64(message.minHtlcIn); + /* uint32 min_accept_depth = 10; */ + if (message.minAcceptDepth !== 0) + writer.tag(10, WireType.Varint).uint32(message.minAcceptDepth); + /* bool zero_conf = 11; */ + if (message.zeroConf !== false) + writer.tag(11, WireType.Varint).bool(message.zeroConf); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelAcceptResponse + */ +export const ChannelAcceptResponse = new ChannelAcceptResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelPoint$Type extends MessageType { + constructor() { + super("lnrpc.ChannelPoint", [ + { no: 1, name: "funding_txid_bytes", kind: "scalar", oneof: "fundingTxid", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "funding_txid_str", kind: "scalar", oneof: "fundingTxid", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): ChannelPoint { + const message = { fundingTxid: { oneofKind: undefined }, outputIndex: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelPoint): ChannelPoint { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes funding_txid_bytes */ 1: + message.fundingTxid = { + oneofKind: "fundingTxidBytes", + fundingTxidBytes: reader.bytes() + }; + break; + case /* string funding_txid_str */ 2: + message.fundingTxid = { + oneofKind: "fundingTxidStr", + fundingTxidStr: reader.string() + }; + break; + case /* uint32 output_index */ 3: + message.outputIndex = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes funding_txid_bytes = 1; */ + if (message.fundingTxid.oneofKind === "fundingTxidBytes") + writer.tag(1, WireType.LengthDelimited).bytes(message.fundingTxid.fundingTxidBytes); + /* string funding_txid_str = 2; */ + if (message.fundingTxid.oneofKind === "fundingTxidStr") + writer.tag(2, WireType.LengthDelimited).string(message.fundingTxid.fundingTxidStr); + /* uint32 output_index = 3; */ + if (message.outputIndex !== 0) + writer.tag(3, WireType.Varint).uint32(message.outputIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelPoint + */ +export const ChannelPoint = new ChannelPoint$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OutPoint$Type extends MessageType { + constructor() { + super("lnrpc.OutPoint", [ + { no: 1, name: "txid_bytes", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "txid_str", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): OutPoint { + const message = { txidBytes: new Uint8Array(0), txidStr: "", outputIndex: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OutPoint): OutPoint { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes txid_bytes */ 1: + message.txidBytes = reader.bytes(); + break; + case /* string txid_str */ 2: + message.txidStr = reader.string(); + break; + case /* uint32 output_index */ 3: + message.outputIndex = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: OutPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes txid_bytes = 1; */ + if (message.txidBytes.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.txidBytes); + /* string txid_str = 2; */ + if (message.txidStr !== "") + writer.tag(2, WireType.LengthDelimited).string(message.txidStr); + /* uint32 output_index = 3; */ + if (message.outputIndex !== 0) + writer.tag(3, WireType.Varint).uint32(message.outputIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.OutPoint + */ +export const OutPoint = new OutPoint$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PreviousOutPoint$Type extends MessageType { + constructor() { + super("lnrpc.PreviousOutPoint", [ + { no: 1, name: "outpoint", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "is_our_output", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): PreviousOutPoint { + const message = { outpoint: "", isOurOutput: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PreviousOutPoint): PreviousOutPoint { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string outpoint */ 1: + message.outpoint = reader.string(); + break; + case /* bool is_our_output */ 2: + message.isOurOutput = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PreviousOutPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string outpoint = 1; */ + if (message.outpoint !== "") + writer.tag(1, WireType.LengthDelimited).string(message.outpoint); + /* bool is_our_output = 2; */ + if (message.isOurOutput !== false) + writer.tag(2, WireType.Varint).bool(message.isOurOutput); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PreviousOutPoint + */ +export const PreviousOutPoint = new PreviousOutPoint$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LightningAddress$Type extends MessageType { + constructor() { + super("lnrpc.LightningAddress", [ + { no: 1, name: "pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "host", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): LightningAddress { + const message = { pubkey: "", host: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LightningAddress): LightningAddress { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pubkey */ 1: + message.pubkey = reader.string(); + break; + case /* string host */ 2: + message.host = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LightningAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string pubkey = 1; */ + if (message.pubkey !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pubkey); + /* string host = 2; */ + if (message.host !== "") + writer.tag(2, WireType.LengthDelimited).string(message.host); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.LightningAddress + */ +export const LightningAddress = new LightningAddress$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EstimateFeeRequest$Type extends MessageType { + constructor() { + super("lnrpc.EstimateFeeRequest", [ + { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } }, + { no: 2, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): EstimateFeeRequest { + const message = { addrToAmount: {}, targetConf: 0, minConfs: 0, spendUnconfirmed: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EstimateFeeRequest): EstimateFeeRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map AddrToAmount = 1 [json_name = "AddrToAmount"];*/ 1: + this.binaryReadMap1(message.addrToAmount, reader, options); + break; + case /* int32 target_conf */ 2: + message.targetConf = reader.int32(); + break; + case /* int32 min_confs */ 3: + message.minConfs = reader.int32(); + break; + case /* bool spend_unconfirmed */ 4: + message.spendUnconfirmed = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap1(map: EstimateFeeRequest["addrToAmount"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof EstimateFeeRequest["addrToAmount"] | undefined, val: EstimateFeeRequest["addrToAmount"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.int64().toBigInt(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.EstimateFeeRequest.AddrToAmount"); + } + } + map[key ?? ""] = val ?? 0n; + } + internalBinaryWrite(message: EstimateFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ + for (let k of Object.keys(message.addrToAmount)) + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int64(message.addrToAmount[k]).join(); + /* int32 target_conf = 2; */ + if (message.targetConf !== 0) + writer.tag(2, WireType.Varint).int32(message.targetConf); + /* int32 min_confs = 3; */ + if (message.minConfs !== 0) + writer.tag(3, WireType.Varint).int32(message.minConfs); + /* bool spend_unconfirmed = 4; */ + if (message.spendUnconfirmed !== false) + writer.tag(4, WireType.Varint).bool(message.spendUnconfirmed); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.EstimateFeeRequest + */ +export const EstimateFeeRequest = new EstimateFeeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EstimateFeeResponse$Type extends MessageType { + constructor() { + super("lnrpc.EstimateFeeResponse", [ + { no: 1, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "feerate_sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): EstimateFeeResponse { + const message = { feeSat: 0n, feerateSatPerByte: 0n, satPerVbyte: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EstimateFeeResponse): EstimateFeeResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 fee_sat */ 1: + message.feeSat = reader.int64().toBigInt(); + break; + case /* int64 feerate_sat_per_byte = 2 [deprecated = true];*/ 2: + message.feerateSatPerByte = reader.int64().toBigInt(); + break; + case /* uint64 sat_per_vbyte */ 3: + message.satPerVbyte = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: EstimateFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 fee_sat = 1; */ + if (message.feeSat !== 0n) + writer.tag(1, WireType.Varint).int64(message.feeSat); + /* int64 feerate_sat_per_byte = 2 [deprecated = true]; */ + if (message.feerateSatPerByte !== 0n) + writer.tag(2, WireType.Varint).int64(message.feerateSatPerByte); + /* uint64 sat_per_vbyte = 3; */ + if (message.satPerVbyte !== 0n) + writer.tag(3, WireType.Varint).uint64(message.satPerVbyte); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.EstimateFeeResponse + */ +export const EstimateFeeResponse = new EstimateFeeResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendManyRequest$Type extends MessageType { + constructor() { + super("lnrpc.SendManyRequest", [ + { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } }, + { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SendManyRequest { + const message = { addrToAmount: {}, targetConf: 0, satPerVbyte: 0n, satPerByte: 0n, label: "", minConfs: 0, spendUnconfirmed: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendManyRequest): SendManyRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map AddrToAmount = 1 [json_name = "AddrToAmount"];*/ 1: + this.binaryReadMap1(message.addrToAmount, reader, options); + break; + case /* int32 target_conf */ 3: + message.targetConf = reader.int32(); + break; + case /* uint64 sat_per_vbyte */ 4: + message.satPerVbyte = reader.uint64().toBigInt(); + break; + case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: + message.satPerByte = reader.int64().toBigInt(); + break; + case /* string label */ 6: + message.label = reader.string(); + break; + case /* int32 min_confs */ 7: + message.minConfs = reader.int32(); + break; + case /* bool spend_unconfirmed */ 8: + message.spendUnconfirmed = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap1(map: SendManyRequest["addrToAmount"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SendManyRequest["addrToAmount"] | undefined, val: SendManyRequest["addrToAmount"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.int64().toBigInt(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.SendManyRequest.AddrToAmount"); + } + } + map[key ?? ""] = val ?? 0n; + } + internalBinaryWrite(message: SendManyRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ + for (let k of Object.keys(message.addrToAmount)) + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int64(message.addrToAmount[k]).join(); + /* int32 target_conf = 3; */ + if (message.targetConf !== 0) + writer.tag(3, WireType.Varint).int32(message.targetConf); + /* uint64 sat_per_vbyte = 4; */ + if (message.satPerVbyte !== 0n) + writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); + /* int64 sat_per_byte = 5 [deprecated = true]; */ + if (message.satPerByte !== 0n) + writer.tag(5, WireType.Varint).int64(message.satPerByte); + /* string label = 6; */ + if (message.label !== "") + writer.tag(6, WireType.LengthDelimited).string(message.label); + /* int32 min_confs = 7; */ + if (message.minConfs !== 0) + writer.tag(7, WireType.Varint).int32(message.minConfs); + /* bool spend_unconfirmed = 8; */ + if (message.spendUnconfirmed !== false) + writer.tag(8, WireType.Varint).bool(message.spendUnconfirmed); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendManyRequest + */ +export const SendManyRequest = new SendManyRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendManyResponse$Type extends MessageType { + constructor() { + super("lnrpc.SendManyResponse", [ + { no: 1, name: "txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SendManyResponse { + const message = { txid: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendManyResponse): SendManyResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string txid */ 1: + message.txid = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendManyResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string txid = 1; */ + if (message.txid !== "") + writer.tag(1, WireType.LengthDelimited).string(message.txid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendManyResponse + */ +export const SendManyResponse = new SendManyResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendCoinsRequest$Type extends MessageType { + constructor() { + super("lnrpc.SendCoinsRequest", [ + { no: 1, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "send_all", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 9, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SendCoinsRequest { + const message = { addr: "", amount: 0n, targetConf: 0, satPerVbyte: 0n, satPerByte: 0n, sendAll: false, label: "", minConfs: 0, spendUnconfirmed: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCoinsRequest): SendCoinsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string addr */ 1: + message.addr = reader.string(); + break; + case /* int64 amount */ 2: + message.amount = reader.int64().toBigInt(); + break; + case /* int32 target_conf */ 3: + message.targetConf = reader.int32(); + break; + case /* uint64 sat_per_vbyte */ 4: + message.satPerVbyte = reader.uint64().toBigInt(); + break; + case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: + message.satPerByte = reader.int64().toBigInt(); + break; + case /* bool send_all */ 6: + message.sendAll = reader.bool(); + break; + case /* string label */ 7: + message.label = reader.string(); + break; + case /* int32 min_confs */ 8: + message.minConfs = reader.int32(); + break; + case /* bool spend_unconfirmed */ 9: + message.spendUnconfirmed = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendCoinsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string addr = 1; */ + if (message.addr !== "") + writer.tag(1, WireType.LengthDelimited).string(message.addr); + /* int64 amount = 2; */ + if (message.amount !== 0n) + writer.tag(2, WireType.Varint).int64(message.amount); + /* int32 target_conf = 3; */ + if (message.targetConf !== 0) + writer.tag(3, WireType.Varint).int32(message.targetConf); + /* uint64 sat_per_vbyte = 4; */ + if (message.satPerVbyte !== 0n) + writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); + /* int64 sat_per_byte = 5 [deprecated = true]; */ + if (message.satPerByte !== 0n) + writer.tag(5, WireType.Varint).int64(message.satPerByte); + /* bool send_all = 6; */ + if (message.sendAll !== false) + writer.tag(6, WireType.Varint).bool(message.sendAll); + /* string label = 7; */ + if (message.label !== "") + writer.tag(7, WireType.LengthDelimited).string(message.label); + /* int32 min_confs = 8; */ + if (message.minConfs !== 0) + writer.tag(8, WireType.Varint).int32(message.minConfs); + /* bool spend_unconfirmed = 9; */ + if (message.spendUnconfirmed !== false) + writer.tag(9, WireType.Varint).bool(message.spendUnconfirmed); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendCoinsRequest + */ +export const SendCoinsRequest = new SendCoinsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendCoinsResponse$Type extends MessageType { + constructor() { + super("lnrpc.SendCoinsResponse", [ + { no: 1, name: "txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SendCoinsResponse { + const message = { txid: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCoinsResponse): SendCoinsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string txid */ 1: + message.txid = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendCoinsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string txid = 1; */ + if (message.txid !== "") + writer.tag(1, WireType.LengthDelimited).string(message.txid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendCoinsResponse + */ +export const SendCoinsResponse = new SendCoinsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListUnspentRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListUnspentRequest", [ + { no: 1, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "max_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ListUnspentRequest { + const message = { minConfs: 0, maxConfs: 0, account: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUnspentRequest): ListUnspentRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 min_confs */ 1: + message.minConfs = reader.int32(); + break; + case /* int32 max_confs */ 2: + message.maxConfs = reader.int32(); + break; + case /* string account */ 3: + message.account = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListUnspentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int32 min_confs = 1; */ + if (message.minConfs !== 0) + writer.tag(1, WireType.Varint).int32(message.minConfs); + /* int32 max_confs = 2; */ + if (message.maxConfs !== 0) + writer.tag(2, WireType.Varint).int32(message.maxConfs); + /* string account = 3; */ + if (message.account !== "") + writer.tag(3, WireType.LengthDelimited).string(message.account); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListUnspentRequest + */ +export const ListUnspentRequest = new ListUnspentRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListUnspentResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListUnspentResponse", [ + { no: 1, name: "utxos", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Utxo } + ]); + } + create(value?: PartialMessage): ListUnspentResponse { + const message = { utxos: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUnspentResponse): ListUnspentResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.Utxo utxos */ 1: + message.utxos.push(Utxo.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListUnspentResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.Utxo utxos = 1; */ + for (let i = 0; i < message.utxos.length; i++) + Utxo.internalBinaryWrite(message.utxos[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListUnspentResponse + */ +export const ListUnspentResponse = new ListUnspentResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewAddressRequest$Type extends MessageType { + constructor() { + super("lnrpc.NewAddressRequest", [ + { no: 1, name: "type", kind: "enum", T: () => ["lnrpc.AddressType", AddressType] }, + { no: 2, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): NewAddressRequest { + const message = { type: 0, account: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NewAddressRequest): NewAddressRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.AddressType type */ 1: + message.type = reader.int32(); + break; + case /* string account */ 2: + message.account = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NewAddressRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.AddressType type = 1; */ + if (message.type !== 0) + writer.tag(1, WireType.Varint).int32(message.type); + /* string account = 2; */ + if (message.account !== "") + writer.tag(2, WireType.LengthDelimited).string(message.account); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NewAddressRequest + */ +export const NewAddressRequest = new NewAddressRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NewAddressResponse$Type extends MessageType { + constructor() { + super("lnrpc.NewAddressResponse", [ + { no: 1, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): NewAddressResponse { + const message = { address: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NewAddressResponse): NewAddressResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string address */ 1: + message.address = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NewAddressResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string address = 1; */ + if (message.address !== "") + writer.tag(1, WireType.LengthDelimited).string(message.address); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NewAddressResponse + */ +export const NewAddressResponse = new NewAddressResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignMessageRequest$Type extends MessageType { + constructor() { + super("lnrpc.SignMessageRequest", [ + { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "single_hash", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SignMessageRequest { + const message = { msg: new Uint8Array(0), singleHash: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SignMessageRequest): SignMessageRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes msg */ 1: + message.msg = reader.bytes(); + break; + case /* bool single_hash */ 2: + message.singleHash = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SignMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes msg = 1; */ + if (message.msg.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.msg); + /* bool single_hash = 2; */ + if (message.singleHash !== false) + writer.tag(2, WireType.Varint).bool(message.singleHash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SignMessageRequest + */ +export const SignMessageRequest = new SignMessageRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SignMessageResponse$Type extends MessageType { + constructor() { + super("lnrpc.SignMessageResponse", [ + { no: 1, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SignMessageResponse { + const message = { signature: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SignMessageResponse): SignMessageResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string signature */ 1: + message.signature = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SignMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string signature = 1; */ + if (message.signature !== "") + writer.tag(1, WireType.LengthDelimited).string(message.signature); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SignMessageResponse + */ +export const SignMessageResponse = new SignMessageResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class VerifyMessageRequest$Type extends MessageType { + constructor() { + super("lnrpc.VerifyMessageRequest", [ + { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): VerifyMessageRequest { + const message = { msg: new Uint8Array(0), signature: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyMessageRequest): VerifyMessageRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes msg */ 1: + message.msg = reader.bytes(); + break; + case /* string signature */ 2: + message.signature = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: VerifyMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes msg = 1; */ + if (message.msg.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.msg); + /* string signature = 2; */ + if (message.signature !== "") + writer.tag(2, WireType.LengthDelimited).string(message.signature); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.VerifyMessageRequest + */ +export const VerifyMessageRequest = new VerifyMessageRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class VerifyMessageResponse$Type extends MessageType { + constructor() { + super("lnrpc.VerifyMessageResponse", [ + { no: 1, name: "valid", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): VerifyMessageResponse { + const message = { valid: false, pubkey: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyMessageResponse): VerifyMessageResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool valid */ 1: + message.valid = reader.bool(); + break; + case /* string pubkey */ 2: + message.pubkey = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: VerifyMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool valid = 1; */ + if (message.valid !== false) + writer.tag(1, WireType.Varint).bool(message.valid); + /* string pubkey = 2; */ + if (message.pubkey !== "") + writer.tag(2, WireType.LengthDelimited).string(message.pubkey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.VerifyMessageResponse + */ +export const VerifyMessageResponse = new VerifyMessageResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ConnectPeerRequest$Type extends MessageType { + constructor() { + super("lnrpc.ConnectPeerRequest", [ + { no: 1, name: "addr", kind: "message", T: () => LightningAddress }, + { no: 2, name: "perm", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "timeout", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): ConnectPeerRequest { + const message = { perm: false, timeout: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConnectPeerRequest): ConnectPeerRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.LightningAddress addr */ 1: + message.addr = LightningAddress.internalBinaryRead(reader, reader.uint32(), options, message.addr); + break; + case /* bool perm */ 2: + message.perm = reader.bool(); + break; + case /* uint64 timeout */ 3: + message.timeout = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ConnectPeerRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.LightningAddress addr = 1; */ + if (message.addr) + LightningAddress.internalBinaryWrite(message.addr, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bool perm = 2; */ + if (message.perm !== false) + writer.tag(2, WireType.Varint).bool(message.perm); + /* uint64 timeout = 3; */ + if (message.timeout !== 0n) + writer.tag(3, WireType.Varint).uint64(message.timeout); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ConnectPeerRequest + */ +export const ConnectPeerRequest = new ConnectPeerRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ConnectPeerResponse$Type extends MessageType { + constructor() { + super("lnrpc.ConnectPeerResponse", []); + } + create(value?: PartialMessage): ConnectPeerResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConnectPeerResponse): ConnectPeerResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: ConnectPeerResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ConnectPeerResponse + */ +export const ConnectPeerResponse = new ConnectPeerResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DisconnectPeerRequest$Type extends MessageType { + constructor() { + super("lnrpc.DisconnectPeerRequest", [ + { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DisconnectPeerRequest { + const message = { pubKey: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisconnectPeerRequest): DisconnectPeerRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pub_key */ 1: + message.pubKey = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DisconnectPeerRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string pub_key = 1; */ + if (message.pubKey !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pubKey); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DisconnectPeerRequest + */ +export const DisconnectPeerRequest = new DisconnectPeerRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DisconnectPeerResponse$Type extends MessageType { + constructor() { + super("lnrpc.DisconnectPeerResponse", []); + } + create(value?: PartialMessage): DisconnectPeerResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisconnectPeerResponse): DisconnectPeerResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: DisconnectPeerResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DisconnectPeerResponse + */ +export const DisconnectPeerResponse = new DisconnectPeerResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HTLC$Type extends MessageType { + constructor() { + super("lnrpc.HTLC", [ + { no: 1, name: "incoming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "hash_lock", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "expiration_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "forwarding_channel", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "forwarding_htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): HTLC { + const message = { incoming: false, amount: 0n, hashLock: new Uint8Array(0), expirationHeight: 0, htlcIndex: 0n, forwardingChannel: 0n, forwardingHtlcIndex: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HTLC): HTLC { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool incoming */ 1: + message.incoming = reader.bool(); + break; + case /* int64 amount */ 2: + message.amount = reader.int64().toBigInt(); + break; + case /* bytes hash_lock */ 3: + message.hashLock = reader.bytes(); + break; + case /* uint32 expiration_height */ 4: + message.expirationHeight = reader.uint32(); + break; + case /* uint64 htlc_index */ 5: + message.htlcIndex = reader.uint64().toBigInt(); + break; + case /* uint64 forwarding_channel */ 6: + message.forwardingChannel = reader.uint64().toBigInt(); + break; + case /* uint64 forwarding_htlc_index */ 7: + message.forwardingHtlcIndex = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: HTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool incoming = 1; */ + if (message.incoming !== false) + writer.tag(1, WireType.Varint).bool(message.incoming); + /* int64 amount = 2; */ + if (message.amount !== 0n) + writer.tag(2, WireType.Varint).int64(message.amount); + /* bytes hash_lock = 3; */ + if (message.hashLock.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.hashLock); + /* uint32 expiration_height = 4; */ + if (message.expirationHeight !== 0) + writer.tag(4, WireType.Varint).uint32(message.expirationHeight); + /* uint64 htlc_index = 5; */ + if (message.htlcIndex !== 0n) + writer.tag(5, WireType.Varint).uint64(message.htlcIndex); + /* uint64 forwarding_channel = 6; */ + if (message.forwardingChannel !== 0n) + writer.tag(6, WireType.Varint).uint64(message.forwardingChannel); + /* uint64 forwarding_htlc_index = 7; */ + if (message.forwardingHtlcIndex !== 0n) + writer.tag(7, WireType.Varint).uint64(message.forwardingHtlcIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.HTLC + */ +export const HTLC = new HTLC$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelConstraints$Type extends MessageType { + constructor() { + super("lnrpc.ChannelConstraints", [ + { no: 1, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "dust_limit_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "max_pending_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "max_accepted_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): ChannelConstraints { + const message = { csvDelay: 0, chanReserveSat: 0n, dustLimitSat: 0n, maxPendingAmtMsat: 0n, minHtlcMsat: 0n, maxAcceptedHtlcs: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelConstraints): ChannelConstraints { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 csv_delay */ 1: + message.csvDelay = reader.uint32(); + break; + case /* uint64 chan_reserve_sat */ 2: + message.chanReserveSat = reader.uint64().toBigInt(); + break; + case /* uint64 dust_limit_sat */ 3: + message.dustLimitSat = reader.uint64().toBigInt(); + break; + case /* uint64 max_pending_amt_msat */ 4: + message.maxPendingAmtMsat = reader.uint64().toBigInt(); + break; + case /* uint64 min_htlc_msat */ 5: + message.minHtlcMsat = reader.uint64().toBigInt(); + break; + case /* uint32 max_accepted_htlcs */ 6: + message.maxAcceptedHtlcs = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelConstraints, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint32 csv_delay = 1; */ + if (message.csvDelay !== 0) + writer.tag(1, WireType.Varint).uint32(message.csvDelay); + /* uint64 chan_reserve_sat = 2; */ + if (message.chanReserveSat !== 0n) + writer.tag(2, WireType.Varint).uint64(message.chanReserveSat); + /* uint64 dust_limit_sat = 3; */ + if (message.dustLimitSat !== 0n) + writer.tag(3, WireType.Varint).uint64(message.dustLimitSat); + /* uint64 max_pending_amt_msat = 4; */ + if (message.maxPendingAmtMsat !== 0n) + writer.tag(4, WireType.Varint).uint64(message.maxPendingAmtMsat); + /* uint64 min_htlc_msat = 5; */ + if (message.minHtlcMsat !== 0n) + writer.tag(5, WireType.Varint).uint64(message.minHtlcMsat); + /* uint32 max_accepted_htlcs = 6; */ + if (message.maxAcceptedHtlcs !== 0) + writer.tag(6, WireType.Varint).uint32(message.maxAcceptedHtlcs); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelConstraints + */ +export const ChannelConstraints = new ChannelConstraints$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Channel$Type extends MessageType { + constructor() { + super("lnrpc.Channel", [ + { no: 1, name: "active", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "remote_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "unsettled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "total_satoshis_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 13, name: "total_satoshis_received", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 14, name: "num_updates", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 15, name: "pending_htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLC }, + { no: 16, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 17, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 18, name: "initiator", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 19, name: "chan_status_flags", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: "local_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 21, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 22, name: "static_remote_key", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 26, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, + { no: 23, name: "lifetime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 24, name: "uptime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 25, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 27, name: "push_amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 28, name: "thaw_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 29, name: "local_constraints", kind: "message", T: () => ChannelConstraints }, + { no: 30, name: "remote_constraints", kind: "message", T: () => ChannelConstraints }, + { no: 31, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 32, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 33, name: "zero_conf_confirmed_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): Channel { + const message = { active: false, remotePubkey: "", channelPoint: "", chanId: "0", capacity: 0n, localBalance: 0n, remoteBalance: 0n, commitFee: 0n, commitWeight: 0n, feePerKw: 0n, unsettledBalance: 0n, totalSatoshisSent: 0n, totalSatoshisReceived: 0n, numUpdates: 0n, pendingHtlcs: [], csvDelay: 0, private: false, initiator: false, chanStatusFlags: "", localChanReserveSat: 0n, remoteChanReserveSat: 0n, staticRemoteKey: false, commitmentType: 0, lifetime: 0n, uptime: 0n, closeAddress: "", pushAmountSat: 0n, thawHeight: 0, aliasScids: [], zeroConf: false, zeroConfConfirmedScid: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Channel): Channel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool active */ 1: + message.active = reader.bool(); + break; + case /* string remote_pubkey */ 2: + message.remotePubkey = reader.string(); + break; + case /* string channel_point */ 3: + message.channelPoint = reader.string(); + break; + case /* uint64 chan_id = 4 [jstype = JS_STRING];*/ 4: + message.chanId = reader.uint64().toString(); + break; + case /* int64 capacity */ 5: + message.capacity = reader.int64().toBigInt(); + break; + case /* int64 local_balance */ 6: + message.localBalance = reader.int64().toBigInt(); + break; + case /* int64 remote_balance */ 7: + message.remoteBalance = reader.int64().toBigInt(); + break; + case /* int64 commit_fee */ 8: + message.commitFee = reader.int64().toBigInt(); + break; + case /* int64 commit_weight */ 9: + message.commitWeight = reader.int64().toBigInt(); + break; + case /* int64 fee_per_kw */ 10: + message.feePerKw = reader.int64().toBigInt(); + break; + case /* int64 unsettled_balance */ 11: + message.unsettledBalance = reader.int64().toBigInt(); + break; + case /* int64 total_satoshis_sent */ 12: + message.totalSatoshisSent = reader.int64().toBigInt(); + break; + case /* int64 total_satoshis_received */ 13: + message.totalSatoshisReceived = reader.int64().toBigInt(); + break; + case /* uint64 num_updates */ 14: + message.numUpdates = reader.uint64().toBigInt(); + break; + case /* repeated lnrpc.HTLC pending_htlcs */ 15: + message.pendingHtlcs.push(HTLC.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint32 csv_delay = 16 [deprecated = true];*/ 16: + message.csvDelay = reader.uint32(); + break; + case /* bool private */ 17: + message.private = reader.bool(); + break; + case /* bool initiator */ 18: + message.initiator = reader.bool(); + break; + case /* string chan_status_flags */ 19: + message.chanStatusFlags = reader.string(); + break; + case /* int64 local_chan_reserve_sat = 20 [deprecated = true];*/ 20: + message.localChanReserveSat = reader.int64().toBigInt(); + break; + case /* int64 remote_chan_reserve_sat = 21 [deprecated = true];*/ 21: + message.remoteChanReserveSat = reader.int64().toBigInt(); + break; + case /* bool static_remote_key = 22 [deprecated = true];*/ 22: + message.staticRemoteKey = reader.bool(); + break; + case /* lnrpc.CommitmentType commitment_type */ 26: + message.commitmentType = reader.int32(); + break; + case /* int64 lifetime */ 23: + message.lifetime = reader.int64().toBigInt(); + break; + case /* int64 uptime */ 24: + message.uptime = reader.int64().toBigInt(); + break; + case /* string close_address */ 25: + message.closeAddress = reader.string(); + break; + case /* uint64 push_amount_sat */ 27: + message.pushAmountSat = reader.uint64().toBigInt(); + break; + case /* uint32 thaw_height */ 28: + message.thawHeight = reader.uint32(); + break; + case /* lnrpc.ChannelConstraints local_constraints */ 29: + message.localConstraints = ChannelConstraints.internalBinaryRead(reader, reader.uint32(), options, message.localConstraints); + break; + case /* lnrpc.ChannelConstraints remote_constraints */ 30: + message.remoteConstraints = ChannelConstraints.internalBinaryRead(reader, reader.uint32(), options, message.remoteConstraints); + break; + case /* repeated uint64 alias_scids */ 31: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.aliasScids.push(reader.uint64().toBigInt()); + else + message.aliasScids.push(reader.uint64().toBigInt()); + break; + case /* bool zero_conf */ 32: + message.zeroConf = reader.bool(); + break; + case /* uint64 zero_conf_confirmed_scid */ 33: + message.zeroConfConfirmedScid = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Channel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool active = 1; */ + if (message.active !== false) + writer.tag(1, WireType.Varint).bool(message.active); + /* string remote_pubkey = 2; */ + if (message.remotePubkey !== "") + writer.tag(2, WireType.LengthDelimited).string(message.remotePubkey); + /* string channel_point = 3; */ + if (message.channelPoint !== "") + writer.tag(3, WireType.LengthDelimited).string(message.channelPoint); + /* uint64 chan_id = 4 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(4, WireType.Varint).uint64(message.chanId); + /* int64 capacity = 5; */ + if (message.capacity !== 0n) + writer.tag(5, WireType.Varint).int64(message.capacity); + /* int64 local_balance = 6; */ + if (message.localBalance !== 0n) + writer.tag(6, WireType.Varint).int64(message.localBalance); + /* int64 remote_balance = 7; */ + if (message.remoteBalance !== 0n) + writer.tag(7, WireType.Varint).int64(message.remoteBalance); + /* int64 commit_fee = 8; */ + if (message.commitFee !== 0n) + writer.tag(8, WireType.Varint).int64(message.commitFee); + /* int64 commit_weight = 9; */ + if (message.commitWeight !== 0n) + writer.tag(9, WireType.Varint).int64(message.commitWeight); + /* int64 fee_per_kw = 10; */ + if (message.feePerKw !== 0n) + writer.tag(10, WireType.Varint).int64(message.feePerKw); + /* int64 unsettled_balance = 11; */ + if (message.unsettledBalance !== 0n) + writer.tag(11, WireType.Varint).int64(message.unsettledBalance); + /* int64 total_satoshis_sent = 12; */ + if (message.totalSatoshisSent !== 0n) + writer.tag(12, WireType.Varint).int64(message.totalSatoshisSent); + /* int64 total_satoshis_received = 13; */ + if (message.totalSatoshisReceived !== 0n) + writer.tag(13, WireType.Varint).int64(message.totalSatoshisReceived); + /* uint64 num_updates = 14; */ + if (message.numUpdates !== 0n) + writer.tag(14, WireType.Varint).uint64(message.numUpdates); + /* repeated lnrpc.HTLC pending_htlcs = 15; */ + for (let i = 0; i < message.pendingHtlcs.length; i++) + HTLC.internalBinaryWrite(message.pendingHtlcs[i], writer.tag(15, WireType.LengthDelimited).fork(), options).join(); + /* uint32 csv_delay = 16 [deprecated = true]; */ + if (message.csvDelay !== 0) + writer.tag(16, WireType.Varint).uint32(message.csvDelay); + /* bool private = 17; */ + if (message.private !== false) + writer.tag(17, WireType.Varint).bool(message.private); + /* bool initiator = 18; */ + if (message.initiator !== false) + writer.tag(18, WireType.Varint).bool(message.initiator); + /* string chan_status_flags = 19; */ + if (message.chanStatusFlags !== "") + writer.tag(19, WireType.LengthDelimited).string(message.chanStatusFlags); + /* int64 local_chan_reserve_sat = 20 [deprecated = true]; */ + if (message.localChanReserveSat !== 0n) + writer.tag(20, WireType.Varint).int64(message.localChanReserveSat); + /* int64 remote_chan_reserve_sat = 21 [deprecated = true]; */ + if (message.remoteChanReserveSat !== 0n) + writer.tag(21, WireType.Varint).int64(message.remoteChanReserveSat); + /* bool static_remote_key = 22 [deprecated = true]; */ + if (message.staticRemoteKey !== false) + writer.tag(22, WireType.Varint).bool(message.staticRemoteKey); + /* lnrpc.CommitmentType commitment_type = 26; */ + if (message.commitmentType !== 0) + writer.tag(26, WireType.Varint).int32(message.commitmentType); + /* int64 lifetime = 23; */ + if (message.lifetime !== 0n) + writer.tag(23, WireType.Varint).int64(message.lifetime); + /* int64 uptime = 24; */ + if (message.uptime !== 0n) + writer.tag(24, WireType.Varint).int64(message.uptime); + /* string close_address = 25; */ + if (message.closeAddress !== "") + writer.tag(25, WireType.LengthDelimited).string(message.closeAddress); + /* uint64 push_amount_sat = 27; */ + if (message.pushAmountSat !== 0n) + writer.tag(27, WireType.Varint).uint64(message.pushAmountSat); + /* uint32 thaw_height = 28; */ + if (message.thawHeight !== 0) + writer.tag(28, WireType.Varint).uint32(message.thawHeight); + /* lnrpc.ChannelConstraints local_constraints = 29; */ + if (message.localConstraints) + ChannelConstraints.internalBinaryWrite(message.localConstraints, writer.tag(29, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelConstraints remote_constraints = 30; */ + if (message.remoteConstraints) + ChannelConstraints.internalBinaryWrite(message.remoteConstraints, writer.tag(30, WireType.LengthDelimited).fork(), options).join(); + /* repeated uint64 alias_scids = 31; */ + if (message.aliasScids.length) { + writer.tag(31, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.aliasScids.length; i++) + writer.uint64(message.aliasScids[i]); + writer.join(); + } + /* bool zero_conf = 32; */ + if (message.zeroConf !== false) + writer.tag(32, WireType.Varint).bool(message.zeroConf); + /* uint64 zero_conf_confirmed_scid = 33; */ + if (message.zeroConfConfirmedScid !== 0n) + writer.tag(33, WireType.Varint).uint64(message.zeroConfConfirmedScid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Channel + */ +export const Channel = new Channel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListChannelsRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListChannelsRequest", [ + { no: 1, name: "active_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "inactive_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "public_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "private_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): ListChannelsRequest { + const message = { activeOnly: false, inactiveOnly: false, publicOnly: false, privateOnly: false, peer: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChannelsRequest): ListChannelsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool active_only */ 1: + message.activeOnly = reader.bool(); + break; + case /* bool inactive_only */ 2: + message.inactiveOnly = reader.bool(); + break; + case /* bool public_only */ 3: + message.publicOnly = reader.bool(); + break; + case /* bool private_only */ 4: + message.privateOnly = reader.bool(); + break; + case /* bytes peer */ 5: + message.peer = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool active_only = 1; */ + if (message.activeOnly !== false) + writer.tag(1, WireType.Varint).bool(message.activeOnly); + /* bool inactive_only = 2; */ + if (message.inactiveOnly !== false) + writer.tag(2, WireType.Varint).bool(message.inactiveOnly); + /* bool public_only = 3; */ + if (message.publicOnly !== false) + writer.tag(3, WireType.Varint).bool(message.publicOnly); + /* bool private_only = 4; */ + if (message.privateOnly !== false) + writer.tag(4, WireType.Varint).bool(message.privateOnly); + /* bytes peer = 5; */ + if (message.peer.length) + writer.tag(5, WireType.LengthDelimited).bytes(message.peer); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListChannelsRequest + */ +export const ListChannelsRequest = new ListChannelsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListChannelsResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListChannelsResponse", [ + { no: 11, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Channel } + ]); + } + create(value?: PartialMessage): ListChannelsResponse { + const message = { channels: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChannelsResponse): ListChannelsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.Channel channels */ 11: + message.channels.push(Channel.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.Channel channels = 11; */ + for (let i = 0; i < message.channels.length; i++) + Channel.internalBinaryWrite(message.channels[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListChannelsResponse + */ +export const ListChannelsResponse = new ListChannelsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AliasMap$Type extends MessageType { + constructor() { + super("lnrpc.AliasMap", [ + { no: 1, name: "base_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "aliases", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): AliasMap { + const message = { baseScid: 0n, aliases: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AliasMap): AliasMap { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 base_scid */ 1: + message.baseScid = reader.uint64().toBigInt(); + break; + case /* repeated uint64 aliases */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.aliases.push(reader.uint64().toBigInt()); + else + message.aliases.push(reader.uint64().toBigInt()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AliasMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 base_scid = 1; */ + if (message.baseScid !== 0n) + writer.tag(1, WireType.Varint).uint64(message.baseScid); + /* repeated uint64 aliases = 2; */ + if (message.aliases.length) { + writer.tag(2, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.aliases.length; i++) + writer.uint64(message.aliases[i]); + writer.join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AliasMap + */ +export const AliasMap = new AliasMap$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListAliasesRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListAliasesRequest", []); + } + create(value?: PartialMessage): ListAliasesRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesRequest): ListAliasesRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: ListAliasesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListAliasesRequest + */ +export const ListAliasesRequest = new ListAliasesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListAliasesResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListAliasesResponse", [ + { no: 1, name: "alias_maps", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => AliasMap } + ]); + } + create(value?: PartialMessage): ListAliasesResponse { + const message = { aliasMaps: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesResponse): ListAliasesResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.AliasMap alias_maps */ 1: + message.aliasMaps.push(AliasMap.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListAliasesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.AliasMap alias_maps = 1; */ + for (let i = 0; i < message.aliasMaps.length; i++) + AliasMap.internalBinaryWrite(message.aliasMaps[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListAliasesResponse + */ +export const ListAliasesResponse = new ListAliasesResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelCloseSummary$Type extends MessageType { + constructor() { + super("lnrpc.ChannelCloseSummary", [ + { no: 1, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "chain_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "closing_tx_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "remote_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "close_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 8, name: "settled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "time_locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "close_type", kind: "enum", T: () => ["lnrpc.ChannelCloseSummary.ClosureType", ChannelCloseSummary_ClosureType] }, + { no: 11, name: "open_initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, + { no: 12, name: "close_initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, + { no: 13, name: "resolutions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Resolution }, + { no: 14, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 15, name: "zero_conf_confirmed_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): ChannelCloseSummary { + const message = { channelPoint: "", chanId: "0", chainHash: "", closingTxHash: "", remotePubkey: "", capacity: 0n, closeHeight: 0, settledBalance: 0n, timeLockedBalance: 0n, closeType: 0, openInitiator: 0, closeInitiator: 0, resolutions: [], aliasScids: [], zeroConfConfirmedScid: "0" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelCloseSummary): ChannelCloseSummary { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string channel_point */ 1: + message.channelPoint = reader.string(); + break; + case /* uint64 chan_id = 2 [jstype = JS_STRING];*/ 2: + message.chanId = reader.uint64().toString(); + break; + case /* string chain_hash */ 3: + message.chainHash = reader.string(); + break; + case /* string closing_tx_hash */ 4: + message.closingTxHash = reader.string(); + break; + case /* string remote_pubkey */ 5: + message.remotePubkey = reader.string(); + break; + case /* int64 capacity */ 6: + message.capacity = reader.int64().toBigInt(); + break; + case /* uint32 close_height */ 7: + message.closeHeight = reader.uint32(); + break; + case /* int64 settled_balance */ 8: + message.settledBalance = reader.int64().toBigInt(); + break; + case /* int64 time_locked_balance */ 9: + message.timeLockedBalance = reader.int64().toBigInt(); + break; + case /* lnrpc.ChannelCloseSummary.ClosureType close_type */ 10: + message.closeType = reader.int32(); + break; + case /* lnrpc.Initiator open_initiator */ 11: + message.openInitiator = reader.int32(); + break; + case /* lnrpc.Initiator close_initiator */ 12: + message.closeInitiator = reader.int32(); + break; + case /* repeated lnrpc.Resolution resolutions */ 13: + message.resolutions.push(Resolution.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated uint64 alias_scids */ 14: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.aliasScids.push(reader.uint64().toBigInt()); + else + message.aliasScids.push(reader.uint64().toBigInt()); + break; + case /* uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING];*/ 15: + message.zeroConfConfirmedScid = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelCloseSummary, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string channel_point = 1; */ + if (message.channelPoint !== "") + writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); + /* uint64 chan_id = 2 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(2, WireType.Varint).uint64(message.chanId); + /* string chain_hash = 3; */ + if (message.chainHash !== "") + writer.tag(3, WireType.LengthDelimited).string(message.chainHash); + /* string closing_tx_hash = 4; */ + if (message.closingTxHash !== "") + writer.tag(4, WireType.LengthDelimited).string(message.closingTxHash); + /* string remote_pubkey = 5; */ + if (message.remotePubkey !== "") + writer.tag(5, WireType.LengthDelimited).string(message.remotePubkey); + /* int64 capacity = 6; */ + if (message.capacity !== 0n) + writer.tag(6, WireType.Varint).int64(message.capacity); + /* uint32 close_height = 7; */ + if (message.closeHeight !== 0) + writer.tag(7, WireType.Varint).uint32(message.closeHeight); + /* int64 settled_balance = 8; */ + if (message.settledBalance !== 0n) + writer.tag(8, WireType.Varint).int64(message.settledBalance); + /* int64 time_locked_balance = 9; */ + if (message.timeLockedBalance !== 0n) + writer.tag(9, WireType.Varint).int64(message.timeLockedBalance); + /* lnrpc.ChannelCloseSummary.ClosureType close_type = 10; */ + if (message.closeType !== 0) + writer.tag(10, WireType.Varint).int32(message.closeType); + /* lnrpc.Initiator open_initiator = 11; */ + if (message.openInitiator !== 0) + writer.tag(11, WireType.Varint).int32(message.openInitiator); + /* lnrpc.Initiator close_initiator = 12; */ + if (message.closeInitiator !== 0) + writer.tag(12, WireType.Varint).int32(message.closeInitiator); + /* repeated lnrpc.Resolution resolutions = 13; */ + for (let i = 0; i < message.resolutions.length; i++) + Resolution.internalBinaryWrite(message.resolutions[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join(); + /* repeated uint64 alias_scids = 14; */ + if (message.aliasScids.length) { + writer.tag(14, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.aliasScids.length; i++) + writer.uint64(message.aliasScids[i]); + writer.join(); + } + /* uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; */ + if (message.zeroConfConfirmedScid !== "0") + writer.tag(15, WireType.Varint).uint64(message.zeroConfConfirmedScid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelCloseSummary + */ +export const ChannelCloseSummary = new ChannelCloseSummary$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Resolution$Type extends MessageType { + constructor() { + super("lnrpc.Resolution", [ + { no: 1, name: "resolution_type", kind: "enum", T: () => ["lnrpc.ResolutionType", ResolutionType] }, + { no: 2, name: "outcome", kind: "enum", T: () => ["lnrpc.ResolutionOutcome", ResolutionOutcome] }, + { no: 3, name: "outpoint", kind: "message", T: () => OutPoint }, + { no: 4, name: "amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "sweep_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Resolution { + const message = { resolutionType: 0, outcome: 0, amountSat: 0n, sweepTxid: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Resolution): Resolution { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ResolutionType resolution_type */ 1: + message.resolutionType = reader.int32(); + break; + case /* lnrpc.ResolutionOutcome outcome */ 2: + message.outcome = reader.int32(); + break; + case /* lnrpc.OutPoint outpoint */ 3: + message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); + break; + case /* uint64 amount_sat */ 4: + message.amountSat = reader.uint64().toBigInt(); + break; + case /* string sweep_txid */ 5: + message.sweepTxid = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Resolution, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ResolutionType resolution_type = 1; */ + if (message.resolutionType !== 0) + writer.tag(1, WireType.Varint).int32(message.resolutionType); + /* lnrpc.ResolutionOutcome outcome = 2; */ + if (message.outcome !== 0) + writer.tag(2, WireType.Varint).int32(message.outcome); + /* lnrpc.OutPoint outpoint = 3; */ + if (message.outpoint) + OutPoint.internalBinaryWrite(message.outpoint, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* uint64 amount_sat = 4; */ + if (message.amountSat !== 0n) + writer.tag(4, WireType.Varint).uint64(message.amountSat); + /* string sweep_txid = 5; */ + if (message.sweepTxid !== "") + writer.tag(5, WireType.LengthDelimited).string(message.sweepTxid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Resolution + */ +export const Resolution = new Resolution$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ClosedChannelsRequest$Type extends MessageType { + constructor() { + super("lnrpc.ClosedChannelsRequest", [ + { no: 1, name: "cooperative", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "local_force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "remote_force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "breach", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "funding_canceled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "abandoned", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ClosedChannelsRequest { + const message = { cooperative: false, localForce: false, remoteForce: false, breach: false, fundingCanceled: false, abandoned: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelsRequest): ClosedChannelsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool cooperative */ 1: + message.cooperative = reader.bool(); + break; + case /* bool local_force */ 2: + message.localForce = reader.bool(); + break; + case /* bool remote_force */ 3: + message.remoteForce = reader.bool(); + break; + case /* bool breach */ 4: + message.breach = reader.bool(); + break; + case /* bool funding_canceled */ 5: + message.fundingCanceled = reader.bool(); + break; + case /* bool abandoned */ 6: + message.abandoned = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ClosedChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool cooperative = 1; */ + if (message.cooperative !== false) + writer.tag(1, WireType.Varint).bool(message.cooperative); + /* bool local_force = 2; */ + if (message.localForce !== false) + writer.tag(2, WireType.Varint).bool(message.localForce); + /* bool remote_force = 3; */ + if (message.remoteForce !== false) + writer.tag(3, WireType.Varint).bool(message.remoteForce); + /* bool breach = 4; */ + if (message.breach !== false) + writer.tag(4, WireType.Varint).bool(message.breach); + /* bool funding_canceled = 5; */ + if (message.fundingCanceled !== false) + writer.tag(5, WireType.Varint).bool(message.fundingCanceled); + /* bool abandoned = 6; */ + if (message.abandoned !== false) + writer.tag(6, WireType.Varint).bool(message.abandoned); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ClosedChannelsRequest + */ +export const ClosedChannelsRequest = new ClosedChannelsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ClosedChannelsResponse$Type extends MessageType { + constructor() { + super("lnrpc.ClosedChannelsResponse", [ + { no: 1, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelCloseSummary } + ]); + } + create(value?: PartialMessage): ClosedChannelsResponse { + const message = { channels: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelsResponse): ClosedChannelsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.ChannelCloseSummary channels */ 1: + message.channels.push(ChannelCloseSummary.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ClosedChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.ChannelCloseSummary channels = 1; */ + for (let i = 0; i < message.channels.length; i++) + ChannelCloseSummary.internalBinaryWrite(message.channels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ClosedChannelsResponse + */ +export const ClosedChannelsResponse = new ClosedChannelsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Peer$Type extends MessageType { + constructor() { + super("lnrpc.Peer", [ + { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "bytes_sent", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "bytes_recv", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "sat_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "sat_recv", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "inbound", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "ping_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "sync_type", kind: "enum", T: () => ["lnrpc.Peer.SyncType", Peer_SyncType] }, + { no: 11, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, + { no: 12, name: "errors", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => TimestampedError }, + { no: 13, name: "flap_count", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 14, name: "last_flap_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 15, name: "last_ping_payload", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): Peer { + const message = { pubKey: "", address: "", bytesSent: 0n, bytesRecv: 0n, satSent: 0n, satRecv: 0n, inbound: false, pingTime: 0n, syncType: 0, features: {}, errors: [], flapCount: 0, lastFlapNs: 0n, lastPingPayload: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Peer): Peer { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pub_key */ 1: + message.pubKey = reader.string(); + break; + case /* string address */ 3: + message.address = reader.string(); + break; + case /* uint64 bytes_sent */ 4: + message.bytesSent = reader.uint64().toBigInt(); + break; + case /* uint64 bytes_recv */ 5: + message.bytesRecv = reader.uint64().toBigInt(); + break; + case /* int64 sat_sent */ 6: + message.satSent = reader.int64().toBigInt(); + break; + case /* int64 sat_recv */ 7: + message.satRecv = reader.int64().toBigInt(); + break; + case /* bool inbound */ 8: + message.inbound = reader.bool(); + break; + case /* int64 ping_time */ 9: + message.pingTime = reader.int64().toBigInt(); + break; + case /* lnrpc.Peer.SyncType sync_type */ 10: + message.syncType = reader.int32(); + break; + case /* map features */ 11: + this.binaryReadMap11(message.features, reader, options); + break; + case /* repeated lnrpc.TimestampedError errors */ 12: + message.errors.push(TimestampedError.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* int32 flap_count */ 13: + message.flapCount = reader.int32(); + break; + case /* int64 last_flap_ns */ 14: + message.lastFlapNs = reader.int64().toBigInt(); + break; + case /* bytes last_ping_payload */ 15: + message.lastPingPayload = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap11(map: Peer["features"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Peer["features"] | undefined, val: Peer["features"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint32(); + break; + case 2: + val = Feature.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.Peer.features"); + } + } + map[key ?? 0] = val ?? Feature.create(); + } + internalBinaryWrite(message: Peer, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string pub_key = 1; */ + if (message.pubKey !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pubKey); + /* string address = 3; */ + if (message.address !== "") + writer.tag(3, WireType.LengthDelimited).string(message.address); + /* uint64 bytes_sent = 4; */ + if (message.bytesSent !== 0n) + writer.tag(4, WireType.Varint).uint64(message.bytesSent); + /* uint64 bytes_recv = 5; */ + if (message.bytesRecv !== 0n) + writer.tag(5, WireType.Varint).uint64(message.bytesRecv); + /* int64 sat_sent = 6; */ + if (message.satSent !== 0n) + writer.tag(6, WireType.Varint).int64(message.satSent); + /* int64 sat_recv = 7; */ + if (message.satRecv !== 0n) + writer.tag(7, WireType.Varint).int64(message.satRecv); + /* bool inbound = 8; */ + if (message.inbound !== false) + writer.tag(8, WireType.Varint).bool(message.inbound); + /* int64 ping_time = 9; */ + if (message.pingTime !== 0n) + writer.tag(9, WireType.Varint).int64(message.pingTime); + /* lnrpc.Peer.SyncType sync_type = 10; */ + if (message.syncType !== 0) + writer.tag(10, WireType.Varint).int32(message.syncType); + /* map features = 11; */ + for (let k of Object.keys(message.features)) { + writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); + writer.tag(2, WireType.LengthDelimited).fork(); + Feature.internalBinaryWrite(message.features[k as any], writer, options); + writer.join().join(); + } + /* repeated lnrpc.TimestampedError errors = 12; */ + for (let i = 0; i < message.errors.length; i++) + TimestampedError.internalBinaryWrite(message.errors[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + /* int32 flap_count = 13; */ + if (message.flapCount !== 0) + writer.tag(13, WireType.Varint).int32(message.flapCount); + /* int64 last_flap_ns = 14; */ + if (message.lastFlapNs !== 0n) + writer.tag(14, WireType.Varint).int64(message.lastFlapNs); + /* bytes last_ping_payload = 15; */ + if (message.lastPingPayload.length) + writer.tag(15, WireType.LengthDelimited).bytes(message.lastPingPayload); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Peer + */ +export const Peer = new Peer$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TimestampedError$Type extends MessageType { + constructor() { + super("lnrpc.TimestampedError", [ + { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): TimestampedError { + const message = { timestamp: 0n, error: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TimestampedError): TimestampedError { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 timestamp */ 1: + message.timestamp = reader.uint64().toBigInt(); + break; + case /* string error */ 2: + message.error = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TimestampedError, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 timestamp = 1; */ + if (message.timestamp !== 0n) + writer.tag(1, WireType.Varint).uint64(message.timestamp); + /* string error = 2; */ + if (message.error !== "") + writer.tag(2, WireType.LengthDelimited).string(message.error); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.TimestampedError + */ +export const TimestampedError = new TimestampedError$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListPeersRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListPeersRequest", [ + { no: 1, name: "latest_error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ListPeersRequest { + const message = { latestError: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPeersRequest): ListPeersRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool latest_error */ 1: + message.latestError = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListPeersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool latest_error = 1; */ + if (message.latestError !== false) + writer.tag(1, WireType.Varint).bool(message.latestError); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListPeersRequest + */ +export const ListPeersRequest = new ListPeersRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListPeersResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListPeersResponse", [ + { no: 1, name: "peers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Peer } + ]); + } + create(value?: PartialMessage): ListPeersResponse { + const message = { peers: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPeersResponse): ListPeersResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.Peer peers */ 1: + message.peers.push(Peer.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListPeersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.Peer peers = 1; */ + for (let i = 0; i < message.peers.length; i++) + Peer.internalBinaryWrite(message.peers[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListPeersResponse + */ +export const ListPeersResponse = new ListPeersResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PeerEventSubscription$Type extends MessageType { + constructor() { + super("lnrpc.PeerEventSubscription", []); + } + create(value?: PartialMessage): PeerEventSubscription { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeerEventSubscription): PeerEventSubscription { + return target ?? this.create(); + } + internalBinaryWrite(message: PeerEventSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PeerEventSubscription + */ +export const PeerEventSubscription = new PeerEventSubscription$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PeerEvent$Type extends MessageType { + constructor() { + super("lnrpc.PeerEvent", [ + { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "type", kind: "enum", T: () => ["lnrpc.PeerEvent.EventType", PeerEvent_EventType] } + ]); + } + create(value?: PartialMessage): PeerEvent { + const message = { pubKey: "", type: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeerEvent): PeerEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pub_key */ 1: + message.pubKey = reader.string(); + break; + case /* lnrpc.PeerEvent.EventType type */ 2: + message.type = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PeerEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string pub_key = 1; */ + if (message.pubKey !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pubKey); + /* lnrpc.PeerEvent.EventType type = 2; */ + if (message.type !== 0) + writer.tag(2, WireType.Varint).int32(message.type); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PeerEvent + */ +export const PeerEvent = new PeerEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetInfoRequest$Type extends MessageType { + constructor() { + super("lnrpc.GetInfoRequest", []); + } + create(value?: PartialMessage): GetInfoRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetInfoRequest): GetInfoRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: GetInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.GetInfoRequest + */ +export const GetInfoRequest = new GetInfoRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetInfoResponse$Type extends MessageType { + constructor() { + super("lnrpc.GetInfoResponse", [ + { no: 14, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: "commit_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 1, name: "identity_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 17, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "num_pending_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "num_active_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 15, name: "num_inactive_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "num_peers", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 6, name: "block_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 8, name: "block_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: "best_header_timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "synced_to_chain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 18, name: "synced_to_graph", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 10, name: "testnet", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: "chains", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Chain }, + { no: 12, name: "uris", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 19, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, + { no: 21, name: "require_htlc_interceptor", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): GetInfoResponse { + const message = { version: "", commitHash: "", identityPubkey: "", alias: "", color: "", numPendingChannels: 0, numActiveChannels: 0, numInactiveChannels: 0, numPeers: 0, blockHeight: 0, blockHash: "", bestHeaderTimestamp: 0n, syncedToChain: false, syncedToGraph: false, testnet: false, chains: [], uris: [], features: {}, requireHtlcInterceptor: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetInfoResponse): GetInfoResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string version */ 14: + message.version = reader.string(); + break; + case /* string commit_hash */ 20: + message.commitHash = reader.string(); + break; + case /* string identity_pubkey */ 1: + message.identityPubkey = reader.string(); + break; + case /* string alias */ 2: + message.alias = reader.string(); + break; + case /* string color */ 17: + message.color = reader.string(); + break; + case /* uint32 num_pending_channels */ 3: + message.numPendingChannels = reader.uint32(); + break; + case /* uint32 num_active_channels */ 4: + message.numActiveChannels = reader.uint32(); + break; + case /* uint32 num_inactive_channels */ 15: + message.numInactiveChannels = reader.uint32(); + break; + case /* uint32 num_peers */ 5: + message.numPeers = reader.uint32(); + break; + case /* uint32 block_height */ 6: + message.blockHeight = reader.uint32(); + break; + case /* string block_hash */ 8: + message.blockHash = reader.string(); + break; + case /* int64 best_header_timestamp */ 13: + message.bestHeaderTimestamp = reader.int64().toBigInt(); + break; + case /* bool synced_to_chain */ 9: + message.syncedToChain = reader.bool(); + break; + case /* bool synced_to_graph */ 18: + message.syncedToGraph = reader.bool(); + break; + case /* bool testnet = 10 [deprecated = true];*/ 10: + message.testnet = reader.bool(); + break; + case /* repeated lnrpc.Chain chains */ 16: + message.chains.push(Chain.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated string uris */ 12: + message.uris.push(reader.string()); + break; + case /* map features */ 19: + this.binaryReadMap19(message.features, reader, options); + break; + case /* bool require_htlc_interceptor */ 21: + message.requireHtlcInterceptor = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap19(map: GetInfoResponse["features"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof GetInfoResponse["features"] | undefined, val: GetInfoResponse["features"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint32(); + break; + case 2: + val = Feature.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.GetInfoResponse.features"); + } + } + map[key ?? 0] = val ?? Feature.create(); + } + internalBinaryWrite(message: GetInfoResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string version = 14; */ + if (message.version !== "") + writer.tag(14, WireType.LengthDelimited).string(message.version); + /* string commit_hash = 20; */ + if (message.commitHash !== "") + writer.tag(20, WireType.LengthDelimited).string(message.commitHash); + /* string identity_pubkey = 1; */ + if (message.identityPubkey !== "") + writer.tag(1, WireType.LengthDelimited).string(message.identityPubkey); + /* string alias = 2; */ + if (message.alias !== "") + writer.tag(2, WireType.LengthDelimited).string(message.alias); + /* string color = 17; */ + if (message.color !== "") + writer.tag(17, WireType.LengthDelimited).string(message.color); + /* uint32 num_pending_channels = 3; */ + if (message.numPendingChannels !== 0) + writer.tag(3, WireType.Varint).uint32(message.numPendingChannels); + /* uint32 num_active_channels = 4; */ + if (message.numActiveChannels !== 0) + writer.tag(4, WireType.Varint).uint32(message.numActiveChannels); + /* uint32 num_inactive_channels = 15; */ + if (message.numInactiveChannels !== 0) + writer.tag(15, WireType.Varint).uint32(message.numInactiveChannels); + /* uint32 num_peers = 5; */ + if (message.numPeers !== 0) + writer.tag(5, WireType.Varint).uint32(message.numPeers); + /* uint32 block_height = 6; */ + if (message.blockHeight !== 0) + writer.tag(6, WireType.Varint).uint32(message.blockHeight); + /* string block_hash = 8; */ + if (message.blockHash !== "") + writer.tag(8, WireType.LengthDelimited).string(message.blockHash); + /* int64 best_header_timestamp = 13; */ + if (message.bestHeaderTimestamp !== 0n) + writer.tag(13, WireType.Varint).int64(message.bestHeaderTimestamp); + /* bool synced_to_chain = 9; */ + if (message.syncedToChain !== false) + writer.tag(9, WireType.Varint).bool(message.syncedToChain); + /* bool synced_to_graph = 18; */ + if (message.syncedToGraph !== false) + writer.tag(18, WireType.Varint).bool(message.syncedToGraph); + /* bool testnet = 10 [deprecated = true]; */ + if (message.testnet !== false) + writer.tag(10, WireType.Varint).bool(message.testnet); + /* repeated lnrpc.Chain chains = 16; */ + for (let i = 0; i < message.chains.length; i++) + Chain.internalBinaryWrite(message.chains[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join(); + /* repeated string uris = 12; */ + for (let i = 0; i < message.uris.length; i++) + writer.tag(12, WireType.LengthDelimited).string(message.uris[i]); + /* map features = 19; */ + for (let k of Object.keys(message.features)) { + writer.tag(19, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); + writer.tag(2, WireType.LengthDelimited).fork(); + Feature.internalBinaryWrite(message.features[k as any], writer, options); + writer.join().join(); + } + /* bool require_htlc_interceptor = 21; */ + if (message.requireHtlcInterceptor !== false) + writer.tag(21, WireType.Varint).bool(message.requireHtlcInterceptor); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.GetInfoResponse + */ +export const GetInfoResponse = new GetInfoResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetRecoveryInfoRequest$Type extends MessageType { + constructor() { + super("lnrpc.GetRecoveryInfoRequest", []); + } + create(value?: PartialMessage): GetRecoveryInfoRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRecoveryInfoRequest): GetRecoveryInfoRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: GetRecoveryInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoRequest + */ +export const GetRecoveryInfoRequest = new GetRecoveryInfoRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetRecoveryInfoResponse$Type extends MessageType { + constructor() { + super("lnrpc.GetRecoveryInfoResponse", [ + { no: 1, name: "recovery_mode", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "recovery_finished", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "progress", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): GetRecoveryInfoResponse { + const message = { recoveryMode: false, recoveryFinished: false, progress: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRecoveryInfoResponse): GetRecoveryInfoResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool recovery_mode */ 1: + message.recoveryMode = reader.bool(); + break; + case /* bool recovery_finished */ 2: + message.recoveryFinished = reader.bool(); + break; + case /* double progress */ 3: + message.progress = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetRecoveryInfoResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool recovery_mode = 1; */ + if (message.recoveryMode !== false) + writer.tag(1, WireType.Varint).bool(message.recoveryMode); + /* bool recovery_finished = 2; */ + if (message.recoveryFinished !== false) + writer.tag(2, WireType.Varint).bool(message.recoveryFinished); + /* double progress = 3; */ + if (message.progress !== 0) + writer.tag(3, WireType.Bit64).double(message.progress); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoResponse + */ +export const GetRecoveryInfoResponse = new GetRecoveryInfoResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Chain$Type extends MessageType { + constructor() { + super("lnrpc.Chain", [ + { no: 1, name: "chain", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "network", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Chain { + const message = { chain: "", network: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Chain): Chain { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string chain */ 1: + message.chain = reader.string(); + break; + case /* string network */ 2: + message.network = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Chain, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string chain = 1; */ + if (message.chain !== "") + writer.tag(1, WireType.LengthDelimited).string(message.chain); + /* string network = 2; */ + if (message.network !== "") + writer.tag(2, WireType.LengthDelimited).string(message.network); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Chain + */ +export const Chain = new Chain$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ConfirmationUpdate$Type extends MessageType { + constructor() { + super("lnrpc.ConfirmationUpdate", [ + { no: 1, name: "block_sha", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "block_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "num_confs_left", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): ConfirmationUpdate { + const message = { blockSha: new Uint8Array(0), blockHeight: 0, numConfsLeft: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfirmationUpdate): ConfirmationUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes block_sha */ 1: + message.blockSha = reader.bytes(); + break; + case /* int32 block_height */ 2: + message.blockHeight = reader.int32(); + break; + case /* uint32 num_confs_left */ 3: + message.numConfsLeft = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ConfirmationUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes block_sha = 1; */ + if (message.blockSha.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.blockSha); + /* int32 block_height = 2; */ + if (message.blockHeight !== 0) + writer.tag(2, WireType.Varint).int32(message.blockHeight); + /* uint32 num_confs_left = 3; */ + if (message.numConfsLeft !== 0) + writer.tag(3, WireType.Varint).uint32(message.numConfsLeft); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ConfirmationUpdate + */ +export const ConfirmationUpdate = new ConfirmationUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelOpenUpdate$Type extends MessageType { + constructor() { + super("lnrpc.ChannelOpenUpdate", [ + { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint } + ]); + } + create(value?: PartialMessage): ChannelOpenUpdate { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelOpenUpdate): ChannelOpenUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelPoint channel_point */ 1: + message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelOpenUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelPoint channel_point = 1; */ + if (message.channelPoint) + ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelOpenUpdate + */ +export const ChannelOpenUpdate = new ChannelOpenUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelCloseUpdate$Type extends MessageType { + constructor() { + super("lnrpc.ChannelCloseUpdate", [ + { no: 1, name: "closing_txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ChannelCloseUpdate { + const message = { closingTxid: new Uint8Array(0), success: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelCloseUpdate): ChannelCloseUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes closing_txid */ 1: + message.closingTxid = reader.bytes(); + break; + case /* bool success */ 2: + message.success = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelCloseUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes closing_txid = 1; */ + if (message.closingTxid.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.closingTxid); + /* bool success = 2; */ + if (message.success !== false) + writer.tag(2, WireType.Varint).bool(message.success); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelCloseUpdate + */ +export const ChannelCloseUpdate = new ChannelCloseUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CloseChannelRequest$Type extends MessageType { + constructor() { + super("lnrpc.CloseChannelRequest", [ + { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint }, + { no: 2, name: "force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "delivery_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "max_fee_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): CloseChannelRequest { + const message = { force: false, targetConf: 0, satPerByte: 0n, deliveryAddress: "", satPerVbyte: 0n, maxFeePerVbyte: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CloseChannelRequest): CloseChannelRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelPoint channel_point */ 1: + message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); + break; + case /* bool force */ 2: + message.force = reader.bool(); + break; + case /* int32 target_conf */ 3: + message.targetConf = reader.int32(); + break; + case /* int64 sat_per_byte = 4 [deprecated = true];*/ 4: + message.satPerByte = reader.int64().toBigInt(); + break; + case /* string delivery_address */ 5: + message.deliveryAddress = reader.string(); + break; + case /* uint64 sat_per_vbyte */ 6: + message.satPerVbyte = reader.uint64().toBigInt(); + break; + case /* uint64 max_fee_per_vbyte */ 7: + message.maxFeePerVbyte = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CloseChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelPoint channel_point = 1; */ + if (message.channelPoint) + ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bool force = 2; */ + if (message.force !== false) + writer.tag(2, WireType.Varint).bool(message.force); + /* int32 target_conf = 3; */ + if (message.targetConf !== 0) + writer.tag(3, WireType.Varint).int32(message.targetConf); + /* int64 sat_per_byte = 4 [deprecated = true]; */ + if (message.satPerByte !== 0n) + writer.tag(4, WireType.Varint).int64(message.satPerByte); + /* string delivery_address = 5; */ + if (message.deliveryAddress !== "") + writer.tag(5, WireType.LengthDelimited).string(message.deliveryAddress); + /* uint64 sat_per_vbyte = 6; */ + if (message.satPerVbyte !== 0n) + writer.tag(6, WireType.Varint).uint64(message.satPerVbyte); + /* uint64 max_fee_per_vbyte = 7; */ + if (message.maxFeePerVbyte !== 0n) + writer.tag(7, WireType.Varint).uint64(message.maxFeePerVbyte); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CloseChannelRequest + */ +export const CloseChannelRequest = new CloseChannelRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CloseStatusUpdate$Type extends MessageType { + constructor() { + super("lnrpc.CloseStatusUpdate", [ + { no: 1, name: "close_pending", kind: "message", oneof: "update", T: () => PendingUpdate }, + { no: 3, name: "chan_close", kind: "message", oneof: "update", T: () => ChannelCloseUpdate } + ]); + } + create(value?: PartialMessage): CloseStatusUpdate { + const message = { update: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CloseStatusUpdate): CloseStatusUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.PendingUpdate close_pending */ 1: + message.update = { + oneofKind: "closePending", + closePending: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).closePending) + }; + break; + case /* lnrpc.ChannelCloseUpdate chan_close */ 3: + message.update = { + oneofKind: "chanClose", + chanClose: ChannelCloseUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).chanClose) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CloseStatusUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.PendingUpdate close_pending = 1; */ + if (message.update.oneofKind === "closePending") + PendingUpdate.internalBinaryWrite(message.update.closePending, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelCloseUpdate chan_close = 3; */ + if (message.update.oneofKind === "chanClose") + ChannelCloseUpdate.internalBinaryWrite(message.update.chanClose, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CloseStatusUpdate + */ +export const CloseStatusUpdate = new CloseStatusUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingUpdate$Type extends MessageType { + constructor() { + super("lnrpc.PendingUpdate", [ + { no: 1, name: "txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): PendingUpdate { + const message = { txid: new Uint8Array(0), outputIndex: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingUpdate): PendingUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes txid */ 1: + message.txid = reader.bytes(); + break; + case /* uint32 output_index */ 2: + message.outputIndex = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes txid = 1; */ + if (message.txid.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.txid); + /* uint32 output_index = 2; */ + if (message.outputIndex !== 0) + writer.tag(2, WireType.Varint).uint32(message.outputIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingUpdate + */ +export const PendingUpdate = new PendingUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ReadyForPsbtFunding$Type extends MessageType { + constructor() { + super("lnrpc.ReadyForPsbtFunding", [ + { no: 1, name: "funding_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): ReadyForPsbtFunding { + const message = { fundingAddress: "", fundingAmount: 0n, psbt: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReadyForPsbtFunding): ReadyForPsbtFunding { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string funding_address */ 1: + message.fundingAddress = reader.string(); + break; + case /* int64 funding_amount */ 2: + message.fundingAmount = reader.int64().toBigInt(); + break; + case /* bytes psbt */ 3: + message.psbt = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ReadyForPsbtFunding, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string funding_address = 1; */ + if (message.fundingAddress !== "") + writer.tag(1, WireType.LengthDelimited).string(message.fundingAddress); + /* int64 funding_amount = 2; */ + if (message.fundingAmount !== 0n) + writer.tag(2, WireType.Varint).int64(message.fundingAmount); + /* bytes psbt = 3; */ + if (message.psbt.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.psbt); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ReadyForPsbtFunding + */ +export const ReadyForPsbtFunding = new ReadyForPsbtFunding$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BatchOpenChannelRequest$Type extends MessageType { + constructor() { + super("lnrpc.BatchOpenChannelRequest", [ + { no: 1, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => BatchOpenChannel }, + { no: 2, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): BatchOpenChannelRequest { + const message = { channels: [], targetConf: 0, satPerVbyte: 0n, minConfs: 0, spendUnconfirmed: false, label: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelRequest): BatchOpenChannelRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.BatchOpenChannel channels */ 1: + message.channels.push(BatchOpenChannel.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* int32 target_conf */ 2: + message.targetConf = reader.int32(); + break; + case /* int64 sat_per_vbyte */ 3: + message.satPerVbyte = reader.int64().toBigInt(); + break; + case /* int32 min_confs */ 4: + message.minConfs = reader.int32(); + break; + case /* bool spend_unconfirmed */ 5: + message.spendUnconfirmed = reader.bool(); + break; + case /* string label */ 6: + message.label = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BatchOpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.BatchOpenChannel channels = 1; */ + for (let i = 0; i < message.channels.length; i++) + BatchOpenChannel.internalBinaryWrite(message.channels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* int32 target_conf = 2; */ + if (message.targetConf !== 0) + writer.tag(2, WireType.Varint).int32(message.targetConf); + /* int64 sat_per_vbyte = 3; */ + if (message.satPerVbyte !== 0n) + writer.tag(3, WireType.Varint).int64(message.satPerVbyte); + /* int32 min_confs = 4; */ + if (message.minConfs !== 0) + writer.tag(4, WireType.Varint).int32(message.minConfs); + /* bool spend_unconfirmed = 5; */ + if (message.spendUnconfirmed !== false) + writer.tag(5, WireType.Varint).bool(message.spendUnconfirmed); + /* string label = 6; */ + if (message.label !== "") + writer.tag(6, WireType.LengthDelimited).string(message.label); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BatchOpenChannelRequest + */ +export const BatchOpenChannelRequest = new BatchOpenChannelRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BatchOpenChannel$Type extends MessageType { + constructor() { + super("lnrpc.BatchOpenChannel", [ + { no: 1, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "local_funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "remote_csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 7, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] } + ]); + } + create(value?: PartialMessage): BatchOpenChannel { + const message = { nodePubkey: new Uint8Array(0), localFundingAmount: 0n, pushSat: 0n, private: false, minHtlcMsat: 0n, remoteCsvDelay: 0, closeAddress: "", pendingChanId: new Uint8Array(0), commitmentType: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannel): BatchOpenChannel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes node_pubkey */ 1: + message.nodePubkey = reader.bytes(); + break; + case /* int64 local_funding_amount */ 2: + message.localFundingAmount = reader.int64().toBigInt(); + break; + case /* int64 push_sat */ 3: + message.pushSat = reader.int64().toBigInt(); + break; + case /* bool private */ 4: + message.private = reader.bool(); + break; + case /* int64 min_htlc_msat */ 5: + message.minHtlcMsat = reader.int64().toBigInt(); + break; + case /* uint32 remote_csv_delay */ 6: + message.remoteCsvDelay = reader.uint32(); + break; + case /* string close_address */ 7: + message.closeAddress = reader.string(); + break; + case /* bytes pending_chan_id */ 8: + message.pendingChanId = reader.bytes(); + break; + case /* lnrpc.CommitmentType commitment_type */ 9: + message.commitmentType = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BatchOpenChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes node_pubkey = 1; */ + if (message.nodePubkey.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); + /* int64 local_funding_amount = 2; */ + if (message.localFundingAmount !== 0n) + writer.tag(2, WireType.Varint).int64(message.localFundingAmount); + /* int64 push_sat = 3; */ + if (message.pushSat !== 0n) + writer.tag(3, WireType.Varint).int64(message.pushSat); + /* bool private = 4; */ + if (message.private !== false) + writer.tag(4, WireType.Varint).bool(message.private); + /* int64 min_htlc_msat = 5; */ + if (message.minHtlcMsat !== 0n) + writer.tag(5, WireType.Varint).int64(message.minHtlcMsat); + /* uint32 remote_csv_delay = 6; */ + if (message.remoteCsvDelay !== 0) + writer.tag(6, WireType.Varint).uint32(message.remoteCsvDelay); + /* string close_address = 7; */ + if (message.closeAddress !== "") + writer.tag(7, WireType.LengthDelimited).string(message.closeAddress); + /* bytes pending_chan_id = 8; */ + if (message.pendingChanId.length) + writer.tag(8, WireType.LengthDelimited).bytes(message.pendingChanId); + /* lnrpc.CommitmentType commitment_type = 9; */ + if (message.commitmentType !== 0) + writer.tag(9, WireType.Varint).int32(message.commitmentType); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BatchOpenChannel + */ +export const BatchOpenChannel = new BatchOpenChannel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BatchOpenChannelResponse$Type extends MessageType { + constructor() { + super("lnrpc.BatchOpenChannelResponse", [ + { no: 1, name: "pending_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingUpdate } + ]); + } + create(value?: PartialMessage): BatchOpenChannelResponse { + const message = { pendingChannels: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelResponse): BatchOpenChannelResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.PendingUpdate pending_channels */ 1: + message.pendingChannels.push(PendingUpdate.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BatchOpenChannelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.PendingUpdate pending_channels = 1; */ + for (let i = 0; i < message.pendingChannels.length; i++) + PendingUpdate.internalBinaryWrite(message.pendingChannels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BatchOpenChannelResponse + */ +export const BatchOpenChannelResponse = new BatchOpenChannelResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OpenChannelRequest$Type extends MessageType { + constructor() { + super("lnrpc.OpenChannelRequest", [ + { no: 1, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "node_pubkey_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "local_funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "remote_csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 11, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 12, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 13, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: "funding_shim", kind: "message", T: () => FundingShim }, + { no: 15, name: "remote_max_value_in_flight_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 16, name: "remote_max_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 17, name: "max_local_csv", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 18, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, + { no: 19, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 20, name: "scid_alias", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 21, name: "base_fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 22, name: "fee_rate", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 23, name: "use_base_fee", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 24, name: "use_fee_rate", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 25, name: "remote_chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): OpenChannelRequest { + const message = { satPerVbyte: 0n, nodePubkey: new Uint8Array(0), nodePubkeyString: "", localFundingAmount: 0n, pushSat: 0n, targetConf: 0, satPerByte: 0n, private: false, minHtlcMsat: 0n, remoteCsvDelay: 0, minConfs: 0, spendUnconfirmed: false, closeAddress: "", remoteMaxValueInFlightMsat: 0n, remoteMaxHtlcs: 0, maxLocalCsv: 0, commitmentType: 0, zeroConf: false, scidAlias: false, baseFee: 0n, feeRate: 0n, useBaseFee: false, useFeeRate: false, remoteChanReserveSat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenChannelRequest): OpenChannelRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 sat_per_vbyte */ 1: + message.satPerVbyte = reader.uint64().toBigInt(); + break; + case /* bytes node_pubkey */ 2: + message.nodePubkey = reader.bytes(); + break; + case /* string node_pubkey_string = 3 [deprecated = true];*/ 3: + message.nodePubkeyString = reader.string(); + break; + case /* int64 local_funding_amount */ 4: + message.localFundingAmount = reader.int64().toBigInt(); + break; + case /* int64 push_sat */ 5: + message.pushSat = reader.int64().toBigInt(); + break; + case /* int32 target_conf */ 6: + message.targetConf = reader.int32(); + break; + case /* int64 sat_per_byte = 7 [deprecated = true];*/ 7: + message.satPerByte = reader.int64().toBigInt(); + break; + case /* bool private */ 8: + message.private = reader.bool(); + break; + case /* int64 min_htlc_msat */ 9: + message.minHtlcMsat = reader.int64().toBigInt(); + break; + case /* uint32 remote_csv_delay */ 10: + message.remoteCsvDelay = reader.uint32(); + break; + case /* int32 min_confs */ 11: + message.minConfs = reader.int32(); + break; + case /* bool spend_unconfirmed */ 12: + message.spendUnconfirmed = reader.bool(); + break; + case /* string close_address */ 13: + message.closeAddress = reader.string(); + break; + case /* lnrpc.FundingShim funding_shim */ 14: + message.fundingShim = FundingShim.internalBinaryRead(reader, reader.uint32(), options, message.fundingShim); + break; + case /* uint64 remote_max_value_in_flight_msat */ 15: + message.remoteMaxValueInFlightMsat = reader.uint64().toBigInt(); + break; + case /* uint32 remote_max_htlcs */ 16: + message.remoteMaxHtlcs = reader.uint32(); + break; + case /* uint32 max_local_csv */ 17: + message.maxLocalCsv = reader.uint32(); + break; + case /* lnrpc.CommitmentType commitment_type */ 18: + message.commitmentType = reader.int32(); + break; + case /* bool zero_conf */ 19: + message.zeroConf = reader.bool(); + break; + case /* bool scid_alias */ 20: + message.scidAlias = reader.bool(); + break; + case /* uint64 base_fee */ 21: + message.baseFee = reader.uint64().toBigInt(); + break; + case /* uint64 fee_rate */ 22: + message.feeRate = reader.uint64().toBigInt(); + break; + case /* bool use_base_fee */ 23: + message.useBaseFee = reader.bool(); + break; + case /* bool use_fee_rate */ 24: + message.useFeeRate = reader.bool(); + break; + case /* uint64 remote_chan_reserve_sat */ 25: + message.remoteChanReserveSat = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: OpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 sat_per_vbyte = 1; */ + if (message.satPerVbyte !== 0n) + writer.tag(1, WireType.Varint).uint64(message.satPerVbyte); + /* bytes node_pubkey = 2; */ + if (message.nodePubkey.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.nodePubkey); + /* string node_pubkey_string = 3 [deprecated = true]; */ + if (message.nodePubkeyString !== "") + writer.tag(3, WireType.LengthDelimited).string(message.nodePubkeyString); + /* int64 local_funding_amount = 4; */ + if (message.localFundingAmount !== 0n) + writer.tag(4, WireType.Varint).int64(message.localFundingAmount); + /* int64 push_sat = 5; */ + if (message.pushSat !== 0n) + writer.tag(5, WireType.Varint).int64(message.pushSat); + /* int32 target_conf = 6; */ + if (message.targetConf !== 0) + writer.tag(6, WireType.Varint).int32(message.targetConf); + /* int64 sat_per_byte = 7 [deprecated = true]; */ + if (message.satPerByte !== 0n) + writer.tag(7, WireType.Varint).int64(message.satPerByte); + /* bool private = 8; */ + if (message.private !== false) + writer.tag(8, WireType.Varint).bool(message.private); + /* int64 min_htlc_msat = 9; */ + if (message.minHtlcMsat !== 0n) + writer.tag(9, WireType.Varint).int64(message.minHtlcMsat); + /* uint32 remote_csv_delay = 10; */ + if (message.remoteCsvDelay !== 0) + writer.tag(10, WireType.Varint).uint32(message.remoteCsvDelay); + /* int32 min_confs = 11; */ + if (message.minConfs !== 0) + writer.tag(11, WireType.Varint).int32(message.minConfs); + /* bool spend_unconfirmed = 12; */ + if (message.spendUnconfirmed !== false) + writer.tag(12, WireType.Varint).bool(message.spendUnconfirmed); + /* string close_address = 13; */ + if (message.closeAddress !== "") + writer.tag(13, WireType.LengthDelimited).string(message.closeAddress); + /* lnrpc.FundingShim funding_shim = 14; */ + if (message.fundingShim) + FundingShim.internalBinaryWrite(message.fundingShim, writer.tag(14, WireType.LengthDelimited).fork(), options).join(); + /* uint64 remote_max_value_in_flight_msat = 15; */ + if (message.remoteMaxValueInFlightMsat !== 0n) + writer.tag(15, WireType.Varint).uint64(message.remoteMaxValueInFlightMsat); + /* uint32 remote_max_htlcs = 16; */ + if (message.remoteMaxHtlcs !== 0) + writer.tag(16, WireType.Varint).uint32(message.remoteMaxHtlcs); + /* uint32 max_local_csv = 17; */ + if (message.maxLocalCsv !== 0) + writer.tag(17, WireType.Varint).uint32(message.maxLocalCsv); + /* lnrpc.CommitmentType commitment_type = 18; */ + if (message.commitmentType !== 0) + writer.tag(18, WireType.Varint).int32(message.commitmentType); + /* bool zero_conf = 19; */ + if (message.zeroConf !== false) + writer.tag(19, WireType.Varint).bool(message.zeroConf); + /* bool scid_alias = 20; */ + if (message.scidAlias !== false) + writer.tag(20, WireType.Varint).bool(message.scidAlias); + /* uint64 base_fee = 21; */ + if (message.baseFee !== 0n) + writer.tag(21, WireType.Varint).uint64(message.baseFee); + /* uint64 fee_rate = 22; */ + if (message.feeRate !== 0n) + writer.tag(22, WireType.Varint).uint64(message.feeRate); + /* bool use_base_fee = 23; */ + if (message.useBaseFee !== false) + writer.tag(23, WireType.Varint).bool(message.useBaseFee); + /* bool use_fee_rate = 24; */ + if (message.useFeeRate !== false) + writer.tag(24, WireType.Varint).bool(message.useFeeRate); + /* uint64 remote_chan_reserve_sat = 25; */ + if (message.remoteChanReserveSat !== 0n) + writer.tag(25, WireType.Varint).uint64(message.remoteChanReserveSat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.OpenChannelRequest + */ +export const OpenChannelRequest = new OpenChannelRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OpenStatusUpdate$Type extends MessageType { + constructor() { + super("lnrpc.OpenStatusUpdate", [ + { no: 1, name: "chan_pending", kind: "message", oneof: "update", T: () => PendingUpdate }, + { no: 3, name: "chan_open", kind: "message", oneof: "update", T: () => ChannelOpenUpdate }, + { no: 5, name: "psbt_fund", kind: "message", oneof: "update", T: () => ReadyForPsbtFunding }, + { no: 4, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): OpenStatusUpdate { + const message = { update: { oneofKind: undefined }, pendingChanId: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenStatusUpdate): OpenStatusUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.PendingUpdate chan_pending */ 1: + message.update = { + oneofKind: "chanPending", + chanPending: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).chanPending) + }; + break; + case /* lnrpc.ChannelOpenUpdate chan_open */ 3: + message.update = { + oneofKind: "chanOpen", + chanOpen: ChannelOpenUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).chanOpen) + }; + break; + case /* lnrpc.ReadyForPsbtFunding psbt_fund */ 5: + message.update = { + oneofKind: "psbtFund", + psbtFund: ReadyForPsbtFunding.internalBinaryRead(reader, reader.uint32(), options, (message.update as any).psbtFund) + }; + break; + case /* bytes pending_chan_id */ 4: + message.pendingChanId = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: OpenStatusUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.PendingUpdate chan_pending = 1; */ + if (message.update.oneofKind === "chanPending") + PendingUpdate.internalBinaryWrite(message.update.chanPending, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelOpenUpdate chan_open = 3; */ + if (message.update.oneofKind === "chanOpen") + ChannelOpenUpdate.internalBinaryWrite(message.update.chanOpen, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ReadyForPsbtFunding psbt_fund = 5; */ + if (message.update.oneofKind === "psbtFund") + ReadyForPsbtFunding.internalBinaryWrite(message.update.psbtFund, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* bytes pending_chan_id = 4; */ + if (message.pendingChanId.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.pendingChanId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.OpenStatusUpdate + */ +export const OpenStatusUpdate = new OpenStatusUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class KeyLocator$Type extends MessageType { + constructor() { + super("lnrpc.KeyLocator", [ + { no: 1, name: "key_family", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "key_index", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): KeyLocator { + const message = { keyFamily: 0, keyIndex: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: KeyLocator): KeyLocator { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 key_family */ 1: + message.keyFamily = reader.int32(); + break; + case /* int32 key_index */ 2: + message.keyIndex = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: KeyLocator, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int32 key_family = 1; */ + if (message.keyFamily !== 0) + writer.tag(1, WireType.Varint).int32(message.keyFamily); + /* int32 key_index = 2; */ + if (message.keyIndex !== 0) + writer.tag(2, WireType.Varint).int32(message.keyIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.KeyLocator + */ +export const KeyLocator = new KeyLocator$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class KeyDescriptor$Type extends MessageType { + constructor() { + super("lnrpc.KeyDescriptor", [ + { no: 1, name: "raw_key_bytes", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "key_loc", kind: "message", T: () => KeyLocator } + ]); + } + create(value?: PartialMessage): KeyDescriptor { + const message = { rawKeyBytes: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: KeyDescriptor): KeyDescriptor { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes raw_key_bytes */ 1: + message.rawKeyBytes = reader.bytes(); + break; + case /* lnrpc.KeyLocator key_loc */ 2: + message.keyLoc = KeyLocator.internalBinaryRead(reader, reader.uint32(), options, message.keyLoc); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: KeyDescriptor, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes raw_key_bytes = 1; */ + if (message.rawKeyBytes.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.rawKeyBytes); + /* lnrpc.KeyLocator key_loc = 2; */ + if (message.keyLoc) + KeyLocator.internalBinaryWrite(message.keyLoc, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.KeyDescriptor + */ +export const KeyDescriptor = new KeyDescriptor$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChanPointShim$Type extends MessageType { + constructor() { + super("lnrpc.ChanPointShim", [ + { no: 1, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "chan_point", kind: "message", T: () => ChannelPoint }, + { no: 3, name: "local_key", kind: "message", T: () => KeyDescriptor }, + { no: 4, name: "remote_key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 6, name: "thaw_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): ChanPointShim { + const message = { amt: 0n, remoteKey: new Uint8Array(0), pendingChanId: new Uint8Array(0), thawHeight: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanPointShim): ChanPointShim { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 amt */ 1: + message.amt = reader.int64().toBigInt(); + break; + case /* lnrpc.ChannelPoint chan_point */ 2: + message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); + break; + case /* lnrpc.KeyDescriptor local_key */ 3: + message.localKey = KeyDescriptor.internalBinaryRead(reader, reader.uint32(), options, message.localKey); + break; + case /* bytes remote_key */ 4: + message.remoteKey = reader.bytes(); + break; + case /* bytes pending_chan_id */ 5: + message.pendingChanId = reader.bytes(); + break; + case /* uint32 thaw_height */ 6: + message.thawHeight = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChanPointShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 amt = 1; */ + if (message.amt !== 0n) + writer.tag(1, WireType.Varint).int64(message.amt); + /* lnrpc.ChannelPoint chan_point = 2; */ + if (message.chanPoint) + ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.KeyDescriptor local_key = 3; */ + if (message.localKey) + KeyDescriptor.internalBinaryWrite(message.localKey, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* bytes remote_key = 4; */ + if (message.remoteKey.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.remoteKey); + /* bytes pending_chan_id = 5; */ + if (message.pendingChanId.length) + writer.tag(5, WireType.LengthDelimited).bytes(message.pendingChanId); + /* uint32 thaw_height = 6; */ + if (message.thawHeight !== 0) + writer.tag(6, WireType.Varint).uint32(message.thawHeight); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChanPointShim + */ +export const ChanPointShim = new ChanPointShim$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PsbtShim$Type extends MessageType { + constructor() { + super("lnrpc.PsbtShim", [ + { no: 1, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "base_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "no_publish", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): PsbtShim { + const message = { pendingChanId: new Uint8Array(0), basePsbt: new Uint8Array(0), noPublish: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PsbtShim): PsbtShim { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes pending_chan_id */ 1: + message.pendingChanId = reader.bytes(); + break; + case /* bytes base_psbt */ 2: + message.basePsbt = reader.bytes(); + break; + case /* bool no_publish */ 3: + message.noPublish = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PsbtShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes pending_chan_id = 1; */ + if (message.pendingChanId.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.pendingChanId); + /* bytes base_psbt = 2; */ + if (message.basePsbt.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.basePsbt); + /* bool no_publish = 3; */ + if (message.noPublish !== false) + writer.tag(3, WireType.Varint).bool(message.noPublish); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PsbtShim + */ +export const PsbtShim = new PsbtShim$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FundingShim$Type extends MessageType { + constructor() { + super("lnrpc.FundingShim", [ + { no: 1, name: "chan_point_shim", kind: "message", oneof: "shim", T: () => ChanPointShim }, + { no: 2, name: "psbt_shim", kind: "message", oneof: "shim", T: () => PsbtShim } + ]); + } + create(value?: PartialMessage): FundingShim { + const message = { shim: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingShim): FundingShim { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChanPointShim chan_point_shim */ 1: + message.shim = { + oneofKind: "chanPointShim", + chanPointShim: ChanPointShim.internalBinaryRead(reader, reader.uint32(), options, (message.shim as any).chanPointShim) + }; + break; + case /* lnrpc.PsbtShim psbt_shim */ 2: + message.shim = { + oneofKind: "psbtShim", + psbtShim: PsbtShim.internalBinaryRead(reader, reader.uint32(), options, (message.shim as any).psbtShim) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FundingShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChanPointShim chan_point_shim = 1; */ + if (message.shim.oneofKind === "chanPointShim") + ChanPointShim.internalBinaryWrite(message.shim.chanPointShim, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.PsbtShim psbt_shim = 2; */ + if (message.shim.oneofKind === "psbtShim") + PsbtShim.internalBinaryWrite(message.shim.psbtShim, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FundingShim + */ +export const FundingShim = new FundingShim$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FundingShimCancel$Type extends MessageType { + constructor() { + super("lnrpc.FundingShimCancel", [ + { no: 1, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): FundingShimCancel { + const message = { pendingChanId: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingShimCancel): FundingShimCancel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes pending_chan_id */ 1: + message.pendingChanId = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FundingShimCancel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes pending_chan_id = 1; */ + if (message.pendingChanId.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.pendingChanId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FundingShimCancel + */ +export const FundingShimCancel = new FundingShimCancel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FundingPsbtVerify$Type extends MessageType { + constructor() { + super("lnrpc.FundingPsbtVerify", [ + { no: 1, name: "funded_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "skip_finalize", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): FundingPsbtVerify { + const message = { fundedPsbt: new Uint8Array(0), pendingChanId: new Uint8Array(0), skipFinalize: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingPsbtVerify): FundingPsbtVerify { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes funded_psbt */ 1: + message.fundedPsbt = reader.bytes(); + break; + case /* bytes pending_chan_id */ 2: + message.pendingChanId = reader.bytes(); + break; + case /* bool skip_finalize */ 3: + message.skipFinalize = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FundingPsbtVerify, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes funded_psbt = 1; */ + if (message.fundedPsbt.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.fundedPsbt); + /* bytes pending_chan_id = 2; */ + if (message.pendingChanId.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); + /* bool skip_finalize = 3; */ + if (message.skipFinalize !== false) + writer.tag(3, WireType.Varint).bool(message.skipFinalize); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FundingPsbtVerify + */ +export const FundingPsbtVerify = new FundingPsbtVerify$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FundingPsbtFinalize$Type extends MessageType { + constructor() { + super("lnrpc.FundingPsbtFinalize", [ + { no: 1, name: "signed_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "final_raw_tx", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): FundingPsbtFinalize { + const message = { signedPsbt: new Uint8Array(0), pendingChanId: new Uint8Array(0), finalRawTx: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingPsbtFinalize): FundingPsbtFinalize { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes signed_psbt */ 1: + message.signedPsbt = reader.bytes(); + break; + case /* bytes pending_chan_id */ 2: + message.pendingChanId = reader.bytes(); + break; + case /* bytes final_raw_tx */ 3: + message.finalRawTx = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FundingPsbtFinalize, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes signed_psbt = 1; */ + if (message.signedPsbt.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.signedPsbt); + /* bytes pending_chan_id = 2; */ + if (message.pendingChanId.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); + /* bytes final_raw_tx = 3; */ + if (message.finalRawTx.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.finalRawTx); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FundingPsbtFinalize + */ +export const FundingPsbtFinalize = new FundingPsbtFinalize$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FundingTransitionMsg$Type extends MessageType { + constructor() { + super("lnrpc.FundingTransitionMsg", [ + { no: 1, name: "shim_register", kind: "message", oneof: "trigger", T: () => FundingShim }, + { no: 2, name: "shim_cancel", kind: "message", oneof: "trigger", T: () => FundingShimCancel }, + { no: 3, name: "psbt_verify", kind: "message", oneof: "trigger", T: () => FundingPsbtVerify }, + { no: 4, name: "psbt_finalize", kind: "message", oneof: "trigger", T: () => FundingPsbtFinalize } + ]); + } + create(value?: PartialMessage): FundingTransitionMsg { + const message = { trigger: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingTransitionMsg): FundingTransitionMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.FundingShim shim_register */ 1: + message.trigger = { + oneofKind: "shimRegister", + shimRegister: FundingShim.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).shimRegister) + }; + break; + case /* lnrpc.FundingShimCancel shim_cancel */ 2: + message.trigger = { + oneofKind: "shimCancel", + shimCancel: FundingShimCancel.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).shimCancel) + }; + break; + case /* lnrpc.FundingPsbtVerify psbt_verify */ 3: + message.trigger = { + oneofKind: "psbtVerify", + psbtVerify: FundingPsbtVerify.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).psbtVerify) + }; + break; + case /* lnrpc.FundingPsbtFinalize psbt_finalize */ 4: + message.trigger = { + oneofKind: "psbtFinalize", + psbtFinalize: FundingPsbtFinalize.internalBinaryRead(reader, reader.uint32(), options, (message.trigger as any).psbtFinalize) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FundingTransitionMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.FundingShim shim_register = 1; */ + if (message.trigger.oneofKind === "shimRegister") + FundingShim.internalBinaryWrite(message.trigger.shimRegister, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.FundingShimCancel shim_cancel = 2; */ + if (message.trigger.oneofKind === "shimCancel") + FundingShimCancel.internalBinaryWrite(message.trigger.shimCancel, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.FundingPsbtVerify psbt_verify = 3; */ + if (message.trigger.oneofKind === "psbtVerify") + FundingPsbtVerify.internalBinaryWrite(message.trigger.psbtVerify, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.FundingPsbtFinalize psbt_finalize = 4; */ + if (message.trigger.oneofKind === "psbtFinalize") + FundingPsbtFinalize.internalBinaryWrite(message.trigger.psbtFinalize, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FundingTransitionMsg + */ +export const FundingTransitionMsg = new FundingTransitionMsg$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FundingStateStepResp$Type extends MessageType { + constructor() { + super("lnrpc.FundingStateStepResp", []); + } + create(value?: PartialMessage): FundingStateStepResp { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingStateStepResp): FundingStateStepResp { + return target ?? this.create(); + } + internalBinaryWrite(message: FundingStateStepResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FundingStateStepResp + */ +export const FundingStateStepResp = new FundingStateStepResp$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingHTLC$Type extends MessageType { + constructor() { + super("lnrpc.PendingHTLC", [ + { no: 1, name: "incoming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "outpoint", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "maturity_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "blocks_til_maturity", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: "stage", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): PendingHTLC { + const message = { incoming: false, amount: 0n, outpoint: "", maturityHeight: 0, blocksTilMaturity: 0, stage: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingHTLC): PendingHTLC { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool incoming */ 1: + message.incoming = reader.bool(); + break; + case /* int64 amount */ 2: + message.amount = reader.int64().toBigInt(); + break; + case /* string outpoint */ 3: + message.outpoint = reader.string(); + break; + case /* uint32 maturity_height */ 4: + message.maturityHeight = reader.uint32(); + break; + case /* int32 blocks_til_maturity */ 5: + message.blocksTilMaturity = reader.int32(); + break; + case /* uint32 stage */ 6: + message.stage = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingHTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool incoming = 1; */ + if (message.incoming !== false) + writer.tag(1, WireType.Varint).bool(message.incoming); + /* int64 amount = 2; */ + if (message.amount !== 0n) + writer.tag(2, WireType.Varint).int64(message.amount); + /* string outpoint = 3; */ + if (message.outpoint !== "") + writer.tag(3, WireType.LengthDelimited).string(message.outpoint); + /* uint32 maturity_height = 4; */ + if (message.maturityHeight !== 0) + writer.tag(4, WireType.Varint).uint32(message.maturityHeight); + /* int32 blocks_til_maturity = 5; */ + if (message.blocksTilMaturity !== 0) + writer.tag(5, WireType.Varint).int32(message.blocksTilMaturity); + /* uint32 stage = 6; */ + if (message.stage !== 0) + writer.tag(6, WireType.Varint).uint32(message.stage); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingHTLC + */ +export const PendingHTLC = new PendingHTLC$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsRequest$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsRequest", []); + } + create(value?: PartialMessage): PendingChannelsRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsRequest): PendingChannelsRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: PendingChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsRequest + */ +export const PendingChannelsRequest = new PendingChannelsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsResponse$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsResponse", [ + { no: 1, name: "total_limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "pending_open_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_PendingOpenChannel }, + { no: 3, name: "pending_closing_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_ClosedChannel }, + { no: 4, name: "pending_force_closing_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_ForceClosedChannel }, + { no: 5, name: "waiting_close_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_WaitingCloseChannel } + ]); + } + create(value?: PartialMessage): PendingChannelsResponse { + const message = { totalLimboBalance: 0n, pendingOpenChannels: [], pendingClosingChannels: [], pendingForceClosingChannels: [], waitingCloseChannels: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse): PendingChannelsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 total_limbo_balance */ 1: + message.totalLimboBalance = reader.int64().toBigInt(); + break; + case /* repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels */ 2: + message.pendingOpenChannels.push(PendingChannelsResponse_PendingOpenChannel.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true];*/ 3: + message.pendingClosingChannels.push(PendingChannelsResponse_ClosedChannel.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels */ 4: + message.pendingForceClosingChannels.push(PendingChannelsResponse_ForceClosedChannel.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels */ 5: + message.waitingCloseChannels.push(PendingChannelsResponse_WaitingCloseChannel.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 total_limbo_balance = 1; */ + if (message.totalLimboBalance !== 0n) + writer.tag(1, WireType.Varint).int64(message.totalLimboBalance); + /* repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels = 2; */ + for (let i = 0; i < message.pendingOpenChannels.length; i++) + PendingChannelsResponse_PendingOpenChannel.internalBinaryWrite(message.pendingOpenChannels[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true]; */ + for (let i = 0; i < message.pendingClosingChannels.length; i++) + PendingChannelsResponse_ClosedChannel.internalBinaryWrite(message.pendingClosingChannels[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels = 4; */ + for (let i = 0; i < message.pendingForceClosingChannels.length; i++) + PendingChannelsResponse_ForceClosedChannel.internalBinaryWrite(message.pendingForceClosingChannels[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels = 5; */ + for (let i = 0; i < message.waitingCloseChannels.length; i++) + PendingChannelsResponse_WaitingCloseChannel.internalBinaryWrite(message.waitingCloseChannels[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse + */ +export const PendingChannelsResponse = new PendingChannelsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsResponse_PendingChannel$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsResponse.PendingChannel", [ + { no: 1, name: "remote_node_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "local_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, + { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, + { no: 10, name: "num_forwarding_packages", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "chan_status_flags", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): PendingChannelsResponse_PendingChannel { + const message = { remoteNodePub: "", channelPoint: "", capacity: 0n, localBalance: 0n, remoteBalance: 0n, localChanReserveSat: 0n, remoteChanReserveSat: 0n, initiator: 0, commitmentType: 0, numForwardingPackages: 0n, chanStatusFlags: "", private: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_PendingChannel): PendingChannelsResponse_PendingChannel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string remote_node_pub */ 1: + message.remoteNodePub = reader.string(); + break; + case /* string channel_point */ 2: + message.channelPoint = reader.string(); + break; + case /* int64 capacity */ 3: + message.capacity = reader.int64().toBigInt(); + break; + case /* int64 local_balance */ 4: + message.localBalance = reader.int64().toBigInt(); + break; + case /* int64 remote_balance */ 5: + message.remoteBalance = reader.int64().toBigInt(); + break; + case /* int64 local_chan_reserve_sat */ 6: + message.localChanReserveSat = reader.int64().toBigInt(); + break; + case /* int64 remote_chan_reserve_sat */ 7: + message.remoteChanReserveSat = reader.int64().toBigInt(); + break; + case /* lnrpc.Initiator initiator */ 8: + message.initiator = reader.int32(); + break; + case /* lnrpc.CommitmentType commitment_type */ 9: + message.commitmentType = reader.int32(); + break; + case /* int64 num_forwarding_packages */ 10: + message.numForwardingPackages = reader.int64().toBigInt(); + break; + case /* string chan_status_flags */ 11: + message.chanStatusFlags = reader.string(); + break; + case /* bool private */ 12: + message.private = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingChannelsResponse_PendingChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string remote_node_pub = 1; */ + if (message.remoteNodePub !== "") + writer.tag(1, WireType.LengthDelimited).string(message.remoteNodePub); + /* string channel_point = 2; */ + if (message.channelPoint !== "") + writer.tag(2, WireType.LengthDelimited).string(message.channelPoint); + /* int64 capacity = 3; */ + if (message.capacity !== 0n) + writer.tag(3, WireType.Varint).int64(message.capacity); + /* int64 local_balance = 4; */ + if (message.localBalance !== 0n) + writer.tag(4, WireType.Varint).int64(message.localBalance); + /* int64 remote_balance = 5; */ + if (message.remoteBalance !== 0n) + writer.tag(5, WireType.Varint).int64(message.remoteBalance); + /* int64 local_chan_reserve_sat = 6; */ + if (message.localChanReserveSat !== 0n) + writer.tag(6, WireType.Varint).int64(message.localChanReserveSat); + /* int64 remote_chan_reserve_sat = 7; */ + if (message.remoteChanReserveSat !== 0n) + writer.tag(7, WireType.Varint).int64(message.remoteChanReserveSat); + /* lnrpc.Initiator initiator = 8; */ + if (message.initiator !== 0) + writer.tag(8, WireType.Varint).int32(message.initiator); + /* lnrpc.CommitmentType commitment_type = 9; */ + if (message.commitmentType !== 0) + writer.tag(9, WireType.Varint).int32(message.commitmentType); + /* int64 num_forwarding_packages = 10; */ + if (message.numForwardingPackages !== 0n) + writer.tag(10, WireType.Varint).int64(message.numForwardingPackages); + /* string chan_status_flags = 11; */ + if (message.chanStatusFlags !== "") + writer.tag(11, WireType.LengthDelimited).string(message.chanStatusFlags); + /* bool private = 12; */ + if (message.private !== false) + writer.tag(12, WireType.Varint).bool(message.private); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingChannel + */ +export const PendingChannelsResponse_PendingChannel = new PendingChannelsResponse_PendingChannel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsResponse_PendingOpenChannel$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsResponse.PendingOpenChannel", [ + { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, + { no: 4, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): PendingChannelsResponse_PendingOpenChannel { + const message = { commitFee: 0n, commitWeight: 0n, feePerKw: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_PendingOpenChannel): PendingChannelsResponse_PendingOpenChannel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: + message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); + break; + case /* int64 commit_fee */ 4: + message.commitFee = reader.int64().toBigInt(); + break; + case /* int64 commit_weight */ 5: + message.commitWeight = reader.int64().toBigInt(); + break; + case /* int64 fee_per_kw */ 6: + message.feePerKw = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingChannelsResponse_PendingOpenChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ + if (message.channel) + PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* int64 commit_fee = 4; */ + if (message.commitFee !== 0n) + writer.tag(4, WireType.Varint).int64(message.commitFee); + /* int64 commit_weight = 5; */ + if (message.commitWeight !== 0n) + writer.tag(5, WireType.Varint).int64(message.commitWeight); + /* int64 fee_per_kw = 6; */ + if (message.feePerKw !== 0n) + writer.tag(6, WireType.Varint).int64(message.feePerKw); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingOpenChannel + */ +export const PendingChannelsResponse_PendingOpenChannel = new PendingChannelsResponse_PendingOpenChannel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsResponse_WaitingCloseChannel$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsResponse.WaitingCloseChannel", [ + { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, + { no: 2, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "commitments", kind: "message", T: () => PendingChannelsResponse_Commitments }, + { no: 4, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): PendingChannelsResponse_WaitingCloseChannel { + const message = { limboBalance: 0n, closingTxid: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_WaitingCloseChannel): PendingChannelsResponse_WaitingCloseChannel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: + message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); + break; + case /* int64 limbo_balance */ 2: + message.limboBalance = reader.int64().toBigInt(); + break; + case /* lnrpc.PendingChannelsResponse.Commitments commitments */ 3: + message.commitments = PendingChannelsResponse_Commitments.internalBinaryRead(reader, reader.uint32(), options, message.commitments); + break; + case /* string closing_txid */ 4: + message.closingTxid = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingChannelsResponse_WaitingCloseChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ + if (message.channel) + PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* int64 limbo_balance = 2; */ + if (message.limboBalance !== 0n) + writer.tag(2, WireType.Varint).int64(message.limboBalance); + /* lnrpc.PendingChannelsResponse.Commitments commitments = 3; */ + if (message.commitments) + PendingChannelsResponse_Commitments.internalBinaryWrite(message.commitments, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string closing_txid = 4; */ + if (message.closingTxid !== "") + writer.tag(4, WireType.LengthDelimited).string(message.closingTxid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel + */ +export const PendingChannelsResponse_WaitingCloseChannel = new PendingChannelsResponse_WaitingCloseChannel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsResponse_Commitments$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsResponse.Commitments", [ + { no: 1, name: "local_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "remote_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "remote_pending_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "local_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "remote_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "remote_pending_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): PendingChannelsResponse_Commitments { + const message = { localTxid: "", remoteTxid: "", remotePendingTxid: "", localCommitFeeSat: 0n, remoteCommitFeeSat: 0n, remotePendingCommitFeeSat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_Commitments): PendingChannelsResponse_Commitments { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string local_txid */ 1: + message.localTxid = reader.string(); + break; + case /* string remote_txid */ 2: + message.remoteTxid = reader.string(); + break; + case /* string remote_pending_txid */ 3: + message.remotePendingTxid = reader.string(); + break; + case /* uint64 local_commit_fee_sat */ 4: + message.localCommitFeeSat = reader.uint64().toBigInt(); + break; + case /* uint64 remote_commit_fee_sat */ 5: + message.remoteCommitFeeSat = reader.uint64().toBigInt(); + break; + case /* uint64 remote_pending_commit_fee_sat */ 6: + message.remotePendingCommitFeeSat = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingChannelsResponse_Commitments, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string local_txid = 1; */ + if (message.localTxid !== "") + writer.tag(1, WireType.LengthDelimited).string(message.localTxid); + /* string remote_txid = 2; */ + if (message.remoteTxid !== "") + writer.tag(2, WireType.LengthDelimited).string(message.remoteTxid); + /* string remote_pending_txid = 3; */ + if (message.remotePendingTxid !== "") + writer.tag(3, WireType.LengthDelimited).string(message.remotePendingTxid); + /* uint64 local_commit_fee_sat = 4; */ + if (message.localCommitFeeSat !== 0n) + writer.tag(4, WireType.Varint).uint64(message.localCommitFeeSat); + /* uint64 remote_commit_fee_sat = 5; */ + if (message.remoteCommitFeeSat !== 0n) + writer.tag(5, WireType.Varint).uint64(message.remoteCommitFeeSat); + /* uint64 remote_pending_commit_fee_sat = 6; */ + if (message.remotePendingCommitFeeSat !== 0n) + writer.tag(6, WireType.Varint).uint64(message.remotePendingCommitFeeSat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.Commitments + */ +export const PendingChannelsResponse_Commitments = new PendingChannelsResponse_Commitments$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsResponse_ClosedChannel$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsResponse.ClosedChannel", [ + { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, + { no: 2, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): PendingChannelsResponse_ClosedChannel { + const message = { closingTxid: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_ClosedChannel): PendingChannelsResponse_ClosedChannel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: + message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); + break; + case /* string closing_txid */ 2: + message.closingTxid = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingChannelsResponse_ClosedChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ + if (message.channel) + PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string closing_txid = 2; */ + if (message.closingTxid !== "") + writer.tag(2, WireType.LengthDelimited).string(message.closingTxid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ClosedChannel + */ +export const PendingChannelsResponse_ClosedChannel = new PendingChannelsResponse_ClosedChannel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PendingChannelsResponse_ForceClosedChannel$Type extends MessageType { + constructor() { + super("lnrpc.PendingChannelsResponse.ForceClosedChannel", [ + { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, + { no: 2, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "maturity_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "blocks_til_maturity", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: "recovered_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "pending_htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingHTLC }, + { no: 9, name: "anchor", kind: "enum", T: () => ["lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState", PendingChannelsResponse_ForceClosedChannel_AnchorState] } + ]); + } + create(value?: PartialMessage): PendingChannelsResponse_ForceClosedChannel { + const message = { closingTxid: "", limboBalance: 0n, maturityHeight: 0, blocksTilMaturity: 0, recoveredBalance: 0n, pendingHtlcs: [], anchor: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_ForceClosedChannel): PendingChannelsResponse_ForceClosedChannel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: + message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); + break; + case /* string closing_txid */ 2: + message.closingTxid = reader.string(); + break; + case /* int64 limbo_balance */ 3: + message.limboBalance = reader.int64().toBigInt(); + break; + case /* uint32 maturity_height */ 4: + message.maturityHeight = reader.uint32(); + break; + case /* int32 blocks_til_maturity */ 5: + message.blocksTilMaturity = reader.int32(); + break; + case /* int64 recovered_balance */ 6: + message.recoveredBalance = reader.int64().toBigInt(); + break; + case /* repeated lnrpc.PendingHTLC pending_htlcs */ 8: + message.pendingHtlcs.push(PendingHTLC.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor */ 9: + message.anchor = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PendingChannelsResponse_ForceClosedChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ + if (message.channel) + PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string closing_txid = 2; */ + if (message.closingTxid !== "") + writer.tag(2, WireType.LengthDelimited).string(message.closingTxid); + /* int64 limbo_balance = 3; */ + if (message.limboBalance !== 0n) + writer.tag(3, WireType.Varint).int64(message.limboBalance); + /* uint32 maturity_height = 4; */ + if (message.maturityHeight !== 0) + writer.tag(4, WireType.Varint).uint32(message.maturityHeight); + /* int32 blocks_til_maturity = 5; */ + if (message.blocksTilMaturity !== 0) + writer.tag(5, WireType.Varint).int32(message.blocksTilMaturity); + /* int64 recovered_balance = 6; */ + if (message.recoveredBalance !== 0n) + writer.tag(6, WireType.Varint).int64(message.recoveredBalance); + /* repeated lnrpc.PendingHTLC pending_htlcs = 8; */ + for (let i = 0; i < message.pendingHtlcs.length; i++) + PendingHTLC.internalBinaryWrite(message.pendingHtlcs[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor = 9; */ + if (message.anchor !== 0) + writer.tag(9, WireType.Varint).int32(message.anchor); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ForceClosedChannel + */ +export const PendingChannelsResponse_ForceClosedChannel = new PendingChannelsResponse_ForceClosedChannel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelEventSubscription$Type extends MessageType { + constructor() { + super("lnrpc.ChannelEventSubscription", []); + } + create(value?: PartialMessage): ChannelEventSubscription { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEventSubscription): ChannelEventSubscription { + return target ?? this.create(); + } + internalBinaryWrite(message: ChannelEventSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelEventSubscription + */ +export const ChannelEventSubscription = new ChannelEventSubscription$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelEventUpdate$Type extends MessageType { + constructor() { + super("lnrpc.ChannelEventUpdate", [ + { no: 1, name: "open_channel", kind: "message", oneof: "channel", T: () => Channel }, + { no: 2, name: "closed_channel", kind: "message", oneof: "channel", T: () => ChannelCloseSummary }, + { no: 3, name: "active_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, + { no: 4, name: "inactive_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, + { no: 6, name: "pending_open_channel", kind: "message", oneof: "channel", T: () => PendingUpdate }, + { no: 7, name: "fully_resolved_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, + { no: 5, name: "type", kind: "enum", T: () => ["lnrpc.ChannelEventUpdate.UpdateType", ChannelEventUpdate_UpdateType] } + ]); + } + create(value?: PartialMessage): ChannelEventUpdate { + const message = { channel: { oneofKind: undefined }, type: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEventUpdate): ChannelEventUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.Channel open_channel */ 1: + message.channel = { + oneofKind: "openChannel", + openChannel: Channel.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).openChannel) + }; + break; + case /* lnrpc.ChannelCloseSummary closed_channel */ 2: + message.channel = { + oneofKind: "closedChannel", + closedChannel: ChannelCloseSummary.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).closedChannel) + }; + break; + case /* lnrpc.ChannelPoint active_channel */ 3: + message.channel = { + oneofKind: "activeChannel", + activeChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).activeChannel) + }; + break; + case /* lnrpc.ChannelPoint inactive_channel */ 4: + message.channel = { + oneofKind: "inactiveChannel", + inactiveChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).inactiveChannel) + }; + break; + case /* lnrpc.PendingUpdate pending_open_channel */ 6: + message.channel = { + oneofKind: "pendingOpenChannel", + pendingOpenChannel: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).pendingOpenChannel) + }; + break; + case /* lnrpc.ChannelPoint fully_resolved_channel */ 7: + message.channel = { + oneofKind: "fullyResolvedChannel", + fullyResolvedChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).fullyResolvedChannel) + }; + break; + case /* lnrpc.ChannelEventUpdate.UpdateType type */ 5: + message.type = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelEventUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.Channel open_channel = 1; */ + if (message.channel.oneofKind === "openChannel") + Channel.internalBinaryWrite(message.channel.openChannel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelCloseSummary closed_channel = 2; */ + if (message.channel.oneofKind === "closedChannel") + ChannelCloseSummary.internalBinaryWrite(message.channel.closedChannel, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelPoint active_channel = 3; */ + if (message.channel.oneofKind === "activeChannel") + ChannelPoint.internalBinaryWrite(message.channel.activeChannel, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelPoint inactive_channel = 4; */ + if (message.channel.oneofKind === "inactiveChannel") + ChannelPoint.internalBinaryWrite(message.channel.inactiveChannel, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.PendingUpdate pending_open_channel = 6; */ + if (message.channel.oneofKind === "pendingOpenChannel") + PendingUpdate.internalBinaryWrite(message.channel.pendingOpenChannel, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelPoint fully_resolved_channel = 7; */ + if (message.channel.oneofKind === "fullyResolvedChannel") + ChannelPoint.internalBinaryWrite(message.channel.fullyResolvedChannel, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelEventUpdate.UpdateType type = 5; */ + if (message.type !== 0) + writer.tag(5, WireType.Varint).int32(message.type); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelEventUpdate + */ +export const ChannelEventUpdate = new ChannelEventUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class WalletAccountBalance$Type extends MessageType { + constructor() { + super("lnrpc.WalletAccountBalance", [ + { no: 1, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): WalletAccountBalance { + const message = { confirmedBalance: 0n, unconfirmedBalance: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletAccountBalance): WalletAccountBalance { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 confirmed_balance */ 1: + message.confirmedBalance = reader.int64().toBigInt(); + break; + case /* int64 unconfirmed_balance */ 2: + message.unconfirmedBalance = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: WalletAccountBalance, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 confirmed_balance = 1; */ + if (message.confirmedBalance !== 0n) + writer.tag(1, WireType.Varint).int64(message.confirmedBalance); + /* int64 unconfirmed_balance = 2; */ + if (message.unconfirmedBalance !== 0n) + writer.tag(2, WireType.Varint).int64(message.unconfirmedBalance); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.WalletAccountBalance + */ +export const WalletAccountBalance = new WalletAccountBalance$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class WalletBalanceRequest$Type extends MessageType { + constructor() { + super("lnrpc.WalletBalanceRequest", []); + } + create(value?: PartialMessage): WalletBalanceRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletBalanceRequest): WalletBalanceRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: WalletBalanceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.WalletBalanceRequest + */ +export const WalletBalanceRequest = new WalletBalanceRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class WalletBalanceResponse$Type extends MessageType { + constructor() { + super("lnrpc.WalletBalanceResponse", [ + { no: 1, name: "total_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "reserved_balance_anchor_chan", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "account_balance", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => WalletAccountBalance } } + ]); + } + create(value?: PartialMessage): WalletBalanceResponse { + const message = { totalBalance: 0n, confirmedBalance: 0n, unconfirmedBalance: 0n, lockedBalance: 0n, reservedBalanceAnchorChan: 0n, accountBalance: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletBalanceResponse): WalletBalanceResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 total_balance */ 1: + message.totalBalance = reader.int64().toBigInt(); + break; + case /* int64 confirmed_balance */ 2: + message.confirmedBalance = reader.int64().toBigInt(); + break; + case /* int64 unconfirmed_balance */ 3: + message.unconfirmedBalance = reader.int64().toBigInt(); + break; + case /* int64 locked_balance */ 5: + message.lockedBalance = reader.int64().toBigInt(); + break; + case /* int64 reserved_balance_anchor_chan */ 6: + message.reservedBalanceAnchorChan = reader.int64().toBigInt(); + break; + case /* map account_balance */ 4: + this.binaryReadMap4(message.accountBalance, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap4(map: WalletBalanceResponse["accountBalance"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof WalletBalanceResponse["accountBalance"] | undefined, val: WalletBalanceResponse["accountBalance"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = WalletAccountBalance.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.WalletBalanceResponse.account_balance"); + } + } + map[key ?? ""] = val ?? WalletAccountBalance.create(); + } + internalBinaryWrite(message: WalletBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 total_balance = 1; */ + if (message.totalBalance !== 0n) + writer.tag(1, WireType.Varint).int64(message.totalBalance); + /* int64 confirmed_balance = 2; */ + if (message.confirmedBalance !== 0n) + writer.tag(2, WireType.Varint).int64(message.confirmedBalance); + /* int64 unconfirmed_balance = 3; */ + if (message.unconfirmedBalance !== 0n) + writer.tag(3, WireType.Varint).int64(message.unconfirmedBalance); + /* int64 locked_balance = 5; */ + if (message.lockedBalance !== 0n) + writer.tag(5, WireType.Varint).int64(message.lockedBalance); + /* int64 reserved_balance_anchor_chan = 6; */ + if (message.reservedBalanceAnchorChan !== 0n) + writer.tag(6, WireType.Varint).int64(message.reservedBalanceAnchorChan); + /* map account_balance = 4; */ + for (let k of Object.keys(message.accountBalance)) { + writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + WalletAccountBalance.internalBinaryWrite(message.accountBalance[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.WalletBalanceResponse + */ +export const WalletBalanceResponse = new WalletBalanceResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Amount$Type extends MessageType { + constructor() { + super("lnrpc.Amount", [ + { no: 1, name: "sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): Amount { + const message = { sat: 0n, msat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Amount): Amount { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 sat */ 1: + message.sat = reader.uint64().toBigInt(); + break; + case /* uint64 msat */ 2: + message.msat = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Amount, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 sat = 1; */ + if (message.sat !== 0n) + writer.tag(1, WireType.Varint).uint64(message.sat); + /* uint64 msat = 2; */ + if (message.msat !== 0n) + writer.tag(2, WireType.Varint).uint64(message.msat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Amount + */ +export const Amount = new Amount$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelBalanceRequest$Type extends MessageType { + constructor() { + super("lnrpc.ChannelBalanceRequest", []); + } + create(value?: PartialMessage): ChannelBalanceRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBalanceRequest): ChannelBalanceRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: ChannelBalanceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelBalanceRequest + */ +export const ChannelBalanceRequest = new ChannelBalanceRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelBalanceResponse$Type extends MessageType { + constructor() { + super("lnrpc.ChannelBalanceResponse", [ + { no: 1, name: "balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "pending_open_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "local_balance", kind: "message", T: () => Amount }, + { no: 4, name: "remote_balance", kind: "message", T: () => Amount }, + { no: 5, name: "unsettled_local_balance", kind: "message", T: () => Amount }, + { no: 6, name: "unsettled_remote_balance", kind: "message", T: () => Amount }, + { no: 7, name: "pending_open_local_balance", kind: "message", T: () => Amount }, + { no: 8, name: "pending_open_remote_balance", kind: "message", T: () => Amount } + ]); + } + create(value?: PartialMessage): ChannelBalanceResponse { + const message = { balance: 0n, pendingOpenBalance: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBalanceResponse): ChannelBalanceResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 balance = 1 [deprecated = true];*/ 1: + message.balance = reader.int64().toBigInt(); + break; + case /* int64 pending_open_balance = 2 [deprecated = true];*/ 2: + message.pendingOpenBalance = reader.int64().toBigInt(); + break; + case /* lnrpc.Amount local_balance */ 3: + message.localBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.localBalance); + break; + case /* lnrpc.Amount remote_balance */ 4: + message.remoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.remoteBalance); + break; + case /* lnrpc.Amount unsettled_local_balance */ 5: + message.unsettledLocalBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.unsettledLocalBalance); + break; + case /* lnrpc.Amount unsettled_remote_balance */ 6: + message.unsettledRemoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.unsettledRemoteBalance); + break; + case /* lnrpc.Amount pending_open_local_balance */ 7: + message.pendingOpenLocalBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.pendingOpenLocalBalance); + break; + case /* lnrpc.Amount pending_open_remote_balance */ 8: + message.pendingOpenRemoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.pendingOpenRemoteBalance); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 balance = 1 [deprecated = true]; */ + if (message.balance !== 0n) + writer.tag(1, WireType.Varint).int64(message.balance); + /* int64 pending_open_balance = 2 [deprecated = true]; */ + if (message.pendingOpenBalance !== 0n) + writer.tag(2, WireType.Varint).int64(message.pendingOpenBalance); + /* lnrpc.Amount local_balance = 3; */ + if (message.localBalance) + Amount.internalBinaryWrite(message.localBalance, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.Amount remote_balance = 4; */ + if (message.remoteBalance) + Amount.internalBinaryWrite(message.remoteBalance, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.Amount unsettled_local_balance = 5; */ + if (message.unsettledLocalBalance) + Amount.internalBinaryWrite(message.unsettledLocalBalance, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.Amount unsettled_remote_balance = 6; */ + if (message.unsettledRemoteBalance) + Amount.internalBinaryWrite(message.unsettledRemoteBalance, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.Amount pending_open_local_balance = 7; */ + if (message.pendingOpenLocalBalance) + Amount.internalBinaryWrite(message.pendingOpenLocalBalance, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.Amount pending_open_remote_balance = 8; */ + if (message.pendingOpenRemoteBalance) + Amount.internalBinaryWrite(message.pendingOpenRemoteBalance, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelBalanceResponse + */ +export const ChannelBalanceResponse = new ChannelBalanceResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryRoutesRequest$Type extends MessageType { + constructor() { + super("lnrpc.QueryRoutesRequest", [ + { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: "fee_limit", kind: "message", T: () => FeeLimit }, + { no: 6, name: "ignored_nodes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, + { no: 7, name: "ignored_edges", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EdgeLocator }, + { no: 8, name: "source_pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "use_mission_control", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 10, name: "ignored_pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodePair }, + { no: 11, name: "cltv_limit", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 13, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, + { no: 14, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 15, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 16, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, + { no: 17, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, + { no: 18, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): QueryRoutesRequest { + const message = { pubKey: "", amt: 0n, amtMsat: 0n, finalCltvDelta: 0, ignoredNodes: [], ignoredEdges: [], sourcePubKey: "", useMissionControl: false, ignoredPairs: [], cltvLimit: 0, destCustomRecords: {}, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), routeHints: [], destFeatures: [], timePref: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoutesRequest): QueryRoutesRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pub_key */ 1: + message.pubKey = reader.string(); + break; + case /* int64 amt */ 2: + message.amt = reader.int64().toBigInt(); + break; + case /* int64 amt_msat */ 12: + message.amtMsat = reader.int64().toBigInt(); + break; + case /* int32 final_cltv_delta */ 4: + message.finalCltvDelta = reader.int32(); + break; + case /* lnrpc.FeeLimit fee_limit */ 5: + message.feeLimit = FeeLimit.internalBinaryRead(reader, reader.uint32(), options, message.feeLimit); + break; + case /* repeated bytes ignored_nodes */ 6: + message.ignoredNodes.push(reader.bytes()); + break; + case /* repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true];*/ 7: + message.ignoredEdges.push(EdgeLocator.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string source_pub_key */ 8: + message.sourcePubKey = reader.string(); + break; + case /* bool use_mission_control */ 9: + message.useMissionControl = reader.bool(); + break; + case /* repeated lnrpc.NodePair ignored_pairs */ 10: + message.ignoredPairs.push(NodePair.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint32 cltv_limit */ 11: + message.cltvLimit = reader.uint32(); + break; + case /* map dest_custom_records */ 13: + this.binaryReadMap13(message.destCustomRecords, reader, options); + break; + case /* uint64 outgoing_chan_id = 14 [jstype = JS_STRING];*/ 14: + message.outgoingChanId = reader.uint64().toString(); + break; + case /* bytes last_hop_pubkey */ 15: + message.lastHopPubkey = reader.bytes(); + break; + case /* repeated lnrpc.RouteHint route_hints */ 16: + message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated lnrpc.FeatureBit dest_features */ 17: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.destFeatures.push(reader.int32()); + else + message.destFeatures.push(reader.int32()); + break; + case /* double time_pref */ 18: + message.timePref = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap13(map: QueryRoutesRequest["destCustomRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof QueryRoutesRequest["destCustomRecords"] | undefined, val: QueryRoutesRequest["destCustomRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.QueryRoutesRequest.dest_custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: QueryRoutesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string pub_key = 1; */ + if (message.pubKey !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pubKey); + /* int64 amt = 2; */ + if (message.amt !== 0n) + writer.tag(2, WireType.Varint).int64(message.amt); + /* int64 amt_msat = 12; */ + if (message.amtMsat !== 0n) + writer.tag(12, WireType.Varint).int64(message.amtMsat); + /* int32 final_cltv_delta = 4; */ + if (message.finalCltvDelta !== 0) + writer.tag(4, WireType.Varint).int32(message.finalCltvDelta); + /* lnrpc.FeeLimit fee_limit = 5; */ + if (message.feeLimit) + FeeLimit.internalBinaryWrite(message.feeLimit, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* repeated bytes ignored_nodes = 6; */ + for (let i = 0; i < message.ignoredNodes.length; i++) + writer.tag(6, WireType.LengthDelimited).bytes(message.ignoredNodes[i]); + /* repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true]; */ + for (let i = 0; i < message.ignoredEdges.length; i++) + EdgeLocator.internalBinaryWrite(message.ignoredEdges[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* string source_pub_key = 8; */ + if (message.sourcePubKey !== "") + writer.tag(8, WireType.LengthDelimited).string(message.sourcePubKey); + /* bool use_mission_control = 9; */ + if (message.useMissionControl !== false) + writer.tag(9, WireType.Varint).bool(message.useMissionControl); + /* repeated lnrpc.NodePair ignored_pairs = 10; */ + for (let i = 0; i < message.ignoredPairs.length; i++) + NodePair.internalBinaryWrite(message.ignoredPairs[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); + /* uint32 cltv_limit = 11; */ + if (message.cltvLimit !== 0) + writer.tag(11, WireType.Varint).uint32(message.cltvLimit); + /* map dest_custom_records = 13; */ + for (let k of Object.keys(message.destCustomRecords)) + writer.tag(13, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); + /* uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; */ + if (message.outgoingChanId !== "0") + writer.tag(14, WireType.Varint).uint64(message.outgoingChanId); + /* bytes last_hop_pubkey = 15; */ + if (message.lastHopPubkey.length) + writer.tag(15, WireType.LengthDelimited).bytes(message.lastHopPubkey); + /* repeated lnrpc.RouteHint route_hints = 16; */ + for (let i = 0; i < message.routeHints.length; i++) + RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join(); + /* repeated lnrpc.FeatureBit dest_features = 17; */ + if (message.destFeatures.length) { + writer.tag(17, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.destFeatures.length; i++) + writer.int32(message.destFeatures[i]); + writer.join(); + } + /* double time_pref = 18; */ + if (message.timePref !== 0) + writer.tag(18, WireType.Bit64).double(message.timePref); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.QueryRoutesRequest + */ +export const QueryRoutesRequest = new QueryRoutesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodePair$Type extends MessageType { + constructor() { + super("lnrpc.NodePair", [ + { no: 1, name: "from", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "to", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): NodePair { + const message = { from: new Uint8Array(0), to: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodePair): NodePair { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes from */ 1: + message.from = reader.bytes(); + break; + case /* bytes to */ 2: + message.to = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodePair, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes from = 1; */ + if (message.from.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.from); + /* bytes to = 2; */ + if (message.to.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.to); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NodePair + */ +export const NodePair = new NodePair$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EdgeLocator$Type extends MessageType { + constructor() { + super("lnrpc.EdgeLocator", [ + { no: 1, name: "channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "direction_reverse", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): EdgeLocator { + const message = { channelId: "0", directionReverse: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EdgeLocator): EdgeLocator { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 channel_id = 1 [jstype = JS_STRING];*/ 1: + message.channelId = reader.uint64().toString(); + break; + case /* bool direction_reverse */ 2: + message.directionReverse = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: EdgeLocator, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 channel_id = 1 [jstype = JS_STRING]; */ + if (message.channelId !== "0") + writer.tag(1, WireType.Varint).uint64(message.channelId); + /* bool direction_reverse = 2; */ + if (message.directionReverse !== false) + writer.tag(2, WireType.Varint).bool(message.directionReverse); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.EdgeLocator + */ +export const EdgeLocator = new EdgeLocator$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryRoutesResponse$Type extends MessageType { + constructor() { + super("lnrpc.QueryRoutesResponse", [ + { no: 1, name: "routes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Route }, + { no: 2, name: "success_prob", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): QueryRoutesResponse { + const message = { routes: [], successProb: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoutesResponse): QueryRoutesResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.Route routes */ 1: + message.routes.push(Route.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* double success_prob */ 2: + message.successProb = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: QueryRoutesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.Route routes = 1; */ + for (let i = 0; i < message.routes.length; i++) + Route.internalBinaryWrite(message.routes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* double success_prob = 2; */ + if (message.successProb !== 0) + writer.tag(2, WireType.Bit64).double(message.successProb); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.QueryRoutesResponse + */ +export const QueryRoutesResponse = new QueryRoutesResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Hop$Type extends MessageType { + constructor() { + super("lnrpc.Hop", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "chan_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "amt_to_forward", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 6, name: "amt_to_forward_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "tlv_payload", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 10, name: "mpp_record", kind: "message", T: () => MPPRecord }, + { no: 12, name: "amp_record", kind: "message", T: () => AMPRecord }, + { no: 11, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, + { no: 13, name: "metadata", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): Hop { + const message = { chanId: "0", chanCapacity: 0n, amtToForward: 0n, fee: 0n, expiry: 0, amtToForwardMsat: 0n, feeMsat: 0n, pubKey: "", tlvPayload: false, customRecords: {}, metadata: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Hop): Hop { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: + message.chanId = reader.uint64().toString(); + break; + case /* int64 chan_capacity = 2 [deprecated = true];*/ 2: + message.chanCapacity = reader.int64().toBigInt(); + break; + case /* int64 amt_to_forward = 3 [deprecated = true];*/ 3: + message.amtToForward = reader.int64().toBigInt(); + break; + case /* int64 fee = 4 [deprecated = true];*/ 4: + message.fee = reader.int64().toBigInt(); + break; + case /* uint32 expiry */ 5: + message.expiry = reader.uint32(); + break; + case /* int64 amt_to_forward_msat */ 6: + message.amtToForwardMsat = reader.int64().toBigInt(); + break; + case /* int64 fee_msat */ 7: + message.feeMsat = reader.int64().toBigInt(); + break; + case /* string pub_key */ 8: + message.pubKey = reader.string(); + break; + case /* bool tlv_payload = 9 [deprecated = true];*/ 9: + message.tlvPayload = reader.bool(); + break; + case /* lnrpc.MPPRecord mpp_record */ 10: + message.mppRecord = MPPRecord.internalBinaryRead(reader, reader.uint32(), options, message.mppRecord); + break; + case /* lnrpc.AMPRecord amp_record */ 12: + message.ampRecord = AMPRecord.internalBinaryRead(reader, reader.uint32(), options, message.ampRecord); + break; + case /* map custom_records */ 11: + this.binaryReadMap11(message.customRecords, reader, options); + break; + case /* bytes metadata */ 13: + message.metadata = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap11(map: Hop["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Hop["customRecords"] | undefined, val: Hop["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.Hop.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: Hop, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(1, WireType.Varint).uint64(message.chanId); + /* int64 chan_capacity = 2 [deprecated = true]; */ + if (message.chanCapacity !== 0n) + writer.tag(2, WireType.Varint).int64(message.chanCapacity); + /* int64 amt_to_forward = 3 [deprecated = true]; */ + if (message.amtToForward !== 0n) + writer.tag(3, WireType.Varint).int64(message.amtToForward); + /* int64 fee = 4 [deprecated = true]; */ + if (message.fee !== 0n) + writer.tag(4, WireType.Varint).int64(message.fee); + /* uint32 expiry = 5; */ + if (message.expiry !== 0) + writer.tag(5, WireType.Varint).uint32(message.expiry); + /* int64 amt_to_forward_msat = 6; */ + if (message.amtToForwardMsat !== 0n) + writer.tag(6, WireType.Varint).int64(message.amtToForwardMsat); + /* int64 fee_msat = 7; */ + if (message.feeMsat !== 0n) + writer.tag(7, WireType.Varint).int64(message.feeMsat); + /* string pub_key = 8; */ + if (message.pubKey !== "") + writer.tag(8, WireType.LengthDelimited).string(message.pubKey); + /* bool tlv_payload = 9 [deprecated = true]; */ + if (message.tlvPayload !== false) + writer.tag(9, WireType.Varint).bool(message.tlvPayload); + /* lnrpc.MPPRecord mpp_record = 10; */ + if (message.mppRecord) + MPPRecord.internalBinaryWrite(message.mppRecord, writer.tag(10, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.AMPRecord amp_record = 12; */ + if (message.ampRecord) + AMPRecord.internalBinaryWrite(message.ampRecord, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + /* map custom_records = 11; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); + /* bytes metadata = 13; */ + if (message.metadata.length) + writer.tag(13, WireType.LengthDelimited).bytes(message.metadata); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Hop + */ +export const Hop = new Hop$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MPPRecord$Type extends MessageType { + constructor() { + super("lnrpc.MPPRecord", [ + { no: 11, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 10, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): MPPRecord { + const message = { paymentAddr: new Uint8Array(0), totalAmtMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MPPRecord): MPPRecord { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_addr */ 11: + message.paymentAddr = reader.bytes(); + break; + case /* int64 total_amt_msat */ 10: + message.totalAmtMsat = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MPPRecord, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_addr = 11; */ + if (message.paymentAddr.length) + writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); + /* int64 total_amt_msat = 10; */ + if (message.totalAmtMsat !== 0n) + writer.tag(10, WireType.Varint).int64(message.totalAmtMsat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.MPPRecord + */ +export const MPPRecord = new MPPRecord$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AMPRecord$Type extends MessageType { + constructor() { + super("lnrpc.AMPRecord", [ + { no: 1, name: "root_share", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "child_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): AMPRecord { + const message = { rootShare: new Uint8Array(0), setId: new Uint8Array(0), childIndex: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMPRecord): AMPRecord { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes root_share */ 1: + message.rootShare = reader.bytes(); + break; + case /* bytes set_id */ 2: + message.setId = reader.bytes(); + break; + case /* uint32 child_index */ 3: + message.childIndex = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AMPRecord, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes root_share = 1; */ + if (message.rootShare.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.rootShare); + /* bytes set_id = 2; */ + if (message.setId.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.setId); + /* uint32 child_index = 3; */ + if (message.childIndex !== 0) + writer.tag(3, WireType.Varint).uint32(message.childIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AMPRecord + */ +export const AMPRecord = new AMPRecord$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Route$Type extends MessageType { + constructor() { + super("lnrpc.Route", [ + { no: 1, name: "total_time_lock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "total_amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "hops", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Hop }, + { no: 5, name: "total_fees_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): Route { + const message = { totalTimeLock: 0, totalFees: 0n, totalAmt: 0n, hops: [], totalFeesMsat: 0n, totalAmtMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Route): Route { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 total_time_lock */ 1: + message.totalTimeLock = reader.uint32(); + break; + case /* int64 total_fees = 2 [deprecated = true];*/ 2: + message.totalFees = reader.int64().toBigInt(); + break; + case /* int64 total_amt = 3 [deprecated = true];*/ 3: + message.totalAmt = reader.int64().toBigInt(); + break; + case /* repeated lnrpc.Hop hops */ 4: + message.hops.push(Hop.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* int64 total_fees_msat */ 5: + message.totalFeesMsat = reader.int64().toBigInt(); + break; + case /* int64 total_amt_msat */ 6: + message.totalAmtMsat = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Route, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint32 total_time_lock = 1; */ + if (message.totalTimeLock !== 0) + writer.tag(1, WireType.Varint).uint32(message.totalTimeLock); + /* int64 total_fees = 2 [deprecated = true]; */ + if (message.totalFees !== 0n) + writer.tag(2, WireType.Varint).int64(message.totalFees); + /* int64 total_amt = 3 [deprecated = true]; */ + if (message.totalAmt !== 0n) + writer.tag(3, WireType.Varint).int64(message.totalAmt); + /* repeated lnrpc.Hop hops = 4; */ + for (let i = 0; i < message.hops.length; i++) + Hop.internalBinaryWrite(message.hops[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* int64 total_fees_msat = 5; */ + if (message.totalFeesMsat !== 0n) + writer.tag(5, WireType.Varint).int64(message.totalFeesMsat); + /* int64 total_amt_msat = 6; */ + if (message.totalAmtMsat !== 0n) + writer.tag(6, WireType.Varint).int64(message.totalAmtMsat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Route + */ +export const Route = new Route$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeInfoRequest$Type extends MessageType { + constructor() { + super("lnrpc.NodeInfoRequest", [ + { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "include_channels", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): NodeInfoRequest { + const message = { pubKey: "", includeChannels: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeInfoRequest): NodeInfoRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pub_key */ 1: + message.pubKey = reader.string(); + break; + case /* bool include_channels */ 2: + message.includeChannels = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodeInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string pub_key = 1; */ + if (message.pubKey !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pubKey); + /* bool include_channels = 2; */ + if (message.includeChannels !== false) + writer.tag(2, WireType.Varint).bool(message.includeChannels); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NodeInfoRequest + */ +export const NodeInfoRequest = new NodeInfoRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeInfo$Type extends MessageType { + constructor() { + super("lnrpc.NodeInfo", [ + { no: 1, name: "node", kind: "message", T: () => LightningNode }, + { no: 2, name: "num_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "total_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdge } + ]); + } + create(value?: PartialMessage): NodeInfo { + const message = { numChannels: 0, totalCapacity: 0n, channels: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeInfo): NodeInfo { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.LightningNode node */ 1: + message.node = LightningNode.internalBinaryRead(reader, reader.uint32(), options, message.node); + break; + case /* uint32 num_channels */ 2: + message.numChannels = reader.uint32(); + break; + case /* int64 total_capacity */ 3: + message.totalCapacity = reader.int64().toBigInt(); + break; + case /* repeated lnrpc.ChannelEdge channels */ 4: + message.channels.push(ChannelEdge.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodeInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.LightningNode node = 1; */ + if (message.node) + LightningNode.internalBinaryWrite(message.node, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint32 num_channels = 2; */ + if (message.numChannels !== 0) + writer.tag(2, WireType.Varint).uint32(message.numChannels); + /* int64 total_capacity = 3; */ + if (message.totalCapacity !== 0n) + writer.tag(3, WireType.Varint).int64(message.totalCapacity); + /* repeated lnrpc.ChannelEdge channels = 4; */ + for (let i = 0; i < message.channels.length; i++) + ChannelEdge.internalBinaryWrite(message.channels[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NodeInfo + */ +export const NodeInfo = new NodeInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LightningNode$Type extends MessageType { + constructor() { + super("lnrpc.LightningNode", [ + { no: 1, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "addresses", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeAddress }, + { no: 5, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, + { no: 7, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } + ]); + } + create(value?: PartialMessage): LightningNode { + const message = { lastUpdate: 0, pubKey: "", alias: "", addresses: [], color: "", features: {}, customRecords: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LightningNode): LightningNode { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 last_update */ 1: + message.lastUpdate = reader.uint32(); + break; + case /* string pub_key */ 2: + message.pubKey = reader.string(); + break; + case /* string alias */ 3: + message.alias = reader.string(); + break; + case /* repeated lnrpc.NodeAddress addresses */ 4: + message.addresses.push(NodeAddress.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string color */ 5: + message.color = reader.string(); + break; + case /* map features */ 6: + this.binaryReadMap6(message.features, reader, options); + break; + case /* map custom_records */ 7: + this.binaryReadMap7(message.customRecords, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap6(map: LightningNode["features"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof LightningNode["features"] | undefined, val: LightningNode["features"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint32(); + break; + case 2: + val = Feature.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.LightningNode.features"); + } + } + map[key ?? 0] = val ?? Feature.create(); + } + private binaryReadMap7(map: LightningNode["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof LightningNode["customRecords"] | undefined, val: LightningNode["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.LightningNode.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: LightningNode, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint32 last_update = 1; */ + if (message.lastUpdate !== 0) + writer.tag(1, WireType.Varint).uint32(message.lastUpdate); + /* string pub_key = 2; */ + if (message.pubKey !== "") + writer.tag(2, WireType.LengthDelimited).string(message.pubKey); + /* string alias = 3; */ + if (message.alias !== "") + writer.tag(3, WireType.LengthDelimited).string(message.alias); + /* repeated lnrpc.NodeAddress addresses = 4; */ + for (let i = 0; i < message.addresses.length; i++) + NodeAddress.internalBinaryWrite(message.addresses[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* string color = 5; */ + if (message.color !== "") + writer.tag(5, WireType.LengthDelimited).string(message.color); + /* map features = 6; */ + for (let k of Object.keys(message.features)) { + writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); + writer.tag(2, WireType.LengthDelimited).fork(); + Feature.internalBinaryWrite(message.features[k as any], writer, options); + writer.join().join(); + } + /* map custom_records = 7; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(7, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.LightningNode + */ +export const LightningNode = new LightningNode$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeAddress$Type extends MessageType { + constructor() { + super("lnrpc.NodeAddress", [ + { no: 1, name: "network", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): NodeAddress { + const message = { network: "", addr: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeAddress): NodeAddress { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string network */ 1: + message.network = reader.string(); + break; + case /* string addr */ 2: + message.addr = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodeAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string network = 1; */ + if (message.network !== "") + writer.tag(1, WireType.LengthDelimited).string(message.network); + /* string addr = 2; */ + if (message.addr !== "") + writer.tag(2, WireType.LengthDelimited).string(message.addr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NodeAddress + */ +export const NodeAddress = new NodeAddress$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RoutingPolicy$Type extends MessageType { + constructor() { + super("lnrpc.RoutingPolicy", [ + { no: 1, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "min_htlc", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "fee_base_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fee_rate_milli_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "disabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 8, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } + ]); + } + create(value?: PartialMessage): RoutingPolicy { + const message = { timeLockDelta: 0, minHtlc: 0n, feeBaseMsat: 0n, feeRateMilliMsat: 0n, disabled: false, maxHtlcMsat: 0n, lastUpdate: 0, customRecords: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RoutingPolicy): RoutingPolicy { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 time_lock_delta */ 1: + message.timeLockDelta = reader.uint32(); + break; + case /* int64 min_htlc */ 2: + message.minHtlc = reader.int64().toBigInt(); + break; + case /* int64 fee_base_msat */ 3: + message.feeBaseMsat = reader.int64().toBigInt(); + break; + case /* int64 fee_rate_milli_msat */ 4: + message.feeRateMilliMsat = reader.int64().toBigInt(); + break; + case /* bool disabled */ 5: + message.disabled = reader.bool(); + break; + case /* uint64 max_htlc_msat */ 6: + message.maxHtlcMsat = reader.uint64().toBigInt(); + break; + case /* uint32 last_update */ 7: + message.lastUpdate = reader.uint32(); + break; + case /* map custom_records */ 8: + this.binaryReadMap8(message.customRecords, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap8(map: RoutingPolicy["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof RoutingPolicy["customRecords"] | undefined, val: RoutingPolicy["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.RoutingPolicy.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: RoutingPolicy, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint32 time_lock_delta = 1; */ + if (message.timeLockDelta !== 0) + writer.tag(1, WireType.Varint).uint32(message.timeLockDelta); + /* int64 min_htlc = 2; */ + if (message.minHtlc !== 0n) + writer.tag(2, WireType.Varint).int64(message.minHtlc); + /* int64 fee_base_msat = 3; */ + if (message.feeBaseMsat !== 0n) + writer.tag(3, WireType.Varint).int64(message.feeBaseMsat); + /* int64 fee_rate_milli_msat = 4; */ + if (message.feeRateMilliMsat !== 0n) + writer.tag(4, WireType.Varint).int64(message.feeRateMilliMsat); + /* bool disabled = 5; */ + if (message.disabled !== false) + writer.tag(5, WireType.Varint).bool(message.disabled); + /* uint64 max_htlc_msat = 6; */ + if (message.maxHtlcMsat !== 0n) + writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); + /* uint32 last_update = 7; */ + if (message.lastUpdate !== 0) + writer.tag(7, WireType.Varint).uint32(message.lastUpdate); + /* map custom_records = 8; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(8, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RoutingPolicy + */ +export const RoutingPolicy = new RoutingPolicy$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelEdge$Type extends MessageType { + constructor() { + super("lnrpc.ChannelEdge", [ + { no: 1, name: "channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "chan_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "node1_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "node2_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "node1_policy", kind: "message", T: () => RoutingPolicy }, + { no: 8, name: "node2_policy", kind: "message", T: () => RoutingPolicy }, + { no: 9, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } + ]); + } + create(value?: PartialMessage): ChannelEdge { + const message = { channelId: "0", chanPoint: "", lastUpdate: 0, node1Pub: "", node2Pub: "", capacity: 0n, customRecords: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEdge): ChannelEdge { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 channel_id = 1 [jstype = JS_STRING];*/ 1: + message.channelId = reader.uint64().toString(); + break; + case /* string chan_point */ 2: + message.chanPoint = reader.string(); + break; + case /* uint32 last_update = 3 [deprecated = true];*/ 3: + message.lastUpdate = reader.uint32(); + break; + case /* string node1_pub */ 4: + message.node1Pub = reader.string(); + break; + case /* string node2_pub */ 5: + message.node2Pub = reader.string(); + break; + case /* int64 capacity */ 6: + message.capacity = reader.int64().toBigInt(); + break; + case /* lnrpc.RoutingPolicy node1_policy */ 7: + message.node1Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node1Policy); + break; + case /* lnrpc.RoutingPolicy node2_policy */ 8: + message.node2Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node2Policy); + break; + case /* map custom_records */ 9: + this.binaryReadMap9(message.customRecords, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap9(map: ChannelEdge["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof ChannelEdge["customRecords"] | undefined, val: ChannelEdge["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.ChannelEdge.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: ChannelEdge, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 channel_id = 1 [jstype = JS_STRING]; */ + if (message.channelId !== "0") + writer.tag(1, WireType.Varint).uint64(message.channelId); + /* string chan_point = 2; */ + if (message.chanPoint !== "") + writer.tag(2, WireType.LengthDelimited).string(message.chanPoint); + /* uint32 last_update = 3 [deprecated = true]; */ + if (message.lastUpdate !== 0) + writer.tag(3, WireType.Varint).uint32(message.lastUpdate); + /* string node1_pub = 4; */ + if (message.node1Pub !== "") + writer.tag(4, WireType.LengthDelimited).string(message.node1Pub); + /* string node2_pub = 5; */ + if (message.node2Pub !== "") + writer.tag(5, WireType.LengthDelimited).string(message.node2Pub); + /* int64 capacity = 6; */ + if (message.capacity !== 0n) + writer.tag(6, WireType.Varint).int64(message.capacity); + /* lnrpc.RoutingPolicy node1_policy = 7; */ + if (message.node1Policy) + RoutingPolicy.internalBinaryWrite(message.node1Policy, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.RoutingPolicy node2_policy = 8; */ + if (message.node2Policy) + RoutingPolicy.internalBinaryWrite(message.node2Policy, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* map custom_records = 9; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelEdge + */ +export const ChannelEdge = new ChannelEdge$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelGraphRequest$Type extends MessageType { + constructor() { + super("lnrpc.ChannelGraphRequest", [ + { no: 1, name: "include_unannounced", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ChannelGraphRequest { + const message = { includeUnannounced: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelGraphRequest): ChannelGraphRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool include_unannounced */ 1: + message.includeUnannounced = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelGraphRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool include_unannounced = 1; */ + if (message.includeUnannounced !== false) + writer.tag(1, WireType.Varint).bool(message.includeUnannounced); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelGraphRequest + */ +export const ChannelGraphRequest = new ChannelGraphRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelGraph$Type extends MessageType { + constructor() { + super("lnrpc.ChannelGraph", [ + { no: 1, name: "nodes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => LightningNode }, + { no: 2, name: "edges", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdge } + ]); + } + create(value?: PartialMessage): ChannelGraph { + const message = { nodes: [], edges: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelGraph): ChannelGraph { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.LightningNode nodes */ 1: + message.nodes.push(LightningNode.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated lnrpc.ChannelEdge edges */ 2: + message.edges.push(ChannelEdge.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelGraph, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.LightningNode nodes = 1; */ + for (let i = 0; i < message.nodes.length; i++) + LightningNode.internalBinaryWrite(message.nodes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated lnrpc.ChannelEdge edges = 2; */ + for (let i = 0; i < message.edges.length; i++) + ChannelEdge.internalBinaryWrite(message.edges[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelGraph + */ +export const ChannelGraph = new ChannelGraph$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeMetricsRequest$Type extends MessageType { + constructor() { + super("lnrpc.NodeMetricsRequest", [ + { no: 1, name: "types", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.NodeMetricType", NodeMetricType] } + ]); + } + create(value?: PartialMessage): NodeMetricsRequest { + const message = { types: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeMetricsRequest): NodeMetricsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.NodeMetricType types */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.types.push(reader.int32()); + else + message.types.push(reader.int32()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NodeMetricsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.NodeMetricType types = 1; */ + if (message.types.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.types.length; i++) + writer.int32(message.types[i]); + writer.join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NodeMetricsRequest + */ +export const NodeMetricsRequest = new NodeMetricsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeMetricsResponse$Type extends MessageType { + constructor() { + super("lnrpc.NodeMetricsResponse", [ + { no: 1, name: "betweenness_centrality", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => FloatMetric } } + ]); + } + create(value?: PartialMessage): NodeMetricsResponse { + const message = { betweennessCentrality: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeMetricsResponse): NodeMetricsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map betweenness_centrality */ 1: + this.binaryReadMap1(message.betweennessCentrality, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap1(map: NodeMetricsResponse["betweennessCentrality"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof NodeMetricsResponse["betweennessCentrality"] | undefined, val: NodeMetricsResponse["betweennessCentrality"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = FloatMetric.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.NodeMetricsResponse.betweenness_centrality"); + } + } + map[key ?? ""] = val ?? FloatMetric.create(); + } + internalBinaryWrite(message: NodeMetricsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map betweenness_centrality = 1; */ + for (let k of Object.keys(message.betweennessCentrality)) { + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + FloatMetric.internalBinaryWrite(message.betweennessCentrality[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NodeMetricsResponse + */ +export const NodeMetricsResponse = new NodeMetricsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FloatMetric$Type extends MessageType { + constructor() { + super("lnrpc.FloatMetric", [ + { no: 1, name: "value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 2, name: "normalized_value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): FloatMetric { + const message = { value: 0, normalizedValue: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FloatMetric): FloatMetric { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* double value */ 1: + message.value = reader.double(); + break; + case /* double normalized_value */ 2: + message.normalizedValue = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FloatMetric, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* double value = 1; */ + if (message.value !== 0) + writer.tag(1, WireType.Bit64).double(message.value); + /* double normalized_value = 2; */ + if (message.normalizedValue !== 0) + writer.tag(2, WireType.Bit64).double(message.normalizedValue); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FloatMetric + */ +export const FloatMetric = new FloatMetric$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChanInfoRequest$Type extends MessageType { + constructor() { + super("lnrpc.ChanInfoRequest", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + ]); + } + create(value?: PartialMessage): ChanInfoRequest { + const message = { chanId: "0" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanInfoRequest): ChanInfoRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: + message.chanId = reader.uint64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChanInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(1, WireType.Varint).uint64(message.chanId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChanInfoRequest + */ +export const ChanInfoRequest = new ChanInfoRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NetworkInfoRequest$Type extends MessageType { + constructor() { + super("lnrpc.NetworkInfoRequest", []); + } + create(value?: PartialMessage): NetworkInfoRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NetworkInfoRequest): NetworkInfoRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: NetworkInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NetworkInfoRequest + */ +export const NetworkInfoRequest = new NetworkInfoRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NetworkInfo$Type extends MessageType { + constructor() { + super("lnrpc.NetworkInfo", [ + { no: 1, name: "graph_diameter", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "avg_out_degree", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 3, name: "max_out_degree", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "num_nodes", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "num_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 6, name: "total_network_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "avg_channel_size", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 8, name: "min_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "max_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "median_channel_size_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "num_zombie_chans", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): NetworkInfo { + const message = { graphDiameter: 0, avgOutDegree: 0, maxOutDegree: 0, numNodes: 0, numChannels: 0, totalNetworkCapacity: 0n, avgChannelSize: 0, minChannelSize: 0n, maxChannelSize: 0n, medianChannelSizeSat: 0n, numZombieChans: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NetworkInfo): NetworkInfo { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 graph_diameter */ 1: + message.graphDiameter = reader.uint32(); + break; + case /* double avg_out_degree */ 2: + message.avgOutDegree = reader.double(); + break; + case /* uint32 max_out_degree */ 3: + message.maxOutDegree = reader.uint32(); + break; + case /* uint32 num_nodes */ 4: + message.numNodes = reader.uint32(); + break; + case /* uint32 num_channels */ 5: + message.numChannels = reader.uint32(); + break; + case /* int64 total_network_capacity */ 6: + message.totalNetworkCapacity = reader.int64().toBigInt(); + break; + case /* double avg_channel_size */ 7: + message.avgChannelSize = reader.double(); + break; + case /* int64 min_channel_size */ 8: + message.minChannelSize = reader.int64().toBigInt(); + break; + case /* int64 max_channel_size */ 9: + message.maxChannelSize = reader.int64().toBigInt(); + break; + case /* int64 median_channel_size_sat */ 10: + message.medianChannelSizeSat = reader.int64().toBigInt(); + break; + case /* uint64 num_zombie_chans */ 11: + message.numZombieChans = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: NetworkInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint32 graph_diameter = 1; */ + if (message.graphDiameter !== 0) + writer.tag(1, WireType.Varint).uint32(message.graphDiameter); + /* double avg_out_degree = 2; */ + if (message.avgOutDegree !== 0) + writer.tag(2, WireType.Bit64).double(message.avgOutDegree); + /* uint32 max_out_degree = 3; */ + if (message.maxOutDegree !== 0) + writer.tag(3, WireType.Varint).uint32(message.maxOutDegree); + /* uint32 num_nodes = 4; */ + if (message.numNodes !== 0) + writer.tag(4, WireType.Varint).uint32(message.numNodes); + /* uint32 num_channels = 5; */ + if (message.numChannels !== 0) + writer.tag(5, WireType.Varint).uint32(message.numChannels); + /* int64 total_network_capacity = 6; */ + if (message.totalNetworkCapacity !== 0n) + writer.tag(6, WireType.Varint).int64(message.totalNetworkCapacity); + /* double avg_channel_size = 7; */ + if (message.avgChannelSize !== 0) + writer.tag(7, WireType.Bit64).double(message.avgChannelSize); + /* int64 min_channel_size = 8; */ + if (message.minChannelSize !== 0n) + writer.tag(8, WireType.Varint).int64(message.minChannelSize); + /* int64 max_channel_size = 9; */ + if (message.maxChannelSize !== 0n) + writer.tag(9, WireType.Varint).int64(message.maxChannelSize); + /* int64 median_channel_size_sat = 10; */ + if (message.medianChannelSizeSat !== 0n) + writer.tag(10, WireType.Varint).int64(message.medianChannelSizeSat); + /* uint64 num_zombie_chans = 11; */ + if (message.numZombieChans !== 0n) + writer.tag(11, WireType.Varint).uint64(message.numZombieChans); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NetworkInfo + */ +export const NetworkInfo = new NetworkInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StopRequest$Type extends MessageType { + constructor() { + super("lnrpc.StopRequest", []); + } + create(value?: PartialMessage): StopRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StopRequest): StopRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: StopRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.StopRequest + */ +export const StopRequest = new StopRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StopResponse$Type extends MessageType { + constructor() { + super("lnrpc.StopResponse", []); + } + create(value?: PartialMessage): StopResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StopResponse): StopResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: StopResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.StopResponse + */ +export const StopResponse = new StopResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GraphTopologySubscription$Type extends MessageType { + constructor() { + super("lnrpc.GraphTopologySubscription", []); + } + create(value?: PartialMessage): GraphTopologySubscription { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GraphTopologySubscription): GraphTopologySubscription { + return target ?? this.create(); + } + internalBinaryWrite(message: GraphTopologySubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.GraphTopologySubscription + */ +export const GraphTopologySubscription = new GraphTopologySubscription$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GraphTopologyUpdate$Type extends MessageType { + constructor() { + super("lnrpc.GraphTopologyUpdate", [ + { no: 1, name: "node_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeUpdate }, + { no: 2, name: "channel_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdgeUpdate }, + { no: 3, name: "closed_chans", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ClosedChannelUpdate } + ]); + } + create(value?: PartialMessage): GraphTopologyUpdate { + const message = { nodeUpdates: [], channelUpdates: [], closedChans: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GraphTopologyUpdate): GraphTopologyUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.NodeUpdate node_updates */ 1: + message.nodeUpdates.push(NodeUpdate.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated lnrpc.ChannelEdgeUpdate channel_updates */ 2: + message.channelUpdates.push(ChannelEdgeUpdate.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated lnrpc.ClosedChannelUpdate closed_chans */ 3: + message.closedChans.push(ClosedChannelUpdate.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GraphTopologyUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.NodeUpdate node_updates = 1; */ + for (let i = 0; i < message.nodeUpdates.length; i++) + NodeUpdate.internalBinaryWrite(message.nodeUpdates[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated lnrpc.ChannelEdgeUpdate channel_updates = 2; */ + for (let i = 0; i < message.channelUpdates.length; i++) + ChannelEdgeUpdate.internalBinaryWrite(message.channelUpdates[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated lnrpc.ClosedChannelUpdate closed_chans = 3; */ + for (let i = 0; i < message.closedChans.length; i++) + ClosedChannelUpdate.internalBinaryWrite(message.closedChans[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.GraphTopologyUpdate + */ +export const GraphTopologyUpdate = new GraphTopologyUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NodeUpdate$Type extends MessageType { + constructor() { + super("lnrpc.NodeUpdate", [ + { no: 1, name: "addresses", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "identity_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "global_features", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "node_addresses", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeAddress }, + { no: 6, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } + ]); + } + create(value?: PartialMessage): NodeUpdate { + const message = { addresses: [], identityKey: "", globalFeatures: new Uint8Array(0), alias: "", color: "", nodeAddresses: [], features: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeUpdate): NodeUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string addresses = 1 [deprecated = true];*/ 1: + message.addresses.push(reader.string()); + break; + case /* string identity_key */ 2: + message.identityKey = reader.string(); + break; + case /* bytes global_features = 3 [deprecated = true];*/ 3: + message.globalFeatures = reader.bytes(); + break; + case /* string alias */ 4: + message.alias = reader.string(); + break; + case /* string color */ 5: + message.color = reader.string(); + break; + case /* repeated lnrpc.NodeAddress node_addresses */ 7: + message.nodeAddresses.push(NodeAddress.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* map features */ 6: + this.binaryReadMap6(message.features, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap6(map: NodeUpdate["features"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof NodeUpdate["features"] | undefined, val: NodeUpdate["features"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint32(); + break; + case 2: + val = Feature.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.NodeUpdate.features"); + } + } + map[key ?? 0] = val ?? Feature.create(); + } + internalBinaryWrite(message: NodeUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string addresses = 1 [deprecated = true]; */ + for (let i = 0; i < message.addresses.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.addresses[i]); + /* string identity_key = 2; */ + if (message.identityKey !== "") + writer.tag(2, WireType.LengthDelimited).string(message.identityKey); + /* bytes global_features = 3 [deprecated = true]; */ + if (message.globalFeatures.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.globalFeatures); + /* string alias = 4; */ + if (message.alias !== "") + writer.tag(4, WireType.LengthDelimited).string(message.alias); + /* string color = 5; */ + if (message.color !== "") + writer.tag(5, WireType.LengthDelimited).string(message.color); + /* repeated lnrpc.NodeAddress node_addresses = 7; */ + for (let i = 0; i < message.nodeAddresses.length; i++) + NodeAddress.internalBinaryWrite(message.nodeAddresses[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* map features = 6; */ + for (let k of Object.keys(message.features)) { + writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); + writer.tag(2, WireType.LengthDelimited).fork(); + Feature.internalBinaryWrite(message.features[k as any], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.NodeUpdate + */ +export const NodeUpdate = new NodeUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelEdgeUpdate$Type extends MessageType { + constructor() { + super("lnrpc.ChannelEdgeUpdate", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "chan_point", kind: "message", T: () => ChannelPoint }, + { no: 3, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "routing_policy", kind: "message", T: () => RoutingPolicy }, + { no: 5, name: "advertising_node", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "connecting_node", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ChannelEdgeUpdate { + const message = { chanId: "0", capacity: 0n, advertisingNode: "", connectingNode: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEdgeUpdate): ChannelEdgeUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: + message.chanId = reader.uint64().toString(); + break; + case /* lnrpc.ChannelPoint chan_point */ 2: + message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); + break; + case /* int64 capacity */ 3: + message.capacity = reader.int64().toBigInt(); + break; + case /* lnrpc.RoutingPolicy routing_policy */ 4: + message.routingPolicy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.routingPolicy); + break; + case /* string advertising_node */ 5: + message.advertisingNode = reader.string(); + break; + case /* string connecting_node */ 6: + message.connectingNode = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelEdgeUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(1, WireType.Varint).uint64(message.chanId); + /* lnrpc.ChannelPoint chan_point = 2; */ + if (message.chanPoint) + ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* int64 capacity = 3; */ + if (message.capacity !== 0n) + writer.tag(3, WireType.Varint).int64(message.capacity); + /* lnrpc.RoutingPolicy routing_policy = 4; */ + if (message.routingPolicy) + RoutingPolicy.internalBinaryWrite(message.routingPolicy, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* string advertising_node = 5; */ + if (message.advertisingNode !== "") + writer.tag(5, WireType.LengthDelimited).string(message.advertisingNode); + /* string connecting_node = 6; */ + if (message.connectingNode !== "") + writer.tag(6, WireType.LengthDelimited).string(message.connectingNode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelEdgeUpdate + */ +export const ChannelEdgeUpdate = new ChannelEdgeUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ClosedChannelUpdate$Type extends MessageType { + constructor() { + super("lnrpc.ClosedChannelUpdate", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "closed_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "chan_point", kind: "message", T: () => ChannelPoint } + ]); + } + create(value?: PartialMessage): ClosedChannelUpdate { + const message = { chanId: "0", capacity: 0n, closedHeight: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelUpdate): ClosedChannelUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: + message.chanId = reader.uint64().toString(); + break; + case /* int64 capacity */ 2: + message.capacity = reader.int64().toBigInt(); + break; + case /* uint32 closed_height */ 3: + message.closedHeight = reader.uint32(); + break; + case /* lnrpc.ChannelPoint chan_point */ 4: + message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ClosedChannelUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(1, WireType.Varint).uint64(message.chanId); + /* int64 capacity = 2; */ + if (message.capacity !== 0n) + writer.tag(2, WireType.Varint).int64(message.capacity); + /* uint32 closed_height = 3; */ + if (message.closedHeight !== 0) + writer.tag(3, WireType.Varint).uint32(message.closedHeight); + /* lnrpc.ChannelPoint chan_point = 4; */ + if (message.chanPoint) + ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ClosedChannelUpdate + */ +export const ClosedChannelUpdate = new ClosedChannelUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HopHint$Type extends MessageType { + constructor() { + super("lnrpc.HopHint", [ + { no: 1, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "fee_base_msat", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "fee_proportional_millionths", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "cltv_expiry_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): HopHint { + const message = { nodeId: "", chanId: "0", feeBaseMsat: 0, feeProportionalMillionths: 0, cltvExpiryDelta: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HopHint): HopHint { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string node_id */ 1: + message.nodeId = reader.string(); + break; + case /* uint64 chan_id = 2 [jstype = JS_STRING];*/ 2: + message.chanId = reader.uint64().toString(); + break; + case /* uint32 fee_base_msat */ 3: + message.feeBaseMsat = reader.uint32(); + break; + case /* uint32 fee_proportional_millionths */ 4: + message.feeProportionalMillionths = reader.uint32(); + break; + case /* uint32 cltv_expiry_delta */ 5: + message.cltvExpiryDelta = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: HopHint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string node_id = 1; */ + if (message.nodeId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.nodeId); + /* uint64 chan_id = 2 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(2, WireType.Varint).uint64(message.chanId); + /* uint32 fee_base_msat = 3; */ + if (message.feeBaseMsat !== 0) + writer.tag(3, WireType.Varint).uint32(message.feeBaseMsat); + /* uint32 fee_proportional_millionths = 4; */ + if (message.feeProportionalMillionths !== 0) + writer.tag(4, WireType.Varint).uint32(message.feeProportionalMillionths); + /* uint32 cltv_expiry_delta = 5; */ + if (message.cltvExpiryDelta !== 0) + writer.tag(5, WireType.Varint).uint32(message.cltvExpiryDelta); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.HopHint + */ +export const HopHint = new HopHint$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetID$Type extends MessageType { + constructor() { + super("lnrpc.SetID", [ + { no: 1, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SetID { + const message = { setId: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetID): SetID { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes set_id */ 1: + message.setId = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SetID, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes set_id = 1; */ + if (message.setId.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.setId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SetID + */ +export const SetID = new SetID$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RouteHint$Type extends MessageType { + constructor() { + super("lnrpc.RouteHint", [ + { no: 1, name: "hop_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HopHint } + ]); + } + create(value?: PartialMessage): RouteHint { + const message = { hopHints: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteHint): RouteHint { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.HopHint hop_hints */ 1: + message.hopHints.push(HopHint.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RouteHint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.HopHint hop_hints = 1; */ + for (let i = 0; i < message.hopHints.length; i++) + HopHint.internalBinaryWrite(message.hopHints[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RouteHint + */ +export const RouteHint = new RouteHint$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AMPInvoiceState$Type extends MessageType { + constructor() { + super("lnrpc.AMPInvoiceState", [ + { no: 1, name: "state", kind: "enum", T: () => ["lnrpc.InvoiceHTLCState", InvoiceHTLCState] }, + { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "settle_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): AMPInvoiceState { + const message = { state: 0, settleIndex: 0n, settleTime: 0n, amtPaidMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMPInvoiceState): AMPInvoiceState { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.InvoiceHTLCState state */ 1: + message.state = reader.int32(); + break; + case /* uint64 settle_index */ 2: + message.settleIndex = reader.uint64().toBigInt(); + break; + case /* int64 settle_time */ 3: + message.settleTime = reader.int64().toBigInt(); + break; + case /* int64 amt_paid_msat */ 5: + message.amtPaidMsat = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AMPInvoiceState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.InvoiceHTLCState state = 1; */ + if (message.state !== 0) + writer.tag(1, WireType.Varint).int32(message.state); + /* uint64 settle_index = 2; */ + if (message.settleIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.settleIndex); + /* int64 settle_time = 3; */ + if (message.settleTime !== 0n) + writer.tag(3, WireType.Varint).int64(message.settleTime); + /* int64 amt_paid_msat = 5; */ + if (message.amtPaidMsat !== 0n) + writer.tag(5, WireType.Varint).int64(message.amtPaidMsat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AMPInvoiceState + */ +export const AMPInvoiceState = new AMPInvoiceState$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Invoice$Type extends MessageType { + constructor() { + super("lnrpc.Invoice", [ + { no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "r_preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 23, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "settle_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 11, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 14, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, + { no: 15, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 17, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 18, name: "amt_paid", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 19, name: "amt_paid_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 20, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 21, name: "state", kind: "enum", T: () => ["lnrpc.Invoice.InvoiceState", Invoice_InvoiceState] }, + { no: 22, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => InvoiceHTLC }, + { no: 24, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, + { no: 25, name: "is_keysend", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 26, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 27, name: "is_amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 28, name: "amp_invoice_state", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => AMPInvoiceState } } + ]); + } + create(value?: PartialMessage): Invoice { + const message = { memo: "", rPreimage: new Uint8Array(0), rHash: new Uint8Array(0), value: 0n, valueMsat: 0n, settled: false, creationDate: 0n, settleDate: 0n, paymentRequest: "", descriptionHash: new Uint8Array(0), expiry: 0n, fallbackAddr: "", cltvExpiry: 0n, routeHints: [], private: false, addIndex: 0n, settleIndex: 0n, amtPaid: 0n, amtPaidSat: 0n, amtPaidMsat: 0n, state: 0, htlcs: [], features: {}, isKeysend: false, paymentAddr: new Uint8Array(0), isAmp: false, ampInvoiceState: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Invoice): Invoice { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string memo */ 1: + message.memo = reader.string(); + break; + case /* bytes r_preimage */ 3: + message.rPreimage = reader.bytes(); + break; + case /* bytes r_hash */ 4: + message.rHash = reader.bytes(); + break; + case /* int64 value */ 5: + message.value = reader.int64().toBigInt(); + break; + case /* int64 value_msat */ 23: + message.valueMsat = reader.int64().toBigInt(); + break; + case /* bool settled = 6 [deprecated = true];*/ 6: + message.settled = reader.bool(); + break; + case /* int64 creation_date */ 7: + message.creationDate = reader.int64().toBigInt(); + break; + case /* int64 settle_date */ 8: + message.settleDate = reader.int64().toBigInt(); + break; + case /* string payment_request */ 9: + message.paymentRequest = reader.string(); + break; + case /* bytes description_hash */ 10: + message.descriptionHash = reader.bytes(); + break; + case /* int64 expiry */ 11: + message.expiry = reader.int64().toBigInt(); + break; + case /* string fallback_addr */ 12: + message.fallbackAddr = reader.string(); + break; + case /* uint64 cltv_expiry */ 13: + message.cltvExpiry = reader.uint64().toBigInt(); + break; + case /* repeated lnrpc.RouteHint route_hints */ 14: + message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* bool private */ 15: + message.private = reader.bool(); + break; + case /* uint64 add_index */ 16: + message.addIndex = reader.uint64().toBigInt(); + break; + case /* uint64 settle_index */ 17: + message.settleIndex = reader.uint64().toBigInt(); + break; + case /* int64 amt_paid = 18 [deprecated = true];*/ 18: + message.amtPaid = reader.int64().toBigInt(); + break; + case /* int64 amt_paid_sat */ 19: + message.amtPaidSat = reader.int64().toBigInt(); + break; + case /* int64 amt_paid_msat */ 20: + message.amtPaidMsat = reader.int64().toBigInt(); + break; + case /* lnrpc.Invoice.InvoiceState state */ 21: + message.state = reader.int32(); + break; + case /* repeated lnrpc.InvoiceHTLC htlcs */ 22: + message.htlcs.push(InvoiceHTLC.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* map features */ 24: + this.binaryReadMap24(message.features, reader, options); + break; + case /* bool is_keysend */ 25: + message.isKeysend = reader.bool(); + break; + case /* bytes payment_addr */ 26: + message.paymentAddr = reader.bytes(); + break; + case /* bool is_amp */ 27: + message.isAmp = reader.bool(); + break; + case /* map amp_invoice_state */ 28: + this.binaryReadMap28(message.ampInvoiceState, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap24(map: Invoice["features"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Invoice["features"] | undefined, val: Invoice["features"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint32(); + break; + case 2: + val = Feature.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.Invoice.features"); + } + } + map[key ?? 0] = val ?? Feature.create(); + } + private binaryReadMap28(map: Invoice["ampInvoiceState"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Invoice["ampInvoiceState"] | undefined, val: Invoice["ampInvoiceState"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = AMPInvoiceState.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.Invoice.amp_invoice_state"); + } + } + map[key ?? ""] = val ?? AMPInvoiceState.create(); + } + internalBinaryWrite(message: Invoice, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string memo = 1; */ + if (message.memo !== "") + writer.tag(1, WireType.LengthDelimited).string(message.memo); + /* bytes r_preimage = 3; */ + if (message.rPreimage.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.rPreimage); + /* bytes r_hash = 4; */ + if (message.rHash.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.rHash); + /* int64 value = 5; */ + if (message.value !== 0n) + writer.tag(5, WireType.Varint).int64(message.value); + /* int64 value_msat = 23; */ + if (message.valueMsat !== 0n) + writer.tag(23, WireType.Varint).int64(message.valueMsat); + /* bool settled = 6 [deprecated = true]; */ + if (message.settled !== false) + writer.tag(6, WireType.Varint).bool(message.settled); + /* int64 creation_date = 7; */ + if (message.creationDate !== 0n) + writer.tag(7, WireType.Varint).int64(message.creationDate); + /* int64 settle_date = 8; */ + if (message.settleDate !== 0n) + writer.tag(8, WireType.Varint).int64(message.settleDate); + /* string payment_request = 9; */ + if (message.paymentRequest !== "") + writer.tag(9, WireType.LengthDelimited).string(message.paymentRequest); + /* bytes description_hash = 10; */ + if (message.descriptionHash.length) + writer.tag(10, WireType.LengthDelimited).bytes(message.descriptionHash); + /* int64 expiry = 11; */ + if (message.expiry !== 0n) + writer.tag(11, WireType.Varint).int64(message.expiry); + /* string fallback_addr = 12; */ + if (message.fallbackAddr !== "") + writer.tag(12, WireType.LengthDelimited).string(message.fallbackAddr); + /* uint64 cltv_expiry = 13; */ + if (message.cltvExpiry !== 0n) + writer.tag(13, WireType.Varint).uint64(message.cltvExpiry); + /* repeated lnrpc.RouteHint route_hints = 14; */ + for (let i = 0; i < message.routeHints.length; i++) + RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join(); + /* bool private = 15; */ + if (message.private !== false) + writer.tag(15, WireType.Varint).bool(message.private); + /* uint64 add_index = 16; */ + if (message.addIndex !== 0n) + writer.tag(16, WireType.Varint).uint64(message.addIndex); + /* uint64 settle_index = 17; */ + if (message.settleIndex !== 0n) + writer.tag(17, WireType.Varint).uint64(message.settleIndex); + /* int64 amt_paid = 18 [deprecated = true]; */ + if (message.amtPaid !== 0n) + writer.tag(18, WireType.Varint).int64(message.amtPaid); + /* int64 amt_paid_sat = 19; */ + if (message.amtPaidSat !== 0n) + writer.tag(19, WireType.Varint).int64(message.amtPaidSat); + /* int64 amt_paid_msat = 20; */ + if (message.amtPaidMsat !== 0n) + writer.tag(20, WireType.Varint).int64(message.amtPaidMsat); + /* lnrpc.Invoice.InvoiceState state = 21; */ + if (message.state !== 0) + writer.tag(21, WireType.Varint).int32(message.state); + /* repeated lnrpc.InvoiceHTLC htlcs = 22; */ + for (let i = 0; i < message.htlcs.length; i++) + InvoiceHTLC.internalBinaryWrite(message.htlcs[i], writer.tag(22, WireType.LengthDelimited).fork(), options).join(); + /* map features = 24; */ + for (let k of Object.keys(message.features)) { + writer.tag(24, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); + writer.tag(2, WireType.LengthDelimited).fork(); + Feature.internalBinaryWrite(message.features[k as any], writer, options); + writer.join().join(); + } + /* bool is_keysend = 25; */ + if (message.isKeysend !== false) + writer.tag(25, WireType.Varint).bool(message.isKeysend); + /* bytes payment_addr = 26; */ + if (message.paymentAddr.length) + writer.tag(26, WireType.LengthDelimited).bytes(message.paymentAddr); + /* bool is_amp = 27; */ + if (message.isAmp !== false) + writer.tag(27, WireType.Varint).bool(message.isAmp); + /* map amp_invoice_state = 28; */ + for (let k of Object.keys(message.ampInvoiceState)) { + writer.tag(28, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + AMPInvoiceState.internalBinaryWrite(message.ampInvoiceState[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Invoice + */ +export const Invoice = new Invoice$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class InvoiceHTLC$Type extends MessageType { + constructor() { + super("lnrpc.InvoiceHTLC", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "accept_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: "accept_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "resolve_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "expiry_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: "state", kind: "enum", T: () => ["lnrpc.InvoiceHTLCState", InvoiceHTLCState] }, + { no: 9, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, + { no: 10, name: "mpp_total_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "amp", kind: "message", T: () => AMP } + ]); + } + create(value?: PartialMessage): InvoiceHTLC { + const message = { chanId: "0", htlcIndex: 0n, amtMsat: 0n, acceptHeight: 0, acceptTime: 0n, resolveTime: 0n, expiryHeight: 0, state: 0, customRecords: {}, mppTotalAmtMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InvoiceHTLC): InvoiceHTLC { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id = 1 [jstype = JS_STRING];*/ 1: + message.chanId = reader.uint64().toString(); + break; + case /* uint64 htlc_index */ 2: + message.htlcIndex = reader.uint64().toBigInt(); + break; + case /* uint64 amt_msat */ 3: + message.amtMsat = reader.uint64().toBigInt(); + break; + case /* int32 accept_height */ 4: + message.acceptHeight = reader.int32(); + break; + case /* int64 accept_time */ 5: + message.acceptTime = reader.int64().toBigInt(); + break; + case /* int64 resolve_time */ 6: + message.resolveTime = reader.int64().toBigInt(); + break; + case /* int32 expiry_height */ 7: + message.expiryHeight = reader.int32(); + break; + case /* lnrpc.InvoiceHTLCState state */ 8: + message.state = reader.int32(); + break; + case /* map custom_records */ 9: + this.binaryReadMap9(message.customRecords, reader, options); + break; + case /* uint64 mpp_total_amt_msat */ 10: + message.mppTotalAmtMsat = reader.uint64().toBigInt(); + break; + case /* lnrpc.AMP amp */ 11: + message.amp = AMP.internalBinaryRead(reader, reader.uint32(), options, message.amp); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap9(map: InvoiceHTLC["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof InvoiceHTLC["customRecords"] | undefined, val: InvoiceHTLC["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.InvoiceHTLC.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: InvoiceHTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(1, WireType.Varint).uint64(message.chanId); + /* uint64 htlc_index = 2; */ + if (message.htlcIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.htlcIndex); + /* uint64 amt_msat = 3; */ + if (message.amtMsat !== 0n) + writer.tag(3, WireType.Varint).uint64(message.amtMsat); + /* int32 accept_height = 4; */ + if (message.acceptHeight !== 0) + writer.tag(4, WireType.Varint).int32(message.acceptHeight); + /* int64 accept_time = 5; */ + if (message.acceptTime !== 0n) + writer.tag(5, WireType.Varint).int64(message.acceptTime); + /* int64 resolve_time = 6; */ + if (message.resolveTime !== 0n) + writer.tag(6, WireType.Varint).int64(message.resolveTime); + /* int32 expiry_height = 7; */ + if (message.expiryHeight !== 0) + writer.tag(7, WireType.Varint).int32(message.expiryHeight); + /* lnrpc.InvoiceHTLCState state = 8; */ + if (message.state !== 0) + writer.tag(8, WireType.Varint).int32(message.state); + /* map custom_records = 9; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); + /* uint64 mpp_total_amt_msat = 10; */ + if (message.mppTotalAmtMsat !== 0n) + writer.tag(10, WireType.Varint).uint64(message.mppTotalAmtMsat); + /* lnrpc.AMP amp = 11; */ + if (message.amp) + AMP.internalBinaryWrite(message.amp, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.InvoiceHTLC + */ +export const InvoiceHTLC = new InvoiceHTLC$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AMP$Type extends MessageType { + constructor() { + super("lnrpc.AMP", [ + { no: 1, name: "root_share", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "child_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): AMP { + const message = { rootShare: new Uint8Array(0), setId: new Uint8Array(0), childIndex: 0, hash: new Uint8Array(0), preimage: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMP): AMP { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes root_share */ 1: + message.rootShare = reader.bytes(); + break; + case /* bytes set_id */ 2: + message.setId = reader.bytes(); + break; + case /* uint32 child_index */ 3: + message.childIndex = reader.uint32(); + break; + case /* bytes hash */ 4: + message.hash = reader.bytes(); + break; + case /* bytes preimage */ 5: + message.preimage = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AMP, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes root_share = 1; */ + if (message.rootShare.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.rootShare); + /* bytes set_id = 2; */ + if (message.setId.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.setId); + /* uint32 child_index = 3; */ + if (message.childIndex !== 0) + writer.tag(3, WireType.Varint).uint32(message.childIndex); + /* bytes hash = 4; */ + if (message.hash.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.hash); + /* bytes preimage = 5; */ + if (message.preimage.length) + writer.tag(5, WireType.LengthDelimited).bytes(message.preimage); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AMP + */ +export const AMP = new AMP$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AddInvoiceResponse$Type extends MessageType { + constructor() { + super("lnrpc.AddInvoiceResponse", [ + { no: 1, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 17, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): AddInvoiceResponse { + const message = { rHash: new Uint8Array(0), paymentRequest: "", addIndex: 0n, paymentAddr: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddInvoiceResponse): AddInvoiceResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes r_hash */ 1: + message.rHash = reader.bytes(); + break; + case /* string payment_request */ 2: + message.paymentRequest = reader.string(); + break; + case /* uint64 add_index */ 16: + message.addIndex = reader.uint64().toBigInt(); + break; + case /* bytes payment_addr */ 17: + message.paymentAddr = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AddInvoiceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes r_hash = 1; */ + if (message.rHash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.rHash); + /* string payment_request = 2; */ + if (message.paymentRequest !== "") + writer.tag(2, WireType.LengthDelimited).string(message.paymentRequest); + /* uint64 add_index = 16; */ + if (message.addIndex !== 0n) + writer.tag(16, WireType.Varint).uint64(message.addIndex); + /* bytes payment_addr = 17; */ + if (message.paymentAddr.length) + writer.tag(17, WireType.LengthDelimited).bytes(message.paymentAddr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AddInvoiceResponse + */ +export const AddInvoiceResponse = new AddInvoiceResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PaymentHash$Type extends MessageType { + constructor() { + super("lnrpc.PaymentHash", [ + { no: 1, name: "r_hash_str", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): PaymentHash { + const message = { rHashStr: "", rHash: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PaymentHash): PaymentHash { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string r_hash_str = 1 [deprecated = true];*/ 1: + message.rHashStr = reader.string(); + break; + case /* bytes r_hash */ 2: + message.rHash = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PaymentHash, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string r_hash_str = 1 [deprecated = true]; */ + if (message.rHashStr !== "") + writer.tag(1, WireType.LengthDelimited).string(message.rHashStr); + /* bytes r_hash = 2; */ + if (message.rHash.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.rHash); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PaymentHash + */ +export const PaymentHash = new PaymentHash$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListInvoiceRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListInvoiceRequest", [ + { no: 1, name: "pending_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "num_max_invoices", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ListInvoiceRequest { + const message = { pendingOnly: false, indexOffset: 0n, numMaxInvoices: 0n, reversed: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListInvoiceRequest): ListInvoiceRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool pending_only */ 1: + message.pendingOnly = reader.bool(); + break; + case /* uint64 index_offset */ 4: + message.indexOffset = reader.uint64().toBigInt(); + break; + case /* uint64 num_max_invoices */ 5: + message.numMaxInvoices = reader.uint64().toBigInt(); + break; + case /* bool reversed */ 6: + message.reversed = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool pending_only = 1; */ + if (message.pendingOnly !== false) + writer.tag(1, WireType.Varint).bool(message.pendingOnly); + /* uint64 index_offset = 4; */ + if (message.indexOffset !== 0n) + writer.tag(4, WireType.Varint).uint64(message.indexOffset); + /* uint64 num_max_invoices = 5; */ + if (message.numMaxInvoices !== 0n) + writer.tag(5, WireType.Varint).uint64(message.numMaxInvoices); + /* bool reversed = 6; */ + if (message.reversed !== false) + writer.tag(6, WireType.Varint).bool(message.reversed); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListInvoiceRequest + */ +export const ListInvoiceRequest = new ListInvoiceRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListInvoiceResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListInvoiceResponse", [ + { no: 1, name: "invoices", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Invoice }, + { no: 2, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): ListInvoiceResponse { + const message = { invoices: [], lastIndexOffset: 0n, firstIndexOffset: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListInvoiceResponse): ListInvoiceResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.Invoice invoices */ 1: + message.invoices.push(Invoice.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint64 last_index_offset */ 2: + message.lastIndexOffset = reader.uint64().toBigInt(); + break; + case /* uint64 first_index_offset */ 3: + message.firstIndexOffset = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListInvoiceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.Invoice invoices = 1; */ + for (let i = 0; i < message.invoices.length; i++) + Invoice.internalBinaryWrite(message.invoices[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint64 last_index_offset = 2; */ + if (message.lastIndexOffset !== 0n) + writer.tag(2, WireType.Varint).uint64(message.lastIndexOffset); + /* uint64 first_index_offset = 3; */ + if (message.firstIndexOffset !== 0n) + writer.tag(3, WireType.Varint).uint64(message.firstIndexOffset); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListInvoiceResponse + */ +export const ListInvoiceResponse = new ListInvoiceResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class InvoiceSubscription$Type extends MessageType { + constructor() { + super("lnrpc.InvoiceSubscription", [ + { no: 1, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): InvoiceSubscription { + const message = { addIndex: 0n, settleIndex: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InvoiceSubscription): InvoiceSubscription { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 add_index */ 1: + message.addIndex = reader.uint64().toBigInt(); + break; + case /* uint64 settle_index */ 2: + message.settleIndex = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: InvoiceSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 add_index = 1; */ + if (message.addIndex !== 0n) + writer.tag(1, WireType.Varint).uint64(message.addIndex); + /* uint64 settle_index = 2; */ + if (message.settleIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.settleIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.InvoiceSubscription + */ +export const InvoiceSubscription = new InvoiceSubscription$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Payment$Type extends MessageType { + constructor() { + super("lnrpc.Payment", [ + { no: 1, name: "payment_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "payment_preimage", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "value_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "status", kind: "enum", T: () => ["lnrpc.Payment.PaymentStatus", Payment_PaymentStatus] }, + { no: 11, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 13, name: "creation_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 14, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLCAttempt }, + { no: 15, name: "payment_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 16, name: "failure_reason", kind: "enum", T: () => ["lnrpc.PaymentFailureReason", PaymentFailureReason] } + ]); + } + create(value?: PartialMessage): Payment { + const message = { paymentHash: "", value: 0n, creationDate: 0n, fee: 0n, paymentPreimage: "", valueSat: 0n, valueMsat: 0n, paymentRequest: "", status: 0, feeSat: 0n, feeMsat: 0n, creationTimeNs: 0n, htlcs: [], paymentIndex: 0n, failureReason: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Payment): Payment { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string payment_hash */ 1: + message.paymentHash = reader.string(); + break; + case /* int64 value = 2 [deprecated = true];*/ 2: + message.value = reader.int64().toBigInt(); + break; + case /* int64 creation_date = 3 [deprecated = true];*/ 3: + message.creationDate = reader.int64().toBigInt(); + break; + case /* int64 fee = 5 [deprecated = true];*/ 5: + message.fee = reader.int64().toBigInt(); + break; + case /* string payment_preimage */ 6: + message.paymentPreimage = reader.string(); + break; + case /* int64 value_sat */ 7: + message.valueSat = reader.int64().toBigInt(); + break; + case /* int64 value_msat */ 8: + message.valueMsat = reader.int64().toBigInt(); + break; + case /* string payment_request */ 9: + message.paymentRequest = reader.string(); + break; + case /* lnrpc.Payment.PaymentStatus status */ 10: + message.status = reader.int32(); + break; + case /* int64 fee_sat */ 11: + message.feeSat = reader.int64().toBigInt(); + break; + case /* int64 fee_msat */ 12: + message.feeMsat = reader.int64().toBigInt(); + break; + case /* int64 creation_time_ns */ 13: + message.creationTimeNs = reader.int64().toBigInt(); + break; + case /* repeated lnrpc.HTLCAttempt htlcs */ 14: + message.htlcs.push(HTLCAttempt.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint64 payment_index */ 15: + message.paymentIndex = reader.uint64().toBigInt(); + break; + case /* lnrpc.PaymentFailureReason failure_reason */ 16: + message.failureReason = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Payment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string payment_hash = 1; */ + if (message.paymentHash !== "") + writer.tag(1, WireType.LengthDelimited).string(message.paymentHash); + /* int64 value = 2 [deprecated = true]; */ + if (message.value !== 0n) + writer.tag(2, WireType.Varint).int64(message.value); + /* int64 creation_date = 3 [deprecated = true]; */ + if (message.creationDate !== 0n) + writer.tag(3, WireType.Varint).int64(message.creationDate); + /* int64 fee = 5 [deprecated = true]; */ + if (message.fee !== 0n) + writer.tag(5, WireType.Varint).int64(message.fee); + /* string payment_preimage = 6; */ + if (message.paymentPreimage !== "") + writer.tag(6, WireType.LengthDelimited).string(message.paymentPreimage); + /* int64 value_sat = 7; */ + if (message.valueSat !== 0n) + writer.tag(7, WireType.Varint).int64(message.valueSat); + /* int64 value_msat = 8; */ + if (message.valueMsat !== 0n) + writer.tag(8, WireType.Varint).int64(message.valueMsat); + /* string payment_request = 9; */ + if (message.paymentRequest !== "") + writer.tag(9, WireType.LengthDelimited).string(message.paymentRequest); + /* lnrpc.Payment.PaymentStatus status = 10; */ + if (message.status !== 0) + writer.tag(10, WireType.Varint).int32(message.status); + /* int64 fee_sat = 11; */ + if (message.feeSat !== 0n) + writer.tag(11, WireType.Varint).int64(message.feeSat); + /* int64 fee_msat = 12; */ + if (message.feeMsat !== 0n) + writer.tag(12, WireType.Varint).int64(message.feeMsat); + /* int64 creation_time_ns = 13; */ + if (message.creationTimeNs !== 0n) + writer.tag(13, WireType.Varint).int64(message.creationTimeNs); + /* repeated lnrpc.HTLCAttempt htlcs = 14; */ + for (let i = 0; i < message.htlcs.length; i++) + HTLCAttempt.internalBinaryWrite(message.htlcs[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join(); + /* uint64 payment_index = 15; */ + if (message.paymentIndex !== 0n) + writer.tag(15, WireType.Varint).uint64(message.paymentIndex); + /* lnrpc.PaymentFailureReason failure_reason = 16; */ + if (message.failureReason !== 0) + writer.tag(16, WireType.Varint).int32(message.failureReason); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Payment + */ +export const Payment = new Payment$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HTLCAttempt$Type extends MessageType { + constructor() { + super("lnrpc.HTLCAttempt", [ + { no: 7, name: "attempt_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 1, name: "status", kind: "enum", T: () => ["lnrpc.HTLCAttempt.HTLCStatus", HTLCAttempt_HTLCStatus] }, + { no: 2, name: "route", kind: "message", T: () => Route }, + { no: 3, name: "attempt_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "resolve_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "failure", kind: "message", T: () => Failure }, + { no: 6, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): HTLCAttempt { + const message = { attemptId: 0n, status: 0, attemptTimeNs: 0n, resolveTimeNs: 0n, preimage: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HTLCAttempt): HTLCAttempt { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 attempt_id */ 7: + message.attemptId = reader.uint64().toBigInt(); + break; + case /* lnrpc.HTLCAttempt.HTLCStatus status */ 1: + message.status = reader.int32(); + break; + case /* lnrpc.Route route */ 2: + message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); + break; + case /* int64 attempt_time_ns */ 3: + message.attemptTimeNs = reader.int64().toBigInt(); + break; + case /* int64 resolve_time_ns */ 4: + message.resolveTimeNs = reader.int64().toBigInt(); + break; + case /* lnrpc.Failure failure */ 5: + message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); + break; + case /* bytes preimage */ 6: + message.preimage = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: HTLCAttempt, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 attempt_id = 7; */ + if (message.attemptId !== 0n) + writer.tag(7, WireType.Varint).uint64(message.attemptId); + /* lnrpc.HTLCAttempt.HTLCStatus status = 1; */ + if (message.status !== 0) + writer.tag(1, WireType.Varint).int32(message.status); + /* lnrpc.Route route = 2; */ + if (message.route) + Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* int64 attempt_time_ns = 3; */ + if (message.attemptTimeNs !== 0n) + writer.tag(3, WireType.Varint).int64(message.attemptTimeNs); + /* int64 resolve_time_ns = 4; */ + if (message.resolveTimeNs !== 0n) + writer.tag(4, WireType.Varint).int64(message.resolveTimeNs); + /* lnrpc.Failure failure = 5; */ + if (message.failure) + Failure.internalBinaryWrite(message.failure, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* bytes preimage = 6; */ + if (message.preimage.length) + writer.tag(6, WireType.LengthDelimited).bytes(message.preimage); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.HTLCAttempt + */ +export const HTLCAttempt = new HTLCAttempt$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListPaymentsRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListPaymentsRequest", [ + { no: 1, name: "include_incomplete", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "max_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "count_total_payments", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ListPaymentsRequest { + const message = { includeIncomplete: false, indexOffset: 0n, maxPayments: 0n, reversed: false, countTotalPayments: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPaymentsRequest): ListPaymentsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool include_incomplete */ 1: + message.includeIncomplete = reader.bool(); + break; + case /* uint64 index_offset */ 2: + message.indexOffset = reader.uint64().toBigInt(); + break; + case /* uint64 max_payments */ 3: + message.maxPayments = reader.uint64().toBigInt(); + break; + case /* bool reversed */ 4: + message.reversed = reader.bool(); + break; + case /* bool count_total_payments */ 5: + message.countTotalPayments = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool include_incomplete = 1; */ + if (message.includeIncomplete !== false) + writer.tag(1, WireType.Varint).bool(message.includeIncomplete); + /* uint64 index_offset = 2; */ + if (message.indexOffset !== 0n) + writer.tag(2, WireType.Varint).uint64(message.indexOffset); + /* uint64 max_payments = 3; */ + if (message.maxPayments !== 0n) + writer.tag(3, WireType.Varint).uint64(message.maxPayments); + /* bool reversed = 4; */ + if (message.reversed !== false) + writer.tag(4, WireType.Varint).bool(message.reversed); + /* bool count_total_payments = 5; */ + if (message.countTotalPayments !== false) + writer.tag(5, WireType.Varint).bool(message.countTotalPayments); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListPaymentsRequest + */ +export const ListPaymentsRequest = new ListPaymentsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListPaymentsResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListPaymentsResponse", [ + { no: 1, name: "payments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Payment }, + { no: 2, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "total_num_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): ListPaymentsResponse { + const message = { payments: [], firstIndexOffset: 0n, lastIndexOffset: 0n, totalNumPayments: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPaymentsResponse): ListPaymentsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.Payment payments */ 1: + message.payments.push(Payment.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint64 first_index_offset */ 2: + message.firstIndexOffset = reader.uint64().toBigInt(); + break; + case /* uint64 last_index_offset */ 3: + message.lastIndexOffset = reader.uint64().toBigInt(); + break; + case /* uint64 total_num_payments */ 4: + message.totalNumPayments = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListPaymentsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.Payment payments = 1; */ + for (let i = 0; i < message.payments.length; i++) + Payment.internalBinaryWrite(message.payments[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint64 first_index_offset = 2; */ + if (message.firstIndexOffset !== 0n) + writer.tag(2, WireType.Varint).uint64(message.firstIndexOffset); + /* uint64 last_index_offset = 3; */ + if (message.lastIndexOffset !== 0n) + writer.tag(3, WireType.Varint).uint64(message.lastIndexOffset); + /* uint64 total_num_payments = 4; */ + if (message.totalNumPayments !== 0n) + writer.tag(4, WireType.Varint).uint64(message.totalNumPayments); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListPaymentsResponse + */ +export const ListPaymentsResponse = new ListPaymentsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeletePaymentRequest$Type extends MessageType { + constructor() { + super("lnrpc.DeletePaymentRequest", [ + { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "failed_htlcs_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): DeletePaymentRequest { + const message = { paymentHash: new Uint8Array(0), failedHtlcsOnly: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentRequest): DeletePaymentRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.paymentHash = reader.bytes(); + break; + case /* bool failed_htlcs_only */ 2: + message.failedHtlcsOnly = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeletePaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.paymentHash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); + /* bool failed_htlcs_only = 2; */ + if (message.failedHtlcsOnly !== false) + writer.tag(2, WireType.Varint).bool(message.failedHtlcsOnly); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeletePaymentRequest + */ +export const DeletePaymentRequest = new DeletePaymentRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeleteAllPaymentsRequest$Type extends MessageType { + constructor() { + super("lnrpc.DeleteAllPaymentsRequest", [ + { no: 1, name: "failed_payments_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "failed_htlcs_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): DeleteAllPaymentsRequest { + const message = { failedPaymentsOnly: false, failedHtlcsOnly: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllPaymentsRequest): DeleteAllPaymentsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool failed_payments_only */ 1: + message.failedPaymentsOnly = reader.bool(); + break; + case /* bool failed_htlcs_only */ 2: + message.failedHtlcsOnly = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeleteAllPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool failed_payments_only = 1; */ + if (message.failedPaymentsOnly !== false) + writer.tag(1, WireType.Varint).bool(message.failedPaymentsOnly); + /* bool failed_htlcs_only = 2; */ + if (message.failedHtlcsOnly !== false) + writer.tag(2, WireType.Varint).bool(message.failedHtlcsOnly); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeleteAllPaymentsRequest + */ +export const DeleteAllPaymentsRequest = new DeleteAllPaymentsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeletePaymentResponse$Type extends MessageType { + constructor() { + super("lnrpc.DeletePaymentResponse", []); + } + create(value?: PartialMessage): DeletePaymentResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentResponse): DeletePaymentResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: DeletePaymentResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeletePaymentResponse + */ +export const DeletePaymentResponse = new DeletePaymentResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeleteAllPaymentsResponse$Type extends MessageType { + constructor() { + super("lnrpc.DeleteAllPaymentsResponse", []); + } + create(value?: PartialMessage): DeleteAllPaymentsResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllPaymentsResponse): DeleteAllPaymentsResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: DeleteAllPaymentsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeleteAllPaymentsResponse + */ +export const DeleteAllPaymentsResponse = new DeleteAllPaymentsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AbandonChannelRequest$Type extends MessageType { + constructor() { + super("lnrpc.AbandonChannelRequest", [ + { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint }, + { no: 2, name: "pending_funding_shim_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "i_know_what_i_am_doing", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): AbandonChannelRequest { + const message = { pendingFundingShimOnly: false, iKnowWhatIAmDoing: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AbandonChannelRequest): AbandonChannelRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelPoint channel_point */ 1: + message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); + break; + case /* bool pending_funding_shim_only */ 2: + message.pendingFundingShimOnly = reader.bool(); + break; + case /* bool i_know_what_i_am_doing */ 3: + message.iKnowWhatIAmDoing = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AbandonChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelPoint channel_point = 1; */ + if (message.channelPoint) + ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bool pending_funding_shim_only = 2; */ + if (message.pendingFundingShimOnly !== false) + writer.tag(2, WireType.Varint).bool(message.pendingFundingShimOnly); + /* bool i_know_what_i_am_doing = 3; */ + if (message.iKnowWhatIAmDoing !== false) + writer.tag(3, WireType.Varint).bool(message.iKnowWhatIAmDoing); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AbandonChannelRequest + */ +export const AbandonChannelRequest = new AbandonChannelRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AbandonChannelResponse$Type extends MessageType { + constructor() { + super("lnrpc.AbandonChannelResponse", []); + } + create(value?: PartialMessage): AbandonChannelResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AbandonChannelResponse): AbandonChannelResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: AbandonChannelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AbandonChannelResponse + */ +export const AbandonChannelResponse = new AbandonChannelResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DebugLevelRequest$Type extends MessageType { + constructor() { + super("lnrpc.DebugLevelRequest", [ + { no: 1, name: "show", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "level_spec", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DebugLevelRequest { + const message = { show: false, levelSpec: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DebugLevelRequest): DebugLevelRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool show */ 1: + message.show = reader.bool(); + break; + case /* string level_spec */ 2: + message.levelSpec = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DebugLevelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool show = 1; */ + if (message.show !== false) + writer.tag(1, WireType.Varint).bool(message.show); + /* string level_spec = 2; */ + if (message.levelSpec !== "") + writer.tag(2, WireType.LengthDelimited).string(message.levelSpec); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DebugLevelRequest + */ +export const DebugLevelRequest = new DebugLevelRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DebugLevelResponse$Type extends MessageType { + constructor() { + super("lnrpc.DebugLevelResponse", [ + { no: 1, name: "sub_systems", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DebugLevelResponse { + const message = { subSystems: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DebugLevelResponse): DebugLevelResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string sub_systems */ 1: + message.subSystems = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DebugLevelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string sub_systems = 1; */ + if (message.subSystems !== "") + writer.tag(1, WireType.LengthDelimited).string(message.subSystems); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DebugLevelResponse + */ +export const DebugLevelResponse = new DebugLevelResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PayReqString$Type extends MessageType { + constructor() { + super("lnrpc.PayReqString", [ + { no: 1, name: "pay_req", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): PayReqString { + const message = { payReq: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PayReqString): PayReqString { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string pay_req */ 1: + message.payReq = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PayReqString, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string pay_req = 1; */ + if (message.payReq !== "") + writer.tag(1, WireType.LengthDelimited).string(message.payReq); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PayReqString + */ +export const PayReqString = new PayReqString$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PayReq$Type extends MessageType { + constructor() { + super("lnrpc.PayReq", [ + { no: 1, name: "destination", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "payment_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "num_satoshis", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "description_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "cltv_expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, + { no: 11, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 12, name: "num_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 13, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } + ]); + } + create(value?: PartialMessage): PayReq { + const message = { destination: "", paymentHash: "", numSatoshis: 0n, timestamp: 0n, expiry: 0n, description: "", descriptionHash: "", fallbackAddr: "", cltvExpiry: 0n, routeHints: [], paymentAddr: new Uint8Array(0), numMsat: 0n, features: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PayReq): PayReq { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string destination */ 1: + message.destination = reader.string(); + break; + case /* string payment_hash */ 2: + message.paymentHash = reader.string(); + break; + case /* int64 num_satoshis */ 3: + message.numSatoshis = reader.int64().toBigInt(); + break; + case /* int64 timestamp */ 4: + message.timestamp = reader.int64().toBigInt(); + break; + case /* int64 expiry */ 5: + message.expiry = reader.int64().toBigInt(); + break; + case /* string description */ 6: + message.description = reader.string(); + break; + case /* string description_hash */ 7: + message.descriptionHash = reader.string(); + break; + case /* string fallback_addr */ 8: + message.fallbackAddr = reader.string(); + break; + case /* int64 cltv_expiry */ 9: + message.cltvExpiry = reader.int64().toBigInt(); + break; + case /* repeated lnrpc.RouteHint route_hints */ 10: + message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* bytes payment_addr */ 11: + message.paymentAddr = reader.bytes(); + break; + case /* int64 num_msat */ 12: + message.numMsat = reader.int64().toBigInt(); + break; + case /* map features */ 13: + this.binaryReadMap13(message.features, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap13(map: PayReq["features"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof PayReq["features"] | undefined, val: PayReq["features"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint32(); + break; + case 2: + val = Feature.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.PayReq.features"); + } + } + map[key ?? 0] = val ?? Feature.create(); + } + internalBinaryWrite(message: PayReq, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string destination = 1; */ + if (message.destination !== "") + writer.tag(1, WireType.LengthDelimited).string(message.destination); + /* string payment_hash = 2; */ + if (message.paymentHash !== "") + writer.tag(2, WireType.LengthDelimited).string(message.paymentHash); + /* int64 num_satoshis = 3; */ + if (message.numSatoshis !== 0n) + writer.tag(3, WireType.Varint).int64(message.numSatoshis); + /* int64 timestamp = 4; */ + if (message.timestamp !== 0n) + writer.tag(4, WireType.Varint).int64(message.timestamp); + /* int64 expiry = 5; */ + if (message.expiry !== 0n) + writer.tag(5, WireType.Varint).int64(message.expiry); + /* string description = 6; */ + if (message.description !== "") + writer.tag(6, WireType.LengthDelimited).string(message.description); + /* string description_hash = 7; */ + if (message.descriptionHash !== "") + writer.tag(7, WireType.LengthDelimited).string(message.descriptionHash); + /* string fallback_addr = 8; */ + if (message.fallbackAddr !== "") + writer.tag(8, WireType.LengthDelimited).string(message.fallbackAddr); + /* int64 cltv_expiry = 9; */ + if (message.cltvExpiry !== 0n) + writer.tag(9, WireType.Varint).int64(message.cltvExpiry); + /* repeated lnrpc.RouteHint route_hints = 10; */ + for (let i = 0; i < message.routeHints.length; i++) + RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); + /* bytes payment_addr = 11; */ + if (message.paymentAddr.length) + writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); + /* int64 num_msat = 12; */ + if (message.numMsat !== 0n) + writer.tag(12, WireType.Varint).int64(message.numMsat); + /* map features = 13; */ + for (let k of Object.keys(message.features)) { + writer.tag(13, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); + writer.tag(2, WireType.LengthDelimited).fork(); + Feature.internalBinaryWrite(message.features[k as any], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PayReq + */ +export const PayReq = new PayReq$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Feature$Type extends MessageType { + constructor() { + super("lnrpc.Feature", [ + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "is_required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "is_known", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): Feature { + const message = { name: "", isRequired: false, isKnown: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Feature): Feature { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 2: + message.name = reader.string(); + break; + case /* bool is_required */ 3: + message.isRequired = reader.bool(); + break; + case /* bool is_known */ 4: + message.isKnown = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Feature, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + /* bool is_required = 3; */ + if (message.isRequired !== false) + writer.tag(3, WireType.Varint).bool(message.isRequired); + /* bool is_known = 4; */ + if (message.isKnown !== false) + writer.tag(4, WireType.Varint).bool(message.isKnown); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Feature + */ +export const Feature = new Feature$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FeeReportRequest$Type extends MessageType { + constructor() { + super("lnrpc.FeeReportRequest", []); + } + create(value?: PartialMessage): FeeReportRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeReportRequest): FeeReportRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: FeeReportRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FeeReportRequest + */ +export const FeeReportRequest = new FeeReportRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelFeeReport$Type extends MessageType { + constructor() { + super("lnrpc.ChannelFeeReport", [ + { no: 5, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 1, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "fee_per_mil", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fee_rate", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): ChannelFeeReport { + const message = { chanId: "0", channelPoint: "", baseFeeMsat: 0n, feePerMil: 0n, feeRate: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelFeeReport): ChannelFeeReport { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id = 5 [jstype = JS_STRING];*/ 5: + message.chanId = reader.uint64().toString(); + break; + case /* string channel_point */ 1: + message.channelPoint = reader.string(); + break; + case /* int64 base_fee_msat */ 2: + message.baseFeeMsat = reader.int64().toBigInt(); + break; + case /* int64 fee_per_mil */ 3: + message.feePerMil = reader.int64().toBigInt(); + break; + case /* double fee_rate */ 4: + message.feeRate = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelFeeReport, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 5 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(5, WireType.Varint).uint64(message.chanId); + /* string channel_point = 1; */ + if (message.channelPoint !== "") + writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); + /* int64 base_fee_msat = 2; */ + if (message.baseFeeMsat !== 0n) + writer.tag(2, WireType.Varint).int64(message.baseFeeMsat); + /* int64 fee_per_mil = 3; */ + if (message.feePerMil !== 0n) + writer.tag(3, WireType.Varint).int64(message.feePerMil); + /* double fee_rate = 4; */ + if (message.feeRate !== 0) + writer.tag(4, WireType.Bit64).double(message.feeRate); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelFeeReport + */ +export const ChannelFeeReport = new ChannelFeeReport$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FeeReportResponse$Type extends MessageType { + constructor() { + super("lnrpc.FeeReportResponse", [ + { no: 1, name: "channel_fees", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelFeeReport }, + { no: 2, name: "day_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "week_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "month_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): FeeReportResponse { + const message = { channelFees: [], dayFeeSum: 0n, weekFeeSum: 0n, monthFeeSum: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeReportResponse): FeeReportResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.ChannelFeeReport channel_fees */ 1: + message.channelFees.push(ChannelFeeReport.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint64 day_fee_sum */ 2: + message.dayFeeSum = reader.uint64().toBigInt(); + break; + case /* uint64 week_fee_sum */ 3: + message.weekFeeSum = reader.uint64().toBigInt(); + break; + case /* uint64 month_fee_sum */ 4: + message.monthFeeSum = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FeeReportResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.ChannelFeeReport channel_fees = 1; */ + for (let i = 0; i < message.channelFees.length; i++) + ChannelFeeReport.internalBinaryWrite(message.channelFees[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint64 day_fee_sum = 2; */ + if (message.dayFeeSum !== 0n) + writer.tag(2, WireType.Varint).uint64(message.dayFeeSum); + /* uint64 week_fee_sum = 3; */ + if (message.weekFeeSum !== 0n) + writer.tag(3, WireType.Varint).uint64(message.weekFeeSum); + /* uint64 month_fee_sum = 4; */ + if (message.monthFeeSum !== 0n) + writer.tag(4, WireType.Varint).uint64(message.monthFeeSum); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FeeReportResponse + */ +export const FeeReportResponse = new FeeReportResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PolicyUpdateRequest$Type extends MessageType { + constructor() { + super("lnrpc.PolicyUpdateRequest", [ + { no: 1, name: "global", kind: "scalar", oneof: "scope", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "chan_point", kind: "message", oneof: "scope", T: () => ChannelPoint }, + { no: 3, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fee_rate", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 9, name: "fee_rate_ppm", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "min_htlc_msat_specified", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): PolicyUpdateRequest { + const message = { scope: { oneofKind: undefined }, baseFeeMsat: 0n, feeRate: 0, feeRatePpm: 0, timeLockDelta: 0, maxHtlcMsat: 0n, minHtlcMsat: 0n, minHtlcMsatSpecified: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyUpdateRequest): PolicyUpdateRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool global */ 1: + message.scope = { + oneofKind: "global", + global: reader.bool() + }; + break; + case /* lnrpc.ChannelPoint chan_point */ 2: + message.scope = { + oneofKind: "chanPoint", + chanPoint: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.scope as any).chanPoint) + }; + break; + case /* int64 base_fee_msat */ 3: + message.baseFeeMsat = reader.int64().toBigInt(); + break; + case /* double fee_rate */ 4: + message.feeRate = reader.double(); + break; + case /* uint32 fee_rate_ppm */ 9: + message.feeRatePpm = reader.uint32(); + break; + case /* uint32 time_lock_delta */ 5: + message.timeLockDelta = reader.uint32(); + break; + case /* uint64 max_htlc_msat */ 6: + message.maxHtlcMsat = reader.uint64().toBigInt(); + break; + case /* uint64 min_htlc_msat */ 7: + message.minHtlcMsat = reader.uint64().toBigInt(); + break; + case /* bool min_htlc_msat_specified */ 8: + message.minHtlcMsatSpecified = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PolicyUpdateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool global = 1; */ + if (message.scope.oneofKind === "global") + writer.tag(1, WireType.Varint).bool(message.scope.global); + /* lnrpc.ChannelPoint chan_point = 2; */ + if (message.scope.oneofKind === "chanPoint") + ChannelPoint.internalBinaryWrite(message.scope.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* int64 base_fee_msat = 3; */ + if (message.baseFeeMsat !== 0n) + writer.tag(3, WireType.Varint).int64(message.baseFeeMsat); + /* double fee_rate = 4; */ + if (message.feeRate !== 0) + writer.tag(4, WireType.Bit64).double(message.feeRate); + /* uint32 fee_rate_ppm = 9; */ + if (message.feeRatePpm !== 0) + writer.tag(9, WireType.Varint).uint32(message.feeRatePpm); + /* uint32 time_lock_delta = 5; */ + if (message.timeLockDelta !== 0) + writer.tag(5, WireType.Varint).uint32(message.timeLockDelta); + /* uint64 max_htlc_msat = 6; */ + if (message.maxHtlcMsat !== 0n) + writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); + /* uint64 min_htlc_msat = 7; */ + if (message.minHtlcMsat !== 0n) + writer.tag(7, WireType.Varint).uint64(message.minHtlcMsat); + /* bool min_htlc_msat_specified = 8; */ + if (message.minHtlcMsatSpecified !== false) + writer.tag(8, WireType.Varint).bool(message.minHtlcMsatSpecified); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PolicyUpdateRequest + */ +export const PolicyUpdateRequest = new PolicyUpdateRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FailedUpdate$Type extends MessageType { + constructor() { + super("lnrpc.FailedUpdate", [ + { no: 1, name: "outpoint", kind: "message", T: () => OutPoint }, + { no: 2, name: "reason", kind: "enum", T: () => ["lnrpc.UpdateFailure", UpdateFailure, "UPDATE_FAILURE_"] }, + { no: 3, name: "update_error", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): FailedUpdate { + const message = { reason: 0, updateError: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FailedUpdate): FailedUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.OutPoint outpoint */ 1: + message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); + break; + case /* lnrpc.UpdateFailure reason */ 2: + message.reason = reader.int32(); + break; + case /* string update_error */ 3: + message.updateError = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FailedUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.OutPoint outpoint = 1; */ + if (message.outpoint) + OutPoint.internalBinaryWrite(message.outpoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.UpdateFailure reason = 2; */ + if (message.reason !== 0) + writer.tag(2, WireType.Varint).int32(message.reason); + /* string update_error = 3; */ + if (message.updateError !== "") + writer.tag(3, WireType.LengthDelimited).string(message.updateError); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FailedUpdate + */ +export const FailedUpdate = new FailedUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PolicyUpdateResponse$Type extends MessageType { + constructor() { + super("lnrpc.PolicyUpdateResponse", [ + { no: 1, name: "failed_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => FailedUpdate } + ]); + } + create(value?: PartialMessage): PolicyUpdateResponse { + const message = { failedUpdates: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyUpdateResponse): PolicyUpdateResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.FailedUpdate failed_updates */ 1: + message.failedUpdates.push(FailedUpdate.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PolicyUpdateResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.FailedUpdate failed_updates = 1; */ + for (let i = 0; i < message.failedUpdates.length; i++) + FailedUpdate.internalBinaryWrite(message.failedUpdates[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PolicyUpdateResponse + */ +export const PolicyUpdateResponse = new PolicyUpdateResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ForwardingHistoryRequest$Type extends MessageType { + constructor() { + super("lnrpc.ForwardingHistoryRequest", [ + { no: 1, name: "start_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "end_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "index_offset", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "num_max_events", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "peer_alias_lookup", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ForwardingHistoryRequest { + const message = { startTime: 0n, endTime: 0n, indexOffset: 0, numMaxEvents: 0, peerAliasLookup: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingHistoryRequest): ForwardingHistoryRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 start_time */ 1: + message.startTime = reader.uint64().toBigInt(); + break; + case /* uint64 end_time */ 2: + message.endTime = reader.uint64().toBigInt(); + break; + case /* uint32 index_offset */ 3: + message.indexOffset = reader.uint32(); + break; + case /* uint32 num_max_events */ 4: + message.numMaxEvents = reader.uint32(); + break; + case /* bool peer_alias_lookup */ 5: + message.peerAliasLookup = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ForwardingHistoryRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 start_time = 1; */ + if (message.startTime !== 0n) + writer.tag(1, WireType.Varint).uint64(message.startTime); + /* uint64 end_time = 2; */ + if (message.endTime !== 0n) + writer.tag(2, WireType.Varint).uint64(message.endTime); + /* uint32 index_offset = 3; */ + if (message.indexOffset !== 0) + writer.tag(3, WireType.Varint).uint32(message.indexOffset); + /* uint32 num_max_events = 4; */ + if (message.numMaxEvents !== 0) + writer.tag(4, WireType.Varint).uint32(message.numMaxEvents); + /* bool peer_alias_lookup = 5; */ + if (message.peerAliasLookup !== false) + writer.tag(5, WireType.Varint).bool(message.peerAliasLookup); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ForwardingHistoryRequest + */ +export const ForwardingHistoryRequest = new ForwardingHistoryRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ForwardingEvent$Type extends MessageType { + constructor() { + super("lnrpc.ForwardingEvent", [ + { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "chan_id_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "chan_id_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "amt_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "amt_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "fee_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "amt_in_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "amt_out_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "peer_alias_in", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: "peer_alias_out", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ForwardingEvent { + const message = { timestamp: 0n, chanIdIn: "0", chanIdOut: "0", amtIn: 0n, amtOut: 0n, fee: 0n, feeMsat: 0n, amtInMsat: 0n, amtOutMsat: 0n, timestampNs: 0n, peerAliasIn: "", peerAliasOut: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingEvent): ForwardingEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 timestamp = 1 [deprecated = true];*/ 1: + message.timestamp = reader.uint64().toBigInt(); + break; + case /* uint64 chan_id_in = 2 [jstype = JS_STRING];*/ 2: + message.chanIdIn = reader.uint64().toString(); + break; + case /* uint64 chan_id_out = 4 [jstype = JS_STRING];*/ 4: + message.chanIdOut = reader.uint64().toString(); + break; + case /* uint64 amt_in */ 5: + message.amtIn = reader.uint64().toBigInt(); + break; + case /* uint64 amt_out */ 6: + message.amtOut = reader.uint64().toBigInt(); + break; + case /* uint64 fee */ 7: + message.fee = reader.uint64().toBigInt(); + break; + case /* uint64 fee_msat */ 8: + message.feeMsat = reader.uint64().toBigInt(); + break; + case /* uint64 amt_in_msat */ 9: + message.amtInMsat = reader.uint64().toBigInt(); + break; + case /* uint64 amt_out_msat */ 10: + message.amtOutMsat = reader.uint64().toBigInt(); + break; + case /* uint64 timestamp_ns */ 11: + message.timestampNs = reader.uint64().toBigInt(); + break; + case /* string peer_alias_in */ 12: + message.peerAliasIn = reader.string(); + break; + case /* string peer_alias_out */ 13: + message.peerAliasOut = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ForwardingEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 timestamp = 1 [deprecated = true]; */ + if (message.timestamp !== 0n) + writer.tag(1, WireType.Varint).uint64(message.timestamp); + /* uint64 chan_id_in = 2 [jstype = JS_STRING]; */ + if (message.chanIdIn !== "0") + writer.tag(2, WireType.Varint).uint64(message.chanIdIn); + /* uint64 chan_id_out = 4 [jstype = JS_STRING]; */ + if (message.chanIdOut !== "0") + writer.tag(4, WireType.Varint).uint64(message.chanIdOut); + /* uint64 amt_in = 5; */ + if (message.amtIn !== 0n) + writer.tag(5, WireType.Varint).uint64(message.amtIn); + /* uint64 amt_out = 6; */ + if (message.amtOut !== 0n) + writer.tag(6, WireType.Varint).uint64(message.amtOut); + /* uint64 fee = 7; */ + if (message.fee !== 0n) + writer.tag(7, WireType.Varint).uint64(message.fee); + /* uint64 fee_msat = 8; */ + if (message.feeMsat !== 0n) + writer.tag(8, WireType.Varint).uint64(message.feeMsat); + /* uint64 amt_in_msat = 9; */ + if (message.amtInMsat !== 0n) + writer.tag(9, WireType.Varint).uint64(message.amtInMsat); + /* uint64 amt_out_msat = 10; */ + if (message.amtOutMsat !== 0n) + writer.tag(10, WireType.Varint).uint64(message.amtOutMsat); + /* uint64 timestamp_ns = 11; */ + if (message.timestampNs !== 0n) + writer.tag(11, WireType.Varint).uint64(message.timestampNs); + /* string peer_alias_in = 12; */ + if (message.peerAliasIn !== "") + writer.tag(12, WireType.LengthDelimited).string(message.peerAliasIn); + /* string peer_alias_out = 13; */ + if (message.peerAliasOut !== "") + writer.tag(13, WireType.LengthDelimited).string(message.peerAliasOut); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ForwardingEvent + */ +export const ForwardingEvent = new ForwardingEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ForwardingHistoryResponse$Type extends MessageType { + constructor() { + super("lnrpc.ForwardingHistoryResponse", [ + { no: 1, name: "forwarding_events", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ForwardingEvent }, + { no: 2, name: "last_offset_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): ForwardingHistoryResponse { + const message = { forwardingEvents: [], lastOffsetIndex: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingHistoryResponse): ForwardingHistoryResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.ForwardingEvent forwarding_events */ 1: + message.forwardingEvents.push(ForwardingEvent.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint32 last_offset_index */ 2: + message.lastOffsetIndex = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ForwardingHistoryResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.ForwardingEvent forwarding_events = 1; */ + for (let i = 0; i < message.forwardingEvents.length; i++) + ForwardingEvent.internalBinaryWrite(message.forwardingEvents[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint32 last_offset_index = 2; */ + if (message.lastOffsetIndex !== 0) + writer.tag(2, WireType.Varint).uint32(message.lastOffsetIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ForwardingHistoryResponse + */ +export const ForwardingHistoryResponse = new ForwardingHistoryResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExportChannelBackupRequest$Type extends MessageType { + constructor() { + super("lnrpc.ExportChannelBackupRequest", [ + { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint } + ]); + } + create(value?: PartialMessage): ExportChannelBackupRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExportChannelBackupRequest): ExportChannelBackupRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelPoint chan_point */ 1: + message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ExportChannelBackupRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelPoint chan_point = 1; */ + if (message.chanPoint) + ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ExportChannelBackupRequest + */ +export const ExportChannelBackupRequest = new ExportChannelBackupRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelBackup$Type extends MessageType { + constructor() { + super("lnrpc.ChannelBackup", [ + { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint }, + { no: 2, name: "chan_backup", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): ChannelBackup { + const message = { chanBackup: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackup): ChannelBackup { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelPoint chan_point */ 1: + message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); + break; + case /* bytes chan_backup */ 2: + message.chanBackup = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelBackup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelPoint chan_point = 1; */ + if (message.chanPoint) + ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bytes chan_backup = 2; */ + if (message.chanBackup.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.chanBackup); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelBackup + */ +export const ChannelBackup = new ChannelBackup$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MultiChanBackup$Type extends MessageType { + constructor() { + super("lnrpc.MultiChanBackup", [ + { no: 1, name: "chan_points", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelPoint }, + { no: 2, name: "multi_chan_backup", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): MultiChanBackup { + const message = { chanPoints: [], multiChanBackup: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MultiChanBackup): MultiChanBackup { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.ChannelPoint chan_points */ 1: + message.chanPoints.push(ChannelPoint.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* bytes multi_chan_backup */ 2: + message.multiChanBackup = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MultiChanBackup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.ChannelPoint chan_points = 1; */ + for (let i = 0; i < message.chanPoints.length; i++) + ChannelPoint.internalBinaryWrite(message.chanPoints[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bytes multi_chan_backup = 2; */ + if (message.multiChanBackup.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.multiChanBackup); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.MultiChanBackup + */ +export const MultiChanBackup = new MultiChanBackup$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChanBackupExportRequest$Type extends MessageType { + constructor() { + super("lnrpc.ChanBackupExportRequest", []); + } + create(value?: PartialMessage): ChanBackupExportRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanBackupExportRequest): ChanBackupExportRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: ChanBackupExportRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChanBackupExportRequest + */ +export const ChanBackupExportRequest = new ChanBackupExportRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChanBackupSnapshot$Type extends MessageType { + constructor() { + super("lnrpc.ChanBackupSnapshot", [ + { no: 1, name: "single_chan_backups", kind: "message", T: () => ChannelBackups }, + { no: 2, name: "multi_chan_backup", kind: "message", T: () => MultiChanBackup } + ]); + } + create(value?: PartialMessage): ChanBackupSnapshot { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanBackupSnapshot): ChanBackupSnapshot { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelBackups single_chan_backups */ 1: + message.singleChanBackups = ChannelBackups.internalBinaryRead(reader, reader.uint32(), options, message.singleChanBackups); + break; + case /* lnrpc.MultiChanBackup multi_chan_backup */ 2: + message.multiChanBackup = MultiChanBackup.internalBinaryRead(reader, reader.uint32(), options, message.multiChanBackup); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChanBackupSnapshot, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelBackups single_chan_backups = 1; */ + if (message.singleChanBackups) + ChannelBackups.internalBinaryWrite(message.singleChanBackups, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.MultiChanBackup multi_chan_backup = 2; */ + if (message.multiChanBackup) + MultiChanBackup.internalBinaryWrite(message.multiChanBackup, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChanBackupSnapshot + */ +export const ChanBackupSnapshot = new ChanBackupSnapshot$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelBackups$Type extends MessageType { + constructor() { + super("lnrpc.ChannelBackups", [ + { no: 1, name: "chan_backups", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelBackup } + ]); + } + create(value?: PartialMessage): ChannelBackups { + const message = { chanBackups: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackups): ChannelBackups { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.ChannelBackup chan_backups */ 1: + message.chanBackups.push(ChannelBackup.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelBackups, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.ChannelBackup chan_backups = 1; */ + for (let i = 0; i < message.chanBackups.length; i++) + ChannelBackup.internalBinaryWrite(message.chanBackups[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelBackups + */ +export const ChannelBackups = new ChannelBackups$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RestoreChanBackupRequest$Type extends MessageType { + constructor() { + super("lnrpc.RestoreChanBackupRequest", [ + { no: 1, name: "chan_backups", kind: "message", oneof: "backup", T: () => ChannelBackups }, + { no: 2, name: "multi_chan_backup", kind: "scalar", oneof: "backup", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): RestoreChanBackupRequest { + const message = { backup: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreChanBackupRequest): RestoreChanBackupRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelBackups chan_backups */ 1: + message.backup = { + oneofKind: "chanBackups", + chanBackups: ChannelBackups.internalBinaryRead(reader, reader.uint32(), options, (message.backup as any).chanBackups) + }; + break; + case /* bytes multi_chan_backup */ 2: + message.backup = { + oneofKind: "multiChanBackup", + multiChanBackup: reader.bytes() + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RestoreChanBackupRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelBackups chan_backups = 1; */ + if (message.backup.oneofKind === "chanBackups") + ChannelBackups.internalBinaryWrite(message.backup.chanBackups, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bytes multi_chan_backup = 2; */ + if (message.backup.oneofKind === "multiChanBackup") + writer.tag(2, WireType.LengthDelimited).bytes(message.backup.multiChanBackup); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RestoreChanBackupRequest + */ +export const RestoreChanBackupRequest = new RestoreChanBackupRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RestoreBackupResponse$Type extends MessageType { + constructor() { + super("lnrpc.RestoreBackupResponse", []); + } + create(value?: PartialMessage): RestoreBackupResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreBackupResponse): RestoreBackupResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: RestoreBackupResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RestoreBackupResponse + */ +export const RestoreBackupResponse = new RestoreBackupResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelBackupSubscription$Type extends MessageType { + constructor() { + super("lnrpc.ChannelBackupSubscription", []); + } + create(value?: PartialMessage): ChannelBackupSubscription { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackupSubscription): ChannelBackupSubscription { + return target ?? this.create(); + } + internalBinaryWrite(message: ChannelBackupSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelBackupSubscription + */ +export const ChannelBackupSubscription = new ChannelBackupSubscription$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class VerifyChanBackupResponse$Type extends MessageType { + constructor() { + super("lnrpc.VerifyChanBackupResponse", []); + } + create(value?: PartialMessage): VerifyChanBackupResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyChanBackupResponse): VerifyChanBackupResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: VerifyChanBackupResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.VerifyChanBackupResponse + */ +export const VerifyChanBackupResponse = new VerifyChanBackupResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MacaroonPermission$Type extends MessageType { + constructor() { + super("lnrpc.MacaroonPermission", [ + { no: 1, name: "entity", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "action", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): MacaroonPermission { + const message = { entity: "", action: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonPermission): MacaroonPermission { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string entity */ 1: + message.entity = reader.string(); + break; + case /* string action */ 2: + message.action = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MacaroonPermission, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string entity = 1; */ + if (message.entity !== "") + writer.tag(1, WireType.LengthDelimited).string(message.entity); + /* string action = 2; */ + if (message.action !== "") + writer.tag(2, WireType.LengthDelimited).string(message.action); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.MacaroonPermission + */ +export const MacaroonPermission = new MacaroonPermission$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BakeMacaroonRequest$Type extends MessageType { + constructor() { + super("lnrpc.BakeMacaroonRequest", [ + { no: 1, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission }, + { no: 2, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "allow_external_permissions", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): BakeMacaroonRequest { + const message = { permissions: [], rootKeyId: 0n, allowExternalPermissions: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BakeMacaroonRequest): BakeMacaroonRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.MacaroonPermission permissions */ 1: + message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint64 root_key_id */ 2: + message.rootKeyId = reader.uint64().toBigInt(); + break; + case /* bool allow_external_permissions */ 3: + message.allowExternalPermissions = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BakeMacaroonRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.MacaroonPermission permissions = 1; */ + for (let i = 0; i < message.permissions.length; i++) + MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint64 root_key_id = 2; */ + if (message.rootKeyId !== 0n) + writer.tag(2, WireType.Varint).uint64(message.rootKeyId); + /* bool allow_external_permissions = 3; */ + if (message.allowExternalPermissions !== false) + writer.tag(3, WireType.Varint).bool(message.allowExternalPermissions); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BakeMacaroonRequest + */ +export const BakeMacaroonRequest = new BakeMacaroonRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BakeMacaroonResponse$Type extends MessageType { + constructor() { + super("lnrpc.BakeMacaroonResponse", [ + { no: 1, name: "macaroon", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): BakeMacaroonResponse { + const message = { macaroon: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BakeMacaroonResponse): BakeMacaroonResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string macaroon */ 1: + message.macaroon = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BakeMacaroonResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string macaroon = 1; */ + if (message.macaroon !== "") + writer.tag(1, WireType.LengthDelimited).string(message.macaroon); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BakeMacaroonResponse + */ +export const BakeMacaroonResponse = new BakeMacaroonResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListMacaroonIDsRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListMacaroonIDsRequest", []); + } + create(value?: PartialMessage): ListMacaroonIDsRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMacaroonIDsRequest): ListMacaroonIDsRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: ListMacaroonIDsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListMacaroonIDsRequest + */ +export const ListMacaroonIDsRequest = new ListMacaroonIDsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListMacaroonIDsResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListMacaroonIDsResponse", [ + { no: 1, name: "root_key_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): ListMacaroonIDsResponse { + const message = { rootKeyIds: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMacaroonIDsResponse): ListMacaroonIDsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated uint64 root_key_ids */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.rootKeyIds.push(reader.uint64().toBigInt()); + else + message.rootKeyIds.push(reader.uint64().toBigInt()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListMacaroonIDsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated uint64 root_key_ids = 1; */ + if (message.rootKeyIds.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.rootKeyIds.length; i++) + writer.uint64(message.rootKeyIds[i]); + writer.join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListMacaroonIDsResponse + */ +export const ListMacaroonIDsResponse = new ListMacaroonIDsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeleteMacaroonIDRequest$Type extends MessageType { + constructor() { + super("lnrpc.DeleteMacaroonIDRequest", [ + { no: 1, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): DeleteMacaroonIDRequest { + const message = { rootKeyId: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMacaroonIDRequest): DeleteMacaroonIDRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 root_key_id */ 1: + message.rootKeyId = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeleteMacaroonIDRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 root_key_id = 1; */ + if (message.rootKeyId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.rootKeyId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDRequest + */ +export const DeleteMacaroonIDRequest = new DeleteMacaroonIDRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DeleteMacaroonIDResponse$Type extends MessageType { + constructor() { + super("lnrpc.DeleteMacaroonIDResponse", [ + { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): DeleteMacaroonIDResponse { + const message = { deleted: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMacaroonIDResponse): DeleteMacaroonIDResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool deleted */ 1: + message.deleted = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeleteMacaroonIDResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool deleted = 1; */ + if (message.deleted !== false) + writer.tag(1, WireType.Varint).bool(message.deleted); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDResponse + */ +export const DeleteMacaroonIDResponse = new DeleteMacaroonIDResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MacaroonPermissionList$Type extends MessageType { + constructor() { + super("lnrpc.MacaroonPermissionList", [ + { no: 1, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission } + ]); + } + create(value?: PartialMessage): MacaroonPermissionList { + const message = { permissions: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonPermissionList): MacaroonPermissionList { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.MacaroonPermission permissions */ 1: + message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MacaroonPermissionList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.MacaroonPermission permissions = 1; */ + for (let i = 0; i < message.permissions.length; i++) + MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.MacaroonPermissionList + */ +export const MacaroonPermissionList = new MacaroonPermissionList$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListPermissionsRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListPermissionsRequest", []); + } + create(value?: PartialMessage): ListPermissionsRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPermissionsRequest): ListPermissionsRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: ListPermissionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListPermissionsRequest + */ +export const ListPermissionsRequest = new ListPermissionsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListPermissionsResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListPermissionsResponse", [ + { no: 1, name: "method_permissions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => MacaroonPermissionList } } + ]); + } + create(value?: PartialMessage): ListPermissionsResponse { + const message = { methodPermissions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPermissionsResponse): ListPermissionsResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map method_permissions */ 1: + this.binaryReadMap1(message.methodPermissions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap1(map: ListPermissionsResponse["methodPermissions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof ListPermissionsResponse["methodPermissions"] | undefined, val: ListPermissionsResponse["methodPermissions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = MacaroonPermissionList.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.ListPermissionsResponse.method_permissions"); + } + } + map[key ?? ""] = val ?? MacaroonPermissionList.create(); + } + internalBinaryWrite(message: ListPermissionsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map method_permissions = 1; */ + for (let k of Object.keys(message.methodPermissions)) { + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + MacaroonPermissionList.internalBinaryWrite(message.methodPermissions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListPermissionsResponse + */ +export const ListPermissionsResponse = new ListPermissionsResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Failure$Type extends MessageType { + constructor() { + super("lnrpc.Failure", [ + { no: 1, name: "code", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] }, + { no: 3, name: "channel_update", kind: "message", T: () => ChannelUpdate }, + { no: 4, name: "htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "onion_sha_256", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 6, name: "cltv_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 7, name: "flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 8, name: "failure_source_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 9, name: "height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): Failure { + const message = { code: 0, htlcMsat: 0n, onionSha256: new Uint8Array(0), cltvExpiry: 0, flags: 0, failureSourceIndex: 0, height: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Failure): Failure { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.Failure.FailureCode code */ 1: + message.code = reader.int32(); + break; + case /* lnrpc.ChannelUpdate channel_update */ 3: + message.channelUpdate = ChannelUpdate.internalBinaryRead(reader, reader.uint32(), options, message.channelUpdate); + break; + case /* uint64 htlc_msat */ 4: + message.htlcMsat = reader.uint64().toBigInt(); + break; + case /* bytes onion_sha_256 */ 5: + message.onionSha256 = reader.bytes(); + break; + case /* uint32 cltv_expiry */ 6: + message.cltvExpiry = reader.uint32(); + break; + case /* uint32 flags */ 7: + message.flags = reader.uint32(); + break; + case /* uint32 failure_source_index */ 8: + message.failureSourceIndex = reader.uint32(); + break; + case /* uint32 height */ 9: + message.height = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Failure, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.Failure.FailureCode code = 1; */ + if (message.code !== 0) + writer.tag(1, WireType.Varint).int32(message.code); + /* lnrpc.ChannelUpdate channel_update = 3; */ + if (message.channelUpdate) + ChannelUpdate.internalBinaryWrite(message.channelUpdate, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* uint64 htlc_msat = 4; */ + if (message.htlcMsat !== 0n) + writer.tag(4, WireType.Varint).uint64(message.htlcMsat); + /* bytes onion_sha_256 = 5; */ + if (message.onionSha256.length) + writer.tag(5, WireType.LengthDelimited).bytes(message.onionSha256); + /* uint32 cltv_expiry = 6; */ + if (message.cltvExpiry !== 0) + writer.tag(6, WireType.Varint).uint32(message.cltvExpiry); + /* uint32 flags = 7; */ + if (message.flags !== 0) + writer.tag(7, WireType.Varint).uint32(message.flags); + /* uint32 failure_source_index = 8; */ + if (message.failureSourceIndex !== 0) + writer.tag(8, WireType.Varint).uint32(message.failureSourceIndex); + /* uint32 height = 9; */ + if (message.height !== 0) + writer.tag(9, WireType.Varint).uint32(message.height); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Failure + */ +export const Failure = new Failure$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ChannelUpdate$Type extends MessageType { + constructor() { + super("lnrpc.ChannelUpdate", [ + { no: 1, name: "signature", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "chain_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "timestamp", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 10, name: "message_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "channel_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 6, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 7, name: "htlc_minimum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "base_fee", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 9, name: "fee_rate", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 11, name: "htlc_maximum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "extra_opaque_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): ChannelUpdate { + const message = { signature: new Uint8Array(0), chainHash: new Uint8Array(0), chanId: "0", timestamp: 0, messageFlags: 0, channelFlags: 0, timeLockDelta: 0, htlcMinimumMsat: 0n, baseFee: 0, feeRate: 0, htlcMaximumMsat: 0n, extraOpaqueData: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelUpdate): ChannelUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes signature */ 1: + message.signature = reader.bytes(); + break; + case /* bytes chain_hash */ 2: + message.chainHash = reader.bytes(); + break; + case /* uint64 chan_id = 3 [jstype = JS_STRING];*/ 3: + message.chanId = reader.uint64().toString(); + break; + case /* uint32 timestamp */ 4: + message.timestamp = reader.uint32(); + break; + case /* uint32 message_flags */ 10: + message.messageFlags = reader.uint32(); + break; + case /* uint32 channel_flags */ 5: + message.channelFlags = reader.uint32(); + break; + case /* uint32 time_lock_delta */ 6: + message.timeLockDelta = reader.uint32(); + break; + case /* uint64 htlc_minimum_msat */ 7: + message.htlcMinimumMsat = reader.uint64().toBigInt(); + break; + case /* uint32 base_fee */ 8: + message.baseFee = reader.uint32(); + break; + case /* uint32 fee_rate */ 9: + message.feeRate = reader.uint32(); + break; + case /* uint64 htlc_maximum_msat */ 11: + message.htlcMaximumMsat = reader.uint64().toBigInt(); + break; + case /* bytes extra_opaque_data */ 12: + message.extraOpaqueData = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ChannelUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes signature = 1; */ + if (message.signature.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.signature); + /* bytes chain_hash = 2; */ + if (message.chainHash.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.chainHash); + /* uint64 chan_id = 3 [jstype = JS_STRING]; */ + if (message.chanId !== "0") + writer.tag(3, WireType.Varint).uint64(message.chanId); + /* uint32 timestamp = 4; */ + if (message.timestamp !== 0) + writer.tag(4, WireType.Varint).uint32(message.timestamp); + /* uint32 message_flags = 10; */ + if (message.messageFlags !== 0) + writer.tag(10, WireType.Varint).uint32(message.messageFlags); + /* uint32 channel_flags = 5; */ + if (message.channelFlags !== 0) + writer.tag(5, WireType.Varint).uint32(message.channelFlags); + /* uint32 time_lock_delta = 6; */ + if (message.timeLockDelta !== 0) + writer.tag(6, WireType.Varint).uint32(message.timeLockDelta); + /* uint64 htlc_minimum_msat = 7; */ + if (message.htlcMinimumMsat !== 0n) + writer.tag(7, WireType.Varint).uint64(message.htlcMinimumMsat); + /* uint32 base_fee = 8; */ + if (message.baseFee !== 0) + writer.tag(8, WireType.Varint).uint32(message.baseFee); + /* uint32 fee_rate = 9; */ + if (message.feeRate !== 0) + writer.tag(9, WireType.Varint).uint32(message.feeRate); + /* uint64 htlc_maximum_msat = 11; */ + if (message.htlcMaximumMsat !== 0n) + writer.tag(11, WireType.Varint).uint64(message.htlcMaximumMsat); + /* bytes extra_opaque_data = 12; */ + if (message.extraOpaqueData.length) + writer.tag(12, WireType.LengthDelimited).bytes(message.extraOpaqueData); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ChannelUpdate + */ +export const ChannelUpdate = new ChannelUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MacaroonId$Type extends MessageType { + constructor() { + super("lnrpc.MacaroonId", [ + { no: 1, name: "nonce", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "storageId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "ops", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Op } + ]); + } + create(value?: PartialMessage): MacaroonId { + const message = { nonce: new Uint8Array(0), storageId: new Uint8Array(0), ops: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonId): MacaroonId { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes nonce */ 1: + message.nonce = reader.bytes(); + break; + case /* bytes storageId */ 2: + message.storageId = reader.bytes(); + break; + case /* repeated lnrpc.Op ops */ 3: + message.ops.push(Op.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MacaroonId, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes nonce = 1; */ + if (message.nonce.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.nonce); + /* bytes storageId = 2; */ + if (message.storageId.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.storageId); + /* repeated lnrpc.Op ops = 3; */ + for (let i = 0; i < message.ops.length; i++) + Op.internalBinaryWrite(message.ops[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.MacaroonId + */ +export const MacaroonId = new MacaroonId$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Op$Type extends MessageType { + constructor() { + super("lnrpc.Op", [ + { no: 1, name: "entity", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "actions", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Op { + const message = { entity: "", actions: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Op): Op { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string entity */ 1: + message.entity = reader.string(); + break; + case /* repeated string actions */ 2: + message.actions.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Op, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string entity = 1; */ + if (message.entity !== "") + writer.tag(1, WireType.LengthDelimited).string(message.entity); + /* repeated string actions = 2; */ + for (let i = 0; i < message.actions.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.actions[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.Op + */ +export const Op = new Op$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckMacPermRequest$Type extends MessageType { + constructor() { + super("lnrpc.CheckMacPermRequest", [ + { no: 1, name: "macaroon", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission }, + { no: 3, name: "fullMethod", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): CheckMacPermRequest { + const message = { macaroon: new Uint8Array(0), permissions: [], fullMethod: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermRequest): CheckMacPermRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes macaroon */ 1: + message.macaroon = reader.bytes(); + break; + case /* repeated lnrpc.MacaroonPermission permissions */ 2: + message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string fullMethod */ 3: + message.fullMethod = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CheckMacPermRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes macaroon = 1; */ + if (message.macaroon.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.macaroon); + /* repeated lnrpc.MacaroonPermission permissions = 2; */ + for (let i = 0; i < message.permissions.length; i++) + MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string fullMethod = 3; */ + if (message.fullMethod !== "") + writer.tag(3, WireType.LengthDelimited).string(message.fullMethod); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CheckMacPermRequest + */ +export const CheckMacPermRequest = new CheckMacPermRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckMacPermResponse$Type extends MessageType { + constructor() { + super("lnrpc.CheckMacPermResponse", [ + { no: 1, name: "valid", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): CheckMacPermResponse { + const message = { valid: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermResponse): CheckMacPermResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool valid */ 1: + message.valid = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CheckMacPermResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool valid = 1; */ + if (message.valid !== false) + writer.tag(1, WireType.Varint).bool(message.valid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CheckMacPermResponse + */ +export const CheckMacPermResponse = new CheckMacPermResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RPCMiddlewareRequest$Type extends MessageType { + constructor() { + super("lnrpc.RPCMiddlewareRequest", [ + { no: 1, name: "request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "raw_macaroon", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "custom_caveat_condition", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "stream_auth", kind: "message", oneof: "interceptType", T: () => StreamAuth }, + { no: 5, name: "request", kind: "message", oneof: "interceptType", T: () => RPCMessage }, + { no: 6, name: "response", kind: "message", oneof: "interceptType", T: () => RPCMessage }, + { no: 8, name: "reg_complete", kind: "scalar", oneof: "interceptType", T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): RPCMiddlewareRequest { + const message = { requestId: 0n, rawMacaroon: new Uint8Array(0), customCaveatCondition: "", interceptType: { oneofKind: undefined }, msgId: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareRequest): RPCMiddlewareRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 request_id */ 1: + message.requestId = reader.uint64().toBigInt(); + break; + case /* bytes raw_macaroon */ 2: + message.rawMacaroon = reader.bytes(); + break; + case /* string custom_caveat_condition */ 3: + message.customCaveatCondition = reader.string(); + break; + case /* lnrpc.StreamAuth stream_auth */ 4: + message.interceptType = { + oneofKind: "streamAuth", + streamAuth: StreamAuth.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).streamAuth) + }; + break; + case /* lnrpc.RPCMessage request */ 5: + message.interceptType = { + oneofKind: "request", + request: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).request) + }; + break; + case /* lnrpc.RPCMessage response */ 6: + message.interceptType = { + oneofKind: "response", + response: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).response) + }; + break; + case /* bool reg_complete */ 8: + message.interceptType = { + oneofKind: "regComplete", + regComplete: reader.bool() + }; + break; + case /* uint64 msg_id */ 7: + message.msgId = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RPCMiddlewareRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 request_id = 1; */ + if (message.requestId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.requestId); + /* bytes raw_macaroon = 2; */ + if (message.rawMacaroon.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.rawMacaroon); + /* string custom_caveat_condition = 3; */ + if (message.customCaveatCondition !== "") + writer.tag(3, WireType.LengthDelimited).string(message.customCaveatCondition); + /* lnrpc.StreamAuth stream_auth = 4; */ + if (message.interceptType.oneofKind === "streamAuth") + StreamAuth.internalBinaryWrite(message.interceptType.streamAuth, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.RPCMessage request = 5; */ + if (message.interceptType.oneofKind === "request") + RPCMessage.internalBinaryWrite(message.interceptType.request, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.RPCMessage response = 6; */ + if (message.interceptType.oneofKind === "response") + RPCMessage.internalBinaryWrite(message.interceptType.response, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* bool reg_complete = 8; */ + if (message.interceptType.oneofKind === "regComplete") + writer.tag(8, WireType.Varint).bool(message.interceptType.regComplete); + /* uint64 msg_id = 7; */ + if (message.msgId !== 0n) + writer.tag(7, WireType.Varint).uint64(message.msgId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RPCMiddlewareRequest + */ +export const RPCMiddlewareRequest = new RPCMiddlewareRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StreamAuth$Type extends MessageType { + constructor() { + super("lnrpc.StreamAuth", [ + { no: 1, name: "method_full_uri", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): StreamAuth { + const message = { methodFullUri: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamAuth): StreamAuth { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string method_full_uri */ 1: + message.methodFullUri = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: StreamAuth, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string method_full_uri = 1; */ + if (message.methodFullUri !== "") + writer.tag(1, WireType.LengthDelimited).string(message.methodFullUri); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.StreamAuth + */ +export const StreamAuth = new StreamAuth$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RPCMessage$Type extends MessageType { + constructor() { + super("lnrpc.RPCMessage", [ + { no: 1, name: "method_full_uri", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "stream_rpc", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "type_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "serialized", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "is_error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): RPCMessage { + const message = { methodFullUri: "", streamRpc: false, typeName: "", serialized: new Uint8Array(0), isError: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMessage): RPCMessage { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string method_full_uri */ 1: + message.methodFullUri = reader.string(); + break; + case /* bool stream_rpc */ 2: + message.streamRpc = reader.bool(); + break; + case /* string type_name */ 3: + message.typeName = reader.string(); + break; + case /* bytes serialized */ 4: + message.serialized = reader.bytes(); + break; + case /* bool is_error */ 5: + message.isError = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RPCMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string method_full_uri = 1; */ + if (message.methodFullUri !== "") + writer.tag(1, WireType.LengthDelimited).string(message.methodFullUri); + /* bool stream_rpc = 2; */ + if (message.streamRpc !== false) + writer.tag(2, WireType.Varint).bool(message.streamRpc); + /* string type_name = 3; */ + if (message.typeName !== "") + writer.tag(3, WireType.LengthDelimited).string(message.typeName); + /* bytes serialized = 4; */ + if (message.serialized.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.serialized); + /* bool is_error = 5; */ + if (message.isError !== false) + writer.tag(5, WireType.Varint).bool(message.isError); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RPCMessage + */ +export const RPCMessage = new RPCMessage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RPCMiddlewareResponse$Type extends MessageType { + constructor() { + super("lnrpc.RPCMiddlewareResponse", [ + { no: 1, name: "ref_msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "register", kind: "message", oneof: "middlewareMessage", T: () => MiddlewareRegistration }, + { no: 3, name: "feedback", kind: "message", oneof: "middlewareMessage", T: () => InterceptFeedback } + ]); + } + create(value?: PartialMessage): RPCMiddlewareResponse { + const message = { refMsgId: 0n, middlewareMessage: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareResponse): RPCMiddlewareResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 ref_msg_id */ 1: + message.refMsgId = reader.uint64().toBigInt(); + break; + case /* lnrpc.MiddlewareRegistration register */ 2: + message.middlewareMessage = { + oneofKind: "register", + register: MiddlewareRegistration.internalBinaryRead(reader, reader.uint32(), options, (message.middlewareMessage as any).register) + }; + break; + case /* lnrpc.InterceptFeedback feedback */ 3: + message.middlewareMessage = { + oneofKind: "feedback", + feedback: InterceptFeedback.internalBinaryRead(reader, reader.uint32(), options, (message.middlewareMessage as any).feedback) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RPCMiddlewareResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 ref_msg_id = 1; */ + if (message.refMsgId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.refMsgId); + /* lnrpc.MiddlewareRegistration register = 2; */ + if (message.middlewareMessage.oneofKind === "register") + MiddlewareRegistration.internalBinaryWrite(message.middlewareMessage.register, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.InterceptFeedback feedback = 3; */ + if (message.middlewareMessage.oneofKind === "feedback") + InterceptFeedback.internalBinaryWrite(message.middlewareMessage.feedback, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RPCMiddlewareResponse + */ +export const RPCMiddlewareResponse = new RPCMiddlewareResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MiddlewareRegistration$Type extends MessageType { + constructor() { + super("lnrpc.MiddlewareRegistration", [ + { no: 1, name: "middleware_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "custom_macaroon_caveat_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "read_only_mode", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): MiddlewareRegistration { + const message = { middlewareName: "", customMacaroonCaveatName: "", readOnlyMode: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MiddlewareRegistration): MiddlewareRegistration { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string middleware_name */ 1: + message.middlewareName = reader.string(); + break; + case /* string custom_macaroon_caveat_name */ 2: + message.customMacaroonCaveatName = reader.string(); + break; + case /* bool read_only_mode */ 3: + message.readOnlyMode = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MiddlewareRegistration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string middleware_name = 1; */ + if (message.middlewareName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.middlewareName); + /* string custom_macaroon_caveat_name = 2; */ + if (message.customMacaroonCaveatName !== "") + writer.tag(2, WireType.LengthDelimited).string(message.customMacaroonCaveatName); + /* bool read_only_mode = 3; */ + if (message.readOnlyMode !== false) + writer.tag(3, WireType.Varint).bool(message.readOnlyMode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.MiddlewareRegistration + */ +export const MiddlewareRegistration = new MiddlewareRegistration$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class InterceptFeedback$Type extends MessageType { + constructor() { + super("lnrpc.InterceptFeedback", [ + { no: 1, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "replace_response", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "replacement_serialized", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): InterceptFeedback { + const message = { error: "", replaceResponse: false, replacementSerialized: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InterceptFeedback): InterceptFeedback { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string error */ 1: + message.error = reader.string(); + break; + case /* bool replace_response */ 2: + message.replaceResponse = reader.bool(); + break; + case /* bytes replacement_serialized */ 3: + message.replacementSerialized = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: InterceptFeedback, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string error = 1; */ + if (message.error !== "") + writer.tag(1, WireType.LengthDelimited).string(message.error); + /* bool replace_response = 2; */ + if (message.replaceResponse !== false) + writer.tag(2, WireType.Varint).bool(message.replaceResponse); + /* bytes replacement_serialized = 3; */ + if (message.replacementSerialized.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.replacementSerialized); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.InterceptFeedback + */ +export const InterceptFeedback = new InterceptFeedback$Type(); +/** + * @generated ServiceType for protobuf service lnrpc.Lightning + */ +export const Lightning = new ServiceType("lnrpc.Lightning", [ + { name: "WalletBalance", options: {}, I: WalletBalanceRequest, O: WalletBalanceResponse }, + { name: "ChannelBalance", options: {}, I: ChannelBalanceRequest, O: ChannelBalanceResponse }, + { name: "GetTransactions", options: {}, I: GetTransactionsRequest, O: TransactionDetails }, + { name: "EstimateFee", options: {}, I: EstimateFeeRequest, O: EstimateFeeResponse }, + { name: "SendCoins", options: {}, I: SendCoinsRequest, O: SendCoinsResponse }, + { name: "ListUnspent", options: {}, I: ListUnspentRequest, O: ListUnspentResponse }, + { name: "SubscribeTransactions", serverStreaming: true, options: {}, I: GetTransactionsRequest, O: Transaction }, + { name: "SendMany", options: {}, I: SendManyRequest, O: SendManyResponse }, + { name: "NewAddress", options: {}, I: NewAddressRequest, O: NewAddressResponse }, + { name: "SignMessage", options: {}, I: SignMessageRequest, O: SignMessageResponse }, + { name: "VerifyMessage", options: {}, I: VerifyMessageRequest, O: VerifyMessageResponse }, + { name: "ConnectPeer", options: {}, I: ConnectPeerRequest, O: ConnectPeerResponse }, + { name: "DisconnectPeer", options: {}, I: DisconnectPeerRequest, O: DisconnectPeerResponse }, + { name: "ListPeers", options: {}, I: ListPeersRequest, O: ListPeersResponse }, + { name: "SubscribePeerEvents", serverStreaming: true, options: {}, I: PeerEventSubscription, O: PeerEvent }, + { name: "GetInfo", options: {}, I: GetInfoRequest, O: GetInfoResponse }, + { name: "GetRecoveryInfo", options: {}, I: GetRecoveryInfoRequest, O: GetRecoveryInfoResponse }, + { name: "PendingChannels", options: {}, I: PendingChannelsRequest, O: PendingChannelsResponse }, + { name: "ListChannels", options: {}, I: ListChannelsRequest, O: ListChannelsResponse }, + { name: "SubscribeChannelEvents", serverStreaming: true, options: {}, I: ChannelEventSubscription, O: ChannelEventUpdate }, + { name: "ClosedChannels", options: {}, I: ClosedChannelsRequest, O: ClosedChannelsResponse }, + { name: "OpenChannelSync", options: {}, I: OpenChannelRequest, O: ChannelPoint }, + { name: "OpenChannel", serverStreaming: true, options: {}, I: OpenChannelRequest, O: OpenStatusUpdate }, + { name: "BatchOpenChannel", options: {}, I: BatchOpenChannelRequest, O: BatchOpenChannelResponse }, + { name: "FundingStateStep", options: {}, I: FundingTransitionMsg, O: FundingStateStepResp }, + { name: "ChannelAcceptor", serverStreaming: true, clientStreaming: true, options: {}, I: ChannelAcceptResponse, O: ChannelAcceptRequest }, + { name: "CloseChannel", serverStreaming: true, options: {}, I: CloseChannelRequest, O: CloseStatusUpdate }, + { name: "AbandonChannel", options: {}, I: AbandonChannelRequest, O: AbandonChannelResponse }, + { name: "SendPayment", serverStreaming: true, clientStreaming: true, options: {}, I: SendRequest, O: SendResponse }, + { name: "SendPaymentSync", options: {}, I: SendRequest, O: SendResponse }, + { name: "SendToRoute", serverStreaming: true, clientStreaming: true, options: {}, I: SendToRouteRequest, O: SendResponse }, + { name: "SendToRouteSync", options: {}, I: SendToRouteRequest, O: SendResponse }, + { name: "AddInvoice", options: {}, I: Invoice, O: AddInvoiceResponse }, + { name: "ListInvoices", options: {}, I: ListInvoiceRequest, O: ListInvoiceResponse }, + { name: "LookupInvoice", options: {}, I: PaymentHash, O: Invoice }, + { name: "SubscribeInvoices", serverStreaming: true, options: {}, I: InvoiceSubscription, O: Invoice }, + { name: "DecodePayReq", options: {}, I: PayReqString, O: PayReq }, + { name: "ListPayments", options: {}, I: ListPaymentsRequest, O: ListPaymentsResponse }, + { name: "DeletePayment", options: {}, I: DeletePaymentRequest, O: DeletePaymentResponse }, + { name: "DeleteAllPayments", options: {}, I: DeleteAllPaymentsRequest, O: DeleteAllPaymentsResponse }, + { name: "DescribeGraph", options: {}, I: ChannelGraphRequest, O: ChannelGraph }, + { name: "GetNodeMetrics", options: {}, I: NodeMetricsRequest, O: NodeMetricsResponse }, + { name: "GetChanInfo", options: {}, I: ChanInfoRequest, O: ChannelEdge }, + { name: "GetNodeInfo", options: {}, I: NodeInfoRequest, O: NodeInfo }, + { name: "QueryRoutes", options: {}, I: QueryRoutesRequest, O: QueryRoutesResponse }, + { name: "GetNetworkInfo", options: {}, I: NetworkInfoRequest, O: NetworkInfo }, + { name: "StopDaemon", options: {}, I: StopRequest, O: StopResponse }, + { name: "SubscribeChannelGraph", serverStreaming: true, options: {}, I: GraphTopologySubscription, O: GraphTopologyUpdate }, + { name: "DebugLevel", options: {}, I: DebugLevelRequest, O: DebugLevelResponse }, + { name: "FeeReport", options: {}, I: FeeReportRequest, O: FeeReportResponse }, + { name: "UpdateChannelPolicy", options: {}, I: PolicyUpdateRequest, O: PolicyUpdateResponse }, + { name: "ForwardingHistory", options: {}, I: ForwardingHistoryRequest, O: ForwardingHistoryResponse }, + { name: "ExportChannelBackup", options: {}, I: ExportChannelBackupRequest, O: ChannelBackup }, + { name: "ExportAllChannelBackups", options: {}, I: ChanBackupExportRequest, O: ChanBackupSnapshot }, + { name: "VerifyChanBackup", options: {}, I: ChanBackupSnapshot, O: VerifyChanBackupResponse }, + { name: "RestoreChannelBackups", options: {}, I: RestoreChanBackupRequest, O: RestoreBackupResponse }, + { name: "SubscribeChannelBackups", serverStreaming: true, options: {}, I: ChannelBackupSubscription, O: ChanBackupSnapshot }, + { name: "BakeMacaroon", options: {}, I: BakeMacaroonRequest, O: BakeMacaroonResponse }, + { name: "ListMacaroonIDs", options: {}, I: ListMacaroonIDsRequest, O: ListMacaroonIDsResponse }, + { name: "DeleteMacaroonID", options: {}, I: DeleteMacaroonIDRequest, O: DeleteMacaroonIDResponse }, + { name: "ListPermissions", options: {}, I: ListPermissionsRequest, O: ListPermissionsResponse }, + { name: "CheckMacaroonPermissions", options: {}, I: CheckMacPermRequest, O: CheckMacPermResponse }, + { name: "RegisterRPCMiddleware", serverStreaming: true, clientStreaming: true, options: {}, I: RPCMiddlewareResponse, O: RPCMiddlewareRequest }, + { name: "SendCustomMessage", options: {}, I: SendCustomMessageRequest, O: SendCustomMessageResponse }, + { name: "SubscribeCustomMessages", serverStreaming: true, options: {}, I: SubscribeCustomMessagesRequest, O: CustomMessage }, + { name: "ListAliases", options: {}, I: ListAliasesRequest, O: ListAliasesResponse }, + { name: "LookupHtlc", options: {}, I: LookupHtlcRequest, O: LookupHtlcResponse } +]); diff --git a/proto/lnd/router.client.ts b/proto/lnd/router.client.ts index 27722e38..ccca4170 100644 --- a/proto/lnd/router.client.ts +++ b/proto/lnd/router.client.ts @@ -1,446 +1,446 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) -// tslint:disable -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import { Router } from "./router.js"; -import type { UpdateChanStatusResponse } from "./router.js"; -import type { UpdateChanStatusRequest } from "./router.js"; -import type { ForwardHtlcInterceptRequest } from "./router.js"; -import type { ForwardHtlcInterceptResponse } from "./router.js"; -import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { PaymentStatus } from "./router.js"; -import type { HtlcEvent } from "./router.js"; -import type { SubscribeHtlcEventsRequest } from "./router.js"; -import type { BuildRouteResponse } from "./router.js"; -import type { BuildRouteRequest } from "./router.js"; -import type { QueryProbabilityResponse } from "./router.js"; -import type { QueryProbabilityRequest } from "./router.js"; -import type { SetMissionControlConfigResponse } from "./router.js"; -import type { SetMissionControlConfigRequest } from "./router.js"; -import type { GetMissionControlConfigResponse } from "./router.js"; -import type { GetMissionControlConfigRequest } from "./router.js"; -import type { XImportMissionControlResponse } from "./router.js"; -import type { XImportMissionControlRequest } from "./router.js"; -import type { QueryMissionControlResponse } from "./router.js"; -import type { QueryMissionControlRequest } from "./router.js"; -import type { ResetMissionControlResponse } from "./router.js"; -import type { ResetMissionControlRequest } from "./router.js"; -import type { HTLCAttempt } from "./lightning.js"; -import type { SendToRouteResponse } from "./router.js"; -import type { SendToRouteRequest } from "./router.js"; -import type { RouteFeeResponse } from "./router.js"; -import type { RouteFeeRequest } from "./router.js"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { TrackPaymentsRequest } from "./router.js"; -import type { TrackPaymentRequest } from "./router.js"; -import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { Payment } from "./lightning.js"; -import type { SendPaymentRequest } from "./router.js"; -import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * Router is a service that offers advanced interaction with the router - * subsystem of the daemon. - * - * @generated from protobuf service routerrpc.Router - */ -export interface IRouterClient { - /** - * - * SendPaymentV2 attempts to route a payment described by the passed - * PaymentRequest to the final destination. The call returns a stream of - * payment updates. - * - * @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment); - */ - sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * TrackPaymentV2 returns an update stream for the payment identified by the - * payment hash. - * - * @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment); - */ - trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * TrackPayments returns an update stream for every payment that is not in a - * terminal state. Note that if payments are in-flight while starting a new - * subscription, the start of the payment stream could produce out-of-order - * and/or duplicate events. In order to get updates for every in-flight - * payment attempt make sure to subscribe to this method before initiating any - * payments. - * - * @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment); - */ - trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it - * may cost to send an HTLC to the target end destination. - * - * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); - */ - estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall; - /** - * - * Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - * the specified route. This method differs from SendPayment in that it - * allows users to specify a full route manually. This can be used for - * things like rebalancing, and atomic swaps. It differs from the newer - * SendToRouteV2 in that it doesn't return the full HTLC information. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); - */ - sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * SendToRouteV2 attempts to make a payment via the specified route. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); - */ - sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * ResetMissionControl clears all mission control state and starts with a clean - * slate. - * - * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); - */ - resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * QueryMissionControl exposes the internal mission control state to callers. - * It is a development feature. - * - * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); - */ - queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * XImportMissionControl is an experimental API that imports the state provided - * to the internal mission control's state, using all results which are more - * recent than our existing values. These values will only be imported - * in-memory, and will not be persisted across restarts. - * - * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); - */ - xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * GetMissionControlConfig returns mission control's current config. - * - * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); - */ - getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; - /** - * - * SetMissionControlConfig will set mission control's config, if the config - * provided is valid. - * - * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); - */ - setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; - /** - * - * QueryProbability returns the current success probability estimate for a - * given node pair and amount. - * - * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); - */ - queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall; - /** - * - * BuildRoute builds a fully specified route based on a list of hop public - * keys. It retrieves the relevant channel policies from the graph in order to - * calculate the correct fees and time locks. - * - * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); - */ - buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeHtlcEvents creates a uni-directional stream from the server to - * the client which delivers a stream of htlc events. - * - * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); - */ - subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - * described by the passed PaymentRequest to the final destination. The call - * returns a stream of payment status updates. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - * the payment identified by the payment hash. - * - * @deprecated - * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * * - * HtlcInterceptor dispatches a bi-directional streaming RPC in which - * Forwarded HTLC requests are sent to the client and the client responds with - * a boolean that tells LND if this htlc should be intercepted. - * In case of interception, the htlc can be either settled, cancelled or - * resumed later by using the ResolveHoldForward endpoint. - * - * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); - */ - htlcInterceptor(options?: RpcOptions): DuplexStreamingCall; - /** - * - * UpdateChanStatus attempts to manually set the state of a channel - * (enabled, disabled, or auto). A manual "disable" request will cause the - * channel to stay disabled until a subsequent manual request of either - * "enable" or "auto". - * - * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); - */ - updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall; -} -/** - * Router is a service that offers advanced interaction with the router - * subsystem of the daemon. - * - * @generated from protobuf service routerrpc.Router - */ -export class RouterClient implements IRouterClient, ServiceInfo { - typeName = Router.typeName; - methods = Router.methods; - options = Router.options; - constructor(private readonly _transport: RpcTransport) { - } - /** - * - * SendPaymentV2 attempts to route a payment described by the passed - * PaymentRequest to the final destination. The call returns a stream of - * payment updates. - * - * @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment); - */ - sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * TrackPaymentV2 returns an update stream for the payment identified by the - * payment hash. - * - * @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment); - */ - trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * TrackPayments returns an update stream for every payment that is not in a - * terminal state. Note that if payments are in-flight while starting a new - * subscription, the start of the payment stream could produce out-of-order - * and/or duplicate events. In order to get updates for every in-flight - * payment attempt make sure to subscribe to this method before initiating any - * payments. - * - * @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment); - */ - trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it - * may cost to send an HTLC to the target end destination. - * - * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); - */ - estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - * the specified route. This method differs from SendPayment in that it - * allows users to specify a full route manually. This can be used for - * things like rebalancing, and atomic swaps. It differs from the newer - * SendToRouteV2 in that it doesn't return the full HTLC information. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); - */ - sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SendToRouteV2 attempts to make a payment via the specified route. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); - */ - sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * ResetMissionControl clears all mission control state and starts with a clean - * slate. - * - * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); - */ - resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * QueryMissionControl exposes the internal mission control state to callers. - * It is a development feature. - * - * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); - */ - queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * XImportMissionControl is an experimental API that imports the state provided - * to the internal mission control's state, using all results which are more - * recent than our existing values. These values will only be imported - * in-memory, and will not be persisted across restarts. - * - * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); - */ - xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[8], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * GetMissionControlConfig returns mission control's current config. - * - * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); - */ - getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[9], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SetMissionControlConfig will set mission control's config, if the config - * provided is valid. - * - * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); - */ - setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[10], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * QueryProbability returns the current success probability estimate for a - * given node pair and amount. - * - * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); - */ - queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[11], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * BuildRoute builds a fully specified route based on a list of hop public - * keys. It retrieves the relevant channel policies from the graph in order to - * calculate the correct fees and time locks. - * - * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); - */ - buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[12], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeHtlcEvents creates a uni-directional stream from the server to - * the client which delivers a stream of htlc events. - * - * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); - */ - subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[13], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - * described by the passed PaymentRequest to the final destination. The call - * returns a stream of payment status updates. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[14], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - * the payment identified by the payment hash. - * - * @deprecated - * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[15], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * * - * HtlcInterceptor dispatches a bi-directional streaming RPC in which - * Forwarded HTLC requests are sent to the client and the client responds with - * a boolean that tells LND if this htlc should be intercepted. - * In case of interception, the htlc can be either settled, cancelled or - * resumed later by using the ResolveHoldForward endpoint. - * - * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); - */ - htlcInterceptor(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[16], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * - * UpdateChanStatus attempts to manually set the state of a channel - * (enabled, disabled, or auto). A manual "disable" request will cause the - * channel to stay disabled until a subsequent manual request of either - * "enable" or "auto". - * - * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); - */ - updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[17], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } -} +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) +// tslint:disable +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import { Router } from "./router.js"; +import type { UpdateChanStatusResponse } from "./router.js"; +import type { UpdateChanStatusRequest } from "./router.js"; +import type { ForwardHtlcInterceptRequest } from "./router.js"; +import type { ForwardHtlcInterceptResponse } from "./router.js"; +import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; +import type { PaymentStatus } from "./router.js"; +import type { HtlcEvent } from "./router.js"; +import type { SubscribeHtlcEventsRequest } from "./router.js"; +import type { BuildRouteResponse } from "./router.js"; +import type { BuildRouteRequest } from "./router.js"; +import type { QueryProbabilityResponse } from "./router.js"; +import type { QueryProbabilityRequest } from "./router.js"; +import type { SetMissionControlConfigResponse } from "./router.js"; +import type { SetMissionControlConfigRequest } from "./router.js"; +import type { GetMissionControlConfigResponse } from "./router.js"; +import type { GetMissionControlConfigRequest } from "./router.js"; +import type { XImportMissionControlResponse } from "./router.js"; +import type { XImportMissionControlRequest } from "./router.js"; +import type { QueryMissionControlResponse } from "./router.js"; +import type { QueryMissionControlRequest } from "./router.js"; +import type { ResetMissionControlResponse } from "./router.js"; +import type { ResetMissionControlRequest } from "./router.js"; +import type { HTLCAttempt } from "./lightning.js"; +import type { SendToRouteResponse } from "./router.js"; +import type { SendToRouteRequest } from "./router.js"; +import type { RouteFeeResponse } from "./router.js"; +import type { RouteFeeRequest } from "./router.js"; +import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import type { TrackPaymentsRequest } from "./router.js"; +import type { TrackPaymentRequest } from "./router.js"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +import type { Payment } from "./lightning.js"; +import type { SendPaymentRequest } from "./router.js"; +import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +/** + * Router is a service that offers advanced interaction with the router + * subsystem of the daemon. + * + * @generated from protobuf service routerrpc.Router + */ +export interface IRouterClient { + /** + * + * SendPaymentV2 attempts to route a payment described by the passed + * PaymentRequest to the final destination. The call returns a stream of + * payment updates. + * + * @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment); + */ + sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * TrackPaymentV2 returns an update stream for the payment identified by the + * payment hash. + * + * @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment); + */ + trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * TrackPayments returns an update stream for every payment that is not in a + * terminal state. Note that if payments are in-flight while starting a new + * subscription, the start of the payment stream could produce out-of-order + * and/or duplicate events. In order to get updates for every in-flight + * payment attempt make sure to subscribe to this method before initiating any + * payments. + * + * @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment); + */ + trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + * may cost to send an HTLC to the target end destination. + * + * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); + */ + estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall; + /** + * + * Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + * the specified route. This method differs from SendPayment in that it + * allows users to specify a full route manually. This can be used for + * things like rebalancing, and atomic swaps. It differs from the newer + * SendToRouteV2 in that it doesn't return the full HTLC information. + * + * @deprecated + * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); + */ + sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; + /** + * + * SendToRouteV2 attempts to make a payment via the specified route. This + * method differs from SendPayment in that it allows users to specify a full + * route manually. This can be used for things like rebalancing, and atomic + * swaps. + * + * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); + */ + sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; + /** + * + * ResetMissionControl clears all mission control state and starts with a clean + * slate. + * + * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); + */ + resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall; + /** + * + * QueryMissionControl exposes the internal mission control state to callers. + * It is a development feature. + * + * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); + */ + queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall; + /** + * + * XImportMissionControl is an experimental API that imports the state provided + * to the internal mission control's state, using all results which are more + * recent than our existing values. These values will only be imported + * in-memory, and will not be persisted across restarts. + * + * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); + */ + xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall; + /** + * + * GetMissionControlConfig returns mission control's current config. + * + * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); + */ + getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; + /** + * + * SetMissionControlConfig will set mission control's config, if the config + * provided is valid. + * + * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); + */ + setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; + /** + * + * QueryProbability returns the current success probability estimate for a + * given node pair and amount. + * + * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); + */ + queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall; + /** + * + * BuildRoute builds a fully specified route based on a list of hop public + * keys. It retrieves the relevant channel policies from the graph in order to + * calculate the correct fees and time locks. + * + * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); + */ + buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall; + /** + * + * SubscribeHtlcEvents creates a uni-directional stream from the server to + * the client which delivers a stream of htlc events. + * + * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); + */ + subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + * described by the passed PaymentRequest to the final destination. The call + * returns a stream of payment status updates. + * + * @deprecated + * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); + */ + sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + * the payment identified by the payment hash. + * + * @deprecated + * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); + */ + trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall; + /** + * * + * HtlcInterceptor dispatches a bi-directional streaming RPC in which + * Forwarded HTLC requests are sent to the client and the client responds with + * a boolean that tells LND if this htlc should be intercepted. + * In case of interception, the htlc can be either settled, cancelled or + * resumed later by using the ResolveHoldForward endpoint. + * + * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); + */ + htlcInterceptor(options?: RpcOptions): DuplexStreamingCall; + /** + * + * UpdateChanStatus attempts to manually set the state of a channel + * (enabled, disabled, or auto). A manual "disable" request will cause the + * channel to stay disabled until a subsequent manual request of either + * "enable" or "auto". + * + * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); + */ + updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall; +} +/** + * Router is a service that offers advanced interaction with the router + * subsystem of the daemon. + * + * @generated from protobuf service routerrpc.Router + */ +export class RouterClient implements IRouterClient, ServiceInfo { + typeName = Router.typeName; + methods = Router.methods; + options = Router.options; + constructor(private readonly _transport: RpcTransport) { + } + /** + * + * SendPaymentV2 attempts to route a payment described by the passed + * PaymentRequest to the final destination. The call returns a stream of + * payment updates. + * + * @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment); + */ + sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * TrackPaymentV2 returns an update stream for the payment identified by the + * payment hash. + * + * @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment); + */ + trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[1], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * TrackPayments returns an update stream for every payment that is not in a + * terminal state. Note that if payments are in-flight while starting a new + * subscription, the start of the payment stream could produce out-of-order + * and/or duplicate events. In order to get updates for every in-flight + * payment attempt make sure to subscribe to this method before initiating any + * payments. + * + * @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment); + */ + trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + * may cost to send an HTLC to the target end destination. + * + * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); + */ + estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[3], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + * the specified route. This method differs from SendPayment in that it + * allows users to specify a full route manually. This can be used for + * things like rebalancing, and atomic swaps. It differs from the newer + * SendToRouteV2 in that it doesn't return the full HTLC information. + * + * @deprecated + * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); + */ + sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[4], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SendToRouteV2 attempts to make a payment via the specified route. This + * method differs from SendPayment in that it allows users to specify a full + * route manually. This can be used for things like rebalancing, and atomic + * swaps. + * + * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); + */ + sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[5], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * ResetMissionControl clears all mission control state and starts with a clean + * slate. + * + * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); + */ + resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[6], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * QueryMissionControl exposes the internal mission control state to callers. + * It is a development feature. + * + * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); + */ + queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[7], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * XImportMissionControl is an experimental API that imports the state provided + * to the internal mission control's state, using all results which are more + * recent than our existing values. These values will only be imported + * in-memory, and will not be persisted across restarts. + * + * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); + */ + xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[8], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * GetMissionControlConfig returns mission control's current config. + * + * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); + */ + getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[9], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SetMissionControlConfig will set mission control's config, if the config + * provided is valid. + * + * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); + */ + setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[10], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * QueryProbability returns the current success probability estimate for a + * given node pair and amount. + * + * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); + */ + queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[11], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * BuildRoute builds a fully specified route based on a list of hop public + * keys. It retrieves the relevant channel policies from the graph in order to + * calculate the correct fees and time locks. + * + * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); + */ + buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[12], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * SubscribeHtlcEvents creates a uni-directional stream from the server to + * the client which delivers a stream of htlc events. + * + * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); + */ + subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[13], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + * described by the passed PaymentRequest to the final destination. The call + * returns a stream of payment status updates. + * + * @deprecated + * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); + */ + sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[14], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * + * Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + * the payment identified by the payment hash. + * + * @deprecated + * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); + */ + trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[15], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * * + * HtlcInterceptor dispatches a bi-directional streaming RPC in which + * Forwarded HTLC requests are sent to the client and the client responds with + * a boolean that tells LND if this htlc should be intercepted. + * In case of interception, the htlc can be either settled, cancelled or + * resumed later by using the ResolveHoldForward endpoint. + * + * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); + */ + htlcInterceptor(options?: RpcOptions): DuplexStreamingCall { + const method = this.methods[16], opt = this._transport.mergeOptions(options); + return stackIntercept("duplex", this._transport, method, opt); + } + /** + * + * UpdateChanStatus attempts to manually set the state of a channel + * (enabled, disabled, or auto). A manual "disable" request will cause the + * channel to stay disabled until a subsequent manual request of either + * "enable" or "auto". + * + * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); + */ + updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[17], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } +} diff --git a/proto/lnd/router.ts b/proto/lnd/router.ts index edb624cd..199b1fc1 100644 --- a/proto/lnd/router.ts +++ b/proto/lnd/router.ts @@ -1,3544 +1,3544 @@ -// @generated by protobuf-ts 2.8.1 -// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) -// tslint:disable -import { Payment } from "./lightning.js"; -import { ServiceType } from "@protobuf-ts/runtime-rpc"; -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import { UnknownFieldHandler } from "@protobuf-ts/runtime"; -import { WireType } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { reflectionMergePartial } from "@protobuf-ts/runtime"; -import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { ChannelPoint } from "./lightning.js"; -import { HTLCAttempt } from "./lightning.js"; -import { Failure_FailureCode } from "./lightning.js"; -import { Failure } from "./lightning.js"; -import { Route } from "./lightning.js"; -import { FeatureBit } from "./lightning.js"; -import { RouteHint } from "./lightning.js"; -/** - * @generated from protobuf message routerrpc.SendPaymentRequest - */ -export interface SendPaymentRequest { - /** - * The identity pubkey of the payment recipient - * - * @generated from protobuf field: bytes dest = 1; - */ - dest: Uint8Array; - /** - * - * Number of satoshis to send. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt = 2; - */ - amt: bigint; - /** - * - * Number of millisatoshis to send. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt_msat = 12; - */ - amtMsat: bigint; - /** - * The hash to use within the payment's HTLC - * - * @generated from protobuf field: bytes payment_hash = 3; - */ - paymentHash: Uint8Array; - /** - * - * The CLTV delta from the current height that should be used to set the - * timelock for the final hop. - * - * @generated from protobuf field: int32 final_cltv_delta = 4; - */ - finalCltvDelta: number; - /** - * An optional payment addr to be included within the last hop of the route. - * - * @generated from protobuf field: bytes payment_addr = 20; - */ - paymentAddr: Uint8Array; - /** - * - * A bare-bones invoice for a payment within the Lightning Network. With the - * details of the invoice, the sender has all the data necessary to send a - * payment to the recipient. The amount in the payment request may be zero. In - * that case it is required to set the amt field as well. If no payment request - * is specified, the following fields are required: dest, amt and payment_hash. - * - * @generated from protobuf field: string payment_request = 5; - */ - paymentRequest: string; - /** - * - * An upper limit on the amount of time we should spend when attempting to - * fulfill the payment. This is expressed in seconds. If we cannot make a - * successful payment within this time frame, an error will be returned. - * This field must be non-zero. - * - * @generated from protobuf field: int32 timeout_seconds = 6; - */ - timeoutSeconds: number; - /** - * - * The maximum number of satoshis that will be paid as a fee of the payment. - * If this field is left to the default value of 0, only zero-fee routes will - * be considered. This usually means single hop routes connecting directly to - * the destination. To send the payment without a fee limit, use max int here. - * - * The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fee_limit_sat = 7; - */ - feeLimitSat: bigint; - /** - * - * The maximum number of millisatoshis that will be paid as a fee of the - * payment. If this field is left to the default value of 0, only zero-fee - * routes will be considered. This usually means single hop routes connecting - * directly to the destination. To send the payment without a fee limit, use - * max int here. - * - * The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fee_limit_msat = 13; - */ - feeLimitMsat: bigint; - /** - * - * Deprecated, use outgoing_chan_ids. The channel id of the channel that must - * be taken to the first hop. If zero, any channel may be used (unless - * outgoing_chan_ids are set). - * - * @deprecated - * @generated from protobuf field: uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * The channel ids of the channels are allowed for the first hop. If empty, - * any channel may be used. - * - * @generated from protobuf field: repeated uint64 outgoing_chan_ids = 19; - */ - outgoingChanIds: bigint[]; - /** - * - * The pubkey of the last hop of the route. If empty, any hop may be used. - * - * @generated from protobuf field: bytes last_hop_pubkey = 14; - */ - lastHopPubkey: Uint8Array; - /** - * - * An optional maximum total time lock for the route. This should not exceed - * lnd's `--max-cltv-expiry` setting. If zero, then the value of - * `--max-cltv-expiry` is enforced. - * - * @generated from protobuf field: int32 cltv_limit = 9; - */ - cltvLimit: number; - /** - * - * Optional route hints to reach the destination through private channels. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; - */ - routeHints: RouteHint[]; - /** - * - * An optional field that can be used to pass an arbitrary set of TLV records - * to a peer which understands the new records. This can be used to pass - * application specific data during the payment attempt. Record types are - * required to be in the custom range >= 65536. When using REST, the values - * must be encoded as base64. - * - * @generated from protobuf field: map dest_custom_records = 11; - */ - destCustomRecords: { - [key: string]: Uint8Array; - }; - /** - * If set, circular payments to self are permitted. - * - * @generated from protobuf field: bool allow_self_payment = 15; - */ - allowSelfPayment: boolean; - /** - * - * Features assumed to be supported by the final node. All transitive feature - * dependencies must also be set properly. For a given feature bit pair, either - * optional or remote may be set, but not both. If this field is nil or empty, - * the router will try to load destination features from the graph as a - * fallback. - * - * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 16; - */ - destFeatures: FeatureBit[]; - /** - * - * The maximum number of partial payments that may be use to complete the full - * amount. - * - * @generated from protobuf field: uint32 max_parts = 17; - */ - maxParts: number; - /** - * - * If set, only the final payment update is streamed back. Intermediate updates - * that show which htlcs are still in flight are suppressed. - * - * @generated from protobuf field: bool no_inflight_updates = 18; - */ - noInflightUpdates: boolean; - /** - * - * The largest payment split that should be attempted when making a payment if - * splitting is necessary. Setting this value will effectively cause lnd to - * split more aggressively, vs only when it thinks it needs to. Note that this - * value is in milli-satoshis. - * - * @generated from protobuf field: uint64 max_shard_size_msat = 21; - */ - maxShardSizeMsat: bigint; - /** - * - * If set, an AMP-payment will be attempted. - * - * @generated from protobuf field: bool amp = 22; - */ - amp: boolean; - /** - * - * The time preference for this payment. Set to -1 to optimize for fees - * only, to 1 to optimize for reliability only or a value inbetween for a mix. - * - * @generated from protobuf field: double time_pref = 23; - */ - timePref: number; -} -/** - * @generated from protobuf message routerrpc.TrackPaymentRequest - */ -export interface TrackPaymentRequest { - /** - * The hash of the payment to look up. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - /** - * - * If set, only the final payment update is streamed back. Intermediate updates - * that show which htlcs are still in flight are suppressed. - * - * @generated from protobuf field: bool no_inflight_updates = 2; - */ - noInflightUpdates: boolean; -} -/** - * @generated from protobuf message routerrpc.TrackPaymentsRequest - */ -export interface TrackPaymentsRequest { - /** - * - * If set, only the final payment updates are streamed back. Intermediate - * updates that show which htlcs are still in flight are suppressed. - * - * @generated from protobuf field: bool no_inflight_updates = 1; - */ - noInflightUpdates: boolean; -} -/** - * @generated from protobuf message routerrpc.RouteFeeRequest - */ -export interface RouteFeeRequest { - /** - * - * The destination once wishes to obtain a routing fee quote to. - * - * @generated from protobuf field: bytes dest = 1; - */ - dest: Uint8Array; - /** - * - * The amount one wishes to send to the target destination. - * - * @generated from protobuf field: int64 amt_sat = 2; - */ - amtSat: bigint; -} -/** - * @generated from protobuf message routerrpc.RouteFeeResponse - */ -export interface RouteFeeResponse { - /** - * - * A lower bound of the estimated fee to the target destination within the - * network, expressed in milli-satoshis. - * - * @generated from protobuf field: int64 routing_fee_msat = 1; - */ - routingFeeMsat: bigint; - /** - * - * An estimate of the worst case time delay that can occur. Note that callers - * will still need to factor in the final CLTV delta of the last hop into this - * value. - * - * @generated from protobuf field: int64 time_lock_delay = 2; - */ - timeLockDelay: bigint; -} -/** - * @generated from protobuf message routerrpc.SendToRouteRequest - */ -export interface SendToRouteRequest { - /** - * The payment hash to use for the HTLC. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - /** - * Route that should be used to attempt to complete the payment. - * - * @generated from protobuf field: lnrpc.Route route = 2; - */ - route?: Route; - /** - * - * Whether the payment should be marked as failed when a temporary error is - * returned from the given route. Set it to true so the payment won't be - * failed unless a terminal error is occurred, such as payment timeout, no - * routes, incorrect payment details, or insufficient funds. - * - * @generated from protobuf field: bool skip_temp_err = 3; - */ - skipTempErr: boolean; -} -/** - * @generated from protobuf message routerrpc.SendToRouteResponse - */ -export interface SendToRouteResponse { - /** - * The preimage obtained by making the payment. - * - * @generated from protobuf field: bytes preimage = 1; - */ - preimage: Uint8Array; - /** - * The failure message in case the payment failed. - * - * @generated from protobuf field: lnrpc.Failure failure = 2; - */ - failure?: Failure; -} -/** - * @generated from protobuf message routerrpc.ResetMissionControlRequest - */ -export interface ResetMissionControlRequest { -} -/** - * @generated from protobuf message routerrpc.ResetMissionControlResponse - */ -export interface ResetMissionControlResponse { -} -/** - * @generated from protobuf message routerrpc.QueryMissionControlRequest - */ -export interface QueryMissionControlRequest { -} -/** - * QueryMissionControlResponse contains mission control state. - * - * @generated from protobuf message routerrpc.QueryMissionControlResponse - */ -export interface QueryMissionControlResponse { - /** - * Node pair-level mission control state. - * - * @generated from protobuf field: repeated routerrpc.PairHistory pairs = 2; - */ - pairs: PairHistory[]; -} -/** - * @generated from protobuf message routerrpc.XImportMissionControlRequest - */ -export interface XImportMissionControlRequest { - /** - * Node pair-level mission control state to be imported. - * - * @generated from protobuf field: repeated routerrpc.PairHistory pairs = 1; - */ - pairs: PairHistory[]; - /** - * Whether to force override MC pair history. Note that even with force - * override the failure pair is imported before the success pair and both - * still clamp existing failure/success amounts. - * - * @generated from protobuf field: bool force = 2; - */ - force: boolean; -} -/** - * @generated from protobuf message routerrpc.XImportMissionControlResponse - */ -export interface XImportMissionControlResponse { -} -/** - * PairHistory contains the mission control state for a particular node pair. - * - * @generated from protobuf message routerrpc.PairHistory - */ -export interface PairHistory { - /** - * The source node pubkey of the pair. - * - * @generated from protobuf field: bytes node_from = 1; - */ - nodeFrom: Uint8Array; - /** - * The destination node pubkey of the pair. - * - * @generated from protobuf field: bytes node_to = 2; - */ - nodeTo: Uint8Array; - /** - * @generated from protobuf field: routerrpc.PairData history = 7; - */ - history?: PairData; -} -/** - * @generated from protobuf message routerrpc.PairData - */ -export interface PairData { - /** - * Time of last failure. - * - * @generated from protobuf field: int64 fail_time = 1; - */ - failTime: bigint; - /** - * - * Lowest amount that failed to forward rounded to whole sats. This may be - * set to zero if the failure is independent of amount. - * - * @generated from protobuf field: int64 fail_amt_sat = 2; - */ - failAmtSat: bigint; - /** - * - * Lowest amount that failed to forward in millisats. This may be - * set to zero if the failure is independent of amount. - * - * @generated from protobuf field: int64 fail_amt_msat = 4; - */ - failAmtMsat: bigint; - /** - * Time of last success. - * - * @generated from protobuf field: int64 success_time = 5; - */ - successTime: bigint; - /** - * Highest amount that we could successfully forward rounded to whole sats. - * - * @generated from protobuf field: int64 success_amt_sat = 6; - */ - successAmtSat: bigint; - /** - * Highest amount that we could successfully forward in millisats. - * - * @generated from protobuf field: int64 success_amt_msat = 7; - */ - successAmtMsat: bigint; -} -/** - * @generated from protobuf message routerrpc.GetMissionControlConfigRequest - */ -export interface GetMissionControlConfigRequest { -} -/** - * @generated from protobuf message routerrpc.GetMissionControlConfigResponse - */ -export interface GetMissionControlConfigResponse { - /** - * - * Mission control's currently active config. - * - * @generated from protobuf field: routerrpc.MissionControlConfig config = 1; - */ - config?: MissionControlConfig; -} -/** - * @generated from protobuf message routerrpc.SetMissionControlConfigRequest - */ -export interface SetMissionControlConfigRequest { - /** - * - * The config to set for mission control. Note that all values *must* be set, - * because the full config will be applied. - * - * @generated from protobuf field: routerrpc.MissionControlConfig config = 1; - */ - config?: MissionControlConfig; -} -/** - * @generated from protobuf message routerrpc.SetMissionControlConfigResponse - */ -export interface SetMissionControlConfigResponse { -} -/** - * @generated from protobuf message routerrpc.MissionControlConfig - */ -export interface MissionControlConfig { - /** - * - * The amount of time mission control will take to restore a penalized node - * or channel back to 50% success probability, expressed in seconds. Setting - * this value to a higher value will penalize failures for longer, making - * mission control less likely to route through nodes and channels that we - * have previously recorded failures for. - * - * @generated from protobuf field: uint64 half_life_seconds = 1; - */ - halfLifeSeconds: bigint; - /** - * - * The probability of success mission control should assign to hop in a route - * where it has no other information available. Higher values will make mission - * control more willing to try hops that we have no information about, lower - * values will discourage trying these hops. - * - * @generated from protobuf field: float hop_probability = 2; - */ - hopProbability: number; - /** - * - * The importance that mission control should place on historical results, - * expressed as a value in [0;1]. Setting this value to 1 will ignore all - * historical payments and just use the hop probability to assess the - * probability of success for each hop. A zero value ignores hop probability - * completely and relies entirely on historical results, unless none are - * available. - * - * @generated from protobuf field: float weight = 3; - */ - weight: number; - /** - * - * The maximum number of payment results that mission control will store. - * - * @generated from protobuf field: uint32 maximum_payment_results = 4; - */ - maximumPaymentResults: number; - /** - * - * The minimum time that must have passed since the previously recorded failure - * before we raise the failure amount. - * - * @generated from protobuf field: uint64 minimum_failure_relax_interval = 5; - */ - minimumFailureRelaxInterval: bigint; -} -/** - * @generated from protobuf message routerrpc.QueryProbabilityRequest - */ -export interface QueryProbabilityRequest { - /** - * The source node pubkey of the pair. - * - * @generated from protobuf field: bytes from_node = 1; - */ - fromNode: Uint8Array; - /** - * The destination node pubkey of the pair. - * - * @generated from protobuf field: bytes to_node = 2; - */ - toNode: Uint8Array; - /** - * The amount for which to calculate a probability. - * - * @generated from protobuf field: int64 amt_msat = 3; - */ - amtMsat: bigint; -} -/** - * @generated from protobuf message routerrpc.QueryProbabilityResponse - */ -export interface QueryProbabilityResponse { - /** - * The success probability for the requested pair. - * - * @generated from protobuf field: double probability = 1; - */ - probability: number; - /** - * The historical data for the requested pair. - * - * @generated from protobuf field: routerrpc.PairData history = 2; - */ - history?: PairData; -} -/** - * @generated from protobuf message routerrpc.BuildRouteRequest - */ -export interface BuildRouteRequest { - /** - * - * The amount to send expressed in msat. If set to zero, the minimum routable - * amount is used. - * - * @generated from protobuf field: int64 amt_msat = 1; - */ - amtMsat: bigint; - /** - * - * CLTV delta from the current height that should be used for the timelock - * of the final hop - * - * @generated from protobuf field: int32 final_cltv_delta = 2; - */ - finalCltvDelta: number; - /** - * - * The channel id of the channel that must be taken to the first hop. If zero, - * any channel may be used. - * - * @generated from protobuf field: uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * A list of hops that defines the route. This does not include the source hop - * pubkey. - * - * @generated from protobuf field: repeated bytes hop_pubkeys = 4; - */ - hopPubkeys: Uint8Array[]; - /** - * An optional payment addr to be included within the last hop of the route. - * - * @generated from protobuf field: bytes payment_addr = 5; - */ - paymentAddr: Uint8Array; -} -/** - * @generated from protobuf message routerrpc.BuildRouteResponse - */ -export interface BuildRouteResponse { - /** - * - * Fully specified route that can be used to execute the payment. - * - * @generated from protobuf field: lnrpc.Route route = 1; - */ - route?: Route; -} -/** - * @generated from protobuf message routerrpc.SubscribeHtlcEventsRequest - */ -export interface SubscribeHtlcEventsRequest { -} -/** - * - * HtlcEvent contains the htlc event that was processed. These are served on a - * best-effort basis; events are not persisted, delivery is not guaranteed - * (in the event of a crash in the switch, forward events may be lost) and - * some events may be replayed upon restart. Events consumed from this package - * should be de-duplicated by the htlc's unique combination of incoming and - * outgoing channel id and htlc id. [EXPERIMENTAL] - * - * @generated from protobuf message routerrpc.HtlcEvent - */ -export interface HtlcEvent { - /** - * - * The short channel id that the incoming htlc arrived at our node on. This - * value is zero for sends. - * - * @generated from protobuf field: uint64 incoming_channel_id = 1; - */ - incomingChannelId: bigint; - /** - * - * The short channel id that the outgoing htlc left our node on. This value - * is zero for receives. - * - * @generated from protobuf field: uint64 outgoing_channel_id = 2; - */ - outgoingChannelId: bigint; - /** - * - * Incoming id is the index of the incoming htlc in the incoming channel. - * This value is zero for sends. - * - * @generated from protobuf field: uint64 incoming_htlc_id = 3; - */ - incomingHtlcId: bigint; - /** - * - * Outgoing id is the index of the outgoing htlc in the outgoing channel. - * This value is zero for receives. - * - * @generated from protobuf field: uint64 outgoing_htlc_id = 4; - */ - outgoingHtlcId: bigint; - /** - * - * The time in unix nanoseconds that the event occurred. - * - * @generated from protobuf field: uint64 timestamp_ns = 5; - */ - timestampNs: bigint; - /** - * - * The event type indicates whether the htlc was part of a send, receive or - * forward. - * - * @generated from protobuf field: routerrpc.HtlcEvent.EventType event_type = 6; - */ - eventType: HtlcEvent_EventType; - /** - * @generated from protobuf oneof: event - */ - event: { - oneofKind: "forwardEvent"; - /** - * @generated from protobuf field: routerrpc.ForwardEvent forward_event = 7; - */ - forwardEvent: ForwardEvent; - } | { - oneofKind: "forwardFailEvent"; - /** - * @generated from protobuf field: routerrpc.ForwardFailEvent forward_fail_event = 8; - */ - forwardFailEvent: ForwardFailEvent; - } | { - oneofKind: "settleEvent"; - /** - * @generated from protobuf field: routerrpc.SettleEvent settle_event = 9; - */ - settleEvent: SettleEvent; - } | { - oneofKind: "linkFailEvent"; - /** - * @generated from protobuf field: routerrpc.LinkFailEvent link_fail_event = 10; - */ - linkFailEvent: LinkFailEvent; - } | { - oneofKind: "subscribedEvent"; - /** - * @generated from protobuf field: routerrpc.SubscribedEvent subscribed_event = 11; - */ - subscribedEvent: SubscribedEvent; - } | { - oneofKind: "finalHtlcEvent"; - /** - * @generated from protobuf field: routerrpc.FinalHtlcEvent final_htlc_event = 12; - */ - finalHtlcEvent: FinalHtlcEvent; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf enum routerrpc.HtlcEvent.EventType - */ -export enum HtlcEvent_EventType { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: SEND = 1; - */ - SEND = 1, - /** - * @generated from protobuf enum value: RECEIVE = 2; - */ - RECEIVE = 2, - /** - * @generated from protobuf enum value: FORWARD = 3; - */ - FORWARD = 3 -} -/** - * @generated from protobuf message routerrpc.HtlcInfo - */ -export interface HtlcInfo { - /** - * The timelock on the incoming htlc. - * - * @generated from protobuf field: uint32 incoming_timelock = 1; - */ - incomingTimelock: number; - /** - * The timelock on the outgoing htlc. - * - * @generated from protobuf field: uint32 outgoing_timelock = 2; - */ - outgoingTimelock: number; - /** - * The amount of the incoming htlc. - * - * @generated from protobuf field: uint64 incoming_amt_msat = 3; - */ - incomingAmtMsat: bigint; - /** - * The amount of the outgoing htlc. - * - * @generated from protobuf field: uint64 outgoing_amt_msat = 4; - */ - outgoingAmtMsat: bigint; -} -/** - * @generated from protobuf message routerrpc.ForwardEvent - */ -export interface ForwardEvent { - /** - * Info contains details about the htlc that was forwarded. - * - * @generated from protobuf field: routerrpc.HtlcInfo info = 1; - */ - info?: HtlcInfo; -} -/** - * @generated from protobuf message routerrpc.ForwardFailEvent - */ -export interface ForwardFailEvent { -} -/** - * @generated from protobuf message routerrpc.SettleEvent - */ -export interface SettleEvent { - /** - * The revealed preimage. - * - * @generated from protobuf field: bytes preimage = 1; - */ - preimage: Uint8Array; -} -/** - * @generated from protobuf message routerrpc.FinalHtlcEvent - */ -export interface FinalHtlcEvent { - /** - * @generated from protobuf field: bool settled = 1; - */ - settled: boolean; - /** - * @generated from protobuf field: bool offchain = 2; - */ - offchain: boolean; -} -/** - * @generated from protobuf message routerrpc.SubscribedEvent - */ -export interface SubscribedEvent { -} -/** - * @generated from protobuf message routerrpc.LinkFailEvent - */ -export interface LinkFailEvent { - /** - * Info contains details about the htlc that we failed. - * - * @generated from protobuf field: routerrpc.HtlcInfo info = 1; - */ - info?: HtlcInfo; - /** - * FailureCode is the BOLT error code for the failure. - * - * @generated from protobuf field: lnrpc.Failure.FailureCode wire_failure = 2; - */ - wireFailure: Failure_FailureCode; - /** - * - * FailureDetail provides additional information about the reason for the - * failure. This detail enriches the information provided by the wire message - * and may be 'no detail' if the wire message requires no additional metadata. - * - * @generated from protobuf field: routerrpc.FailureDetail failure_detail = 3; - */ - failureDetail: FailureDetail; - /** - * A string representation of the link failure. - * - * @generated from protobuf field: string failure_string = 4; - */ - failureString: string; -} -/** - * @generated from protobuf message routerrpc.PaymentStatus - */ -export interface PaymentStatus { - /** - * Current state the payment is in. - * - * @generated from protobuf field: routerrpc.PaymentState state = 1; - */ - state: PaymentState; - /** - * - * The pre-image of the payment when state is SUCCEEDED. - * - * @generated from protobuf field: bytes preimage = 2; - */ - preimage: Uint8Array; - /** - * - * The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. - * - * @generated from protobuf field: repeated lnrpc.HTLCAttempt htlcs = 4; - */ - htlcs: HTLCAttempt[]; -} -/** - * @generated from protobuf message routerrpc.CircuitKey - */ -export interface CircuitKey { - /** - * / The id of the channel that the is part of this circuit. - * - * @generated from protobuf field: uint64 chan_id = 1; - */ - chanId: bigint; - /** - * / The index of the incoming htlc in the incoming channel. - * - * @generated from protobuf field: uint64 htlc_id = 2; - */ - htlcId: bigint; -} -/** - * @generated from protobuf message routerrpc.ForwardHtlcInterceptRequest - */ -export interface ForwardHtlcInterceptRequest { - /** - * - * The key of this forwarded htlc. It defines the incoming channel id and - * the index in this channel. - * - * @generated from protobuf field: routerrpc.CircuitKey incoming_circuit_key = 1; - */ - incomingCircuitKey?: CircuitKey; - /** - * The incoming htlc amount. - * - * @generated from protobuf field: uint64 incoming_amount_msat = 5; - */ - incomingAmountMsat: bigint; - /** - * The incoming htlc expiry. - * - * @generated from protobuf field: uint32 incoming_expiry = 6; - */ - incomingExpiry: number; - /** - * - * The htlc payment hash. This value is not guaranteed to be unique per - * request. - * - * @generated from protobuf field: bytes payment_hash = 2; - */ - paymentHash: Uint8Array; - /** - * The requested outgoing channel id for this forwarded htlc. Because of - * non-strict forwarding, this isn't necessarily the channel over which the - * packet will be forwarded eventually. A different channel to the same peer - * may be selected as well. - * - * @generated from protobuf field: uint64 outgoing_requested_chan_id = 7; - */ - outgoingRequestedChanId: bigint; - /** - * The outgoing htlc amount. - * - * @generated from protobuf field: uint64 outgoing_amount_msat = 3; - */ - outgoingAmountMsat: bigint; - /** - * The outgoing htlc expiry. - * - * @generated from protobuf field: uint32 outgoing_expiry = 4; - */ - outgoingExpiry: number; - /** - * Any custom records that were present in the payload. - * - * @generated from protobuf field: map custom_records = 8; - */ - customRecords: { - [key: string]: Uint8Array; - }; - /** - * The onion blob for the next hop - * - * @generated from protobuf field: bytes onion_blob = 9; - */ - onionBlob: Uint8Array; - /** - * The block height at which this htlc will be auto-failed to prevent the - * channel from force-closing. - * - * @generated from protobuf field: int32 auto_fail_height = 10; - */ - autoFailHeight: number; -} -/** - * * - * ForwardHtlcInterceptResponse enables the caller to resolve a previously hold - * forward. The caller can choose either to: - * - `Resume`: Execute the default behavior (usually forward). - * - `Reject`: Fail the htlc backwards. - * - `Settle`: Settle this htlc with a given preimage. - * - * @generated from protobuf message routerrpc.ForwardHtlcInterceptResponse - */ -export interface ForwardHtlcInterceptResponse { - /** - * * - * The key of this forwarded htlc. It defines the incoming channel id and - * the index in this channel. - * - * @generated from protobuf field: routerrpc.CircuitKey incoming_circuit_key = 1; - */ - incomingCircuitKey?: CircuitKey; - /** - * The resolve action for this intercepted htlc. - * - * @generated from protobuf field: routerrpc.ResolveHoldForwardAction action = 2; - */ - action: ResolveHoldForwardAction; - /** - * The preimage in case the resolve action is Settle. - * - * @generated from protobuf field: bytes preimage = 3; - */ - preimage: Uint8Array; - /** - * Encrypted failure message in case the resolve action is Fail. - * - * If failure_message is specified, the failure_code field must be set - * to zero. - * - * @generated from protobuf field: bytes failure_message = 4; - */ - failureMessage: Uint8Array; - /** - * Return the specified failure code in case the resolve action is Fail. The - * message data fields are populated automatically. - * - * If a non-zero failure_code is specified, failure_message must not be set. - * - * For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the - * default value for this field. - * - * @generated from protobuf field: lnrpc.Failure.FailureCode failure_code = 5; - */ - failureCode: Failure_FailureCode; -} -/** - * @generated from protobuf message routerrpc.UpdateChanStatusRequest - */ -export interface UpdateChanStatusRequest { - /** - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; - */ - chanPoint?: ChannelPoint; - /** - * @generated from protobuf field: routerrpc.ChanStatusAction action = 2; - */ - action: ChanStatusAction; -} -/** - * @generated from protobuf message routerrpc.UpdateChanStatusResponse - */ -export interface UpdateChanStatusResponse { -} -/** - * @generated from protobuf enum routerrpc.FailureDetail - */ -export enum FailureDetail { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: NO_DETAIL = 1; - */ - NO_DETAIL = 1, - /** - * @generated from protobuf enum value: ONION_DECODE = 2; - */ - ONION_DECODE = 2, - /** - * @generated from protobuf enum value: LINK_NOT_ELIGIBLE = 3; - */ - LINK_NOT_ELIGIBLE = 3, - /** - * @generated from protobuf enum value: ON_CHAIN_TIMEOUT = 4; - */ - ON_CHAIN_TIMEOUT = 4, - /** - * @generated from protobuf enum value: HTLC_EXCEEDS_MAX = 5; - */ - HTLC_EXCEEDS_MAX = 5, - /** - * @generated from protobuf enum value: INSUFFICIENT_BALANCE = 6; - */ - INSUFFICIENT_BALANCE = 6, - /** - * @generated from protobuf enum value: INCOMPLETE_FORWARD = 7; - */ - INCOMPLETE_FORWARD = 7, - /** - * @generated from protobuf enum value: HTLC_ADD_FAILED = 8; - */ - HTLC_ADD_FAILED = 8, - /** - * @generated from protobuf enum value: FORWARDS_DISABLED = 9; - */ - FORWARDS_DISABLED = 9, - /** - * @generated from protobuf enum value: INVOICE_CANCELED = 10; - */ - INVOICE_CANCELED = 10, - /** - * @generated from protobuf enum value: INVOICE_UNDERPAID = 11; - */ - INVOICE_UNDERPAID = 11, - /** - * @generated from protobuf enum value: INVOICE_EXPIRY_TOO_SOON = 12; - */ - INVOICE_EXPIRY_TOO_SOON = 12, - /** - * @generated from protobuf enum value: INVOICE_NOT_OPEN = 13; - */ - INVOICE_NOT_OPEN = 13, - /** - * @generated from protobuf enum value: MPP_INVOICE_TIMEOUT = 14; - */ - MPP_INVOICE_TIMEOUT = 14, - /** - * @generated from protobuf enum value: ADDRESS_MISMATCH = 15; - */ - ADDRESS_MISMATCH = 15, - /** - * @generated from protobuf enum value: SET_TOTAL_MISMATCH = 16; - */ - SET_TOTAL_MISMATCH = 16, - /** - * @generated from protobuf enum value: SET_TOTAL_TOO_LOW = 17; - */ - SET_TOTAL_TOO_LOW = 17, - /** - * @generated from protobuf enum value: SET_OVERPAID = 18; - */ - SET_OVERPAID = 18, - /** - * @generated from protobuf enum value: UNKNOWN_INVOICE = 19; - */ - UNKNOWN_INVOICE = 19, - /** - * @generated from protobuf enum value: INVALID_KEYSEND = 20; - */ - INVALID_KEYSEND = 20, - /** - * @generated from protobuf enum value: MPP_IN_PROGRESS = 21; - */ - MPP_IN_PROGRESS = 21, - /** - * @generated from protobuf enum value: CIRCULAR_ROUTE = 22; - */ - CIRCULAR_ROUTE = 22 -} -/** - * @generated from protobuf enum routerrpc.PaymentState - */ -export enum PaymentState { - /** - * - * Payment is still in flight. - * - * @generated from protobuf enum value: IN_FLIGHT = 0; - */ - IN_FLIGHT = 0, - /** - * - * Payment completed successfully. - * - * @generated from protobuf enum value: SUCCEEDED = 1; - */ - SUCCEEDED = 1, - /** - * - * There are more routes to try, but the payment timeout was exceeded. - * - * @generated from protobuf enum value: FAILED_TIMEOUT = 2; - */ - FAILED_TIMEOUT = 2, - /** - * - * All possible routes were tried and failed permanently. Or were no - * routes to the destination at all. - * - * @generated from protobuf enum value: FAILED_NO_ROUTE = 3; - */ - FAILED_NO_ROUTE = 3, - /** - * - * A non-recoverable error has occurred. - * - * @generated from protobuf enum value: FAILED_ERROR = 4; - */ - FAILED_ERROR = 4, - /** - * - * Payment details incorrect (unknown hash, invalid amt or - * invalid final cltv delta) - * - * @generated from protobuf enum value: FAILED_INCORRECT_PAYMENT_DETAILS = 5; - */ - FAILED_INCORRECT_PAYMENT_DETAILS = 5, - /** - * - * Insufficient local balance. - * - * @generated from protobuf enum value: FAILED_INSUFFICIENT_BALANCE = 6; - */ - FAILED_INSUFFICIENT_BALANCE = 6 -} -/** - * @generated from protobuf enum routerrpc.ResolveHoldForwardAction - */ -export enum ResolveHoldForwardAction { - /** - * @generated from protobuf enum value: SETTLE = 0; - */ - SETTLE = 0, - /** - * @generated from protobuf enum value: FAIL = 1; - */ - FAIL = 1, - /** - * @generated from protobuf enum value: RESUME = 2; - */ - RESUME = 2 -} -/** - * @generated from protobuf enum routerrpc.ChanStatusAction - */ -export enum ChanStatusAction { - /** - * @generated from protobuf enum value: ENABLE = 0; - */ - ENABLE = 0, - /** - * @generated from protobuf enum value: DISABLE = 1; - */ - DISABLE = 1, - /** - * @generated from protobuf enum value: AUTO = 2; - */ - AUTO = 2 -} -// @generated message type with reflection information, may provide speed optimized methods -class SendPaymentRequest$Type extends MessageType { - constructor() { - super("routerrpc.SendPaymentRequest", [ - { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 20, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "timeout_seconds", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "fee_limit_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 8, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 19, name: "outgoing_chan_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 14, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 9, name: "cltv_limit", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 10, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, - { no: 11, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 15, name: "allow_self_payment", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 16, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, - { no: 17, name: "max_parts", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 18, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 21, name: "max_shard_size_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 22, name: "amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 23, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value?: PartialMessage): SendPaymentRequest { - const message = { dest: new Uint8Array(0), amt: 0n, amtMsat: 0n, paymentHash: new Uint8Array(0), finalCltvDelta: 0, paymentAddr: new Uint8Array(0), paymentRequest: "", timeoutSeconds: 0, feeLimitSat: 0n, feeLimitMsat: 0n, outgoingChanId: "0", outgoingChanIds: [], lastHopPubkey: new Uint8Array(0), cltvLimit: 0, routeHints: [], destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], maxParts: 0, noInflightUpdates: false, maxShardSizeMsat: 0n, amp: false, timePref: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendPaymentRequest): SendPaymentRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes dest */ 1: - message.dest = reader.bytes(); - break; - case /* int64 amt */ 2: - message.amt = reader.int64().toBigInt(); - break; - case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toBigInt(); - break; - case /* bytes payment_hash */ 3: - message.paymentHash = reader.bytes(); - break; - case /* int32 final_cltv_delta */ 4: - message.finalCltvDelta = reader.int32(); - break; - case /* bytes payment_addr */ 20: - message.paymentAddr = reader.bytes(); - break; - case /* string payment_request */ 5: - message.paymentRequest = reader.string(); - break; - case /* int32 timeout_seconds */ 6: - message.timeoutSeconds = reader.int32(); - break; - case /* int64 fee_limit_sat */ 7: - message.feeLimitSat = reader.int64().toBigInt(); - break; - case /* int64 fee_limit_msat */ 13: - message.feeLimitMsat = reader.int64().toBigInt(); - break; - case /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING];*/ 8: - message.outgoingChanId = reader.uint64().toString(); - break; - case /* repeated uint64 outgoing_chan_ids */ 19: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.outgoingChanIds.push(reader.uint64().toBigInt()); - else - message.outgoingChanIds.push(reader.uint64().toBigInt()); - break; - case /* bytes last_hop_pubkey */ 14: - message.lastHopPubkey = reader.bytes(); - break; - case /* int32 cltv_limit */ 9: - message.cltvLimit = reader.int32(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 10: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* map dest_custom_records */ 11: - this.binaryReadMap11(message.destCustomRecords, reader, options); - break; - case /* bool allow_self_payment */ 15: - message.allowSelfPayment = reader.bool(); - break; - case /* repeated lnrpc.FeatureBit dest_features */ 16: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.destFeatures.push(reader.int32()); - else - message.destFeatures.push(reader.int32()); - break; - case /* uint32 max_parts */ 17: - message.maxParts = reader.uint32(); - break; - case /* bool no_inflight_updates */ 18: - message.noInflightUpdates = reader.bool(); - break; - case /* uint64 max_shard_size_msat */ 21: - message.maxShardSizeMsat = reader.uint64().toBigInt(); - break; - case /* bool amp */ 22: - message.amp = reader.bool(); - break; - case /* double time_pref */ 23: - message.timePref = reader.double(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap11(map: SendPaymentRequest["destCustomRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof SendPaymentRequest["destCustomRecords"] | undefined, val: SendPaymentRequest["destCustomRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field routerrpc.SendPaymentRequest.dest_custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: SendPaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes dest = 1; */ - if (message.dest.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.dest); - /* int64 amt = 2; */ - if (message.amt !== 0n) - writer.tag(2, WireType.Varint).int64(message.amt); - /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0n) - writer.tag(12, WireType.Varint).int64(message.amtMsat); - /* bytes payment_hash = 3; */ - if (message.paymentHash.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.paymentHash); - /* int32 final_cltv_delta = 4; */ - if (message.finalCltvDelta !== 0) - writer.tag(4, WireType.Varint).int32(message.finalCltvDelta); - /* bytes payment_addr = 20; */ - if (message.paymentAddr.length) - writer.tag(20, WireType.LengthDelimited).bytes(message.paymentAddr); - /* string payment_request = 5; */ - if (message.paymentRequest !== "") - writer.tag(5, WireType.LengthDelimited).string(message.paymentRequest); - /* int32 timeout_seconds = 6; */ - if (message.timeoutSeconds !== 0) - writer.tag(6, WireType.Varint).int32(message.timeoutSeconds); - /* int64 fee_limit_sat = 7; */ - if (message.feeLimitSat !== 0n) - writer.tag(7, WireType.Varint).int64(message.feeLimitSat); - /* int64 fee_limit_msat = 13; */ - if (message.feeLimitMsat !== 0n) - writer.tag(13, WireType.Varint).int64(message.feeLimitMsat); - /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(8, WireType.Varint).uint64(message.outgoingChanId); - /* repeated uint64 outgoing_chan_ids = 19; */ - if (message.outgoingChanIds.length) { - writer.tag(19, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.outgoingChanIds.length; i++) - writer.uint64(message.outgoingChanIds[i]); - writer.join(); - } - /* bytes last_hop_pubkey = 14; */ - if (message.lastHopPubkey.length) - writer.tag(14, WireType.LengthDelimited).bytes(message.lastHopPubkey); - /* int32 cltv_limit = 9; */ - if (message.cltvLimit !== 0) - writer.tag(9, WireType.Varint).int32(message.cltvLimit); - /* repeated lnrpc.RouteHint route_hints = 10; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* map dest_custom_records = 11; */ - for (let k of Object.keys(message.destCustomRecords)) - writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); - /* bool allow_self_payment = 15; */ - if (message.allowSelfPayment !== false) - writer.tag(15, WireType.Varint).bool(message.allowSelfPayment); - /* repeated lnrpc.FeatureBit dest_features = 16; */ - if (message.destFeatures.length) { - writer.tag(16, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.destFeatures.length; i++) - writer.int32(message.destFeatures[i]); - writer.join(); - } - /* uint32 max_parts = 17; */ - if (message.maxParts !== 0) - writer.tag(17, WireType.Varint).uint32(message.maxParts); - /* bool no_inflight_updates = 18; */ - if (message.noInflightUpdates !== false) - writer.tag(18, WireType.Varint).bool(message.noInflightUpdates); - /* uint64 max_shard_size_msat = 21; */ - if (message.maxShardSizeMsat !== 0n) - writer.tag(21, WireType.Varint).uint64(message.maxShardSizeMsat); - /* bool amp = 22; */ - if (message.amp !== false) - writer.tag(22, WireType.Varint).bool(message.amp); - /* double time_pref = 23; */ - if (message.timePref !== 0) - writer.tag(23, WireType.Bit64).double(message.timePref); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SendPaymentRequest - */ -export const SendPaymentRequest = new SendPaymentRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class TrackPaymentRequest$Type extends MessageType { - constructor() { - super("routerrpc.TrackPaymentRequest", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): TrackPaymentRequest { - const message = { paymentHash: new Uint8Array(0), noInflightUpdates: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackPaymentRequest): TrackPaymentRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_hash */ 1: - message.paymentHash = reader.bytes(); - break; - case /* bool no_inflight_updates */ 2: - message.noInflightUpdates = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: TrackPaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - /* bool no_inflight_updates = 2; */ - if (message.noInflightUpdates !== false) - writer.tag(2, WireType.Varint).bool(message.noInflightUpdates); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.TrackPaymentRequest - */ -export const TrackPaymentRequest = new TrackPaymentRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class TrackPaymentsRequest$Type extends MessageType { - constructor() { - super("routerrpc.TrackPaymentsRequest", [ - { no: 1, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): TrackPaymentsRequest { - const message = { noInflightUpdates: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackPaymentsRequest): TrackPaymentsRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool no_inflight_updates */ 1: - message.noInflightUpdates = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: TrackPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool no_inflight_updates = 1; */ - if (message.noInflightUpdates !== false) - writer.tag(1, WireType.Varint).bool(message.noInflightUpdates); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.TrackPaymentsRequest - */ -export const TrackPaymentsRequest = new TrackPaymentsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RouteFeeRequest$Type extends MessageType { - constructor() { - super("routerrpc.RouteFeeRequest", [ - { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): RouteFeeRequest { - const message = { dest: new Uint8Array(0), amtSat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteFeeRequest): RouteFeeRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes dest */ 1: - message.dest = reader.bytes(); - break; - case /* int64 amt_sat */ 2: - message.amtSat = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RouteFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes dest = 1; */ - if (message.dest.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.dest); - /* int64 amt_sat = 2; */ - if (message.amtSat !== 0n) - writer.tag(2, WireType.Varint).int64(message.amtSat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.RouteFeeRequest - */ -export const RouteFeeRequest = new RouteFeeRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RouteFeeResponse$Type extends MessageType { - constructor() { - super("routerrpc.RouteFeeResponse", [ - { no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): RouteFeeResponse { - const message = { routingFeeMsat: 0n, timeLockDelay: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteFeeResponse): RouteFeeResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 routing_fee_msat */ 1: - message.routingFeeMsat = reader.int64().toBigInt(); - break; - case /* int64 time_lock_delay */ 2: - message.timeLockDelay = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RouteFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 routing_fee_msat = 1; */ - if (message.routingFeeMsat !== 0n) - writer.tag(1, WireType.Varint).int64(message.routingFeeMsat); - /* int64 time_lock_delay = 2; */ - if (message.timeLockDelay !== 0n) - writer.tag(2, WireType.Varint).int64(message.timeLockDelay); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.RouteFeeResponse - */ -export const RouteFeeResponse = new RouteFeeResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendToRouteRequest$Type extends MessageType { - constructor() { - super("routerrpc.SendToRouteRequest", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "route", kind: "message", T: () => Route }, - { no: 3, name: "skip_temp_err", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): SendToRouteRequest { - const message = { paymentHash: new Uint8Array(0), skipTempErr: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteRequest): SendToRouteRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_hash */ 1: - message.paymentHash = reader.bytes(); - break; - case /* lnrpc.Route route */ 2: - message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); - break; - case /* bool skip_temp_err */ 3: - message.skipTempErr = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendToRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - /* lnrpc.Route route = 2; */ - if (message.route) - Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* bool skip_temp_err = 3; */ - if (message.skipTempErr !== false) - writer.tag(3, WireType.Varint).bool(message.skipTempErr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SendToRouteRequest - */ -export const SendToRouteRequest = new SendToRouteRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendToRouteResponse$Type extends MessageType { - constructor() { - super("routerrpc.SendToRouteResponse", [ - { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "failure", kind: "message", T: () => Failure } - ]); - } - create(value?: PartialMessage): SendToRouteResponse { - const message = { preimage: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteResponse): SendToRouteResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes preimage */ 1: - message.preimage = reader.bytes(); - break; - case /* lnrpc.Failure failure */ 2: - message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SendToRouteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes preimage = 1; */ - if (message.preimage.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); - /* lnrpc.Failure failure = 2; */ - if (message.failure) - Failure.internalBinaryWrite(message.failure, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SendToRouteResponse - */ -export const SendToRouteResponse = new SendToRouteResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ResetMissionControlRequest$Type extends MessageType { - constructor() { - super("routerrpc.ResetMissionControlRequest", []); - } - create(value?: PartialMessage): ResetMissionControlRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetMissionControlRequest): ResetMissionControlRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: ResetMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ResetMissionControlRequest - */ -export const ResetMissionControlRequest = new ResetMissionControlRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ResetMissionControlResponse$Type extends MessageType { - constructor() { - super("routerrpc.ResetMissionControlResponse", []); - } - create(value?: PartialMessage): ResetMissionControlResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetMissionControlResponse): ResetMissionControlResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: ResetMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ResetMissionControlResponse - */ -export const ResetMissionControlResponse = new ResetMissionControlResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryMissionControlRequest$Type extends MessageType { - constructor() { - super("routerrpc.QueryMissionControlRequest", []); - } - create(value?: PartialMessage): QueryMissionControlRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryMissionControlRequest): QueryMissionControlRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: QueryMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.QueryMissionControlRequest - */ -export const QueryMissionControlRequest = new QueryMissionControlRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryMissionControlResponse$Type extends MessageType { - constructor() { - super("routerrpc.QueryMissionControlResponse", [ - { no: 2, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory } - ]); - } - create(value?: PartialMessage): QueryMissionControlResponse { - const message = { pairs: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryMissionControlResponse): QueryMissionControlResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated routerrpc.PairHistory pairs */ 2: - message.pairs.push(PairHistory.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: QueryMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated routerrpc.PairHistory pairs = 2; */ - for (let i = 0; i < message.pairs.length; i++) - PairHistory.internalBinaryWrite(message.pairs[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.QueryMissionControlResponse - */ -export const QueryMissionControlResponse = new QueryMissionControlResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class XImportMissionControlRequest$Type extends MessageType { - constructor() { - super("routerrpc.XImportMissionControlRequest", [ - { no: 1, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory }, - { no: 2, name: "force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): XImportMissionControlRequest { - const message = { pairs: [], force: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: XImportMissionControlRequest): XImportMissionControlRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated routerrpc.PairHistory pairs */ 1: - message.pairs.push(PairHistory.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bool force */ 2: - message.force = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: XImportMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* repeated routerrpc.PairHistory pairs = 1; */ - for (let i = 0; i < message.pairs.length; i++) - PairHistory.internalBinaryWrite(message.pairs[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bool force = 2; */ - if (message.force !== false) - writer.tag(2, WireType.Varint).bool(message.force); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.XImportMissionControlRequest - */ -export const XImportMissionControlRequest = new XImportMissionControlRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class XImportMissionControlResponse$Type extends MessageType { - constructor() { - super("routerrpc.XImportMissionControlResponse", []); - } - create(value?: PartialMessage): XImportMissionControlResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: XImportMissionControlResponse): XImportMissionControlResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: XImportMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.XImportMissionControlResponse - */ -export const XImportMissionControlResponse = new XImportMissionControlResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PairHistory$Type extends MessageType { - constructor() { - super("routerrpc.PairHistory", [ - { no: 1, name: "node_from", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "node_to", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 7, name: "history", kind: "message", T: () => PairData } - ]); - } - create(value?: PartialMessage): PairHistory { - const message = { nodeFrom: new Uint8Array(0), nodeTo: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PairHistory): PairHistory { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes node_from */ 1: - message.nodeFrom = reader.bytes(); - break; - case /* bytes node_to */ 2: - message.nodeTo = reader.bytes(); - break; - case /* routerrpc.PairData history */ 7: - message.history = PairData.internalBinaryRead(reader, reader.uint32(), options, message.history); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PairHistory, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes node_from = 1; */ - if (message.nodeFrom.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nodeFrom); - /* bytes node_to = 2; */ - if (message.nodeTo.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.nodeTo); - /* routerrpc.PairData history = 7; */ - if (message.history) - PairData.internalBinaryWrite(message.history, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.PairHistory - */ -export const PairHistory = new PairHistory$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PairData$Type extends MessageType { - constructor() { - super("routerrpc.PairData", [ - { no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): PairData { - const message = { failTime: 0n, failAmtSat: 0n, failAmtMsat: 0n, successTime: 0n, successAmtSat: 0n, successAmtMsat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PairData): PairData { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 fail_time */ 1: - message.failTime = reader.int64().toBigInt(); - break; - case /* int64 fail_amt_sat */ 2: - message.failAmtSat = reader.int64().toBigInt(); - break; - case /* int64 fail_amt_msat */ 4: - message.failAmtMsat = reader.int64().toBigInt(); - break; - case /* int64 success_time */ 5: - message.successTime = reader.int64().toBigInt(); - break; - case /* int64 success_amt_sat */ 6: - message.successAmtSat = reader.int64().toBigInt(); - break; - case /* int64 success_amt_msat */ 7: - message.successAmtMsat = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PairData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 fail_time = 1; */ - if (message.failTime !== 0n) - writer.tag(1, WireType.Varint).int64(message.failTime); - /* int64 fail_amt_sat = 2; */ - if (message.failAmtSat !== 0n) - writer.tag(2, WireType.Varint).int64(message.failAmtSat); - /* int64 fail_amt_msat = 4; */ - if (message.failAmtMsat !== 0n) - writer.tag(4, WireType.Varint).int64(message.failAmtMsat); - /* int64 success_time = 5; */ - if (message.successTime !== 0n) - writer.tag(5, WireType.Varint).int64(message.successTime); - /* int64 success_amt_sat = 6; */ - if (message.successAmtSat !== 0n) - writer.tag(6, WireType.Varint).int64(message.successAmtSat); - /* int64 success_amt_msat = 7; */ - if (message.successAmtMsat !== 0n) - writer.tag(7, WireType.Varint).int64(message.successAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.PairData - */ -export const PairData = new PairData$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetMissionControlConfigRequest$Type extends MessageType { - constructor() { - super("routerrpc.GetMissionControlConfigRequest", []); - } - create(value?: PartialMessage): GetMissionControlConfigRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMissionControlConfigRequest): GetMissionControlConfigRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: GetMissionControlConfigRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.GetMissionControlConfigRequest - */ -export const GetMissionControlConfigRequest = new GetMissionControlConfigRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetMissionControlConfigResponse$Type extends MessageType { - constructor() { - super("routerrpc.GetMissionControlConfigResponse", [ - { no: 1, name: "config", kind: "message", T: () => MissionControlConfig } - ]); - } - create(value?: PartialMessage): GetMissionControlConfigResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMissionControlConfigResponse): GetMissionControlConfigResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.MissionControlConfig config */ 1: - message.config = MissionControlConfig.internalBinaryRead(reader, reader.uint32(), options, message.config); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetMissionControlConfigResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* routerrpc.MissionControlConfig config = 1; */ - if (message.config) - MissionControlConfig.internalBinaryWrite(message.config, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.GetMissionControlConfigResponse - */ -export const GetMissionControlConfigResponse = new GetMissionControlConfigResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SetMissionControlConfigRequest$Type extends MessageType { - constructor() { - super("routerrpc.SetMissionControlConfigRequest", [ - { no: 1, name: "config", kind: "message", T: () => MissionControlConfig } - ]); - } - create(value?: PartialMessage): SetMissionControlConfigRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetMissionControlConfigRequest): SetMissionControlConfigRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.MissionControlConfig config */ 1: - message.config = MissionControlConfig.internalBinaryRead(reader, reader.uint32(), options, message.config); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SetMissionControlConfigRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* routerrpc.MissionControlConfig config = 1; */ - if (message.config) - MissionControlConfig.internalBinaryWrite(message.config, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SetMissionControlConfigRequest - */ -export const SetMissionControlConfigRequest = new SetMissionControlConfigRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SetMissionControlConfigResponse$Type extends MessageType { - constructor() { - super("routerrpc.SetMissionControlConfigResponse", []); - } - create(value?: PartialMessage): SetMissionControlConfigResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetMissionControlConfigResponse): SetMissionControlConfigResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: SetMissionControlConfigResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SetMissionControlConfigResponse - */ -export const SetMissionControlConfigResponse = new SetMissionControlConfigResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MissionControlConfig$Type extends MessageType { - constructor() { - super("routerrpc.MissionControlConfig", [ - { no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "hop_probability", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }, - { no: 3, name: "weight", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }, - { no: 4, name: "maximum_payment_results", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "minimum_failure_relax_interval", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): MissionControlConfig { - const message = { halfLifeSeconds: 0n, hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MissionControlConfig): MissionControlConfig { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 half_life_seconds */ 1: - message.halfLifeSeconds = reader.uint64().toBigInt(); - break; - case /* float hop_probability */ 2: - message.hopProbability = reader.float(); - break; - case /* float weight */ 3: - message.weight = reader.float(); - break; - case /* uint32 maximum_payment_results */ 4: - message.maximumPaymentResults = reader.uint32(); - break; - case /* uint64 minimum_failure_relax_interval */ 5: - message.minimumFailureRelaxInterval = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: MissionControlConfig, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 half_life_seconds = 1; */ - if (message.halfLifeSeconds !== 0n) - writer.tag(1, WireType.Varint).uint64(message.halfLifeSeconds); - /* float hop_probability = 2; */ - if (message.hopProbability !== 0) - writer.tag(2, WireType.Bit32).float(message.hopProbability); - /* float weight = 3; */ - if (message.weight !== 0) - writer.tag(3, WireType.Bit32).float(message.weight); - /* uint32 maximum_payment_results = 4; */ - if (message.maximumPaymentResults !== 0) - writer.tag(4, WireType.Varint).uint32(message.maximumPaymentResults); - /* uint64 minimum_failure_relax_interval = 5; */ - if (message.minimumFailureRelaxInterval !== 0n) - writer.tag(5, WireType.Varint).uint64(message.minimumFailureRelaxInterval); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.MissionControlConfig - */ -export const MissionControlConfig = new MissionControlConfig$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryProbabilityRequest$Type extends MessageType { - constructor() { - super("routerrpc.QueryProbabilityRequest", [ - { no: 1, name: "from_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "to_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): QueryProbabilityRequest { - const message = { fromNode: new Uint8Array(0), toNode: new Uint8Array(0), amtMsat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryProbabilityRequest): QueryProbabilityRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes from_node */ 1: - message.fromNode = reader.bytes(); - break; - case /* bytes to_node */ 2: - message.toNode = reader.bytes(); - break; - case /* int64 amt_msat */ 3: - message.amtMsat = reader.int64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: QueryProbabilityRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes from_node = 1; */ - if (message.fromNode.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.fromNode); - /* bytes to_node = 2; */ - if (message.toNode.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.toNode); - /* int64 amt_msat = 3; */ - if (message.amtMsat !== 0n) - writer.tag(3, WireType.Varint).int64(message.amtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.QueryProbabilityRequest - */ -export const QueryProbabilityRequest = new QueryProbabilityRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryProbabilityResponse$Type extends MessageType { - constructor() { - super("routerrpc.QueryProbabilityResponse", [ - { no: 1, name: "probability", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 2, name: "history", kind: "message", T: () => PairData } - ]); - } - create(value?: PartialMessage): QueryProbabilityResponse { - const message = { probability: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryProbabilityResponse): QueryProbabilityResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* double probability */ 1: - message.probability = reader.double(); - break; - case /* routerrpc.PairData history */ 2: - message.history = PairData.internalBinaryRead(reader, reader.uint32(), options, message.history); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: QueryProbabilityResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* double probability = 1; */ - if (message.probability !== 0) - writer.tag(1, WireType.Bit64).double(message.probability); - /* routerrpc.PairData history = 2; */ - if (message.history) - PairData.internalBinaryWrite(message.history, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.QueryProbabilityResponse - */ -export const QueryProbabilityResponse = new QueryProbabilityResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BuildRouteRequest$Type extends MessageType { - constructor() { - super("routerrpc.BuildRouteRequest", [ - { no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "hop_pubkeys", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): BuildRouteRequest { - const message = { amtMsat: 0n, finalCltvDelta: 0, outgoingChanId: "0", hopPubkeys: [], paymentAddr: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BuildRouteRequest): BuildRouteRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 amt_msat */ 1: - message.amtMsat = reader.int64().toBigInt(); - break; - case /* int32 final_cltv_delta */ 2: - message.finalCltvDelta = reader.int32(); - break; - case /* uint64 outgoing_chan_id = 3 [jstype = JS_STRING];*/ 3: - message.outgoingChanId = reader.uint64().toString(); - break; - case /* repeated bytes hop_pubkeys */ 4: - message.hopPubkeys.push(reader.bytes()); - break; - case /* bytes payment_addr */ 5: - message.paymentAddr = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BuildRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* int64 amt_msat = 1; */ - if (message.amtMsat !== 0n) - writer.tag(1, WireType.Varint).int64(message.amtMsat); - /* int32 final_cltv_delta = 2; */ - if (message.finalCltvDelta !== 0) - writer.tag(2, WireType.Varint).int32(message.finalCltvDelta); - /* uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(3, WireType.Varint).uint64(message.outgoingChanId); - /* repeated bytes hop_pubkeys = 4; */ - for (let i = 0; i < message.hopPubkeys.length; i++) - writer.tag(4, WireType.LengthDelimited).bytes(message.hopPubkeys[i]); - /* bytes payment_addr = 5; */ - if (message.paymentAddr.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.paymentAddr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.BuildRouteRequest - */ -export const BuildRouteRequest = new BuildRouteRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BuildRouteResponse$Type extends MessageType { - constructor() { - super("routerrpc.BuildRouteResponse", [ - { no: 1, name: "route", kind: "message", T: () => Route } - ]); - } - create(value?: PartialMessage): BuildRouteResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BuildRouteResponse): BuildRouteResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.Route route */ 1: - message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: BuildRouteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.Route route = 1; */ - if (message.route) - Route.internalBinaryWrite(message.route, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.BuildRouteResponse - */ -export const BuildRouteResponse = new BuildRouteResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SubscribeHtlcEventsRequest$Type extends MessageType { - constructor() { - super("routerrpc.SubscribeHtlcEventsRequest", []); - } - create(value?: PartialMessage): SubscribeHtlcEventsRequest { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeHtlcEventsRequest): SubscribeHtlcEventsRequest { - return target ?? this.create(); - } - internalBinaryWrite(message: SubscribeHtlcEventsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SubscribeHtlcEventsRequest - */ -export const SubscribeHtlcEventsRequest = new SubscribeHtlcEventsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HtlcEvent$Type extends MessageType { - constructor() { - super("routerrpc.HtlcEvent", [ - { no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "event_type", kind: "enum", T: () => ["routerrpc.HtlcEvent.EventType", HtlcEvent_EventType] }, - { no: 7, name: "forward_event", kind: "message", oneof: "event", T: () => ForwardEvent }, - { no: 8, name: "forward_fail_event", kind: "message", oneof: "event", T: () => ForwardFailEvent }, - { no: 9, name: "settle_event", kind: "message", oneof: "event", T: () => SettleEvent }, - { no: 10, name: "link_fail_event", kind: "message", oneof: "event", T: () => LinkFailEvent }, - { no: 11, name: "subscribed_event", kind: "message", oneof: "event", T: () => SubscribedEvent }, - { no: 12, name: "final_htlc_event", kind: "message", oneof: "event", T: () => FinalHtlcEvent } - ]); - } - create(value?: PartialMessage): HtlcEvent { - const message = { incomingChannelId: 0n, outgoingChannelId: 0n, incomingHtlcId: 0n, outgoingHtlcId: 0n, timestampNs: 0n, eventType: 0, event: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HtlcEvent): HtlcEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 incoming_channel_id */ 1: - message.incomingChannelId = reader.uint64().toBigInt(); - break; - case /* uint64 outgoing_channel_id */ 2: - message.outgoingChannelId = reader.uint64().toBigInt(); - break; - case /* uint64 incoming_htlc_id */ 3: - message.incomingHtlcId = reader.uint64().toBigInt(); - break; - case /* uint64 outgoing_htlc_id */ 4: - message.outgoingHtlcId = reader.uint64().toBigInt(); - break; - case /* uint64 timestamp_ns */ 5: - message.timestampNs = reader.uint64().toBigInt(); - break; - case /* routerrpc.HtlcEvent.EventType event_type */ 6: - message.eventType = reader.int32(); - break; - case /* routerrpc.ForwardEvent forward_event */ 7: - message.event = { - oneofKind: "forwardEvent", - forwardEvent: ForwardEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).forwardEvent) - }; - break; - case /* routerrpc.ForwardFailEvent forward_fail_event */ 8: - message.event = { - oneofKind: "forwardFailEvent", - forwardFailEvent: ForwardFailEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).forwardFailEvent) - }; - break; - case /* routerrpc.SettleEvent settle_event */ 9: - message.event = { - oneofKind: "settleEvent", - settleEvent: SettleEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).settleEvent) - }; - break; - case /* routerrpc.LinkFailEvent link_fail_event */ 10: - message.event = { - oneofKind: "linkFailEvent", - linkFailEvent: LinkFailEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).linkFailEvent) - }; - break; - case /* routerrpc.SubscribedEvent subscribed_event */ 11: - message.event = { - oneofKind: "subscribedEvent", - subscribedEvent: SubscribedEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).subscribedEvent) - }; - break; - case /* routerrpc.FinalHtlcEvent final_htlc_event */ 12: - message.event = { - oneofKind: "finalHtlcEvent", - finalHtlcEvent: FinalHtlcEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).finalHtlcEvent) - }; - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: HtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 incoming_channel_id = 1; */ - if (message.incomingChannelId !== 0n) - writer.tag(1, WireType.Varint).uint64(message.incomingChannelId); - /* uint64 outgoing_channel_id = 2; */ - if (message.outgoingChannelId !== 0n) - writer.tag(2, WireType.Varint).uint64(message.outgoingChannelId); - /* uint64 incoming_htlc_id = 3; */ - if (message.incomingHtlcId !== 0n) - writer.tag(3, WireType.Varint).uint64(message.incomingHtlcId); - /* uint64 outgoing_htlc_id = 4; */ - if (message.outgoingHtlcId !== 0n) - writer.tag(4, WireType.Varint).uint64(message.outgoingHtlcId); - /* uint64 timestamp_ns = 5; */ - if (message.timestampNs !== 0n) - writer.tag(5, WireType.Varint).uint64(message.timestampNs); - /* routerrpc.HtlcEvent.EventType event_type = 6; */ - if (message.eventType !== 0) - writer.tag(6, WireType.Varint).int32(message.eventType); - /* routerrpc.ForwardEvent forward_event = 7; */ - if (message.event.oneofKind === "forwardEvent") - ForwardEvent.internalBinaryWrite(message.event.forwardEvent, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.ForwardFailEvent forward_fail_event = 8; */ - if (message.event.oneofKind === "forwardFailEvent") - ForwardFailEvent.internalBinaryWrite(message.event.forwardFailEvent, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.SettleEvent settle_event = 9; */ - if (message.event.oneofKind === "settleEvent") - SettleEvent.internalBinaryWrite(message.event.settleEvent, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.LinkFailEvent link_fail_event = 10; */ - if (message.event.oneofKind === "linkFailEvent") - LinkFailEvent.internalBinaryWrite(message.event.linkFailEvent, writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.SubscribedEvent subscribed_event = 11; */ - if (message.event.oneofKind === "subscribedEvent") - SubscribedEvent.internalBinaryWrite(message.event.subscribedEvent, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.FinalHtlcEvent final_htlc_event = 12; */ - if (message.event.oneofKind === "finalHtlcEvent") - FinalHtlcEvent.internalBinaryWrite(message.event.finalHtlcEvent, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.HtlcEvent - */ -export const HtlcEvent = new HtlcEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HtlcInfo$Type extends MessageType { - constructor() { - super("routerrpc.HtlcInfo", [ - { no: 1, name: "incoming_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "outgoing_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "incoming_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): HtlcInfo { - const message = { incomingTimelock: 0, outgoingTimelock: 0, incomingAmtMsat: 0n, outgoingAmtMsat: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HtlcInfo): HtlcInfo { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 incoming_timelock */ 1: - message.incomingTimelock = reader.uint32(); - break; - case /* uint32 outgoing_timelock */ 2: - message.outgoingTimelock = reader.uint32(); - break; - case /* uint64 incoming_amt_msat */ 3: - message.incomingAmtMsat = reader.uint64().toBigInt(); - break; - case /* uint64 outgoing_amt_msat */ 4: - message.outgoingAmtMsat = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: HtlcInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint32 incoming_timelock = 1; */ - if (message.incomingTimelock !== 0) - writer.tag(1, WireType.Varint).uint32(message.incomingTimelock); - /* uint32 outgoing_timelock = 2; */ - if (message.outgoingTimelock !== 0) - writer.tag(2, WireType.Varint).uint32(message.outgoingTimelock); - /* uint64 incoming_amt_msat = 3; */ - if (message.incomingAmtMsat !== 0n) - writer.tag(3, WireType.Varint).uint64(message.incomingAmtMsat); - /* uint64 outgoing_amt_msat = 4; */ - if (message.outgoingAmtMsat !== 0n) - writer.tag(4, WireType.Varint).uint64(message.outgoingAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.HtlcInfo - */ -export const HtlcInfo = new HtlcInfo$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardEvent$Type extends MessageType { - constructor() { - super("routerrpc.ForwardEvent", [ - { no: 1, name: "info", kind: "message", T: () => HtlcInfo } - ]); - } - create(value?: PartialMessage): ForwardEvent { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardEvent): ForwardEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.HtlcInfo info */ 1: - message.info = HtlcInfo.internalBinaryRead(reader, reader.uint32(), options, message.info); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ForwardEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* routerrpc.HtlcInfo info = 1; */ - if (message.info) - HtlcInfo.internalBinaryWrite(message.info, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardEvent - */ -export const ForwardEvent = new ForwardEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardFailEvent$Type extends MessageType { - constructor() { - super("routerrpc.ForwardFailEvent", []); - } - create(value?: PartialMessage): ForwardFailEvent { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardFailEvent): ForwardFailEvent { - return target ?? this.create(); - } - internalBinaryWrite(message: ForwardFailEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardFailEvent - */ -export const ForwardFailEvent = new ForwardFailEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SettleEvent$Type extends MessageType { - constructor() { - super("routerrpc.SettleEvent", [ - { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value?: PartialMessage): SettleEvent { - const message = { preimage: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleEvent): SettleEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes preimage */ 1: - message.preimage = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: SettleEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bytes preimage = 1; */ - if (message.preimage.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SettleEvent - */ -export const SettleEvent = new SettleEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FinalHtlcEvent$Type extends MessageType { - constructor() { - super("routerrpc.FinalHtlcEvent", [ - { no: 1, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "offchain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value?: PartialMessage): FinalHtlcEvent { - const message = { settled: false, offchain: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalHtlcEvent): FinalHtlcEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool settled */ 1: - message.settled = reader.bool(); - break; - case /* bool offchain */ 2: - message.offchain = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: FinalHtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool settled = 1; */ - if (message.settled !== false) - writer.tag(1, WireType.Varint).bool(message.settled); - /* bool offchain = 2; */ - if (message.offchain !== false) - writer.tag(2, WireType.Varint).bool(message.offchain); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.FinalHtlcEvent - */ -export const FinalHtlcEvent = new FinalHtlcEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SubscribedEvent$Type extends MessageType { - constructor() { - super("routerrpc.SubscribedEvent", []); - } - create(value?: PartialMessage): SubscribedEvent { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribedEvent): SubscribedEvent { - return target ?? this.create(); - } - internalBinaryWrite(message: SubscribedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SubscribedEvent - */ -export const SubscribedEvent = new SubscribedEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LinkFailEvent$Type extends MessageType { - constructor() { - super("routerrpc.LinkFailEvent", [ - { no: 1, name: "info", kind: "message", T: () => HtlcInfo }, - { no: 2, name: "wire_failure", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] }, - { no: 3, name: "failure_detail", kind: "enum", T: () => ["routerrpc.FailureDetail", FailureDetail] }, - { no: 4, name: "failure_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): LinkFailEvent { - const message = { wireFailure: 0, failureDetail: 0, failureString: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LinkFailEvent): LinkFailEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.HtlcInfo info */ 1: - message.info = HtlcInfo.internalBinaryRead(reader, reader.uint32(), options, message.info); - break; - case /* lnrpc.Failure.FailureCode wire_failure */ 2: - message.wireFailure = reader.int32(); - break; - case /* routerrpc.FailureDetail failure_detail */ 3: - message.failureDetail = reader.int32(); - break; - case /* string failure_string */ 4: - message.failureString = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: LinkFailEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* routerrpc.HtlcInfo info = 1; */ - if (message.info) - HtlcInfo.internalBinaryWrite(message.info, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Failure.FailureCode wire_failure = 2; */ - if (message.wireFailure !== 0) - writer.tag(2, WireType.Varint).int32(message.wireFailure); - /* routerrpc.FailureDetail failure_detail = 3; */ - if (message.failureDetail !== 0) - writer.tag(3, WireType.Varint).int32(message.failureDetail); - /* string failure_string = 4; */ - if (message.failureString !== "") - writer.tag(4, WireType.LengthDelimited).string(message.failureString); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.LinkFailEvent - */ -export const LinkFailEvent = new LinkFailEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PaymentStatus$Type extends MessageType { - constructor() { - super("routerrpc.PaymentStatus", [ - { no: 1, name: "state", kind: "enum", T: () => ["routerrpc.PaymentState", PaymentState] }, - { no: 2, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLCAttempt } - ]); - } - create(value?: PartialMessage): PaymentStatus { - const message = { state: 0, preimage: new Uint8Array(0), htlcs: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PaymentStatus): PaymentStatus { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.PaymentState state */ 1: - message.state = reader.int32(); - break; - case /* bytes preimage */ 2: - message.preimage = reader.bytes(); - break; - case /* repeated lnrpc.HTLCAttempt htlcs */ 4: - message.htlcs.push(HTLCAttempt.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: PaymentStatus, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* routerrpc.PaymentState state = 1; */ - if (message.state !== 0) - writer.tag(1, WireType.Varint).int32(message.state); - /* bytes preimage = 2; */ - if (message.preimage.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.preimage); - /* repeated lnrpc.HTLCAttempt htlcs = 4; */ - for (let i = 0; i < message.htlcs.length; i++) - HTLCAttempt.internalBinaryWrite(message.htlcs[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.PaymentStatus - */ -export const PaymentStatus = new PaymentStatus$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CircuitKey$Type extends MessageType { - constructor() { - super("routerrpc.CircuitKey", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value?: PartialMessage): CircuitKey { - const message = { chanId: 0n, htlcId: 0n }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CircuitKey): CircuitKey { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id */ 1: - message.chanId = reader.uint64().toBigInt(); - break; - case /* uint64 htlc_id */ 2: - message.htlcId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: CircuitKey, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* uint64 chan_id = 1; */ - if (message.chanId !== 0n) - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* uint64 htlc_id = 2; */ - if (message.htlcId !== 0n) - writer.tag(2, WireType.Varint).uint64(message.htlcId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.CircuitKey - */ -export const CircuitKey = new CircuitKey$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardHtlcInterceptRequest$Type extends MessageType { - constructor() { - super("routerrpc.ForwardHtlcInterceptRequest", [ - { no: 1, name: "incoming_circuit_key", kind: "message", T: () => CircuitKey }, - { no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "incoming_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 7, name: "outgoing_requested_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 4, name: "outgoing_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 8, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 9, name: "onion_blob", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 10, name: "auto_fail_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value?: PartialMessage): ForwardHtlcInterceptRequest { - const message = { incomingAmountMsat: 0n, incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: 0n, outgoingAmountMsat: 0n, outgoingExpiry: 0, customRecords: {}, onionBlob: new Uint8Array(0), autoFailHeight: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardHtlcInterceptRequest): ForwardHtlcInterceptRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.CircuitKey incoming_circuit_key */ 1: - message.incomingCircuitKey = CircuitKey.internalBinaryRead(reader, reader.uint32(), options, message.incomingCircuitKey); - break; - case /* uint64 incoming_amount_msat */ 5: - message.incomingAmountMsat = reader.uint64().toBigInt(); - break; - case /* uint32 incoming_expiry */ 6: - message.incomingExpiry = reader.uint32(); - break; - case /* bytes payment_hash */ 2: - message.paymentHash = reader.bytes(); - break; - case /* uint64 outgoing_requested_chan_id */ 7: - message.outgoingRequestedChanId = reader.uint64().toBigInt(); - break; - case /* uint64 outgoing_amount_msat */ 3: - message.outgoingAmountMsat = reader.uint64().toBigInt(); - break; - case /* uint32 outgoing_expiry */ 4: - message.outgoingExpiry = reader.uint32(); - break; - case /* map custom_records */ 8: - this.binaryReadMap8(message.customRecords, reader, options); - break; - case /* bytes onion_blob */ 9: - message.onionBlob = reader.bytes(); - break; - case /* int32 auto_fail_height */ 10: - message.autoFailHeight = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - private binaryReadMap8(map: ForwardHtlcInterceptRequest["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { - let len = reader.uint32(), end = reader.pos + len, key: keyof ForwardHtlcInterceptRequest["customRecords"] | undefined, val: ForwardHtlcInterceptRequest["customRecords"][any] | undefined; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint64().toString(); - break; - case 2: - val = reader.bytes(); - break; - default: throw new globalThis.Error("unknown map entry field for field routerrpc.ForwardHtlcInterceptRequest.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message: ForwardHtlcInterceptRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* routerrpc.CircuitKey incoming_circuit_key = 1; */ - if (message.incomingCircuitKey) - CircuitKey.internalBinaryWrite(message.incomingCircuitKey, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint64 incoming_amount_msat = 5; */ - if (message.incomingAmountMsat !== 0n) - writer.tag(5, WireType.Varint).uint64(message.incomingAmountMsat); - /* uint32 incoming_expiry = 6; */ - if (message.incomingExpiry !== 0) - writer.tag(6, WireType.Varint).uint32(message.incomingExpiry); - /* bytes payment_hash = 2; */ - if (message.paymentHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.paymentHash); - /* uint64 outgoing_requested_chan_id = 7; */ - if (message.outgoingRequestedChanId !== 0n) - writer.tag(7, WireType.Varint).uint64(message.outgoingRequestedChanId); - /* uint64 outgoing_amount_msat = 3; */ - if (message.outgoingAmountMsat !== 0n) - writer.tag(3, WireType.Varint).uint64(message.outgoingAmountMsat); - /* uint32 outgoing_expiry = 4; */ - if (message.outgoingExpiry !== 0) - writer.tag(4, WireType.Varint).uint32(message.outgoingExpiry); - /* map custom_records = 8; */ - for (let k of Object.keys(message.customRecords)) - writer.tag(8, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); - /* bytes onion_blob = 9; */ - if (message.onionBlob.length) - writer.tag(9, WireType.LengthDelimited).bytes(message.onionBlob); - /* int32 auto_fail_height = 10; */ - if (message.autoFailHeight !== 0) - writer.tag(10, WireType.Varint).int32(message.autoFailHeight); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptRequest - */ -export const ForwardHtlcInterceptRequest = new ForwardHtlcInterceptRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardHtlcInterceptResponse$Type extends MessageType { - constructor() { - super("routerrpc.ForwardHtlcInterceptResponse", [ - { no: 1, name: "incoming_circuit_key", kind: "message", T: () => CircuitKey }, - { no: 2, name: "action", kind: "enum", T: () => ["routerrpc.ResolveHoldForwardAction", ResolveHoldForwardAction] }, - { no: 3, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "failure_message", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "failure_code", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] } - ]); - } - create(value?: PartialMessage): ForwardHtlcInterceptResponse { - const message = { action: 0, preimage: new Uint8Array(0), failureMessage: new Uint8Array(0), failureCode: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardHtlcInterceptResponse): ForwardHtlcInterceptResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.CircuitKey incoming_circuit_key */ 1: - message.incomingCircuitKey = CircuitKey.internalBinaryRead(reader, reader.uint32(), options, message.incomingCircuitKey); - break; - case /* routerrpc.ResolveHoldForwardAction action */ 2: - message.action = reader.int32(); - break; - case /* bytes preimage */ 3: - message.preimage = reader.bytes(); - break; - case /* bytes failure_message */ 4: - message.failureMessage = reader.bytes(); - break; - case /* lnrpc.Failure.FailureCode failure_code */ 5: - message.failureCode = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ForwardHtlcInterceptResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* routerrpc.CircuitKey incoming_circuit_key = 1; */ - if (message.incomingCircuitKey) - CircuitKey.internalBinaryWrite(message.incomingCircuitKey, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.ResolveHoldForwardAction action = 2; */ - if (message.action !== 0) - writer.tag(2, WireType.Varint).int32(message.action); - /* bytes preimage = 3; */ - if (message.preimage.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.preimage); - /* bytes failure_message = 4; */ - if (message.failureMessage.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.failureMessage); - /* lnrpc.Failure.FailureCode failure_code = 5; */ - if (message.failureCode !== 0) - writer.tag(5, WireType.Varint).int32(message.failureCode); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptResponse - */ -export const ForwardHtlcInterceptResponse = new ForwardHtlcInterceptResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateChanStatusRequest$Type extends MessageType { - constructor() { - super("routerrpc.UpdateChanStatusRequest", [ - { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint }, - { no: 2, name: "action", kind: "enum", T: () => ["routerrpc.ChanStatusAction", ChanStatusAction] } - ]); - } - create(value?: PartialMessage): UpdateChanStatusRequest { - const message = { action: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateChanStatusRequest): UpdateChanStatusRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint chan_point */ 1: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* routerrpc.ChanStatusAction action */ 2: - message.action = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: UpdateChanStatusRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* lnrpc.ChannelPoint chan_point = 1; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.ChanStatusAction action = 2; */ - if (message.action !== 0) - writer.tag(2, WireType.Varint).int32(message.action); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.UpdateChanStatusRequest - */ -export const UpdateChanStatusRequest = new UpdateChanStatusRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateChanStatusResponse$Type extends MessageType { - constructor() { - super("routerrpc.UpdateChanStatusResponse", []); - } - create(value?: PartialMessage): UpdateChanStatusResponse { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateChanStatusResponse): UpdateChanStatusResponse { - return target ?? this.create(); - } - internalBinaryWrite(message: UpdateChanStatusResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.UpdateChanStatusResponse - */ -export const UpdateChanStatusResponse = new UpdateChanStatusResponse$Type(); -/** - * @generated ServiceType for protobuf service routerrpc.Router - */ -export const Router = new ServiceType("routerrpc.Router", [ - { name: "SendPaymentV2", serverStreaming: true, options: {}, I: SendPaymentRequest, O: Payment }, - { name: "TrackPaymentV2", serverStreaming: true, options: {}, I: TrackPaymentRequest, O: Payment }, - { name: "TrackPayments", serverStreaming: true, options: {}, I: TrackPaymentsRequest, O: Payment }, - { name: "EstimateRouteFee", options: {}, I: RouteFeeRequest, O: RouteFeeResponse }, - { name: "SendToRoute", options: {}, I: SendToRouteRequest, O: SendToRouteResponse }, - { name: "SendToRouteV2", options: {}, I: SendToRouteRequest, O: HTLCAttempt }, - { name: "ResetMissionControl", options: {}, I: ResetMissionControlRequest, O: ResetMissionControlResponse }, - { name: "QueryMissionControl", options: {}, I: QueryMissionControlRequest, O: QueryMissionControlResponse }, - { name: "XImportMissionControl", options: {}, I: XImportMissionControlRequest, O: XImportMissionControlResponse }, - { name: "GetMissionControlConfig", options: {}, I: GetMissionControlConfigRequest, O: GetMissionControlConfigResponse }, - { name: "SetMissionControlConfig", options: {}, I: SetMissionControlConfigRequest, O: SetMissionControlConfigResponse }, - { name: "QueryProbability", options: {}, I: QueryProbabilityRequest, O: QueryProbabilityResponse }, - { name: "BuildRoute", options: {}, I: BuildRouteRequest, O: BuildRouteResponse }, - { name: "SubscribeHtlcEvents", serverStreaming: true, options: {}, I: SubscribeHtlcEventsRequest, O: HtlcEvent }, - { name: "SendPayment", serverStreaming: true, options: {}, I: SendPaymentRequest, O: PaymentStatus }, - { name: "TrackPayment", serverStreaming: true, options: {}, I: TrackPaymentRequest, O: PaymentStatus }, - { name: "HtlcInterceptor", serverStreaming: true, clientStreaming: true, options: {}, I: ForwardHtlcInterceptResponse, O: ForwardHtlcInterceptRequest }, - { name: "UpdateChanStatus", options: {}, I: UpdateChanStatusRequest, O: UpdateChanStatusResponse } -]); +// @generated by protobuf-ts 2.8.1 +// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) +// tslint:disable +import { Payment } from "./lightning.js"; +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { ChannelPoint } from "./lightning.js"; +import { HTLCAttempt } from "./lightning.js"; +import { Failure_FailureCode } from "./lightning.js"; +import { Failure } from "./lightning.js"; +import { Route } from "./lightning.js"; +import { FeatureBit } from "./lightning.js"; +import { RouteHint } from "./lightning.js"; +/** + * @generated from protobuf message routerrpc.SendPaymentRequest + */ +export interface SendPaymentRequest { + /** + * The identity pubkey of the payment recipient + * + * @generated from protobuf field: bytes dest = 1; + */ + dest: Uint8Array; + /** + * + * Number of satoshis to send. + * + * The fields amt and amt_msat are mutually exclusive. + * + * @generated from protobuf field: int64 amt = 2; + */ + amt: bigint; + /** + * + * Number of millisatoshis to send. + * + * The fields amt and amt_msat are mutually exclusive. + * + * @generated from protobuf field: int64 amt_msat = 12; + */ + amtMsat: bigint; + /** + * The hash to use within the payment's HTLC + * + * @generated from protobuf field: bytes payment_hash = 3; + */ + paymentHash: Uint8Array; + /** + * + * The CLTV delta from the current height that should be used to set the + * timelock for the final hop. + * + * @generated from protobuf field: int32 final_cltv_delta = 4; + */ + finalCltvDelta: number; + /** + * An optional payment addr to be included within the last hop of the route. + * + * @generated from protobuf field: bytes payment_addr = 20; + */ + paymentAddr: Uint8Array; + /** + * + * A bare-bones invoice for a payment within the Lightning Network. With the + * details of the invoice, the sender has all the data necessary to send a + * payment to the recipient. The amount in the payment request may be zero. In + * that case it is required to set the amt field as well. If no payment request + * is specified, the following fields are required: dest, amt and payment_hash. + * + * @generated from protobuf field: string payment_request = 5; + */ + paymentRequest: string; + /** + * + * An upper limit on the amount of time we should spend when attempting to + * fulfill the payment. This is expressed in seconds. If we cannot make a + * successful payment within this time frame, an error will be returned. + * This field must be non-zero. + * + * @generated from protobuf field: int32 timeout_seconds = 6; + */ + timeoutSeconds: number; + /** + * + * The maximum number of satoshis that will be paid as a fee of the payment. + * If this field is left to the default value of 0, only zero-fee routes will + * be considered. This usually means single hop routes connecting directly to + * the destination. To send the payment without a fee limit, use max int here. + * + * The fields fee_limit_sat and fee_limit_msat are mutually exclusive. + * + * @generated from protobuf field: int64 fee_limit_sat = 7; + */ + feeLimitSat: bigint; + /** + * + * The maximum number of millisatoshis that will be paid as a fee of the + * payment. If this field is left to the default value of 0, only zero-fee + * routes will be considered. This usually means single hop routes connecting + * directly to the destination. To send the payment without a fee limit, use + * max int here. + * + * The fields fee_limit_sat and fee_limit_msat are mutually exclusive. + * + * @generated from protobuf field: int64 fee_limit_msat = 13; + */ + feeLimitMsat: bigint; + /** + * + * Deprecated, use outgoing_chan_ids. The channel id of the channel that must + * be taken to the first hop. If zero, any channel may be used (unless + * outgoing_chan_ids are set). + * + * @deprecated + * @generated from protobuf field: uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; + */ + outgoingChanId: string; + /** + * + * The channel ids of the channels are allowed for the first hop. If empty, + * any channel may be used. + * + * @generated from protobuf field: repeated uint64 outgoing_chan_ids = 19; + */ + outgoingChanIds: bigint[]; + /** + * + * The pubkey of the last hop of the route. If empty, any hop may be used. + * + * @generated from protobuf field: bytes last_hop_pubkey = 14; + */ + lastHopPubkey: Uint8Array; + /** + * + * An optional maximum total time lock for the route. This should not exceed + * lnd's `--max-cltv-expiry` setting. If zero, then the value of + * `--max-cltv-expiry` is enforced. + * + * @generated from protobuf field: int32 cltv_limit = 9; + */ + cltvLimit: number; + /** + * + * Optional route hints to reach the destination through private channels. + * + * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; + */ + routeHints: RouteHint[]; + /** + * + * An optional field that can be used to pass an arbitrary set of TLV records + * to a peer which understands the new records. This can be used to pass + * application specific data during the payment attempt. Record types are + * required to be in the custom range >= 65536. When using REST, the values + * must be encoded as base64. + * + * @generated from protobuf field: map dest_custom_records = 11; + */ + destCustomRecords: { + [key: string]: Uint8Array; + }; + /** + * If set, circular payments to self are permitted. + * + * @generated from protobuf field: bool allow_self_payment = 15; + */ + allowSelfPayment: boolean; + /** + * + * Features assumed to be supported by the final node. All transitive feature + * dependencies must also be set properly. For a given feature bit pair, either + * optional or remote may be set, but not both. If this field is nil or empty, + * the router will try to load destination features from the graph as a + * fallback. + * + * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 16; + */ + destFeatures: FeatureBit[]; + /** + * + * The maximum number of partial payments that may be use to complete the full + * amount. + * + * @generated from protobuf field: uint32 max_parts = 17; + */ + maxParts: number; + /** + * + * If set, only the final payment update is streamed back. Intermediate updates + * that show which htlcs are still in flight are suppressed. + * + * @generated from protobuf field: bool no_inflight_updates = 18; + */ + noInflightUpdates: boolean; + /** + * + * The largest payment split that should be attempted when making a payment if + * splitting is necessary. Setting this value will effectively cause lnd to + * split more aggressively, vs only when it thinks it needs to. Note that this + * value is in milli-satoshis. + * + * @generated from protobuf field: uint64 max_shard_size_msat = 21; + */ + maxShardSizeMsat: bigint; + /** + * + * If set, an AMP-payment will be attempted. + * + * @generated from protobuf field: bool amp = 22; + */ + amp: boolean; + /** + * + * The time preference for this payment. Set to -1 to optimize for fees + * only, to 1 to optimize for reliability only or a value inbetween for a mix. + * + * @generated from protobuf field: double time_pref = 23; + */ + timePref: number; +} +/** + * @generated from protobuf message routerrpc.TrackPaymentRequest + */ +export interface TrackPaymentRequest { + /** + * The hash of the payment to look up. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; + /** + * + * If set, only the final payment update is streamed back. Intermediate updates + * that show which htlcs are still in flight are suppressed. + * + * @generated from protobuf field: bool no_inflight_updates = 2; + */ + noInflightUpdates: boolean; +} +/** + * @generated from protobuf message routerrpc.TrackPaymentsRequest + */ +export interface TrackPaymentsRequest { + /** + * + * If set, only the final payment updates are streamed back. Intermediate + * updates that show which htlcs are still in flight are suppressed. + * + * @generated from protobuf field: bool no_inflight_updates = 1; + */ + noInflightUpdates: boolean; +} +/** + * @generated from protobuf message routerrpc.RouteFeeRequest + */ +export interface RouteFeeRequest { + /** + * + * The destination once wishes to obtain a routing fee quote to. + * + * @generated from protobuf field: bytes dest = 1; + */ + dest: Uint8Array; + /** + * + * The amount one wishes to send to the target destination. + * + * @generated from protobuf field: int64 amt_sat = 2; + */ + amtSat: bigint; +} +/** + * @generated from protobuf message routerrpc.RouteFeeResponse + */ +export interface RouteFeeResponse { + /** + * + * A lower bound of the estimated fee to the target destination within the + * network, expressed in milli-satoshis. + * + * @generated from protobuf field: int64 routing_fee_msat = 1; + */ + routingFeeMsat: bigint; + /** + * + * An estimate of the worst case time delay that can occur. Note that callers + * will still need to factor in the final CLTV delta of the last hop into this + * value. + * + * @generated from protobuf field: int64 time_lock_delay = 2; + */ + timeLockDelay: bigint; +} +/** + * @generated from protobuf message routerrpc.SendToRouteRequest + */ +export interface SendToRouteRequest { + /** + * The payment hash to use for the HTLC. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; + /** + * Route that should be used to attempt to complete the payment. + * + * @generated from protobuf field: lnrpc.Route route = 2; + */ + route?: Route; + /** + * + * Whether the payment should be marked as failed when a temporary error is + * returned from the given route. Set it to true so the payment won't be + * failed unless a terminal error is occurred, such as payment timeout, no + * routes, incorrect payment details, or insufficient funds. + * + * @generated from protobuf field: bool skip_temp_err = 3; + */ + skipTempErr: boolean; +} +/** + * @generated from protobuf message routerrpc.SendToRouteResponse + */ +export interface SendToRouteResponse { + /** + * The preimage obtained by making the payment. + * + * @generated from protobuf field: bytes preimage = 1; + */ + preimage: Uint8Array; + /** + * The failure message in case the payment failed. + * + * @generated from protobuf field: lnrpc.Failure failure = 2; + */ + failure?: Failure; +} +/** + * @generated from protobuf message routerrpc.ResetMissionControlRequest + */ +export interface ResetMissionControlRequest { +} +/** + * @generated from protobuf message routerrpc.ResetMissionControlResponse + */ +export interface ResetMissionControlResponse { +} +/** + * @generated from protobuf message routerrpc.QueryMissionControlRequest + */ +export interface QueryMissionControlRequest { +} +/** + * QueryMissionControlResponse contains mission control state. + * + * @generated from protobuf message routerrpc.QueryMissionControlResponse + */ +export interface QueryMissionControlResponse { + /** + * Node pair-level mission control state. + * + * @generated from protobuf field: repeated routerrpc.PairHistory pairs = 2; + */ + pairs: PairHistory[]; +} +/** + * @generated from protobuf message routerrpc.XImportMissionControlRequest + */ +export interface XImportMissionControlRequest { + /** + * Node pair-level mission control state to be imported. + * + * @generated from protobuf field: repeated routerrpc.PairHistory pairs = 1; + */ + pairs: PairHistory[]; + /** + * Whether to force override MC pair history. Note that even with force + * override the failure pair is imported before the success pair and both + * still clamp existing failure/success amounts. + * + * @generated from protobuf field: bool force = 2; + */ + force: boolean; +} +/** + * @generated from protobuf message routerrpc.XImportMissionControlResponse + */ +export interface XImportMissionControlResponse { +} +/** + * PairHistory contains the mission control state for a particular node pair. + * + * @generated from protobuf message routerrpc.PairHistory + */ +export interface PairHistory { + /** + * The source node pubkey of the pair. + * + * @generated from protobuf field: bytes node_from = 1; + */ + nodeFrom: Uint8Array; + /** + * The destination node pubkey of the pair. + * + * @generated from protobuf field: bytes node_to = 2; + */ + nodeTo: Uint8Array; + /** + * @generated from protobuf field: routerrpc.PairData history = 7; + */ + history?: PairData; +} +/** + * @generated from protobuf message routerrpc.PairData + */ +export interface PairData { + /** + * Time of last failure. + * + * @generated from protobuf field: int64 fail_time = 1; + */ + failTime: bigint; + /** + * + * Lowest amount that failed to forward rounded to whole sats. This may be + * set to zero if the failure is independent of amount. + * + * @generated from protobuf field: int64 fail_amt_sat = 2; + */ + failAmtSat: bigint; + /** + * + * Lowest amount that failed to forward in millisats. This may be + * set to zero if the failure is independent of amount. + * + * @generated from protobuf field: int64 fail_amt_msat = 4; + */ + failAmtMsat: bigint; + /** + * Time of last success. + * + * @generated from protobuf field: int64 success_time = 5; + */ + successTime: bigint; + /** + * Highest amount that we could successfully forward rounded to whole sats. + * + * @generated from protobuf field: int64 success_amt_sat = 6; + */ + successAmtSat: bigint; + /** + * Highest amount that we could successfully forward in millisats. + * + * @generated from protobuf field: int64 success_amt_msat = 7; + */ + successAmtMsat: bigint; +} +/** + * @generated from protobuf message routerrpc.GetMissionControlConfigRequest + */ +export interface GetMissionControlConfigRequest { +} +/** + * @generated from protobuf message routerrpc.GetMissionControlConfigResponse + */ +export interface GetMissionControlConfigResponse { + /** + * + * Mission control's currently active config. + * + * @generated from protobuf field: routerrpc.MissionControlConfig config = 1; + */ + config?: MissionControlConfig; +} +/** + * @generated from protobuf message routerrpc.SetMissionControlConfigRequest + */ +export interface SetMissionControlConfigRequest { + /** + * + * The config to set for mission control. Note that all values *must* be set, + * because the full config will be applied. + * + * @generated from protobuf field: routerrpc.MissionControlConfig config = 1; + */ + config?: MissionControlConfig; +} +/** + * @generated from protobuf message routerrpc.SetMissionControlConfigResponse + */ +export interface SetMissionControlConfigResponse { +} +/** + * @generated from protobuf message routerrpc.MissionControlConfig + */ +export interface MissionControlConfig { + /** + * + * The amount of time mission control will take to restore a penalized node + * or channel back to 50% success probability, expressed in seconds. Setting + * this value to a higher value will penalize failures for longer, making + * mission control less likely to route through nodes and channels that we + * have previously recorded failures for. + * + * @generated from protobuf field: uint64 half_life_seconds = 1; + */ + halfLifeSeconds: bigint; + /** + * + * The probability of success mission control should assign to hop in a route + * where it has no other information available. Higher values will make mission + * control more willing to try hops that we have no information about, lower + * values will discourage trying these hops. + * + * @generated from protobuf field: float hop_probability = 2; + */ + hopProbability: number; + /** + * + * The importance that mission control should place on historical results, + * expressed as a value in [0;1]. Setting this value to 1 will ignore all + * historical payments and just use the hop probability to assess the + * probability of success for each hop. A zero value ignores hop probability + * completely and relies entirely on historical results, unless none are + * available. + * + * @generated from protobuf field: float weight = 3; + */ + weight: number; + /** + * + * The maximum number of payment results that mission control will store. + * + * @generated from protobuf field: uint32 maximum_payment_results = 4; + */ + maximumPaymentResults: number; + /** + * + * The minimum time that must have passed since the previously recorded failure + * before we raise the failure amount. + * + * @generated from protobuf field: uint64 minimum_failure_relax_interval = 5; + */ + minimumFailureRelaxInterval: bigint; +} +/** + * @generated from protobuf message routerrpc.QueryProbabilityRequest + */ +export interface QueryProbabilityRequest { + /** + * The source node pubkey of the pair. + * + * @generated from protobuf field: bytes from_node = 1; + */ + fromNode: Uint8Array; + /** + * The destination node pubkey of the pair. + * + * @generated from protobuf field: bytes to_node = 2; + */ + toNode: Uint8Array; + /** + * The amount for which to calculate a probability. + * + * @generated from protobuf field: int64 amt_msat = 3; + */ + amtMsat: bigint; +} +/** + * @generated from protobuf message routerrpc.QueryProbabilityResponse + */ +export interface QueryProbabilityResponse { + /** + * The success probability for the requested pair. + * + * @generated from protobuf field: double probability = 1; + */ + probability: number; + /** + * The historical data for the requested pair. + * + * @generated from protobuf field: routerrpc.PairData history = 2; + */ + history?: PairData; +} +/** + * @generated from protobuf message routerrpc.BuildRouteRequest + */ +export interface BuildRouteRequest { + /** + * + * The amount to send expressed in msat. If set to zero, the minimum routable + * amount is used. + * + * @generated from protobuf field: int64 amt_msat = 1; + */ + amtMsat: bigint; + /** + * + * CLTV delta from the current height that should be used for the timelock + * of the final hop + * + * @generated from protobuf field: int32 final_cltv_delta = 2; + */ + finalCltvDelta: number; + /** + * + * The channel id of the channel that must be taken to the first hop. If zero, + * any channel may be used. + * + * @generated from protobuf field: uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; + */ + outgoingChanId: string; + /** + * + * A list of hops that defines the route. This does not include the source hop + * pubkey. + * + * @generated from protobuf field: repeated bytes hop_pubkeys = 4; + */ + hopPubkeys: Uint8Array[]; + /** + * An optional payment addr to be included within the last hop of the route. + * + * @generated from protobuf field: bytes payment_addr = 5; + */ + paymentAddr: Uint8Array; +} +/** + * @generated from protobuf message routerrpc.BuildRouteResponse + */ +export interface BuildRouteResponse { + /** + * + * Fully specified route that can be used to execute the payment. + * + * @generated from protobuf field: lnrpc.Route route = 1; + */ + route?: Route; +} +/** + * @generated from protobuf message routerrpc.SubscribeHtlcEventsRequest + */ +export interface SubscribeHtlcEventsRequest { +} +/** + * + * HtlcEvent contains the htlc event that was processed. These are served on a + * best-effort basis; events are not persisted, delivery is not guaranteed + * (in the event of a crash in the switch, forward events may be lost) and + * some events may be replayed upon restart. Events consumed from this package + * should be de-duplicated by the htlc's unique combination of incoming and + * outgoing channel id and htlc id. [EXPERIMENTAL] + * + * @generated from protobuf message routerrpc.HtlcEvent + */ +export interface HtlcEvent { + /** + * + * The short channel id that the incoming htlc arrived at our node on. This + * value is zero for sends. + * + * @generated from protobuf field: uint64 incoming_channel_id = 1; + */ + incomingChannelId: bigint; + /** + * + * The short channel id that the outgoing htlc left our node on. This value + * is zero for receives. + * + * @generated from protobuf field: uint64 outgoing_channel_id = 2; + */ + outgoingChannelId: bigint; + /** + * + * Incoming id is the index of the incoming htlc in the incoming channel. + * This value is zero for sends. + * + * @generated from protobuf field: uint64 incoming_htlc_id = 3; + */ + incomingHtlcId: bigint; + /** + * + * Outgoing id is the index of the outgoing htlc in the outgoing channel. + * This value is zero for receives. + * + * @generated from protobuf field: uint64 outgoing_htlc_id = 4; + */ + outgoingHtlcId: bigint; + /** + * + * The time in unix nanoseconds that the event occurred. + * + * @generated from protobuf field: uint64 timestamp_ns = 5; + */ + timestampNs: bigint; + /** + * + * The event type indicates whether the htlc was part of a send, receive or + * forward. + * + * @generated from protobuf field: routerrpc.HtlcEvent.EventType event_type = 6; + */ + eventType: HtlcEvent_EventType; + /** + * @generated from protobuf oneof: event + */ + event: { + oneofKind: "forwardEvent"; + /** + * @generated from protobuf field: routerrpc.ForwardEvent forward_event = 7; + */ + forwardEvent: ForwardEvent; + } | { + oneofKind: "forwardFailEvent"; + /** + * @generated from protobuf field: routerrpc.ForwardFailEvent forward_fail_event = 8; + */ + forwardFailEvent: ForwardFailEvent; + } | { + oneofKind: "settleEvent"; + /** + * @generated from protobuf field: routerrpc.SettleEvent settle_event = 9; + */ + settleEvent: SettleEvent; + } | { + oneofKind: "linkFailEvent"; + /** + * @generated from protobuf field: routerrpc.LinkFailEvent link_fail_event = 10; + */ + linkFailEvent: LinkFailEvent; + } | { + oneofKind: "subscribedEvent"; + /** + * @generated from protobuf field: routerrpc.SubscribedEvent subscribed_event = 11; + */ + subscribedEvent: SubscribedEvent; + } | { + oneofKind: "finalHtlcEvent"; + /** + * @generated from protobuf field: routerrpc.FinalHtlcEvent final_htlc_event = 12; + */ + finalHtlcEvent: FinalHtlcEvent; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf enum routerrpc.HtlcEvent.EventType + */ +export enum HtlcEvent_EventType { + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: SEND = 1; + */ + SEND = 1, + /** + * @generated from protobuf enum value: RECEIVE = 2; + */ + RECEIVE = 2, + /** + * @generated from protobuf enum value: FORWARD = 3; + */ + FORWARD = 3 +} +/** + * @generated from protobuf message routerrpc.HtlcInfo + */ +export interface HtlcInfo { + /** + * The timelock on the incoming htlc. + * + * @generated from protobuf field: uint32 incoming_timelock = 1; + */ + incomingTimelock: number; + /** + * The timelock on the outgoing htlc. + * + * @generated from protobuf field: uint32 outgoing_timelock = 2; + */ + outgoingTimelock: number; + /** + * The amount of the incoming htlc. + * + * @generated from protobuf field: uint64 incoming_amt_msat = 3; + */ + incomingAmtMsat: bigint; + /** + * The amount of the outgoing htlc. + * + * @generated from protobuf field: uint64 outgoing_amt_msat = 4; + */ + outgoingAmtMsat: bigint; +} +/** + * @generated from protobuf message routerrpc.ForwardEvent + */ +export interface ForwardEvent { + /** + * Info contains details about the htlc that was forwarded. + * + * @generated from protobuf field: routerrpc.HtlcInfo info = 1; + */ + info?: HtlcInfo; +} +/** + * @generated from protobuf message routerrpc.ForwardFailEvent + */ +export interface ForwardFailEvent { +} +/** + * @generated from protobuf message routerrpc.SettleEvent + */ +export interface SettleEvent { + /** + * The revealed preimage. + * + * @generated from protobuf field: bytes preimage = 1; + */ + preimage: Uint8Array; +} +/** + * @generated from protobuf message routerrpc.FinalHtlcEvent + */ +export interface FinalHtlcEvent { + /** + * @generated from protobuf field: bool settled = 1; + */ + settled: boolean; + /** + * @generated from protobuf field: bool offchain = 2; + */ + offchain: boolean; +} +/** + * @generated from protobuf message routerrpc.SubscribedEvent + */ +export interface SubscribedEvent { +} +/** + * @generated from protobuf message routerrpc.LinkFailEvent + */ +export interface LinkFailEvent { + /** + * Info contains details about the htlc that we failed. + * + * @generated from protobuf field: routerrpc.HtlcInfo info = 1; + */ + info?: HtlcInfo; + /** + * FailureCode is the BOLT error code for the failure. + * + * @generated from protobuf field: lnrpc.Failure.FailureCode wire_failure = 2; + */ + wireFailure: Failure_FailureCode; + /** + * + * FailureDetail provides additional information about the reason for the + * failure. This detail enriches the information provided by the wire message + * and may be 'no detail' if the wire message requires no additional metadata. + * + * @generated from protobuf field: routerrpc.FailureDetail failure_detail = 3; + */ + failureDetail: FailureDetail; + /** + * A string representation of the link failure. + * + * @generated from protobuf field: string failure_string = 4; + */ + failureString: string; +} +/** + * @generated from protobuf message routerrpc.PaymentStatus + */ +export interface PaymentStatus { + /** + * Current state the payment is in. + * + * @generated from protobuf field: routerrpc.PaymentState state = 1; + */ + state: PaymentState; + /** + * + * The pre-image of the payment when state is SUCCEEDED. + * + * @generated from protobuf field: bytes preimage = 2; + */ + preimage: Uint8Array; + /** + * + * The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. + * + * @generated from protobuf field: repeated lnrpc.HTLCAttempt htlcs = 4; + */ + htlcs: HTLCAttempt[]; +} +/** + * @generated from protobuf message routerrpc.CircuitKey + */ +export interface CircuitKey { + /** + * / The id of the channel that the is part of this circuit. + * + * @generated from protobuf field: uint64 chan_id = 1; + */ + chanId: bigint; + /** + * / The index of the incoming htlc in the incoming channel. + * + * @generated from protobuf field: uint64 htlc_id = 2; + */ + htlcId: bigint; +} +/** + * @generated from protobuf message routerrpc.ForwardHtlcInterceptRequest + */ +export interface ForwardHtlcInterceptRequest { + /** + * + * The key of this forwarded htlc. It defines the incoming channel id and + * the index in this channel. + * + * @generated from protobuf field: routerrpc.CircuitKey incoming_circuit_key = 1; + */ + incomingCircuitKey?: CircuitKey; + /** + * The incoming htlc amount. + * + * @generated from protobuf field: uint64 incoming_amount_msat = 5; + */ + incomingAmountMsat: bigint; + /** + * The incoming htlc expiry. + * + * @generated from protobuf field: uint32 incoming_expiry = 6; + */ + incomingExpiry: number; + /** + * + * The htlc payment hash. This value is not guaranteed to be unique per + * request. + * + * @generated from protobuf field: bytes payment_hash = 2; + */ + paymentHash: Uint8Array; + /** + * The requested outgoing channel id for this forwarded htlc. Because of + * non-strict forwarding, this isn't necessarily the channel over which the + * packet will be forwarded eventually. A different channel to the same peer + * may be selected as well. + * + * @generated from protobuf field: uint64 outgoing_requested_chan_id = 7; + */ + outgoingRequestedChanId: bigint; + /** + * The outgoing htlc amount. + * + * @generated from protobuf field: uint64 outgoing_amount_msat = 3; + */ + outgoingAmountMsat: bigint; + /** + * The outgoing htlc expiry. + * + * @generated from protobuf field: uint32 outgoing_expiry = 4; + */ + outgoingExpiry: number; + /** + * Any custom records that were present in the payload. + * + * @generated from protobuf field: map custom_records = 8; + */ + customRecords: { + [key: string]: Uint8Array; + }; + /** + * The onion blob for the next hop + * + * @generated from protobuf field: bytes onion_blob = 9; + */ + onionBlob: Uint8Array; + /** + * The block height at which this htlc will be auto-failed to prevent the + * channel from force-closing. + * + * @generated from protobuf field: int32 auto_fail_height = 10; + */ + autoFailHeight: number; +} +/** + * * + * ForwardHtlcInterceptResponse enables the caller to resolve a previously hold + * forward. The caller can choose either to: + * - `Resume`: Execute the default behavior (usually forward). + * - `Reject`: Fail the htlc backwards. + * - `Settle`: Settle this htlc with a given preimage. + * + * @generated from protobuf message routerrpc.ForwardHtlcInterceptResponse + */ +export interface ForwardHtlcInterceptResponse { + /** + * * + * The key of this forwarded htlc. It defines the incoming channel id and + * the index in this channel. + * + * @generated from protobuf field: routerrpc.CircuitKey incoming_circuit_key = 1; + */ + incomingCircuitKey?: CircuitKey; + /** + * The resolve action for this intercepted htlc. + * + * @generated from protobuf field: routerrpc.ResolveHoldForwardAction action = 2; + */ + action: ResolveHoldForwardAction; + /** + * The preimage in case the resolve action is Settle. + * + * @generated from protobuf field: bytes preimage = 3; + */ + preimage: Uint8Array; + /** + * Encrypted failure message in case the resolve action is Fail. + * + * If failure_message is specified, the failure_code field must be set + * to zero. + * + * @generated from protobuf field: bytes failure_message = 4; + */ + failureMessage: Uint8Array; + /** + * Return the specified failure code in case the resolve action is Fail. The + * message data fields are populated automatically. + * + * If a non-zero failure_code is specified, failure_message must not be set. + * + * For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the + * default value for this field. + * + * @generated from protobuf field: lnrpc.Failure.FailureCode failure_code = 5; + */ + failureCode: Failure_FailureCode; +} +/** + * @generated from protobuf message routerrpc.UpdateChanStatusRequest + */ +export interface UpdateChanStatusRequest { + /** + * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; + */ + chanPoint?: ChannelPoint; + /** + * @generated from protobuf field: routerrpc.ChanStatusAction action = 2; + */ + action: ChanStatusAction; +} +/** + * @generated from protobuf message routerrpc.UpdateChanStatusResponse + */ +export interface UpdateChanStatusResponse { +} +/** + * @generated from protobuf enum routerrpc.FailureDetail + */ +export enum FailureDetail { + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: NO_DETAIL = 1; + */ + NO_DETAIL = 1, + /** + * @generated from protobuf enum value: ONION_DECODE = 2; + */ + ONION_DECODE = 2, + /** + * @generated from protobuf enum value: LINK_NOT_ELIGIBLE = 3; + */ + LINK_NOT_ELIGIBLE = 3, + /** + * @generated from protobuf enum value: ON_CHAIN_TIMEOUT = 4; + */ + ON_CHAIN_TIMEOUT = 4, + /** + * @generated from protobuf enum value: HTLC_EXCEEDS_MAX = 5; + */ + HTLC_EXCEEDS_MAX = 5, + /** + * @generated from protobuf enum value: INSUFFICIENT_BALANCE = 6; + */ + INSUFFICIENT_BALANCE = 6, + /** + * @generated from protobuf enum value: INCOMPLETE_FORWARD = 7; + */ + INCOMPLETE_FORWARD = 7, + /** + * @generated from protobuf enum value: HTLC_ADD_FAILED = 8; + */ + HTLC_ADD_FAILED = 8, + /** + * @generated from protobuf enum value: FORWARDS_DISABLED = 9; + */ + FORWARDS_DISABLED = 9, + /** + * @generated from protobuf enum value: INVOICE_CANCELED = 10; + */ + INVOICE_CANCELED = 10, + /** + * @generated from protobuf enum value: INVOICE_UNDERPAID = 11; + */ + INVOICE_UNDERPAID = 11, + /** + * @generated from protobuf enum value: INVOICE_EXPIRY_TOO_SOON = 12; + */ + INVOICE_EXPIRY_TOO_SOON = 12, + /** + * @generated from protobuf enum value: INVOICE_NOT_OPEN = 13; + */ + INVOICE_NOT_OPEN = 13, + /** + * @generated from protobuf enum value: MPP_INVOICE_TIMEOUT = 14; + */ + MPP_INVOICE_TIMEOUT = 14, + /** + * @generated from protobuf enum value: ADDRESS_MISMATCH = 15; + */ + ADDRESS_MISMATCH = 15, + /** + * @generated from protobuf enum value: SET_TOTAL_MISMATCH = 16; + */ + SET_TOTAL_MISMATCH = 16, + /** + * @generated from protobuf enum value: SET_TOTAL_TOO_LOW = 17; + */ + SET_TOTAL_TOO_LOW = 17, + /** + * @generated from protobuf enum value: SET_OVERPAID = 18; + */ + SET_OVERPAID = 18, + /** + * @generated from protobuf enum value: UNKNOWN_INVOICE = 19; + */ + UNKNOWN_INVOICE = 19, + /** + * @generated from protobuf enum value: INVALID_KEYSEND = 20; + */ + INVALID_KEYSEND = 20, + /** + * @generated from protobuf enum value: MPP_IN_PROGRESS = 21; + */ + MPP_IN_PROGRESS = 21, + /** + * @generated from protobuf enum value: CIRCULAR_ROUTE = 22; + */ + CIRCULAR_ROUTE = 22 +} +/** + * @generated from protobuf enum routerrpc.PaymentState + */ +export enum PaymentState { + /** + * + * Payment is still in flight. + * + * @generated from protobuf enum value: IN_FLIGHT = 0; + */ + IN_FLIGHT = 0, + /** + * + * Payment completed successfully. + * + * @generated from protobuf enum value: SUCCEEDED = 1; + */ + SUCCEEDED = 1, + /** + * + * There are more routes to try, but the payment timeout was exceeded. + * + * @generated from protobuf enum value: FAILED_TIMEOUT = 2; + */ + FAILED_TIMEOUT = 2, + /** + * + * All possible routes were tried and failed permanently. Or were no + * routes to the destination at all. + * + * @generated from protobuf enum value: FAILED_NO_ROUTE = 3; + */ + FAILED_NO_ROUTE = 3, + /** + * + * A non-recoverable error has occurred. + * + * @generated from protobuf enum value: FAILED_ERROR = 4; + */ + FAILED_ERROR = 4, + /** + * + * Payment details incorrect (unknown hash, invalid amt or + * invalid final cltv delta) + * + * @generated from protobuf enum value: FAILED_INCORRECT_PAYMENT_DETAILS = 5; + */ + FAILED_INCORRECT_PAYMENT_DETAILS = 5, + /** + * + * Insufficient local balance. + * + * @generated from protobuf enum value: FAILED_INSUFFICIENT_BALANCE = 6; + */ + FAILED_INSUFFICIENT_BALANCE = 6 +} +/** + * @generated from protobuf enum routerrpc.ResolveHoldForwardAction + */ +export enum ResolveHoldForwardAction { + /** + * @generated from protobuf enum value: SETTLE = 0; + */ + SETTLE = 0, + /** + * @generated from protobuf enum value: FAIL = 1; + */ + FAIL = 1, + /** + * @generated from protobuf enum value: RESUME = 2; + */ + RESUME = 2 +} +/** + * @generated from protobuf enum routerrpc.ChanStatusAction + */ +export enum ChanStatusAction { + /** + * @generated from protobuf enum value: ENABLE = 0; + */ + ENABLE = 0, + /** + * @generated from protobuf enum value: DISABLE = 1; + */ + DISABLE = 1, + /** + * @generated from protobuf enum value: AUTO = 2; + */ + AUTO = 2 +} +// @generated message type with reflection information, may provide speed optimized methods +class SendPaymentRequest$Type extends MessageType { + constructor() { + super("routerrpc.SendPaymentRequest", [ + { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 20, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "timeout_seconds", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: "fee_limit_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 19, name: "outgoing_chan_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 14, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 9, name: "cltv_limit", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 10, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, + { no: 11, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, + { no: 15, name: "allow_self_payment", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, + { no: 17, name: "max_parts", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 18, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 21, name: "max_shard_size_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 22, name: "amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 23, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): SendPaymentRequest { + const message = { dest: new Uint8Array(0), amt: 0n, amtMsat: 0n, paymentHash: new Uint8Array(0), finalCltvDelta: 0, paymentAddr: new Uint8Array(0), paymentRequest: "", timeoutSeconds: 0, feeLimitSat: 0n, feeLimitMsat: 0n, outgoingChanId: "0", outgoingChanIds: [], lastHopPubkey: new Uint8Array(0), cltvLimit: 0, routeHints: [], destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], maxParts: 0, noInflightUpdates: false, maxShardSizeMsat: 0n, amp: false, timePref: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendPaymentRequest): SendPaymentRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes dest */ 1: + message.dest = reader.bytes(); + break; + case /* int64 amt */ 2: + message.amt = reader.int64().toBigInt(); + break; + case /* int64 amt_msat */ 12: + message.amtMsat = reader.int64().toBigInt(); + break; + case /* bytes payment_hash */ 3: + message.paymentHash = reader.bytes(); + break; + case /* int32 final_cltv_delta */ 4: + message.finalCltvDelta = reader.int32(); + break; + case /* bytes payment_addr */ 20: + message.paymentAddr = reader.bytes(); + break; + case /* string payment_request */ 5: + message.paymentRequest = reader.string(); + break; + case /* int32 timeout_seconds */ 6: + message.timeoutSeconds = reader.int32(); + break; + case /* int64 fee_limit_sat */ 7: + message.feeLimitSat = reader.int64().toBigInt(); + break; + case /* int64 fee_limit_msat */ 13: + message.feeLimitMsat = reader.int64().toBigInt(); + break; + case /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING];*/ 8: + message.outgoingChanId = reader.uint64().toString(); + break; + case /* repeated uint64 outgoing_chan_ids */ 19: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.outgoingChanIds.push(reader.uint64().toBigInt()); + else + message.outgoingChanIds.push(reader.uint64().toBigInt()); + break; + case /* bytes last_hop_pubkey */ 14: + message.lastHopPubkey = reader.bytes(); + break; + case /* int32 cltv_limit */ 9: + message.cltvLimit = reader.int32(); + break; + case /* repeated lnrpc.RouteHint route_hints */ 10: + message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* map dest_custom_records */ 11: + this.binaryReadMap11(message.destCustomRecords, reader, options); + break; + case /* bool allow_self_payment */ 15: + message.allowSelfPayment = reader.bool(); + break; + case /* repeated lnrpc.FeatureBit dest_features */ 16: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.destFeatures.push(reader.int32()); + else + message.destFeatures.push(reader.int32()); + break; + case /* uint32 max_parts */ 17: + message.maxParts = reader.uint32(); + break; + case /* bool no_inflight_updates */ 18: + message.noInflightUpdates = reader.bool(); + break; + case /* uint64 max_shard_size_msat */ 21: + message.maxShardSizeMsat = reader.uint64().toBigInt(); + break; + case /* bool amp */ 22: + message.amp = reader.bool(); + break; + case /* double time_pref */ 23: + message.timePref = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap11(map: SendPaymentRequest["destCustomRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SendPaymentRequest["destCustomRecords"] | undefined, val: SendPaymentRequest["destCustomRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field routerrpc.SendPaymentRequest.dest_custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: SendPaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes dest = 1; */ + if (message.dest.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.dest); + /* int64 amt = 2; */ + if (message.amt !== 0n) + writer.tag(2, WireType.Varint).int64(message.amt); + /* int64 amt_msat = 12; */ + if (message.amtMsat !== 0n) + writer.tag(12, WireType.Varint).int64(message.amtMsat); + /* bytes payment_hash = 3; */ + if (message.paymentHash.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.paymentHash); + /* int32 final_cltv_delta = 4; */ + if (message.finalCltvDelta !== 0) + writer.tag(4, WireType.Varint).int32(message.finalCltvDelta); + /* bytes payment_addr = 20; */ + if (message.paymentAddr.length) + writer.tag(20, WireType.LengthDelimited).bytes(message.paymentAddr); + /* string payment_request = 5; */ + if (message.paymentRequest !== "") + writer.tag(5, WireType.LengthDelimited).string(message.paymentRequest); + /* int32 timeout_seconds = 6; */ + if (message.timeoutSeconds !== 0) + writer.tag(6, WireType.Varint).int32(message.timeoutSeconds); + /* int64 fee_limit_sat = 7; */ + if (message.feeLimitSat !== 0n) + writer.tag(7, WireType.Varint).int64(message.feeLimitSat); + /* int64 fee_limit_msat = 13; */ + if (message.feeLimitMsat !== 0n) + writer.tag(13, WireType.Varint).int64(message.feeLimitMsat); + /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; */ + if (message.outgoingChanId !== "0") + writer.tag(8, WireType.Varint).uint64(message.outgoingChanId); + /* repeated uint64 outgoing_chan_ids = 19; */ + if (message.outgoingChanIds.length) { + writer.tag(19, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.outgoingChanIds.length; i++) + writer.uint64(message.outgoingChanIds[i]); + writer.join(); + } + /* bytes last_hop_pubkey = 14; */ + if (message.lastHopPubkey.length) + writer.tag(14, WireType.LengthDelimited).bytes(message.lastHopPubkey); + /* int32 cltv_limit = 9; */ + if (message.cltvLimit !== 0) + writer.tag(9, WireType.Varint).int32(message.cltvLimit); + /* repeated lnrpc.RouteHint route_hints = 10; */ + for (let i = 0; i < message.routeHints.length; i++) + RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); + /* map dest_custom_records = 11; */ + for (let k of Object.keys(message.destCustomRecords)) + writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); + /* bool allow_self_payment = 15; */ + if (message.allowSelfPayment !== false) + writer.tag(15, WireType.Varint).bool(message.allowSelfPayment); + /* repeated lnrpc.FeatureBit dest_features = 16; */ + if (message.destFeatures.length) { + writer.tag(16, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.destFeatures.length; i++) + writer.int32(message.destFeatures[i]); + writer.join(); + } + /* uint32 max_parts = 17; */ + if (message.maxParts !== 0) + writer.tag(17, WireType.Varint).uint32(message.maxParts); + /* bool no_inflight_updates = 18; */ + if (message.noInflightUpdates !== false) + writer.tag(18, WireType.Varint).bool(message.noInflightUpdates); + /* uint64 max_shard_size_msat = 21; */ + if (message.maxShardSizeMsat !== 0n) + writer.tag(21, WireType.Varint).uint64(message.maxShardSizeMsat); + /* bool amp = 22; */ + if (message.amp !== false) + writer.tag(22, WireType.Varint).bool(message.amp); + /* double time_pref = 23; */ + if (message.timePref !== 0) + writer.tag(23, WireType.Bit64).double(message.timePref); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SendPaymentRequest + */ +export const SendPaymentRequest = new SendPaymentRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TrackPaymentRequest$Type extends MessageType { + constructor() { + super("routerrpc.TrackPaymentRequest", [ + { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): TrackPaymentRequest { + const message = { paymentHash: new Uint8Array(0), noInflightUpdates: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackPaymentRequest): TrackPaymentRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.paymentHash = reader.bytes(); + break; + case /* bool no_inflight_updates */ 2: + message.noInflightUpdates = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TrackPaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.paymentHash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); + /* bool no_inflight_updates = 2; */ + if (message.noInflightUpdates !== false) + writer.tag(2, WireType.Varint).bool(message.noInflightUpdates); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.TrackPaymentRequest + */ +export const TrackPaymentRequest = new TrackPaymentRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TrackPaymentsRequest$Type extends MessageType { + constructor() { + super("routerrpc.TrackPaymentsRequest", [ + { no: 1, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): TrackPaymentsRequest { + const message = { noInflightUpdates: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackPaymentsRequest): TrackPaymentsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool no_inflight_updates */ 1: + message.noInflightUpdates = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TrackPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool no_inflight_updates = 1; */ + if (message.noInflightUpdates !== false) + writer.tag(1, WireType.Varint).bool(message.noInflightUpdates); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.TrackPaymentsRequest + */ +export const TrackPaymentsRequest = new TrackPaymentsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RouteFeeRequest$Type extends MessageType { + constructor() { + super("routerrpc.RouteFeeRequest", [ + { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): RouteFeeRequest { + const message = { dest: new Uint8Array(0), amtSat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteFeeRequest): RouteFeeRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes dest */ 1: + message.dest = reader.bytes(); + break; + case /* int64 amt_sat */ 2: + message.amtSat = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RouteFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes dest = 1; */ + if (message.dest.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.dest); + /* int64 amt_sat = 2; */ + if (message.amtSat !== 0n) + writer.tag(2, WireType.Varint).int64(message.amtSat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.RouteFeeRequest + */ +export const RouteFeeRequest = new RouteFeeRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RouteFeeResponse$Type extends MessageType { + constructor() { + super("routerrpc.RouteFeeResponse", [ + { no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): RouteFeeResponse { + const message = { routingFeeMsat: 0n, timeLockDelay: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteFeeResponse): RouteFeeResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 routing_fee_msat */ 1: + message.routingFeeMsat = reader.int64().toBigInt(); + break; + case /* int64 time_lock_delay */ 2: + message.timeLockDelay = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RouteFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 routing_fee_msat = 1; */ + if (message.routingFeeMsat !== 0n) + writer.tag(1, WireType.Varint).int64(message.routingFeeMsat); + /* int64 time_lock_delay = 2; */ + if (message.timeLockDelay !== 0n) + writer.tag(2, WireType.Varint).int64(message.timeLockDelay); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.RouteFeeResponse + */ +export const RouteFeeResponse = new RouteFeeResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendToRouteRequest$Type extends MessageType { + constructor() { + super("routerrpc.SendToRouteRequest", [ + { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "route", kind: "message", T: () => Route }, + { no: 3, name: "skip_temp_err", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SendToRouteRequest { + const message = { paymentHash: new Uint8Array(0), skipTempErr: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteRequest): SendToRouteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.paymentHash = reader.bytes(); + break; + case /* lnrpc.Route route */ 2: + message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); + break; + case /* bool skip_temp_err */ 3: + message.skipTempErr = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendToRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.paymentHash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); + /* lnrpc.Route route = 2; */ + if (message.route) + Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* bool skip_temp_err = 3; */ + if (message.skipTempErr !== false) + writer.tag(3, WireType.Varint).bool(message.skipTempErr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SendToRouteRequest + */ +export const SendToRouteRequest = new SendToRouteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendToRouteResponse$Type extends MessageType { + constructor() { + super("routerrpc.SendToRouteResponse", [ + { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "failure", kind: "message", T: () => Failure } + ]); + } + create(value?: PartialMessage): SendToRouteResponse { + const message = { preimage: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteResponse): SendToRouteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes preimage */ 1: + message.preimage = reader.bytes(); + break; + case /* lnrpc.Failure failure */ 2: + message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendToRouteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes preimage = 1; */ + if (message.preimage.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); + /* lnrpc.Failure failure = 2; */ + if (message.failure) + Failure.internalBinaryWrite(message.failure, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SendToRouteResponse + */ +export const SendToRouteResponse = new SendToRouteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ResetMissionControlRequest$Type extends MessageType { + constructor() { + super("routerrpc.ResetMissionControlRequest", []); + } + create(value?: PartialMessage): ResetMissionControlRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetMissionControlRequest): ResetMissionControlRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: ResetMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.ResetMissionControlRequest + */ +export const ResetMissionControlRequest = new ResetMissionControlRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ResetMissionControlResponse$Type extends MessageType { + constructor() { + super("routerrpc.ResetMissionControlResponse", []); + } + create(value?: PartialMessage): ResetMissionControlResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetMissionControlResponse): ResetMissionControlResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: ResetMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.ResetMissionControlResponse + */ +export const ResetMissionControlResponse = new ResetMissionControlResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryMissionControlRequest$Type extends MessageType { + constructor() { + super("routerrpc.QueryMissionControlRequest", []); + } + create(value?: PartialMessage): QueryMissionControlRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryMissionControlRequest): QueryMissionControlRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: QueryMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.QueryMissionControlRequest + */ +export const QueryMissionControlRequest = new QueryMissionControlRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryMissionControlResponse$Type extends MessageType { + constructor() { + super("routerrpc.QueryMissionControlResponse", [ + { no: 2, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory } + ]); + } + create(value?: PartialMessage): QueryMissionControlResponse { + const message = { pairs: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryMissionControlResponse): QueryMissionControlResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated routerrpc.PairHistory pairs */ 2: + message.pairs.push(PairHistory.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: QueryMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated routerrpc.PairHistory pairs = 2; */ + for (let i = 0; i < message.pairs.length; i++) + PairHistory.internalBinaryWrite(message.pairs[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.QueryMissionControlResponse + */ +export const QueryMissionControlResponse = new QueryMissionControlResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class XImportMissionControlRequest$Type extends MessageType { + constructor() { + super("routerrpc.XImportMissionControlRequest", [ + { no: 1, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory }, + { no: 2, name: "force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): XImportMissionControlRequest { + const message = { pairs: [], force: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: XImportMissionControlRequest): XImportMissionControlRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated routerrpc.PairHistory pairs */ 1: + message.pairs.push(PairHistory.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* bool force */ 2: + message.force = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: XImportMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated routerrpc.PairHistory pairs = 1; */ + for (let i = 0; i < message.pairs.length; i++) + PairHistory.internalBinaryWrite(message.pairs[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bool force = 2; */ + if (message.force !== false) + writer.tag(2, WireType.Varint).bool(message.force); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.XImportMissionControlRequest + */ +export const XImportMissionControlRequest = new XImportMissionControlRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class XImportMissionControlResponse$Type extends MessageType { + constructor() { + super("routerrpc.XImportMissionControlResponse", []); + } + create(value?: PartialMessage): XImportMissionControlResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: XImportMissionControlResponse): XImportMissionControlResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: XImportMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.XImportMissionControlResponse + */ +export const XImportMissionControlResponse = new XImportMissionControlResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PairHistory$Type extends MessageType { + constructor() { + super("routerrpc.PairHistory", [ + { no: 1, name: "node_from", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "node_to", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 7, name: "history", kind: "message", T: () => PairData } + ]); + } + create(value?: PartialMessage): PairHistory { + const message = { nodeFrom: new Uint8Array(0), nodeTo: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PairHistory): PairHistory { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes node_from */ 1: + message.nodeFrom = reader.bytes(); + break; + case /* bytes node_to */ 2: + message.nodeTo = reader.bytes(); + break; + case /* routerrpc.PairData history */ 7: + message.history = PairData.internalBinaryRead(reader, reader.uint32(), options, message.history); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PairHistory, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes node_from = 1; */ + if (message.nodeFrom.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.nodeFrom); + /* bytes node_to = 2; */ + if (message.nodeTo.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.nodeTo); + /* routerrpc.PairData history = 7; */ + if (message.history) + PairData.internalBinaryWrite(message.history, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.PairHistory + */ +export const PairHistory = new PairHistory$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PairData$Type extends MessageType { + constructor() { + super("routerrpc.PairData", [ + { no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): PairData { + const message = { failTime: 0n, failAmtSat: 0n, failAmtMsat: 0n, successTime: 0n, successAmtSat: 0n, successAmtMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PairData): PairData { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 fail_time */ 1: + message.failTime = reader.int64().toBigInt(); + break; + case /* int64 fail_amt_sat */ 2: + message.failAmtSat = reader.int64().toBigInt(); + break; + case /* int64 fail_amt_msat */ 4: + message.failAmtMsat = reader.int64().toBigInt(); + break; + case /* int64 success_time */ 5: + message.successTime = reader.int64().toBigInt(); + break; + case /* int64 success_amt_sat */ 6: + message.successAmtSat = reader.int64().toBigInt(); + break; + case /* int64 success_amt_msat */ 7: + message.successAmtMsat = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PairData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 fail_time = 1; */ + if (message.failTime !== 0n) + writer.tag(1, WireType.Varint).int64(message.failTime); + /* int64 fail_amt_sat = 2; */ + if (message.failAmtSat !== 0n) + writer.tag(2, WireType.Varint).int64(message.failAmtSat); + /* int64 fail_amt_msat = 4; */ + if (message.failAmtMsat !== 0n) + writer.tag(4, WireType.Varint).int64(message.failAmtMsat); + /* int64 success_time = 5; */ + if (message.successTime !== 0n) + writer.tag(5, WireType.Varint).int64(message.successTime); + /* int64 success_amt_sat = 6; */ + if (message.successAmtSat !== 0n) + writer.tag(6, WireType.Varint).int64(message.successAmtSat); + /* int64 success_amt_msat = 7; */ + if (message.successAmtMsat !== 0n) + writer.tag(7, WireType.Varint).int64(message.successAmtMsat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.PairData + */ +export const PairData = new PairData$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetMissionControlConfigRequest$Type extends MessageType { + constructor() { + super("routerrpc.GetMissionControlConfigRequest", []); + } + create(value?: PartialMessage): GetMissionControlConfigRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMissionControlConfigRequest): GetMissionControlConfigRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: GetMissionControlConfigRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.GetMissionControlConfigRequest + */ +export const GetMissionControlConfigRequest = new GetMissionControlConfigRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GetMissionControlConfigResponse$Type extends MessageType { + constructor() { + super("routerrpc.GetMissionControlConfigResponse", [ + { no: 1, name: "config", kind: "message", T: () => MissionControlConfig } + ]); + } + create(value?: PartialMessage): GetMissionControlConfigResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMissionControlConfigResponse): GetMissionControlConfigResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* routerrpc.MissionControlConfig config */ 1: + message.config = MissionControlConfig.internalBinaryRead(reader, reader.uint32(), options, message.config); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: GetMissionControlConfigResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* routerrpc.MissionControlConfig config = 1; */ + if (message.config) + MissionControlConfig.internalBinaryWrite(message.config, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.GetMissionControlConfigResponse + */ +export const GetMissionControlConfigResponse = new GetMissionControlConfigResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetMissionControlConfigRequest$Type extends MessageType { + constructor() { + super("routerrpc.SetMissionControlConfigRequest", [ + { no: 1, name: "config", kind: "message", T: () => MissionControlConfig } + ]); + } + create(value?: PartialMessage): SetMissionControlConfigRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetMissionControlConfigRequest): SetMissionControlConfigRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* routerrpc.MissionControlConfig config */ 1: + message.config = MissionControlConfig.internalBinaryRead(reader, reader.uint32(), options, message.config); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SetMissionControlConfigRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* routerrpc.MissionControlConfig config = 1; */ + if (message.config) + MissionControlConfig.internalBinaryWrite(message.config, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SetMissionControlConfigRequest + */ +export const SetMissionControlConfigRequest = new SetMissionControlConfigRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SetMissionControlConfigResponse$Type extends MessageType { + constructor() { + super("routerrpc.SetMissionControlConfigResponse", []); + } + create(value?: PartialMessage): SetMissionControlConfigResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetMissionControlConfigResponse): SetMissionControlConfigResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: SetMissionControlConfigResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SetMissionControlConfigResponse + */ +export const SetMissionControlConfigResponse = new SetMissionControlConfigResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MissionControlConfig$Type extends MessageType { + constructor() { + super("routerrpc.MissionControlConfig", [ + { no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "hop_probability", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: "weight", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: "maximum_payment_results", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "minimum_failure_relax_interval", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): MissionControlConfig { + const message = { halfLifeSeconds: 0n, hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MissionControlConfig): MissionControlConfig { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 half_life_seconds */ 1: + message.halfLifeSeconds = reader.uint64().toBigInt(); + break; + case /* float hop_probability */ 2: + message.hopProbability = reader.float(); + break; + case /* float weight */ 3: + message.weight = reader.float(); + break; + case /* uint32 maximum_payment_results */ 4: + message.maximumPaymentResults = reader.uint32(); + break; + case /* uint64 minimum_failure_relax_interval */ 5: + message.minimumFailureRelaxInterval = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MissionControlConfig, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 half_life_seconds = 1; */ + if (message.halfLifeSeconds !== 0n) + writer.tag(1, WireType.Varint).uint64(message.halfLifeSeconds); + /* float hop_probability = 2; */ + if (message.hopProbability !== 0) + writer.tag(2, WireType.Bit32).float(message.hopProbability); + /* float weight = 3; */ + if (message.weight !== 0) + writer.tag(3, WireType.Bit32).float(message.weight); + /* uint32 maximum_payment_results = 4; */ + if (message.maximumPaymentResults !== 0) + writer.tag(4, WireType.Varint).uint32(message.maximumPaymentResults); + /* uint64 minimum_failure_relax_interval = 5; */ + if (message.minimumFailureRelaxInterval !== 0n) + writer.tag(5, WireType.Varint).uint64(message.minimumFailureRelaxInterval); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.MissionControlConfig + */ +export const MissionControlConfig = new MissionControlConfig$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryProbabilityRequest$Type extends MessageType { + constructor() { + super("routerrpc.QueryProbabilityRequest", [ + { no: 1, name: "from_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "to_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): QueryProbabilityRequest { + const message = { fromNode: new Uint8Array(0), toNode: new Uint8Array(0), amtMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryProbabilityRequest): QueryProbabilityRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes from_node */ 1: + message.fromNode = reader.bytes(); + break; + case /* bytes to_node */ 2: + message.toNode = reader.bytes(); + break; + case /* int64 amt_msat */ 3: + message.amtMsat = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: QueryProbabilityRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes from_node = 1; */ + if (message.fromNode.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.fromNode); + /* bytes to_node = 2; */ + if (message.toNode.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.toNode); + /* int64 amt_msat = 3; */ + if (message.amtMsat !== 0n) + writer.tag(3, WireType.Varint).int64(message.amtMsat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.QueryProbabilityRequest + */ +export const QueryProbabilityRequest = new QueryProbabilityRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryProbabilityResponse$Type extends MessageType { + constructor() { + super("routerrpc.QueryProbabilityResponse", [ + { no: 1, name: "probability", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 2, name: "history", kind: "message", T: () => PairData } + ]); + } + create(value?: PartialMessage): QueryProbabilityResponse { + const message = { probability: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryProbabilityResponse): QueryProbabilityResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* double probability */ 1: + message.probability = reader.double(); + break; + case /* routerrpc.PairData history */ 2: + message.history = PairData.internalBinaryRead(reader, reader.uint32(), options, message.history); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: QueryProbabilityResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* double probability = 1; */ + if (message.probability !== 0) + writer.tag(1, WireType.Bit64).double(message.probability); + /* routerrpc.PairData history = 2; */ + if (message.history) + PairData.internalBinaryWrite(message.history, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.QueryProbabilityResponse + */ +export const QueryProbabilityResponse = new QueryProbabilityResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BuildRouteRequest$Type extends MessageType { + constructor() { + super("routerrpc.BuildRouteRequest", [ + { no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "hop_pubkeys", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): BuildRouteRequest { + const message = { amtMsat: 0n, finalCltvDelta: 0, outgoingChanId: "0", hopPubkeys: [], paymentAddr: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BuildRouteRequest): BuildRouteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 amt_msat */ 1: + message.amtMsat = reader.int64().toBigInt(); + break; + case /* int32 final_cltv_delta */ 2: + message.finalCltvDelta = reader.int32(); + break; + case /* uint64 outgoing_chan_id = 3 [jstype = JS_STRING];*/ 3: + message.outgoingChanId = reader.uint64().toString(); + break; + case /* repeated bytes hop_pubkeys */ 4: + message.hopPubkeys.push(reader.bytes()); + break; + case /* bytes payment_addr */ 5: + message.paymentAddr = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BuildRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 amt_msat = 1; */ + if (message.amtMsat !== 0n) + writer.tag(1, WireType.Varint).int64(message.amtMsat); + /* int32 final_cltv_delta = 2; */ + if (message.finalCltvDelta !== 0) + writer.tag(2, WireType.Varint).int32(message.finalCltvDelta); + /* uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; */ + if (message.outgoingChanId !== "0") + writer.tag(3, WireType.Varint).uint64(message.outgoingChanId); + /* repeated bytes hop_pubkeys = 4; */ + for (let i = 0; i < message.hopPubkeys.length; i++) + writer.tag(4, WireType.LengthDelimited).bytes(message.hopPubkeys[i]); + /* bytes payment_addr = 5; */ + if (message.paymentAddr.length) + writer.tag(5, WireType.LengthDelimited).bytes(message.paymentAddr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.BuildRouteRequest + */ +export const BuildRouteRequest = new BuildRouteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BuildRouteResponse$Type extends MessageType { + constructor() { + super("routerrpc.BuildRouteResponse", [ + { no: 1, name: "route", kind: "message", T: () => Route } + ]); + } + create(value?: PartialMessage): BuildRouteResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BuildRouteResponse): BuildRouteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.Route route */ 1: + message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BuildRouteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.Route route = 1; */ + if (message.route) + Route.internalBinaryWrite(message.route, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.BuildRouteResponse + */ +export const BuildRouteResponse = new BuildRouteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubscribeHtlcEventsRequest$Type extends MessageType { + constructor() { + super("routerrpc.SubscribeHtlcEventsRequest", []); + } + create(value?: PartialMessage): SubscribeHtlcEventsRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeHtlcEventsRequest): SubscribeHtlcEventsRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: SubscribeHtlcEventsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SubscribeHtlcEventsRequest + */ +export const SubscribeHtlcEventsRequest = new SubscribeHtlcEventsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HtlcEvent$Type extends MessageType { + constructor() { + super("routerrpc.HtlcEvent", [ + { no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "event_type", kind: "enum", T: () => ["routerrpc.HtlcEvent.EventType", HtlcEvent_EventType] }, + { no: 7, name: "forward_event", kind: "message", oneof: "event", T: () => ForwardEvent }, + { no: 8, name: "forward_fail_event", kind: "message", oneof: "event", T: () => ForwardFailEvent }, + { no: 9, name: "settle_event", kind: "message", oneof: "event", T: () => SettleEvent }, + { no: 10, name: "link_fail_event", kind: "message", oneof: "event", T: () => LinkFailEvent }, + { no: 11, name: "subscribed_event", kind: "message", oneof: "event", T: () => SubscribedEvent }, + { no: 12, name: "final_htlc_event", kind: "message", oneof: "event", T: () => FinalHtlcEvent } + ]); + } + create(value?: PartialMessage): HtlcEvent { + const message = { incomingChannelId: 0n, outgoingChannelId: 0n, incomingHtlcId: 0n, outgoingHtlcId: 0n, timestampNs: 0n, eventType: 0, event: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HtlcEvent): HtlcEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 incoming_channel_id */ 1: + message.incomingChannelId = reader.uint64().toBigInt(); + break; + case /* uint64 outgoing_channel_id */ 2: + message.outgoingChannelId = reader.uint64().toBigInt(); + break; + case /* uint64 incoming_htlc_id */ 3: + message.incomingHtlcId = reader.uint64().toBigInt(); + break; + case /* uint64 outgoing_htlc_id */ 4: + message.outgoingHtlcId = reader.uint64().toBigInt(); + break; + case /* uint64 timestamp_ns */ 5: + message.timestampNs = reader.uint64().toBigInt(); + break; + case /* routerrpc.HtlcEvent.EventType event_type */ 6: + message.eventType = reader.int32(); + break; + case /* routerrpc.ForwardEvent forward_event */ 7: + message.event = { + oneofKind: "forwardEvent", + forwardEvent: ForwardEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).forwardEvent) + }; + break; + case /* routerrpc.ForwardFailEvent forward_fail_event */ 8: + message.event = { + oneofKind: "forwardFailEvent", + forwardFailEvent: ForwardFailEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).forwardFailEvent) + }; + break; + case /* routerrpc.SettleEvent settle_event */ 9: + message.event = { + oneofKind: "settleEvent", + settleEvent: SettleEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).settleEvent) + }; + break; + case /* routerrpc.LinkFailEvent link_fail_event */ 10: + message.event = { + oneofKind: "linkFailEvent", + linkFailEvent: LinkFailEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).linkFailEvent) + }; + break; + case /* routerrpc.SubscribedEvent subscribed_event */ 11: + message.event = { + oneofKind: "subscribedEvent", + subscribedEvent: SubscribedEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).subscribedEvent) + }; + break; + case /* routerrpc.FinalHtlcEvent final_htlc_event */ 12: + message.event = { + oneofKind: "finalHtlcEvent", + finalHtlcEvent: FinalHtlcEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).finalHtlcEvent) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: HtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 incoming_channel_id = 1; */ + if (message.incomingChannelId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.incomingChannelId); + /* uint64 outgoing_channel_id = 2; */ + if (message.outgoingChannelId !== 0n) + writer.tag(2, WireType.Varint).uint64(message.outgoingChannelId); + /* uint64 incoming_htlc_id = 3; */ + if (message.incomingHtlcId !== 0n) + writer.tag(3, WireType.Varint).uint64(message.incomingHtlcId); + /* uint64 outgoing_htlc_id = 4; */ + if (message.outgoingHtlcId !== 0n) + writer.tag(4, WireType.Varint).uint64(message.outgoingHtlcId); + /* uint64 timestamp_ns = 5; */ + if (message.timestampNs !== 0n) + writer.tag(5, WireType.Varint).uint64(message.timestampNs); + /* routerrpc.HtlcEvent.EventType event_type = 6; */ + if (message.eventType !== 0) + writer.tag(6, WireType.Varint).int32(message.eventType); + /* routerrpc.ForwardEvent forward_event = 7; */ + if (message.event.oneofKind === "forwardEvent") + ForwardEvent.internalBinaryWrite(message.event.forwardEvent, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.ForwardFailEvent forward_fail_event = 8; */ + if (message.event.oneofKind === "forwardFailEvent") + ForwardFailEvent.internalBinaryWrite(message.event.forwardFailEvent, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.SettleEvent settle_event = 9; */ + if (message.event.oneofKind === "settleEvent") + SettleEvent.internalBinaryWrite(message.event.settleEvent, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.LinkFailEvent link_fail_event = 10; */ + if (message.event.oneofKind === "linkFailEvent") + LinkFailEvent.internalBinaryWrite(message.event.linkFailEvent, writer.tag(10, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.SubscribedEvent subscribed_event = 11; */ + if (message.event.oneofKind === "subscribedEvent") + SubscribedEvent.internalBinaryWrite(message.event.subscribedEvent, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.FinalHtlcEvent final_htlc_event = 12; */ + if (message.event.oneofKind === "finalHtlcEvent") + FinalHtlcEvent.internalBinaryWrite(message.event.finalHtlcEvent, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.HtlcEvent + */ +export const HtlcEvent = new HtlcEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HtlcInfo$Type extends MessageType { + constructor() { + super("routerrpc.HtlcInfo", [ + { no: 1, name: "incoming_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "outgoing_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "incoming_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): HtlcInfo { + const message = { incomingTimelock: 0, outgoingTimelock: 0, incomingAmtMsat: 0n, outgoingAmtMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HtlcInfo): HtlcInfo { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 incoming_timelock */ 1: + message.incomingTimelock = reader.uint32(); + break; + case /* uint32 outgoing_timelock */ 2: + message.outgoingTimelock = reader.uint32(); + break; + case /* uint64 incoming_amt_msat */ 3: + message.incomingAmtMsat = reader.uint64().toBigInt(); + break; + case /* uint64 outgoing_amt_msat */ 4: + message.outgoingAmtMsat = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: HtlcInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint32 incoming_timelock = 1; */ + if (message.incomingTimelock !== 0) + writer.tag(1, WireType.Varint).uint32(message.incomingTimelock); + /* uint32 outgoing_timelock = 2; */ + if (message.outgoingTimelock !== 0) + writer.tag(2, WireType.Varint).uint32(message.outgoingTimelock); + /* uint64 incoming_amt_msat = 3; */ + if (message.incomingAmtMsat !== 0n) + writer.tag(3, WireType.Varint).uint64(message.incomingAmtMsat); + /* uint64 outgoing_amt_msat = 4; */ + if (message.outgoingAmtMsat !== 0n) + writer.tag(4, WireType.Varint).uint64(message.outgoingAmtMsat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.HtlcInfo + */ +export const HtlcInfo = new HtlcInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ForwardEvent$Type extends MessageType { + constructor() { + super("routerrpc.ForwardEvent", [ + { no: 1, name: "info", kind: "message", T: () => HtlcInfo } + ]); + } + create(value?: PartialMessage): ForwardEvent { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardEvent): ForwardEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* routerrpc.HtlcInfo info */ 1: + message.info = HtlcInfo.internalBinaryRead(reader, reader.uint32(), options, message.info); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ForwardEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* routerrpc.HtlcInfo info = 1; */ + if (message.info) + HtlcInfo.internalBinaryWrite(message.info, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.ForwardEvent + */ +export const ForwardEvent = new ForwardEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ForwardFailEvent$Type extends MessageType { + constructor() { + super("routerrpc.ForwardFailEvent", []); + } + create(value?: PartialMessage): ForwardFailEvent { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardFailEvent): ForwardFailEvent { + return target ?? this.create(); + } + internalBinaryWrite(message: ForwardFailEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.ForwardFailEvent + */ +export const ForwardFailEvent = new ForwardFailEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SettleEvent$Type extends MessageType { + constructor() { + super("routerrpc.SettleEvent", [ + { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SettleEvent { + const message = { preimage: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleEvent): SettleEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes preimage */ 1: + message.preimage = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SettleEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes preimage = 1; */ + if (message.preimage.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SettleEvent + */ +export const SettleEvent = new SettleEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FinalHtlcEvent$Type extends MessageType { + constructor() { + super("routerrpc.FinalHtlcEvent", [ + { no: 1, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "offchain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): FinalHtlcEvent { + const message = { settled: false, offchain: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalHtlcEvent): FinalHtlcEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool settled */ 1: + message.settled = reader.bool(); + break; + case /* bool offchain */ 2: + message.offchain = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FinalHtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool settled = 1; */ + if (message.settled !== false) + writer.tag(1, WireType.Varint).bool(message.settled); + /* bool offchain = 2; */ + if (message.offchain !== false) + writer.tag(2, WireType.Varint).bool(message.offchain); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.FinalHtlcEvent + */ +export const FinalHtlcEvent = new FinalHtlcEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubscribedEvent$Type extends MessageType { + constructor() { + super("routerrpc.SubscribedEvent", []); + } + create(value?: PartialMessage): SubscribedEvent { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribedEvent): SubscribedEvent { + return target ?? this.create(); + } + internalBinaryWrite(message: SubscribedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SubscribedEvent + */ +export const SubscribedEvent = new SubscribedEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LinkFailEvent$Type extends MessageType { + constructor() { + super("routerrpc.LinkFailEvent", [ + { no: 1, name: "info", kind: "message", T: () => HtlcInfo }, + { no: 2, name: "wire_failure", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] }, + { no: 3, name: "failure_detail", kind: "enum", T: () => ["routerrpc.FailureDetail", FailureDetail] }, + { no: 4, name: "failure_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): LinkFailEvent { + const message = { wireFailure: 0, failureDetail: 0, failureString: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LinkFailEvent): LinkFailEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* routerrpc.HtlcInfo info */ 1: + message.info = HtlcInfo.internalBinaryRead(reader, reader.uint32(), options, message.info); + break; + case /* lnrpc.Failure.FailureCode wire_failure */ 2: + message.wireFailure = reader.int32(); + break; + case /* routerrpc.FailureDetail failure_detail */ 3: + message.failureDetail = reader.int32(); + break; + case /* string failure_string */ 4: + message.failureString = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LinkFailEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* routerrpc.HtlcInfo info = 1; */ + if (message.info) + HtlcInfo.internalBinaryWrite(message.info, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.Failure.FailureCode wire_failure = 2; */ + if (message.wireFailure !== 0) + writer.tag(2, WireType.Varint).int32(message.wireFailure); + /* routerrpc.FailureDetail failure_detail = 3; */ + if (message.failureDetail !== 0) + writer.tag(3, WireType.Varint).int32(message.failureDetail); + /* string failure_string = 4; */ + if (message.failureString !== "") + writer.tag(4, WireType.LengthDelimited).string(message.failureString); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.LinkFailEvent + */ +export const LinkFailEvent = new LinkFailEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PaymentStatus$Type extends MessageType { + constructor() { + super("routerrpc.PaymentStatus", [ + { no: 1, name: "state", kind: "enum", T: () => ["routerrpc.PaymentState", PaymentState] }, + { no: 2, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLCAttempt } + ]); + } + create(value?: PartialMessage): PaymentStatus { + const message = { state: 0, preimage: new Uint8Array(0), htlcs: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PaymentStatus): PaymentStatus { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* routerrpc.PaymentState state */ 1: + message.state = reader.int32(); + break; + case /* bytes preimage */ 2: + message.preimage = reader.bytes(); + break; + case /* repeated lnrpc.HTLCAttempt htlcs */ 4: + message.htlcs.push(HTLCAttempt.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PaymentStatus, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* routerrpc.PaymentState state = 1; */ + if (message.state !== 0) + writer.tag(1, WireType.Varint).int32(message.state); + /* bytes preimage = 2; */ + if (message.preimage.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.preimage); + /* repeated lnrpc.HTLCAttempt htlcs = 4; */ + for (let i = 0; i < message.htlcs.length; i++) + HTLCAttempt.internalBinaryWrite(message.htlcs[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.PaymentStatus + */ +export const PaymentStatus = new PaymentStatus$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CircuitKey$Type extends MessageType { + constructor() { + super("routerrpc.CircuitKey", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): CircuitKey { + const message = { chanId: 0n, htlcId: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CircuitKey): CircuitKey { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id */ 1: + message.chanId = reader.uint64().toBigInt(); + break; + case /* uint64 htlc_id */ 2: + message.htlcId = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CircuitKey, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1; */ + if (message.chanId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.chanId); + /* uint64 htlc_id = 2; */ + if (message.htlcId !== 0n) + writer.tag(2, WireType.Varint).uint64(message.htlcId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.CircuitKey + */ +export const CircuitKey = new CircuitKey$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ForwardHtlcInterceptRequest$Type extends MessageType { + constructor() { + super("routerrpc.ForwardHtlcInterceptRequest", [ + { no: 1, name: "incoming_circuit_key", kind: "message", T: () => CircuitKey }, + { no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "incoming_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 7, name: "outgoing_requested_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "outgoing_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 8, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, + { no: 9, name: "onion_blob", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 10, name: "auto_fail_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): ForwardHtlcInterceptRequest { + const message = { incomingAmountMsat: 0n, incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: 0n, outgoingAmountMsat: 0n, outgoingExpiry: 0, customRecords: {}, onionBlob: new Uint8Array(0), autoFailHeight: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardHtlcInterceptRequest): ForwardHtlcInterceptRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* routerrpc.CircuitKey incoming_circuit_key */ 1: + message.incomingCircuitKey = CircuitKey.internalBinaryRead(reader, reader.uint32(), options, message.incomingCircuitKey); + break; + case /* uint64 incoming_amount_msat */ 5: + message.incomingAmountMsat = reader.uint64().toBigInt(); + break; + case /* uint32 incoming_expiry */ 6: + message.incomingExpiry = reader.uint32(); + break; + case /* bytes payment_hash */ 2: + message.paymentHash = reader.bytes(); + break; + case /* uint64 outgoing_requested_chan_id */ 7: + message.outgoingRequestedChanId = reader.uint64().toBigInt(); + break; + case /* uint64 outgoing_amount_msat */ 3: + message.outgoingAmountMsat = reader.uint64().toBigInt(); + break; + case /* uint32 outgoing_expiry */ 4: + message.outgoingExpiry = reader.uint32(); + break; + case /* map custom_records */ 8: + this.binaryReadMap8(message.customRecords, reader, options); + break; + case /* bytes onion_blob */ 9: + message.onionBlob = reader.bytes(); + break; + case /* int32 auto_fail_height */ 10: + message.autoFailHeight = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap8(map: ForwardHtlcInterceptRequest["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof ForwardHtlcInterceptRequest["customRecords"] | undefined, val: ForwardHtlcInterceptRequest["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field routerrpc.ForwardHtlcInterceptRequest.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } + internalBinaryWrite(message: ForwardHtlcInterceptRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* routerrpc.CircuitKey incoming_circuit_key = 1; */ + if (message.incomingCircuitKey) + CircuitKey.internalBinaryWrite(message.incomingCircuitKey, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint64 incoming_amount_msat = 5; */ + if (message.incomingAmountMsat !== 0n) + writer.tag(5, WireType.Varint).uint64(message.incomingAmountMsat); + /* uint32 incoming_expiry = 6; */ + if (message.incomingExpiry !== 0) + writer.tag(6, WireType.Varint).uint32(message.incomingExpiry); + /* bytes payment_hash = 2; */ + if (message.paymentHash.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.paymentHash); + /* uint64 outgoing_requested_chan_id = 7; */ + if (message.outgoingRequestedChanId !== 0n) + writer.tag(7, WireType.Varint).uint64(message.outgoingRequestedChanId); + /* uint64 outgoing_amount_msat = 3; */ + if (message.outgoingAmountMsat !== 0n) + writer.tag(3, WireType.Varint).uint64(message.outgoingAmountMsat); + /* uint32 outgoing_expiry = 4; */ + if (message.outgoingExpiry !== 0) + writer.tag(4, WireType.Varint).uint32(message.outgoingExpiry); + /* map custom_records = 8; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(8, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); + /* bytes onion_blob = 9; */ + if (message.onionBlob.length) + writer.tag(9, WireType.LengthDelimited).bytes(message.onionBlob); + /* int32 auto_fail_height = 10; */ + if (message.autoFailHeight !== 0) + writer.tag(10, WireType.Varint).int32(message.autoFailHeight); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptRequest + */ +export const ForwardHtlcInterceptRequest = new ForwardHtlcInterceptRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ForwardHtlcInterceptResponse$Type extends MessageType { + constructor() { + super("routerrpc.ForwardHtlcInterceptResponse", [ + { no: 1, name: "incoming_circuit_key", kind: "message", T: () => CircuitKey }, + { no: 2, name: "action", kind: "enum", T: () => ["routerrpc.ResolveHoldForwardAction", ResolveHoldForwardAction] }, + { no: 3, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "failure_message", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "failure_code", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] } + ]); + } + create(value?: PartialMessage): ForwardHtlcInterceptResponse { + const message = { action: 0, preimage: new Uint8Array(0), failureMessage: new Uint8Array(0), failureCode: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardHtlcInterceptResponse): ForwardHtlcInterceptResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* routerrpc.CircuitKey incoming_circuit_key */ 1: + message.incomingCircuitKey = CircuitKey.internalBinaryRead(reader, reader.uint32(), options, message.incomingCircuitKey); + break; + case /* routerrpc.ResolveHoldForwardAction action */ 2: + message.action = reader.int32(); + break; + case /* bytes preimage */ 3: + message.preimage = reader.bytes(); + break; + case /* bytes failure_message */ 4: + message.failureMessage = reader.bytes(); + break; + case /* lnrpc.Failure.FailureCode failure_code */ 5: + message.failureCode = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ForwardHtlcInterceptResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* routerrpc.CircuitKey incoming_circuit_key = 1; */ + if (message.incomingCircuitKey) + CircuitKey.internalBinaryWrite(message.incomingCircuitKey, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.ResolveHoldForwardAction action = 2; */ + if (message.action !== 0) + writer.tag(2, WireType.Varint).int32(message.action); + /* bytes preimage = 3; */ + if (message.preimage.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.preimage); + /* bytes failure_message = 4; */ + if (message.failureMessage.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.failureMessage); + /* lnrpc.Failure.FailureCode failure_code = 5; */ + if (message.failureCode !== 0) + writer.tag(5, WireType.Varint).int32(message.failureCode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptResponse + */ +export const ForwardHtlcInterceptResponse = new ForwardHtlcInterceptResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UpdateChanStatusRequest$Type extends MessageType { + constructor() { + super("routerrpc.UpdateChanStatusRequest", [ + { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint }, + { no: 2, name: "action", kind: "enum", T: () => ["routerrpc.ChanStatusAction", ChanStatusAction] } + ]); + } + create(value?: PartialMessage): UpdateChanStatusRequest { + const message = { action: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateChanStatusRequest): UpdateChanStatusRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.ChannelPoint chan_point */ 1: + message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); + break; + case /* routerrpc.ChanStatusAction action */ 2: + message.action = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: UpdateChanStatusRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.ChannelPoint chan_point = 1; */ + if (message.chanPoint) + ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.ChanStatusAction action = 2; */ + if (message.action !== 0) + writer.tag(2, WireType.Varint).int32(message.action); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.UpdateChanStatusRequest + */ +export const UpdateChanStatusRequest = new UpdateChanStatusRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UpdateChanStatusResponse$Type extends MessageType { + constructor() { + super("routerrpc.UpdateChanStatusResponse", []); + } + create(value?: PartialMessage): UpdateChanStatusResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateChanStatusResponse): UpdateChanStatusResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: UpdateChanStatusResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.UpdateChanStatusResponse + */ +export const UpdateChanStatusResponse = new UpdateChanStatusResponse$Type(); +/** + * @generated ServiceType for protobuf service routerrpc.Router + */ +export const Router = new ServiceType("routerrpc.Router", [ + { name: "SendPaymentV2", serverStreaming: true, options: {}, I: SendPaymentRequest, O: Payment }, + { name: "TrackPaymentV2", serverStreaming: true, options: {}, I: TrackPaymentRequest, O: Payment }, + { name: "TrackPayments", serverStreaming: true, options: {}, I: TrackPaymentsRequest, O: Payment }, + { name: "EstimateRouteFee", options: {}, I: RouteFeeRequest, O: RouteFeeResponse }, + { name: "SendToRoute", options: {}, I: SendToRouteRequest, O: SendToRouteResponse }, + { name: "SendToRouteV2", options: {}, I: SendToRouteRequest, O: HTLCAttempt }, + { name: "ResetMissionControl", options: {}, I: ResetMissionControlRequest, O: ResetMissionControlResponse }, + { name: "QueryMissionControl", options: {}, I: QueryMissionControlRequest, O: QueryMissionControlResponse }, + { name: "XImportMissionControl", options: {}, I: XImportMissionControlRequest, O: XImportMissionControlResponse }, + { name: "GetMissionControlConfig", options: {}, I: GetMissionControlConfigRequest, O: GetMissionControlConfigResponse }, + { name: "SetMissionControlConfig", options: {}, I: SetMissionControlConfigRequest, O: SetMissionControlConfigResponse }, + { name: "QueryProbability", options: {}, I: QueryProbabilityRequest, O: QueryProbabilityResponse }, + { name: "BuildRoute", options: {}, I: BuildRouteRequest, O: BuildRouteResponse }, + { name: "SubscribeHtlcEvents", serverStreaming: true, options: {}, I: SubscribeHtlcEventsRequest, O: HtlcEvent }, + { name: "SendPayment", serverStreaming: true, options: {}, I: SendPaymentRequest, O: PaymentStatus }, + { name: "TrackPayment", serverStreaming: true, options: {}, I: TrackPaymentRequest, O: PaymentStatus }, + { name: "HtlcInterceptor", serverStreaming: true, clientStreaming: true, options: {}, I: ForwardHtlcInterceptResponse, O: ForwardHtlcInterceptRequest }, + { name: "UpdateChanStatus", options: {}, I: UpdateChanStatusRequest, O: UpdateChanStatusResponse } +]); diff --git a/proto/others/chainnotifier.proto b/proto/others/chainnotifier.proto index 211065ed..82509114 100644 --- a/proto/others/chainnotifier.proto +++ b/proto/others/chainnotifier.proto @@ -1,200 +1,200 @@ -syntax = "proto3"; - -package chainrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc/chainrpc"; - -// ChainNotifier is a service that can be used to get information about the -// chain backend by registering notifiers for chain events. -service ChainNotifier { - /* - RegisterConfirmationsNtfn is a synchronous response-streaming RPC that - registers an intent for a client to be notified once a confirmation request - has reached its required number of confirmations on-chain. - - A confirmation request must have a valid output script. It is also possible - to give a transaction ID. If the transaction ID is not set, a notification - is sent once the output script confirms. If the transaction ID is also set, - a notification is sent once the output script confirms in the given - transaction. - */ - rpc RegisterConfirmationsNtfn (ConfRequest) returns (stream ConfEvent); - - /* - RegisterSpendNtfn is a synchronous response-streaming RPC that registers an - intent for a client to be notification once a spend request has been spent - by a transaction that has confirmed on-chain. - - A client can specify whether the spend request should be for a particular - outpoint or for an output script by specifying a zero outpoint. - */ - rpc RegisterSpendNtfn (SpendRequest) returns (stream SpendEvent); - - /* - RegisterBlockEpochNtfn is a synchronous response-streaming RPC that - registers an intent for a client to be notified of blocks in the chain. The - stream will return a hash and height tuple of a block for each new/stale - block in the chain. It is the client's responsibility to determine whether - the tuple returned is for a new or stale block in the chain. - - A client can also request a historical backlog of blocks from a particular - point. This allows clients to be idempotent by ensuring that they do not - missing processing a single block within the chain. - */ - rpc RegisterBlockEpochNtfn (BlockEpoch) returns (stream BlockEpoch); -} - -message ConfRequest { - /* - The transaction hash for which we should request a confirmation notification - for. If set to a hash of all zeros, then the confirmation notification will - be requested for the script instead. - */ - bytes txid = 1; - - /* - An output script within a transaction with the hash above which will be used - by light clients to match block filters. If the transaction hash is set to a - hash of all zeros, then a confirmation notification will be requested for - this script instead. - */ - bytes script = 2; - - /* - The number of desired confirmations the transaction/output script should - reach before dispatching a confirmation notification. - */ - uint32 num_confs = 3; - - /* - The earliest height in the chain for which the transaction/output script - could have been included in a block. This should in most cases be set to the - broadcast height of the transaction/output script. - */ - uint32 height_hint = 4; - - /* - If true, then the block that mines the specified txid/script will be - included in eventual the notification event. - */ - bool include_block = 5; -} - -message ConfDetails { - // The raw bytes of the confirmed transaction. - bytes raw_tx = 1; - - // The hash of the block in which the confirmed transaction was included in. - bytes block_hash = 2; - - // The height of the block in which the confirmed transaction was included - // in. - uint32 block_height = 3; - - // The index of the confirmed transaction within the block. - uint32 tx_index = 4; - - /* - The raw bytes of the block that mined the transaction. Only included if - include_block was set in the request. - */ - bytes raw_block = 5; -} - -message Reorg { - // TODO(wilmer): need to know how the client will use this first. -} - -message ConfEvent { - oneof event { - /* - An event that includes the confirmation details of the request - (txid/ouput script). - */ - ConfDetails conf = 1; - - /* - An event send when the transaction of the request is reorged out of the - chain. - */ - Reorg reorg = 2; - } -} - -message Outpoint { - // The hash of the transaction. - bytes hash = 1; - - // The index of the output within the transaction. - uint32 index = 2; -} - -message SpendRequest { - /* - The outpoint for which we should request a spend notification for. If set to - a zero outpoint, then the spend notification will be requested for the - script instead. A zero or nil outpoint is not supported for Taproot spends - because the output script cannot reliably be computed from the witness alone - and the spent output script is not always available in the rescan context. - So an outpoint must _always_ be specified when registering a spend - notification for a Taproot output. - */ - Outpoint outpoint = 1; - - /* - The output script for the outpoint above. This will be used by light clients - to match block filters. If the outpoint is set to a zero outpoint, then a - spend notification will be requested for this script instead. - */ - bytes script = 2; - - /* - The earliest height in the chain for which the outpoint/output script could - have been spent. This should in most cases be set to the broadcast height of - the outpoint/output script. - */ - uint32 height_hint = 3; - - // TODO(wilmer): extend to support num confs on spending tx. -} - -message SpendDetails { - // The outpoint was that spent. - Outpoint spending_outpoint = 1; - - // The raw bytes of the spending transaction. - bytes raw_spending_tx = 2; - - // The hash of the spending transaction. - bytes spending_tx_hash = 3; - - // The input of the spending transaction that fulfilled the spend request. - uint32 spending_input_index = 4; - - // The height at which the spending transaction was included in a block. - uint32 spending_height = 5; -} - -message SpendEvent { - oneof event { - /* - An event that includes the details of the spending transaction of the - request (outpoint/output script). - */ - SpendDetails spend = 1; - - /* - An event sent when the spending transaction of the request was - reorged out of the chain. - */ - Reorg reorg = 2; - } -} - -message BlockEpoch { - // The hash of the block. - bytes hash = 1; - - // The height of the block. - uint32 height = 2; +syntax = "proto3"; + +package chainrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc/chainrpc"; + +// ChainNotifier is a service that can be used to get information about the +// chain backend by registering notifiers for chain events. +service ChainNotifier { + /* + RegisterConfirmationsNtfn is a synchronous response-streaming RPC that + registers an intent for a client to be notified once a confirmation request + has reached its required number of confirmations on-chain. + + A confirmation request must have a valid output script. It is also possible + to give a transaction ID. If the transaction ID is not set, a notification + is sent once the output script confirms. If the transaction ID is also set, + a notification is sent once the output script confirms in the given + transaction. + */ + rpc RegisterConfirmationsNtfn (ConfRequest) returns (stream ConfEvent); + + /* + RegisterSpendNtfn is a synchronous response-streaming RPC that registers an + intent for a client to be notification once a spend request has been spent + by a transaction that has confirmed on-chain. + + A client can specify whether the spend request should be for a particular + outpoint or for an output script by specifying a zero outpoint. + */ + rpc RegisterSpendNtfn (SpendRequest) returns (stream SpendEvent); + + /* + RegisterBlockEpochNtfn is a synchronous response-streaming RPC that + registers an intent for a client to be notified of blocks in the chain. The + stream will return a hash and height tuple of a block for each new/stale + block in the chain. It is the client's responsibility to determine whether + the tuple returned is for a new or stale block in the chain. + + A client can also request a historical backlog of blocks from a particular + point. This allows clients to be idempotent by ensuring that they do not + missing processing a single block within the chain. + */ + rpc RegisterBlockEpochNtfn (BlockEpoch) returns (stream BlockEpoch); +} + +message ConfRequest { + /* + The transaction hash for which we should request a confirmation notification + for. If set to a hash of all zeros, then the confirmation notification will + be requested for the script instead. + */ + bytes txid = 1; + + /* + An output script within a transaction with the hash above which will be used + by light clients to match block filters. If the transaction hash is set to a + hash of all zeros, then a confirmation notification will be requested for + this script instead. + */ + bytes script = 2; + + /* + The number of desired confirmations the transaction/output script should + reach before dispatching a confirmation notification. + */ + uint32 num_confs = 3; + + /* + The earliest height in the chain for which the transaction/output script + could have been included in a block. This should in most cases be set to the + broadcast height of the transaction/output script. + */ + uint32 height_hint = 4; + + /* + If true, then the block that mines the specified txid/script will be + included in eventual the notification event. + */ + bool include_block = 5; +} + +message ConfDetails { + // The raw bytes of the confirmed transaction. + bytes raw_tx = 1; + + // The hash of the block in which the confirmed transaction was included in. + bytes block_hash = 2; + + // The height of the block in which the confirmed transaction was included + // in. + uint32 block_height = 3; + + // The index of the confirmed transaction within the block. + uint32 tx_index = 4; + + /* + The raw bytes of the block that mined the transaction. Only included if + include_block was set in the request. + */ + bytes raw_block = 5; +} + +message Reorg { + // TODO(wilmer): need to know how the client will use this first. +} + +message ConfEvent { + oneof event { + /* + An event that includes the confirmation details of the request + (txid/ouput script). + */ + ConfDetails conf = 1; + + /* + An event send when the transaction of the request is reorged out of the + chain. + */ + Reorg reorg = 2; + } +} + +message Outpoint { + // The hash of the transaction. + bytes hash = 1; + + // The index of the output within the transaction. + uint32 index = 2; +} + +message SpendRequest { + /* + The outpoint for which we should request a spend notification for. If set to + a zero outpoint, then the spend notification will be requested for the + script instead. A zero or nil outpoint is not supported for Taproot spends + because the output script cannot reliably be computed from the witness alone + and the spent output script is not always available in the rescan context. + So an outpoint must _always_ be specified when registering a spend + notification for a Taproot output. + */ + Outpoint outpoint = 1; + + /* + The output script for the outpoint above. This will be used by light clients + to match block filters. If the outpoint is set to a zero outpoint, then a + spend notification will be requested for this script instead. + */ + bytes script = 2; + + /* + The earliest height in the chain for which the outpoint/output script could + have been spent. This should in most cases be set to the broadcast height of + the outpoint/output script. + */ + uint32 height_hint = 3; + + // TODO(wilmer): extend to support num confs on spending tx. +} + +message SpendDetails { + // The outpoint was that spent. + Outpoint spending_outpoint = 1; + + // The raw bytes of the spending transaction. + bytes raw_spending_tx = 2; + + // The hash of the spending transaction. + bytes spending_tx_hash = 3; + + // The input of the spending transaction that fulfilled the spend request. + uint32 spending_input_index = 4; + + // The height at which the spending transaction was included in a block. + uint32 spending_height = 5; +} + +message SpendEvent { + oneof event { + /* + An event that includes the details of the spending transaction of the + request (outpoint/output script). + */ + SpendDetails spend = 1; + + /* + An event sent when the spending transaction of the request was + reorged out of the chain. + */ + Reorg reorg = 2; + } +} + +message BlockEpoch { + // The hash of the block. + bytes hash = 1; + + // The height of the block. + uint32 height = 2; } \ No newline at end of file diff --git a/proto/others/invoices.proto b/proto/others/invoices.proto index fde739f7..fb4f0ca6 100644 --- a/proto/others/invoices.proto +++ b/proto/others/invoices.proto @@ -1,175 +1,175 @@ -syntax = "proto3"; - -import "lightning.proto"; - -package invoicesrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"; - -// Invoices is a service that can be used to create, accept, settle and cancel -// invoices. -service Invoices { - /* - SubscribeSingleInvoice returns a uni-directional stream (server -> client) - to notify the client of state transitions of the specified invoice. - Initially the current invoice state is always sent out. - */ - rpc SubscribeSingleInvoice (SubscribeSingleInvoiceRequest) - returns (stream lnrpc.Invoice); - - /* - CancelInvoice cancels a currently open invoice. If the invoice is already - canceled, this call will succeed. If the invoice is already settled, it will - fail. - */ - rpc CancelInvoice (CancelInvoiceMsg) returns (CancelInvoiceResp); - - /* - AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - supplied in the request. - */ - rpc AddHoldInvoice (AddHoldInvoiceRequest) returns (AddHoldInvoiceResp); - - /* - SettleInvoice settles an accepted invoice. If the invoice is already - settled, this call will succeed. - */ - rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp); - - /* - LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced - using either its payment hash, payment address, or set ID. - */ - rpc LookupInvoiceV2 (LookupInvoiceMsg) returns (lnrpc.Invoice); -} - -message CancelInvoiceMsg { - // Hash corresponding to the (hold) invoice to cancel. When using - // REST, this field must be encoded as base64. - bytes payment_hash = 1; -} -message CancelInvoiceResp { -} - -message AddHoldInvoiceRequest { - /* - An optional memo to attach along with the invoice. Used for record keeping - purposes for the invoice's creator, and will also be set in the description - field of the encoded payment request if the description_hash field is not - being used. - */ - string memo = 1; - - // The hash of the preimage - bytes hash = 2; - - /* - The value of this invoice in satoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value = 3; - - /* - The value of this invoice in millisatoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value_msat = 10; - - /* - Hash (SHA-256) of a description of the payment. Used if the description of - payment (memo) is too long to naturally fit within the description field - of an encoded payment request. - */ - bytes description_hash = 4; - - // Payment request expiry time in seconds. Default is 3600 (1 hour). - int64 expiry = 5; - - // Fallback on-chain address. - string fallback_addr = 6; - - // Delta to use for the time-lock of the CLTV extended to the final hop. - uint64 cltv_expiry = 7; - - /* - Route hints that can each be individually used to assist in reaching the - invoice's destination. - */ - repeated lnrpc.RouteHint route_hints = 8; - - // Whether this invoice should include routing hints for private channels. - bool private = 9; -} - -message AddHoldInvoiceResp { - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 1; - - /* - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 2; - - /* - The payment address of the generated invoice. This value should be used - in all payments for this invoice as we require it for end to end - security. - */ - bytes payment_addr = 3; -} - -message SettleInvoiceMsg { - // Externally discovered pre-image that should be used to settle the hold - // invoice. - bytes preimage = 1; -} - -message SettleInvoiceResp { -} - -message SubscribeSingleInvoiceRequest { - reserved 1; - - // Hash corresponding to the (hold) invoice to subscribe to. When using - // REST, this field must be encoded as base64url. - bytes r_hash = 2; -} - -enum LookupModifier { - // The default look up modifier, no look up behavior is changed. - DEFAULT = 0; - - /* - Indicates that when a look up is done based on a set_id, then only that set - of HTLCs related to that set ID should be returned. - */ - HTLC_SET_ONLY = 1; - - /* - Indicates that when a look up is done using a payment_addr, then no HTLCs - related to the payment_addr should be returned. This is useful when one - wants to be able to obtain the set of associated setIDs with a given - invoice, then look up the sub-invoices "projected" by that set ID. - */ - HTLC_SET_BLANK = 2; -} - -message LookupInvoiceMsg { - oneof invoice_ref { - // When using REST, this field must be encoded as base64. - bytes payment_hash = 1; - bytes payment_addr = 2; - bytes set_id = 3; - } - - LookupModifier lookup_modifier = 4; +syntax = "proto3"; + +import "lightning.proto"; + +package invoicesrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"; + +// Invoices is a service that can be used to create, accept, settle and cancel +// invoices. +service Invoices { + /* + SubscribeSingleInvoice returns a uni-directional stream (server -> client) + to notify the client of state transitions of the specified invoice. + Initially the current invoice state is always sent out. + */ + rpc SubscribeSingleInvoice (SubscribeSingleInvoiceRequest) + returns (stream lnrpc.Invoice); + + /* + CancelInvoice cancels a currently open invoice. If the invoice is already + canceled, this call will succeed. If the invoice is already settled, it will + fail. + */ + rpc CancelInvoice (CancelInvoiceMsg) returns (CancelInvoiceResp); + + /* + AddHoldInvoice creates a hold invoice. It ties the invoice to the hash + supplied in the request. + */ + rpc AddHoldInvoice (AddHoldInvoiceRequest) returns (AddHoldInvoiceResp); + + /* + SettleInvoice settles an accepted invoice. If the invoice is already + settled, this call will succeed. + */ + rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp); + + /* + LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + using either its payment hash, payment address, or set ID. + */ + rpc LookupInvoiceV2 (LookupInvoiceMsg) returns (lnrpc.Invoice); +} + +message CancelInvoiceMsg { + // Hash corresponding to the (hold) invoice to cancel. When using + // REST, this field must be encoded as base64. + bytes payment_hash = 1; +} +message CancelInvoiceResp { +} + +message AddHoldInvoiceRequest { + /* + An optional memo to attach along with the invoice. Used for record keeping + purposes for the invoice's creator, and will also be set in the description + field of the encoded payment request if the description_hash field is not + being used. + */ + string memo = 1; + + // The hash of the preimage + bytes hash = 2; + + /* + The value of this invoice in satoshis + + The fields value and value_msat are mutually exclusive. + */ + int64 value = 3; + + /* + The value of this invoice in millisatoshis + + The fields value and value_msat are mutually exclusive. + */ + int64 value_msat = 10; + + /* + Hash (SHA-256) of a description of the payment. Used if the description of + payment (memo) is too long to naturally fit within the description field + of an encoded payment request. + */ + bytes description_hash = 4; + + // Payment request expiry time in seconds. Default is 3600 (1 hour). + int64 expiry = 5; + + // Fallback on-chain address. + string fallback_addr = 6; + + // Delta to use for the time-lock of the CLTV extended to the final hop. + uint64 cltv_expiry = 7; + + /* + Route hints that can each be individually used to assist in reaching the + invoice's destination. + */ + repeated lnrpc.RouteHint route_hints = 8; + + // Whether this invoice should include routing hints for private channels. + bool private = 9; +} + +message AddHoldInvoiceResp { + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. + */ + string payment_request = 1; + + /* + The "add" index of this invoice. Each newly created invoice will increment + this index making it monotonically increasing. Callers to the + SubscribeInvoices call can use this to instantly get notified of all added + invoices with an add_index greater than this one. + */ + uint64 add_index = 2; + + /* + The payment address of the generated invoice. This value should be used + in all payments for this invoice as we require it for end to end + security. + */ + bytes payment_addr = 3; +} + +message SettleInvoiceMsg { + // Externally discovered pre-image that should be used to settle the hold + // invoice. + bytes preimage = 1; +} + +message SettleInvoiceResp { +} + +message SubscribeSingleInvoiceRequest { + reserved 1; + + // Hash corresponding to the (hold) invoice to subscribe to. When using + // REST, this field must be encoded as base64url. + bytes r_hash = 2; +} + +enum LookupModifier { + // The default look up modifier, no look up behavior is changed. + DEFAULT = 0; + + /* + Indicates that when a look up is done based on a set_id, then only that set + of HTLCs related to that set ID should be returned. + */ + HTLC_SET_ONLY = 1; + + /* + Indicates that when a look up is done using a payment_addr, then no HTLCs + related to the payment_addr should be returned. This is useful when one + wants to be able to obtain the set of associated setIDs with a given + invoice, then look up the sub-invoices "projected" by that set ID. + */ + HTLC_SET_BLANK = 2; +} + +message LookupInvoiceMsg { + oneof invoice_ref { + // When using REST, this field must be encoded as base64. + bytes payment_hash = 1; + bytes payment_addr = 2; + bytes set_id = 3; + } + + LookupModifier lookup_modifier = 4; } \ No newline at end of file diff --git a/proto/others/lightning.proto b/proto/others/lightning.proto index 9516a69b..882706f6 100644 --- a/proto/others/lightning.proto +++ b/proto/others/lightning.proto @@ -1,4669 +1,4669 @@ -syntax = "proto3"; - -package lnrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc"; - -/* - * Comments in this file will be directly parsed into the API - * Documentation as descriptions of the associated method, message, or field. - * These descriptions should go right above the definition of the object, and - * can be in either block or // comment format. - * - * An RPC method can be matched to an lncli command by placing a line in the - * beginning of the description in exactly the following format: - * lncli: `methodname` - * - * Failure to specify the exact name of the command will cause documentation - * generation to fail. - * - * More information on how exactly the gRPC documentation is generated from - * this proto file can be found here: - * https://github.com/lightninglabs/lightning-api - */ - -// Lightning is the main RPC server of the daemon. -service Lightning { - /* lncli: `walletbalance` - WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - confirmed unspent outputs and all unconfirmed unspent outputs under control - of the wallet. - */ - rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse); - - /* lncli: `channelbalance` - ChannelBalance returns a report on the total funds across all open channels, - categorized in local/remote, pending local/remote and unsettled local/remote - balances. - */ - rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse); - - /* lncli: `listchaintxns` - GetTransactions returns a list describing all the known transactions - relevant to the wallet. - */ - rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails); - - /* lncli: `estimatefee` - EstimateFee asks the chain backend to estimate the fee rate and total fees - for a transaction that pays to multiple specified outputs. - - When using REST, the `AddrToAmount` map type can be set by appending - `&AddrToAmount[
]=` to the URL. Unfortunately this - map type doesn't appear in the REST API documentation because of a bug in - the grpc-gateway library. - */ - rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse); - - /* lncli: `sendcoins` - SendCoins executes a request to send coins to a particular address. Unlike - SendMany, this RPC call only allows creating a single output at a time. If - neither target_conf, or sat_per_vbyte are set, then the internal wallet will - consult its fee model to determine a fee for the default confirmation - target. - */ - rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse); - - /* lncli: `listunspent` - Deprecated, use walletrpc.ListUnspent instead. - - ListUnspent returns a list of all utxos spendable by the wallet with a - number of confirmations between the specified minimum and maximum. - */ - rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse); - - /* - SubscribeTransactions creates a uni-directional stream from the server to - the client in which any newly discovered transactions relevant to the - wallet are sent over. - */ - rpc SubscribeTransactions (GetTransactionsRequest) - returns (stream Transaction); - - /* lncli: `sendmany` - SendMany handles a request for a transaction that creates multiple specified - outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - the internal wallet will consult its fee model to determine a fee for the - default confirmation target. - */ - rpc SendMany (SendManyRequest) returns (SendManyResponse); - - /* lncli: `newaddress` - NewAddress creates a new address under control of the local wallet. - */ - rpc NewAddress (NewAddressRequest) returns (NewAddressResponse); - - /* lncli: `signmessage` - SignMessage signs a message with this node's private key. The returned - signature string is `zbase32` encoded and pubkey recoverable, meaning that - only the message digest and signature are needed for verification. - */ - rpc SignMessage (SignMessageRequest) returns (SignMessageResponse); - - /* lncli: `verifymessage` - VerifyMessage verifies a signature over a msg. The signature must be - zbase32 encoded and signed by an active node in the resident node's - channel database. In addition to returning the validity of the signature, - VerifyMessage also returns the recovered pubkey from the signature. - */ - rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse); - - /* lncli: `connect` - ConnectPeer attempts to establish a connection to a remote peer. This is at - the networking level, and is used for communication between nodes. This is - distinct from establishing a channel with a peer. - */ - rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse); - - /* lncli: `disconnect` - DisconnectPeer attempts to disconnect one peer from another identified by a - given pubKey. In the case that we currently have a pending or active channel - with the target peer, then this action will be not be allowed. - */ - rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse); - - /* lncli: `listpeers` - ListPeers returns a verbose listing of all currently active peers. - */ - rpc ListPeers (ListPeersRequest) returns (ListPeersResponse); - - /* - SubscribePeerEvents creates a uni-directional stream from the server to - the client in which any events relevant to the state of peers are sent - over. Events include peers going online and offline. - */ - rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent); - - /* lncli: `getinfo` - GetInfo returns general information concerning the lightning node including - it's identity pubkey, alias, the chains it is connected to, and information - concerning the number of open+pending channels. - */ - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); - - /** lncli: `getrecoveryinfo` - GetRecoveryInfo returns information concerning the recovery mode including - whether it's in a recovery mode, whether the recovery is finished, and the - progress made so far. - */ - rpc GetRecoveryInfo (GetRecoveryInfoRequest) - returns (GetRecoveryInfoResponse); - - // TODO(roasbeef): merge with below with bool? - /* lncli: `pendingchannels` - PendingChannels returns a list of all the channels that are currently - considered "pending". A channel is pending if it has finished the funding - workflow and is waiting for confirmations for the funding txn, or is in the - process of closure, either initiated cooperatively or non-cooperatively. - */ - rpc PendingChannels (PendingChannelsRequest) - returns (PendingChannelsResponse); - - /* lncli: `listchannels` - ListChannels returns a description of all the open channels that this node - is a participant in. - */ - rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse); - - /* - SubscribeChannelEvents creates a uni-directional stream from the server to - the client in which any updates relevant to the state of the channels are - sent over. Events include new active channels, inactive channels, and closed - channels. - */ - rpc SubscribeChannelEvents (ChannelEventSubscription) - returns (stream ChannelEventUpdate); - - /* lncli: `closedchannels` - ClosedChannels returns a description of all the closed channels that - this node was a participant in. - */ - rpc ClosedChannels (ClosedChannelsRequest) returns (ClosedChannelsResponse); - - /* - OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - call is meant to be consumed by clients to the REST proxy. As with all - other sync calls, all byte slices are intended to be populated as hex - encoded strings. - */ - rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint); - - /* lncli: `openchannel` - OpenChannel attempts to open a singly funded channel specified in the - request to a remote peer. Users are able to specify a target number of - blocks that the funding transaction should be confirmed in, or a manual fee - rate to us for the funding transaction. If neither are specified, then a - lax block confirmation target is used. Each OpenStatusUpdate will return - the pending channel ID of the in-progress channel. Depending on the - arguments specified in the OpenChannelRequest, this pending channel ID can - then be used to manually progress the channel funding flow. - */ - rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate); - - /* lncli: `batchopenchannel` - BatchOpenChannel attempts to open multiple single-funded channels in a - single transaction in an atomic way. This means either all channel open - requests succeed at once or all attempts are aborted if any of them fail. - This is the safer variant of using PSBTs to manually fund a batch of - channels through the OpenChannel RPC. - */ - rpc BatchOpenChannel (BatchOpenChannelRequest) - returns (BatchOpenChannelResponse); - - /* - FundingStateStep is an advanced funding related call that allows the caller - to either execute some preparatory steps for a funding workflow, or - manually progress a funding workflow. The primary way a funding flow is - identified is via its pending channel ID. As an example, this method can be - used to specify that we're expecting a funding flow for a particular - pending channel ID, for which we need to use specific parameters. - Alternatively, this can be used to interactively drive PSBT signing for - funding for partially complete funding transactions. - */ - rpc FundingStateStep (FundingTransitionMsg) returns (FundingStateStepResp); - - /* - ChannelAcceptor dispatches a bi-directional streaming RPC in which - OpenChannel requests are sent to the client and the client responds with - a boolean that tells LND whether or not to accept the channel. This allows - node operators to specify their own criteria for accepting inbound channels - through a single persistent connection. - */ - rpc ChannelAcceptor (stream ChannelAcceptResponse) - returns (stream ChannelAcceptRequest); - - /* lncli: `closechannel` - CloseChannel attempts to close an active channel identified by its channel - outpoint (ChannelPoint). The actions of this method can additionally be - augmented to attempt a force close after a timeout period in the case of an - inactive peer. If a non-force close (cooperative closure) is requested, - then the user can specify either a target number of blocks until the - closure transaction is confirmed, or a manual fee rate. If neither are - specified, then a default lax, block confirmation target is used. - */ - rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate); - - /* lncli: `abandonchannel` - AbandonChannel removes all channel state from the database except for a - close summary. This method can be used to get rid of permanently unusable - channels due to bugs fixed in newer versions of lnd. This method can also be - used to remove externally funded channels where the funding transaction was - never broadcast. Only available for non-externally funded channels in dev - build. - */ - rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse); - - /* lncli: `sendpayment` - Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - bi-directional streaming RPC for sending payments through the Lightning - Network. A single RPC invocation creates a persistent bi-directional - stream allowing clients to rapidly send payments through the Lightning - Network with a single persistent connection. - */ - rpc SendPayment (stream SendRequest) returns (stream SendResponse) { - option deprecated = true; - } - - /* - SendPaymentSync is the synchronous non-streaming version of SendPayment. - This RPC is intended to be consumed by clients of the REST proxy. - Additionally, this RPC expects the destination's public key and the payment - hash (if any) to be encoded as hex strings. - */ - rpc SendPaymentSync (SendRequest) returns (SendResponse); - - /* lncli: `sendtoroute` - Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - streaming RPC for sending payment through the Lightning Network. This - method differs from SendPayment in that it allows users to specify a full - route manually. This can be used for things like rebalancing, and atomic - swaps. - */ - rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse) { - option deprecated = true; - } - - /* - SendToRouteSync is a synchronous version of SendToRoute. It Will block - until the payment either fails or succeeds. - */ - rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse); - - /* lncli: `addinvoice` - AddInvoice attempts to add a new invoice to the invoice database. Any - duplicated invoices are rejected, therefore all invoices *must* have a - unique payment preimage. - */ - rpc AddInvoice (Invoice) returns (AddInvoiceResponse); - - /* lncli: `listinvoices` - ListInvoices returns a list of all the invoices currently stored within the - database. Any active debug invoices are ignored. It has full support for - paginated responses, allowing users to query for specific invoices through - their add_index. This can be done by using either the first_index_offset or - last_index_offset fields included in the response as the index_offset of the - next request. By default, the first 100 invoices created will be returned. - Backwards pagination is also supported through the Reversed flag. - */ - rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse); - - /* lncli: `lookupinvoice` - LookupInvoice attempts to look up an invoice according to its payment hash. - The passed payment hash *must* be exactly 32 bytes, if not, an error is - returned. - */ - rpc LookupInvoice (PaymentHash) returns (Invoice); - - /* - SubscribeInvoices returns a uni-directional stream (server -> client) for - notifying the client of newly added/settled invoices. The caller can - optionally specify the add_index and/or the settle_index. If the add_index - is specified, then we'll first start by sending add invoice events for all - invoices with an add_index greater than the specified value. If the - settle_index is specified, the next, we'll send out all settle events for - invoices with a settle_index greater than the specified value. One or both - of these fields can be set. If no fields are set, then we'll only send out - the latest add/settle events. - */ - rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice); - - /* lncli: `decodepayreq` - DecodePayReq takes an encoded payment request string and attempts to decode - it, returning a full description of the conditions encoded within the - payment request. - */ - rpc DecodePayReq (PayReqString) returns (PayReq); - - /* lncli: `listpayments` - ListPayments returns a list of all outgoing payments. - */ - rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse); - - /* - DeletePayment deletes an outgoing payment from DB. Note that it will not - attempt to delete an In-Flight payment, since that would be unsafe. - */ - rpc DeletePayment (DeletePaymentRequest) returns (DeletePaymentResponse); - - /* - DeleteAllPayments deletes all outgoing payments from DB. Note that it will - not attempt to delete In-Flight payments, since that would be unsafe. - */ - rpc DeleteAllPayments (DeleteAllPaymentsRequest) - returns (DeleteAllPaymentsResponse); - - /* lncli: `describegraph` - DescribeGraph returns a description of the latest graph state from the - point of view of the node. The graph information is partitioned into two - components: all the nodes/vertexes, and all the edges that connect the - vertexes themselves. As this is a directed graph, the edges also contain - the node directional specific routing policy which includes: the time lock - delta, fee information, etc. - */ - rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph); - - /* lncli: `getnodemetrics` - GetNodeMetrics returns node metrics calculated from the graph. Currently - the only supported metric is betweenness centrality of individual nodes. - */ - rpc GetNodeMetrics (NodeMetricsRequest) returns (NodeMetricsResponse); - - /* lncli: `getchaninfo` - GetChanInfo returns the latest authenticated network announcement for the - given channel identified by its channel ID: an 8-byte integer which - uniquely identifies the location of transaction's funding output within the - blockchain. - */ - rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge); - - /* lncli: `getnodeinfo` - GetNodeInfo returns the latest advertised, aggregated, and authenticated - channel information for the specified node identified by its public key. - */ - rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo); - - /* lncli: `queryroutes` - QueryRoutes attempts to query the daemon's Channel Router for a possible - route to a target destination capable of carrying a specific amount of - satoshis. The returned route contains the full details required to craft and - send an HTLC, also including the necessary information that should be - present within the Sphinx packet encapsulated within the HTLC. - - When using REST, the `dest_custom_records` map type can be set by appending - `&dest_custom_records[]=` - to the URL. Unfortunately this map type doesn't appear in the REST API - documentation because of a bug in the grpc-gateway library. - */ - rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse); - - /* lncli: `getnetworkinfo` - GetNetworkInfo returns some basic stats about the known channel graph from - the point of view of the node. - */ - rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo); - - /* lncli: `stop` - StopDaemon will send a shutdown request to the interrupt handler, triggering - a graceful shutdown of the daemon. - */ - rpc StopDaemon (StopRequest) returns (StopResponse); - - /* - SubscribeChannelGraph launches a streaming RPC that allows the caller to - receive notifications upon any changes to the channel graph topology from - the point of view of the responding node. Events notified include: new - nodes coming online, nodes updating their authenticated attributes, new - channels being advertised, updates in the routing policy for a directional - channel edge, and when channels are closed on-chain. - */ - rpc SubscribeChannelGraph (GraphTopologySubscription) - returns (stream GraphTopologyUpdate); - - /* lncli: `debuglevel` - DebugLevel allows a caller to programmatically set the logging verbosity of - lnd. The logging can be targeted according to a coarse daemon-wide logging - level, or in a granular fashion to specify the logging for a target - sub-system. - */ - rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse); - - /* lncli: `feereport` - FeeReport allows the caller to obtain a report detailing the current fee - schedule enforced by the node globally for each channel. - */ - rpc FeeReport (FeeReportRequest) returns (FeeReportResponse); - - /* lncli: `updatechanpolicy` - UpdateChannelPolicy allows the caller to update the fee schedule and - channel policies for all channels globally, or a particular channel. - */ - rpc UpdateChannelPolicy (PolicyUpdateRequest) - returns (PolicyUpdateResponse); - - /* lncli: `fwdinghistory` - ForwardingHistory allows the caller to query the htlcswitch for a record of - all HTLCs forwarded within the target time range, and integer offset - within that time range, for a maximum number of events. If no maximum number - of events is specified, up to 100 events will be returned. If no time-range - is specified, then events will be returned in the order that they occured. - - A list of forwarding events are returned. The size of each forwarding event - is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - As a result each message can only contain 50k entries. Each response has - the index offset of the last entry. The index offset can be provided to the - request to allow the caller to skip a series of records. - */ - rpc ForwardingHistory (ForwardingHistoryRequest) - returns (ForwardingHistoryResponse); - - /* lncli: `exportchanbackup` - ExportChannelBackup attempts to return an encrypted static channel backup - for the target channel identified by it channel point. The backup is - encrypted with a key generated from the aezeed seed of the user. The - returned backup can either be restored using the RestoreChannelBackup - method once lnd is running, or via the InitWallet and UnlockWallet methods - from the WalletUnlocker service. - */ - rpc ExportChannelBackup (ExportChannelBackupRequest) - returns (ChannelBackup); - - /* - ExportAllChannelBackups returns static channel backups for all existing - channels known to lnd. A set of regular singular static channel backups for - each channel are returned. Additionally, a multi-channel backup is returned - as well, which contains a single encrypted blob containing the backups of - each channel. - */ - rpc ExportAllChannelBackups (ChanBackupExportRequest) - returns (ChanBackupSnapshot); - - /* - VerifyChanBackup allows a caller to verify the integrity of a channel backup - snapshot. This method will accept either a packed Single or a packed Multi. - Specifying both will result in an error. - */ - rpc VerifyChanBackup (ChanBackupSnapshot) - returns (VerifyChanBackupResponse); - - /* lncli: `restorechanbackup` - RestoreChannelBackups accepts a set of singular channel backups, or a - single encrypted multi-chan backup and attempts to recover any funds - remaining within the channel. If we are able to unpack the backup, then the - new channel will be shown under listchannels, as well as pending channels. - */ - rpc RestoreChannelBackups (RestoreChanBackupRequest) - returns (RestoreBackupResponse); - - /* - SubscribeChannelBackups allows a client to sub-subscribe to the most up to - date information concerning the state of all channel backups. Each time a - new channel is added, we return the new set of channels, along with a - multi-chan backup containing the backup info for all channels. Each time a - channel is closed, we send a new update, which contains new new chan back - ups, but the updated set of encrypted multi-chan backups with the closed - channel(s) removed. - */ - rpc SubscribeChannelBackups (ChannelBackupSubscription) - returns (stream ChanBackupSnapshot); - - /* lncli: `bakemacaroon` - BakeMacaroon allows the creation of a new macaroon with custom read and - write permissions. No first-party caveats are added since this can be done - offline. - */ - rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse); - - /* lncli: `listmacaroonids` - ListMacaroonIDs returns all root key IDs that are in use. - */ - rpc ListMacaroonIDs (ListMacaroonIDsRequest) - returns (ListMacaroonIDsResponse); - - /* lncli: `deletemacaroonid` - DeleteMacaroonID deletes the specified macaroon ID and invalidates all - macaroons derived from that ID. - */ - rpc DeleteMacaroonID (DeleteMacaroonIDRequest) - returns (DeleteMacaroonIDResponse); - - /* lncli: `listpermissions` - ListPermissions lists all RPC method URIs and their required macaroon - permissions to access them. - */ - rpc ListPermissions (ListPermissionsRequest) - returns (ListPermissionsResponse); - - /* - CheckMacaroonPermissions checks whether a request follows the constraints - imposed on the macaroon and that the macaroon is authorized to follow the - provided permissions. - */ - rpc CheckMacaroonPermissions (CheckMacPermRequest) - returns (CheckMacPermResponse); - - /* - RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A - gRPC middleware is software component external to lnd that aims to add - additional business logic to lnd by observing/intercepting/validating - incoming gRPC client requests and (if needed) replacing/overwriting outgoing - messages before they're sent to the client. When registering the middleware - must identify itself and indicate what custom macaroon caveats it wants to - be responsible for. Only requests that contain a macaroon with that specific - custom caveat are then sent to the middleware for inspection. The other - option is to register for the read-only mode in which all requests/responses - are forwarded for interception to the middleware but the middleware is not - allowed to modify any responses. As a security measure, _no_ middleware can - modify responses for requests made with _unencumbered_ macaroons! - */ - rpc RegisterRPCMiddleware (stream RPCMiddlewareResponse) - returns (stream RPCMiddlewareRequest); - - /* lncli: `sendcustom` - SendCustomMessage sends a custom peer message. - */ - rpc SendCustomMessage (SendCustomMessageRequest) - returns (SendCustomMessageResponse); - - /* lncli: `subscribecustom` - SubscribeCustomMessages subscribes to a stream of incoming custom peer - messages. - */ - rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest) - returns (stream CustomMessage); - - /* lncli: `listaliases` - ListAliases returns the set of all aliases that have ever existed with - their confirmed SCID (if it exists) and/or the base SCID (in the case of - zero conf). - */ - rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse); - - rpc LookupHtlc (LookupHtlcRequest) returns (LookupHtlcResponse); -} - -message LookupHtlcRequest { - uint64 chan_id = 1; - - uint64 htlc_index = 2; -} - -message LookupHtlcResponse { - bool settled = 1; - - bool offchain = 2; -} - -message SubscribeCustomMessagesRequest { -} - -message CustomMessage { - // Peer from which the message originates - bytes peer = 1; - - // Message type. This value will be in the custom range (>= 32768). - uint32 type = 2; - - // Raw message data - bytes data = 3; -} - -message SendCustomMessageRequest { - // Peer to send the message to - bytes peer = 1; - - // Message type. This value needs to be in the custom range (>= 32768). - uint32 type = 2; - - // Raw message data. - bytes data = 3; -} - -message SendCustomMessageResponse { -} - -message Utxo { - // The type of address - AddressType address_type = 1; - - // The address - string address = 2; - - // The value of the unspent coin in satoshis - int64 amount_sat = 3; - - // The pkscript in hex - string pk_script = 4; - - // The outpoint in format txid:n - OutPoint outpoint = 5; - - // The number of confirmations for the Utxo - int64 confirmations = 6; -} - -enum OutputScriptType { - SCRIPT_TYPE_PUBKEY_HASH = 0; - SCRIPT_TYPE_SCRIPT_HASH = 1; - SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; - SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; - SCRIPT_TYPE_PUBKEY = 4; - SCRIPT_TYPE_MULTISIG = 5; - SCRIPT_TYPE_NULLDATA = 6; - SCRIPT_TYPE_NON_STANDARD = 7; - SCRIPT_TYPE_WITNESS_UNKNOWN = 8; - SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9; -} - -message OutputDetail { - // The type of the output - OutputScriptType output_type = 1; - - // The address - string address = 2; - - // The pkscript in hex - string pk_script = 3; - - // The output index used in the raw transaction - int64 output_index = 4; - - // The value of the output coin in satoshis - int64 amount = 5; - - // Denotes if the output is controlled by the internal wallet - bool is_our_address = 6; -} - -message Transaction { - // The transaction hash - string tx_hash = 1; - - // The transaction amount, denominated in satoshis - int64 amount = 2; - - // The number of confirmations - int32 num_confirmations = 3; - - // The hash of the block this transaction was included in - string block_hash = 4; - - // The height of the block this transaction was included in - int32 block_height = 5; - - // Timestamp of this transaction - int64 time_stamp = 6; - - // Fees paid for this transaction - int64 total_fees = 7; - - // Addresses that received funds for this transaction. Deprecated as it is - // now incorporated in the output_details field. - repeated string dest_addresses = 8 [deprecated = true]; - - // Outputs that received funds for this transaction - repeated OutputDetail output_details = 11; - - // The raw transaction hex. - string raw_tx_hex = 9; - - // A label that was optionally set on transaction broadcast. - string label = 10; - - // PreviousOutpoints/Inputs of this transaction. - repeated PreviousOutPoint previous_outpoints = 12; -} - -message GetTransactionsRequest { - /* - The height from which to list transactions, inclusive. If this value is - greater than end_height, transactions will be read in reverse. - */ - int32 start_height = 1; - - /* - The height until which to list transactions, inclusive. To include - unconfirmed transactions, this value should be set to -1, which will - return transactions from start_height until the current chain tip and - unconfirmed transactions. If no end_height is provided, the call will - default to this option. - */ - int32 end_height = 2; - - // An optional filter to only include transactions relevant to an account. - string account = 3; -} - -message TransactionDetails { - // The list of transactions relevant to the wallet. - repeated Transaction transactions = 1; -} - -message FeeLimit { - oneof limit { - /* - The fee limit expressed as a fixed amount of satoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed = 1; - - /* - The fee limit expressed as a fixed amount of millisatoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed_msat = 3; - - // The fee limit expressed as a percentage of the payment amount. - int64 percent = 2; - } -} - -message SendRequest { - /* - The identity pubkey of the payment recipient. When using REST, this field - must be encoded as base64. - */ - bytes dest = 1; - - /* - The hex-encoded identity pubkey of the payment recipient. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string dest_string = 2 [deprecated = true]; - - /* - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 3; - - /* - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - /* - The hash to use within the payment's HTLC. When using REST, this field - must be encoded as base64. - */ - bytes payment_hash = 4; - - /* - The hex-encoded hash to use within the payment's HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 5 [deprecated = true]; - - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 6; - - /* - The CLTV delta from the current height that should be used to set the - timelock for the final hop. - */ - int32 final_cltv_delta = 7; - - /* - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. If not specified, lnd will use a default value of 100% - fees for small amounts (<=1k sat) or 5% fees for larger amounts. - */ - FeeLimit fee_limit = 8; - - /* - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; - - /* - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 13; - - /* - An optional maximum total time lock for the route. This should not exceed - lnd's `--max-cltv-expiry` setting. If zero, then the value of - `--max-cltv-expiry` is enforced. - */ - uint32 cltv_limit = 10; - - /* - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. Record types are - required to be in the custom range >= 65536. When using REST, the values - must be encoded as base64. - */ - map dest_custom_records = 11; - - // If set, circular payments to self are permitted. - bool allow_self_payment = 14; - - /* - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated FeatureBit dest_features = 15; - - /* - The payment address of the generated invoice. - */ - bytes payment_addr = 16; -} - -message SendResponse { - string payment_error = 1; - bytes payment_preimage = 2; - Route payment_route = 3; - bytes payment_hash = 4; -} - -message SendToRouteRequest { - /* - The payment hash to use for the HTLC. When using REST, this field must be - encoded as base64. - */ - bytes payment_hash = 1; - - /* - An optional hex-encoded payment hash to be used for the HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 2 [deprecated = true]; - - reserved 3; - - // Route that should be used to attempt to complete the payment. - Route route = 4; -} - -message ChannelAcceptRequest { - // The pubkey of the node that wishes to open an inbound channel. - bytes node_pubkey = 1; - - // The hash of the genesis block that the proposed channel resides in. - bytes chain_hash = 2; - - // The pending channel id. - bytes pending_chan_id = 3; - - // The funding amount in satoshis that initiator wishes to use in the - // channel. - uint64 funding_amt = 4; - - // The push amount of the proposed channel in millisatoshis. - uint64 push_amt = 5; - - // The dust limit of the initiator's commitment tx. - uint64 dust_limit = 6; - - // The maximum amount of coins in millisatoshis that can be pending in this - // channel. - uint64 max_value_in_flight = 7; - - // The minimum amount of satoshis the initiator requires us to have at all - // times. - uint64 channel_reserve = 8; - - // The smallest HTLC in millisatoshis that the initiator will accept. - uint64 min_htlc = 9; - - // The initial fee rate that the initiator suggests for both commitment - // transactions. - uint64 fee_per_kw = 10; - - /* - The number of blocks to use for the relative time lock in the pay-to-self - output of both commitment transactions. - */ - uint32 csv_delay = 11; - - // The total number of incoming HTLC's that the initiator will accept. - uint32 max_accepted_htlcs = 12; - - // A bit-field which the initiator uses to specify proposed channel - // behavior. - uint32 channel_flags = 13; - - // The commitment type the initiator wishes to use for the proposed channel. - CommitmentType commitment_type = 14; - - // Whether the initiator wants to open a zero-conf channel via the channel - // type. - bool wants_zero_conf = 15; - - // Whether the initiator wants to use the scid-alias channel type. This is - // separate from the feature bit. - bool wants_scid_alias = 16; -} - -message ChannelAcceptResponse { - // Whether or not the client accepts the channel. - bool accept = 1; - - // The pending channel id to which this response applies. - bytes pending_chan_id = 2; - - /* - An optional error to send the initiating party to indicate why the channel - was rejected. This field *should not* contain sensitive information, it will - be sent to the initiating party. This field should only be set if accept is - false, the channel will be rejected if an error is set with accept=true - because the meaning of this response is ambiguous. Limited to 500 - characters. - */ - string error = 3; - - /* - The upfront shutdown address to use if the initiating peer supports option - upfront shutdown script (see ListPeers for the features supported). Note - that the channel open will fail if this value is set for a peer that does - not support this feature bit. - */ - string upfront_shutdown = 4; - - /* - The csv delay (in blocks) that we require for the remote party. - */ - uint32 csv_delay = 5; - - /* - The reserve amount in satoshis that we require the remote peer to adhere to. - We require that the remote peer always have some reserve amount allocated to - them so that there is always a disincentive to broadcast old state (if they - hold 0 sats on their side of the channel, there is nothing to lose). - */ - uint64 reserve_sat = 6; - - /* - The maximum amount of funds in millisatoshis that we allow the remote peer - to have in outstanding htlcs. - */ - uint64 in_flight_max_msat = 7; - - /* - The maximum number of htlcs that the remote peer can offer us. - */ - uint32 max_htlc_count = 8; - - /* - The minimum value in millisatoshis for incoming htlcs on the channel. - */ - uint64 min_htlc_in = 9; - - /* - The number of confirmations we require before we consider the channel open. - */ - uint32 min_accept_depth = 10; - - /* - Whether the responder wants this to be a zero-conf channel. This will fail - if either side does not have the scid-alias feature bit set. The minimum - depth field must be zero if this is true. - */ - bool zero_conf = 11; -} - -message ChannelPoint { - oneof funding_txid { - /* - Txid of the funding transaction. When using REST, this field must be - encoded as base64. - */ - bytes funding_txid_bytes = 1; - - /* - Hex-encoded string representing the byte-reversed hash of the funding - transaction. - */ - string funding_txid_str = 2; - } - - // The index of the output of the funding transaction - uint32 output_index = 3; -} - -message OutPoint { - // Raw bytes representing the transaction id. - bytes txid_bytes = 1; - - // Reversed, hex-encoded string representing the transaction id. - string txid_str = 2; - - // The index of the output on the transaction. - uint32 output_index = 3; -} - -message PreviousOutPoint { - // The outpoint in format txid:n. - string outpoint = 1; - - // Denotes if the outpoint is controlled by the internal wallet. - // The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. - bool is_our_output = 2; -} - -message LightningAddress { - // The identity pubkey of the Lightning node. - string pubkey = 1; - - // The network location of the lightning node, e.g. `69.69.69.69:1337` or - // `localhost:10011`. - string host = 2; -} - -message EstimateFeeRequest { - // The map from addresses to amounts for the transaction. - map AddrToAmount = 1; - - // The target number of blocks that this transaction should be confirmed - // by. - int32 target_conf = 2; - - // The minimum number of confirmations each one of your outputs used for - // the transaction must satisfy. - int32 min_confs = 3; - - // Whether unconfirmed outputs should be used as inputs for the transaction. - bool spend_unconfirmed = 4; -} - -message EstimateFeeResponse { - // The total fee in satoshis. - int64 fee_sat = 1; - - // Deprecated, use sat_per_vbyte. - // The fee rate in satoshi/vbyte. - int64 feerate_sat_per_byte = 2 [deprecated = true]; - - // The fee rate in satoshi/vbyte. - uint64 sat_per_vbyte = 3; -} - -message SendManyRequest { - // The map from addresses to amounts - map AddrToAmount = 1; - - // The target number of blocks that this transaction should be confirmed - // by. - int32 target_conf = 3; - - // A manual fee rate set in sat/vbyte that should be used when crafting the - // transaction. - uint64 sat_per_vbyte = 4; - - // Deprecated, use sat_per_vbyte. - // A manual fee rate set in sat/vbyte that should be used when crafting the - // transaction. - int64 sat_per_byte = 5 [deprecated = true]; - - // An optional label for the transaction, limited to 500 characters. - string label = 6; - - // The minimum number of confirmations each one of your outputs used for - // the transaction must satisfy. - int32 min_confs = 7; - - // Whether unconfirmed outputs should be used as inputs for the transaction. - bool spend_unconfirmed = 8; -} -message SendManyResponse { - // The id of the transaction - string txid = 1; -} - -message SendCoinsRequest { - // The address to send coins to - string addr = 1; - - // The amount in satoshis to send - int64 amount = 2; - - // The target number of blocks that this transaction should be confirmed - // by. - int32 target_conf = 3; - - // A manual fee rate set in sat/vbyte that should be used when crafting the - // transaction. - uint64 sat_per_vbyte = 4; - - // Deprecated, use sat_per_vbyte. - // A manual fee rate set in sat/vbyte that should be used when crafting the - // transaction. - int64 sat_per_byte = 5 [deprecated = true]; - - /* - If set, then the amount field will be ignored, and lnd will attempt to - send all the coins under control of the internal wallet to the specified - address. - */ - bool send_all = 6; - - // An optional label for the transaction, limited to 500 characters. - string label = 7; - - // The minimum number of confirmations each one of your outputs used for - // the transaction must satisfy. - int32 min_confs = 8; - - // Whether unconfirmed outputs should be used as inputs for the transaction. - bool spend_unconfirmed = 9; -} -message SendCoinsResponse { - // The transaction ID of the transaction - string txid = 1; -} - -message ListUnspentRequest { - // The minimum number of confirmations to be included. - int32 min_confs = 1; - - // The maximum number of confirmations to be included. - int32 max_confs = 2; - - // An optional filter to only include outputs belonging to an account. - string account = 3; -} -message ListUnspentResponse { - // A list of utxos - repeated Utxo utxos = 1; -} - -/* -`AddressType` has to be one of: - -- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) -- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) -- `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) -*/ -enum AddressType { - WITNESS_PUBKEY_HASH = 0; - NESTED_PUBKEY_HASH = 1; - UNUSED_WITNESS_PUBKEY_HASH = 2; - UNUSED_NESTED_PUBKEY_HASH = 3; - TAPROOT_PUBKEY = 4; - UNUSED_TAPROOT_PUBKEY = 5; -} - -message NewAddressRequest { - // The type of address to generate. - AddressType type = 1; - - /* - The name of the account to generate a new address for. If empty, the - default wallet account is used. - */ - string account = 2; -} -message NewAddressResponse { - // The newly generated wallet address - string address = 1; -} - -message SignMessageRequest { - /* - The message to be signed. When using REST, this field must be encoded as - base64. - */ - bytes msg = 1; - - /* - Instead of the default double-SHA256 hashing of the message before signing, - only use one round of hashing instead. - */ - bool single_hash = 2; -} -message SignMessageResponse { - // The signature for the given message - string signature = 1; -} - -message VerifyMessageRequest { - /* - The message over which the signature is to be verified. When using REST, - this field must be encoded as base64. - */ - bytes msg = 1; - - // The signature to be verified over the given message - string signature = 2; -} -message VerifyMessageResponse { - // Whether the signature was valid over the given message - bool valid = 1; - - // The pubkey recovered from the signature - string pubkey = 2; -} - -message ConnectPeerRequest { - /* - Lightning address of the peer to connect to. - */ - LightningAddress addr = 1; - - /* - If set, the daemon will attempt to persistently connect to the target - peer. Otherwise, the call will be synchronous. - */ - bool perm = 2; - - /* - The connection timeout value (in seconds) for this request. It won't affect - other requests. - */ - uint64 timeout = 3; -} -message ConnectPeerResponse { -} - -message DisconnectPeerRequest { - // The pubkey of the node to disconnect from - string pub_key = 1; -} -message DisconnectPeerResponse { -} - -message HTLC { - bool incoming = 1; - int64 amount = 2; - bytes hash_lock = 3; - uint32 expiration_height = 4; - - // Index identifying the htlc on the channel. - uint64 htlc_index = 5; - - // If this HTLC is involved in a forwarding operation, this field indicates - // the forwarding channel. For an outgoing htlc, it is the incoming channel. - // For an incoming htlc, it is the outgoing channel. When the htlc - // originates from this node or this node is the final destination, - // forwarding_channel will be zero. The forwarding channel will also be zero - // for htlcs that need to be forwarded but don't have a forwarding decision - // persisted yet. - uint64 forwarding_channel = 6; - - // Index identifying the htlc on the forwarding channel. - uint64 forwarding_htlc_index = 7; -} - -enum CommitmentType { - /* - Returned when the commitment type isn't known or unavailable. - */ - UNKNOWN_COMMITMENT_TYPE = 0; - - /* - A channel using the legacy commitment format having tweaked to_remote - keys. - */ - LEGACY = 1; - - /* - A channel that uses the modern commitment format where the key in the - output of the remote party does not change each state. This makes back - up and recovery easier as when the channel is closed, the funds go - directly to that key. - */ - STATIC_REMOTE_KEY = 2; - - /* - A channel that uses a commitment format that has anchor outputs on the - commitments, allowing fee bumping after a force close transaction has - been broadcast. - */ - ANCHORS = 3; - - /* - A channel that uses a commitment type that builds upon the anchors - commitment format, but in addition requires a CLTV clause to spend outputs - paying to the channel initiator. This is intended for use on leased channels - to guarantee that the channel initiator has no incentives to close a leased - channel before its maturity date. - */ - SCRIPT_ENFORCED_LEASE = 4; -} - -message ChannelConstraints { - /* - The CSV delay expressed in relative blocks. If the channel is force closed, - we will need to wait for this many blocks before we can regain our funds. - */ - uint32 csv_delay = 1; - - // The minimum satoshis this node is required to reserve in its balance. - uint64 chan_reserve_sat = 2; - - // The dust limit (in satoshis) of the initiator's commitment tx. - uint64 dust_limit_sat = 3; - - // The maximum amount of coins in millisatoshis that can be pending in this - // channel. - uint64 max_pending_amt_msat = 4; - - // The smallest HTLC in millisatoshis that the initiator will accept. - uint64 min_htlc_msat = 5; - - // The total number of incoming HTLC's that the initiator will accept. - uint32 max_accepted_htlcs = 6; -} - -message Channel { - // Whether this channel is active or not - bool active = 1; - - // The identity pubkey of the remote node - string remote_pubkey = 2; - - /* - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - string channel_point = 3; - - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 4 [jstype = JS_STRING]; - - // The total amount of funds held in this channel - int64 capacity = 5; - - // This node's current balance in this channel - int64 local_balance = 6; - - // The counterparty's current balance in this channel - int64 remote_balance = 7; - - /* - The amount calculated to be paid in fees for the current set of commitment - transactions. The fee amount is persisted with the channel in order to - allow the fee amount to be removed and recalculated with each channel state - update, including updates that happen after a system restart. - */ - int64 commit_fee = 8; - - // The weight of the commitment transaction - int64 commit_weight = 9; - - /* - The required number of satoshis per kilo-weight that the requester will pay - at all times, for both the funding transaction and commitment transaction. - This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 10; - - // The unsettled balance in this channel - int64 unsettled_balance = 11; - - /* - The total number of satoshis we've sent within this channel. - */ - int64 total_satoshis_sent = 12; - - /* - The total number of satoshis we've received within this channel. - */ - int64 total_satoshis_received = 13; - - /* - The total number of updates conducted within this channel. - */ - uint64 num_updates = 14; - - /* - The list of active, uncleared HTLCs currently pending within the channel. - */ - repeated HTLC pending_htlcs = 15; - - /* - Deprecated. The CSV delay expressed in relative blocks. If the channel is - force closed, we will need to wait for this many blocks before we can regain - our funds. - */ - uint32 csv_delay = 16 [deprecated = true]; - - // Whether this channel is advertised to the network or not. - bool private = 17; - - // True if we were the ones that created the channel. - bool initiator = 18; - - // A set of flags showing the current state of the channel. - string chan_status_flags = 19; - - // Deprecated. The minimum satoshis this node is required to reserve in its - // balance. - int64 local_chan_reserve_sat = 20 [deprecated = true]; - - /* - Deprecated. The minimum satoshis the other node is required to reserve in - its balance. - */ - int64 remote_chan_reserve_sat = 21 [deprecated = true]; - - // Deprecated. Use commitment_type. - bool static_remote_key = 22 [deprecated = true]; - - // The commitment type used by this channel. - CommitmentType commitment_type = 26; - - /* - The number of seconds that the channel has been monitored by the channel - scoring system. Scores are currently not persisted, so this value may be - less than the lifetime of the channel [EXPERIMENTAL]. - */ - int64 lifetime = 23; - - /* - The number of seconds that the remote peer has been observed as being online - by the channel scoring system over the lifetime of the channel - [EXPERIMENTAL]. - */ - int64 uptime = 24; - - /* - Close address is the address that we will enforce payout to on cooperative - close if the channel was opened utilizing option upfront shutdown. This - value can be set on channel open by setting close_address in an open channel - request. If this value is not set, you can still choose a payout address by - cooperatively closing with the delivery_address field set. - */ - string close_address = 25; - - /* - The amount that the initiator of the channel optionally pushed to the remote - party on channel open. This amount will be zero if the channel initiator did - not push any funds to the remote peer. If the initiator field is true, we - pushed this amount to our peer, if it is false, the remote peer pushed this - amount to us. - */ - uint64 push_amount_sat = 27; - - /* - This uint32 indicates if this channel is to be considered 'frozen'. A - frozen channel doest not allow a cooperative channel close by the - initiator. The thaw_height is the height that this restriction stops - applying to the channel. This field is optional, not setting it or using a - value of zero will mean the channel has no additional restrictions. The - height can be interpreted in two ways: as a relative height if the value is - less than 500,000, or as an absolute height otherwise. - */ - uint32 thaw_height = 28; - - // List constraints for the local node. - ChannelConstraints local_constraints = 29; - - // List constraints for the remote node. - ChannelConstraints remote_constraints = 30; - - /* - This lists out the set of alias short channel ids that exist for a channel. - This may be empty. - */ - repeated uint64 alias_scids = 31; - - // Whether or not this is a zero-conf channel. - bool zero_conf = 32; - - // This is the confirmed / on-chain zero-conf SCID. - uint64 zero_conf_confirmed_scid = 33; -} - -message ListChannelsRequest { - bool active_only = 1; - bool inactive_only = 2; - bool public_only = 3; - bool private_only = 4; - - /* - Filters the response for channels with a target peer's pubkey. If peer is - empty, all channels will be returned. - */ - bytes peer = 5; -} -message ListChannelsResponse { - // The list of active channels - repeated Channel channels = 11; -} - -message AliasMap { - /* - For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is - the first assigned "base" alias. - */ - uint64 base_scid = 1; - - // The set of all aliases stored for the base SCID. - repeated uint64 aliases = 2; -} -message ListAliasesRequest { -} -message ListAliasesResponse { - repeated AliasMap alias_maps = 1; -} - -enum Initiator { - INITIATOR_UNKNOWN = 0; - INITIATOR_LOCAL = 1; - INITIATOR_REMOTE = 2; - INITIATOR_BOTH = 3; -} - -message ChannelCloseSummary { - // The outpoint (txid:index) of the funding transaction. - string channel_point = 1; - - // The unique channel ID for the channel. - uint64 chan_id = 2 [jstype = JS_STRING]; - - // The hash of the genesis block that this channel resides within. - string chain_hash = 3; - - // The txid of the transaction which ultimately closed this channel. - string closing_tx_hash = 4; - - // Public key of the remote peer that we formerly had a channel with. - string remote_pubkey = 5; - - // Total capacity of the channel. - int64 capacity = 6; - - // Height at which the funding transaction was spent. - uint32 close_height = 7; - - // Settled balance at the time of channel closure - int64 settled_balance = 8; - - // The sum of all the time-locked outputs at the time of channel closure - int64 time_locked_balance = 9; - - enum ClosureType { - COOPERATIVE_CLOSE = 0; - LOCAL_FORCE_CLOSE = 1; - REMOTE_FORCE_CLOSE = 2; - BREACH_CLOSE = 3; - FUNDING_CANCELED = 4; - ABANDONED = 5; - } - - // Details on how the channel was closed. - ClosureType close_type = 10; - - /* - Open initiator is the party that initiated opening the channel. Note that - this value may be unknown if the channel was closed before we migrated to - store open channel information after close. - */ - Initiator open_initiator = 11; - - /* - Close initiator indicates which party initiated the close. This value will - be unknown for channels that were cooperatively closed before we started - tracking cooperative close initiators. Note that this indicates which party - initiated a close, and it is possible for both to initiate cooperative or - force closes, although only one party's close will be confirmed on chain. - */ - Initiator close_initiator = 12; - - repeated Resolution resolutions = 13; - - /* - This lists out the set of alias short channel ids that existed for the - closed channel. This may be empty. - */ - repeated uint64 alias_scids = 14; - - // The confirmed SCID for a zero-conf channel. - uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; -} - -enum ResolutionType { - TYPE_UNKNOWN = 0; - - // We resolved an anchor output. - ANCHOR = 1; - - /* - We are resolving an incoming htlc on chain. This if this htlc is - claimed, we swept the incoming htlc with the preimage. If it is timed - out, our peer swept the timeout path. - */ - INCOMING_HTLC = 2; - - /* - We are resolving an outgoing htlc on chain. If this htlc is claimed, - the remote party swept the htlc with the preimage. If it is timed out, - we swept it with the timeout path. - */ - OUTGOING_HTLC = 3; - - // We force closed and need to sweep our time locked commitment output. - COMMIT = 4; -} - -enum ResolutionOutcome { - // Outcome unknown. - OUTCOME_UNKNOWN = 0; - - // An output was claimed on chain. - CLAIMED = 1; - - // An output was left unclaimed on chain. - UNCLAIMED = 2; - - /* - ResolverOutcomeAbandoned indicates that an output that we did not - claim on chain, for example an anchor that we did not sweep and a - third party claimed on chain, or a htlc that we could not decode - so left unclaimed. - */ - ABANDONED = 3; - - /* - If we force closed our channel, our htlcs need to be claimed in two - stages. This outcome represents the broadcast of a timeout or success - transaction for this two stage htlc claim. - */ - FIRST_STAGE = 4; - - // A htlc was timed out on chain. - TIMEOUT = 5; -} - -message Resolution { - // The type of output we are resolving. - ResolutionType resolution_type = 1; - - // The outcome of our on chain action that resolved the outpoint. - ResolutionOutcome outcome = 2; - - // The outpoint that was spent by the resolution. - OutPoint outpoint = 3; - - // The amount that was claimed by the resolution. - uint64 amount_sat = 4; - - // The hex-encoded transaction ID of the sweep transaction that spent the - // output. - string sweep_txid = 5; -} - -message ClosedChannelsRequest { - bool cooperative = 1; - bool local_force = 2; - bool remote_force = 3; - bool breach = 4; - bool funding_canceled = 5; - bool abandoned = 6; -} - -message ClosedChannelsResponse { - repeated ChannelCloseSummary channels = 1; -} - -message Peer { - // The identity pubkey of the peer - string pub_key = 1; - - // Network address of the peer; eg `127.0.0.1:10011` - string address = 3; - - // Bytes of data transmitted to this peer - uint64 bytes_sent = 4; - - // Bytes of data transmitted from this peer - uint64 bytes_recv = 5; - - // Satoshis sent to this peer - int64 sat_sent = 6; - - // Satoshis received from this peer - int64 sat_recv = 7; - - // A channel is inbound if the counterparty initiated the channel - bool inbound = 8; - - // Ping time to this peer - int64 ping_time = 9; - - enum SyncType { - /* - Denotes that we cannot determine the peer's current sync type. - */ - UNKNOWN_SYNC = 0; - - /* - Denotes that we are actively receiving new graph updates from the peer. - */ - ACTIVE_SYNC = 1; - - /* - Denotes that we are not receiving new graph updates from the peer. - */ - PASSIVE_SYNC = 2; - - /* - Denotes that this peer is pinned into an active sync. - */ - PINNED_SYNC = 3; - } - - // The type of sync we are currently performing with this peer. - SyncType sync_type = 10; - - // Features advertised by the remote peer in their init message. - map features = 11; - - /* - The latest errors received from our peer with timestamps, limited to the 10 - most recent errors. These errors are tracked across peer connections, but - are not persisted across lnd restarts. Note that these errors are only - stored for peers that we have channels open with, to prevent peers from - spamming us with errors at no cost. - */ - repeated TimestampedError errors = 12; - - /* - The number of times we have recorded this peer going offline or coming - online, recorded across restarts. Note that this value is decreased over - time if the peer has not recently flapped, so that we can forgive peers - with historically high flap counts. - */ - int32 flap_count = 13; - - /* - The timestamp of the last flap we observed for this peer. If this value is - zero, we have not observed any flaps for this peer. - */ - int64 last_flap_ns = 14; - - /* - The last ping payload the peer has sent to us. - */ - bytes last_ping_payload = 15; -} - -message TimestampedError { - // The unix timestamp in seconds when the error occurred. - uint64 timestamp = 1; - - // The string representation of the error sent by our peer. - string error = 2; -} - -message ListPeersRequest { - /* - If true, only the last error that our peer sent us will be returned with - the peer's information, rather than the full set of historic errors we have - stored. - */ - bool latest_error = 1; -} -message ListPeersResponse { - // The list of currently connected peers - repeated Peer peers = 1; -} - -message PeerEventSubscription { -} - -message PeerEvent { - // The identity pubkey of the peer. - string pub_key = 1; - - enum EventType { - PEER_ONLINE = 0; - PEER_OFFLINE = 1; - } - - EventType type = 2; -} - -message GetInfoRequest { -} -message GetInfoResponse { - // The version of the LND software that the node is running. - string version = 14; - - // The SHA1 commit hash that the daemon is compiled with. - string commit_hash = 20; - - // The identity pubkey of the current node. - string identity_pubkey = 1; - - // If applicable, the alias of the current node, e.g. "bob" - string alias = 2; - - // The color of the current node in hex code format - string color = 17; - - // Number of pending channels - uint32 num_pending_channels = 3; - - // Number of active channels - uint32 num_active_channels = 4; - - // Number of inactive channels - uint32 num_inactive_channels = 15; - - // Number of peers - uint32 num_peers = 5; - - // The node's current view of the height of the best block - uint32 block_height = 6; - - // The node's current view of the hash of the best block - string block_hash = 8; - - // Timestamp of the block best known to the wallet - int64 best_header_timestamp = 13; - - // Whether the wallet's view is synced to the main chain - bool synced_to_chain = 9; - - // Whether we consider ourselves synced with the public channel graph. - bool synced_to_graph = 18; - - /* - Whether the current node is connected to testnet. This field is - deprecated and the network field should be used instead - **/ - bool testnet = 10 [deprecated = true]; - - reserved 11; - - // A list of active chains the node is connected to - repeated Chain chains = 16; - - // The URIs of the current node. - repeated string uris = 12; - - /* - Features that our node has advertised in our init message, node - announcements and invoices. - */ - map features = 19; - - /* - Indicates whether the HTLC interceptor API is in always-on mode. - */ - bool require_htlc_interceptor = 21; -} - -message GetRecoveryInfoRequest { -} -message GetRecoveryInfoResponse { - // Whether the wallet is in recovery mode - bool recovery_mode = 1; - - // Whether the wallet recovery progress is finished - bool recovery_finished = 2; - - // The recovery progress, ranging from 0 to 1. - double progress = 3; -} - -message Chain { - // The blockchain the node is on (eg bitcoin, litecoin) - string chain = 1; - - // The network the node is on (eg regtest, testnet, mainnet) - string network = 2; -} - -message ConfirmationUpdate { - bytes block_sha = 1; - int32 block_height = 2; - - uint32 num_confs_left = 3; -} - -message ChannelOpenUpdate { - ChannelPoint channel_point = 1; -} - -message ChannelCloseUpdate { - bytes closing_txid = 1; - - bool success = 2; -} - -message CloseChannelRequest { - /* - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - ChannelPoint channel_point = 1; - - // If true, then the channel will be closed forcibly. This means the - // current commitment transaction will be signed and broadcast. - bool force = 2; - - // The target number of blocks that the closure transaction should be - // confirmed by. - int32 target_conf = 3; - - // Deprecated, use sat_per_vbyte. - // A manual fee rate set in sat/vbyte that should be used when crafting the - // closure transaction. - int64 sat_per_byte = 4 [deprecated = true]; - - /* - An optional address to send funds to in the case of a cooperative close. - If the channel was opened with an upfront shutdown script and this field - is set, the request to close will fail because the channel must pay out - to the upfront shutdown addresss. - */ - string delivery_address = 5; - - // A manual fee rate set in sat/vbyte that should be used when crafting the - // closure transaction. - uint64 sat_per_vbyte = 6; - - // The maximum fee rate the closer is willing to pay. - // - // NOTE: This field is only respected if we're the initiator of the channel. - uint64 max_fee_per_vbyte = 7; -} - -message CloseStatusUpdate { - oneof update { - PendingUpdate close_pending = 1; - ChannelCloseUpdate chan_close = 3; - } -} - -message PendingUpdate { - bytes txid = 1; - uint32 output_index = 2; -} - -message ReadyForPsbtFunding { - /* - The P2WSH address of the channel funding multisig address that the below - specified amount in satoshis needs to be sent to. - */ - string funding_address = 1; - - /* - The exact amount in satoshis that needs to be sent to the above address to - fund the pending channel. - */ - int64 funding_amount = 2; - - /* - A raw PSBT that contains the pending channel output. If a base PSBT was - provided in the PsbtShim, this is the base PSBT with one additional output. - If no base PSBT was specified, this is an otherwise empty PSBT with exactly - one output. - */ - bytes psbt = 3; -} - -message BatchOpenChannelRequest { - // The list of channels to open. - repeated BatchOpenChannel channels = 1; - - // The target number of blocks that the funding transaction should be - // confirmed by. - int32 target_conf = 2; - - // A manual fee rate set in sat/vByte that should be used when crafting the - // funding transaction. - int64 sat_per_vbyte = 3; - - // The minimum number of confirmations each one of your outputs used for - // the funding transaction must satisfy. - int32 min_confs = 4; - - // Whether unconfirmed outputs should be used as inputs for the funding - // transaction. - bool spend_unconfirmed = 5; - - // An optional label for the batch transaction, limited to 500 characters. - string label = 6; -} - -message BatchOpenChannel { - // The pubkey of the node to open a channel with. When using REST, this - // field must be encoded as base64. - bytes node_pubkey = 1; - - // The number of satoshis the wallet should commit to the channel. - int64 local_funding_amount = 2; - - // The number of satoshis to push to the remote side as part of the initial - // commitment state. - int64 push_sat = 3; - - // Whether this channel should be private, not announced to the greater - // network. - bool private = 4; - - // The minimum value in millisatoshi we will require for incoming HTLCs on - // the channel. - int64 min_htlc_msat = 5; - - // The delay we require on the remote's commitment transaction. If this is - // not set, it will be scaled automatically with the channel size. - uint32 remote_csv_delay = 6; - - /* - Close address is an optional address which specifies the address to which - funds should be paid out to upon cooperative close. This field may only be - set if the peer supports the option upfront feature bit (call listpeers - to check). The remote peer will only accept cooperative closes to this - address if it is set. - - Note: If this value is set on channel creation, you will *not* be able to - cooperatively close out to a different address. - */ - string close_address = 7; - - /* - An optional, unique identifier of 32 random bytes that will be used as the - pending channel ID to identify the channel while it is in the pre-pending - state. - */ - bytes pending_chan_id = 8; - - /* - The explicit commitment type to use. Note this field will only be used if - the remote peer supports explicit channel negotiation. - */ - CommitmentType commitment_type = 9; -} - -message BatchOpenChannelResponse { - repeated PendingUpdate pending_channels = 1; -} - -message OpenChannelRequest { - // A manual fee rate set in sat/vbyte that should be used when crafting the - // funding transaction. - uint64 sat_per_vbyte = 1; - - /* - The pubkey of the node to open a channel with. When using REST, this field - must be encoded as base64. - */ - bytes node_pubkey = 2; - - /* - The hex encoded pubkey of the node to open a channel with. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string node_pubkey_string = 3 [deprecated = true]; - - // The number of satoshis the wallet should commit to the channel - int64 local_funding_amount = 4; - - // The number of satoshis to push to the remote side as part of the initial - // commitment state - int64 push_sat = 5; - - // The target number of blocks that the funding transaction should be - // confirmed by. - int32 target_conf = 6; - - // Deprecated, use sat_per_vbyte. - // A manual fee rate set in sat/vbyte that should be used when crafting the - // funding transaction. - int64 sat_per_byte = 7 [deprecated = true]; - - // Whether this channel should be private, not announced to the greater - // network. - bool private = 8; - - // The minimum value in millisatoshi we will require for incoming HTLCs on - // the channel. - int64 min_htlc_msat = 9; - - // The delay we require on the remote's commitment transaction. If this is - // not set, it will be scaled automatically with the channel size. - uint32 remote_csv_delay = 10; - - // The minimum number of confirmations each one of your outputs used for - // the funding transaction must satisfy. - int32 min_confs = 11; - - // Whether unconfirmed outputs should be used as inputs for the funding - // transaction. - bool spend_unconfirmed = 12; - - /* - Close address is an optional address which specifies the address to which - funds should be paid out to upon cooperative close. This field may only be - set if the peer supports the option upfront feature bit (call listpeers - to check). The remote peer will only accept cooperative closes to this - address if it is set. - - Note: If this value is set on channel creation, you will *not* be able to - cooperatively close out to a different address. - */ - string close_address = 13; - - /* - Funding shims are an optional argument that allow the caller to intercept - certain funding functionality. For example, a shim can be provided to use a - particular key for the commitment key (ideally cold) rather than use one - that is generated by the wallet as normal, or signal that signing will be - carried out in an interactive manner (PSBT based). - */ - FundingShim funding_shim = 14; - - /* - The maximum amount of coins in millisatoshi that can be pending within - the channel. It only applies to the remote party. - */ - uint64 remote_max_value_in_flight_msat = 15; - - /* - The maximum number of concurrent HTLCs we will allow the remote party to add - to the commitment transaction. - */ - uint32 remote_max_htlcs = 16; - - /* - Max local csv is the maximum csv delay we will allow for our own commitment - transaction. - */ - uint32 max_local_csv = 17; - - /* - The explicit commitment type to use. Note this field will only be used if - the remote peer supports explicit channel negotiation. - */ - CommitmentType commitment_type = 18; - - /* - If this is true, then a zero-conf channel open will be attempted. - */ - bool zero_conf = 19; - - /* - If this is true, then an option-scid-alias channel-type open will be - attempted. - */ - bool scid_alias = 20; - - /* - The base fee charged regardless of the number of milli-satoshis sent. - */ - uint64 base_fee = 21; - - /* - The fee rate in ppm (parts per million) that will be charged in - proportion of the value of each forwarded HTLC. - */ - uint64 fee_rate = 22; - - /* - If use_base_fee is true the open channel announcement will update the - channel base fee with the value specified in base_fee. In the case of - a base_fee of 0 use_base_fee is needed downstream to distinguish whether - to use the default base fee value specified in the config or 0. - */ - bool use_base_fee = 23; - - /* - If use_fee_rate is true the open channel announcement will update the - channel fee rate with the value specified in fee_rate. In the case of - a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether - to use the default fee rate value specified in the config or 0. - */ - bool use_fee_rate = 24; - - /* - The number of satoshis we require the remote peer to reserve. This value, - if specified, must be above the dust limit and below 20% of the channel - capacity. - */ - uint64 remote_chan_reserve_sat = 25; -} -message OpenStatusUpdate { - oneof update { - /* - Signals that the channel is now fully negotiated and the funding - transaction published. - */ - PendingUpdate chan_pending = 1; - - /* - Signals that the channel's funding transaction has now reached the - required number of confirmations on chain and can be used. - */ - ChannelOpenUpdate chan_open = 3; - - /* - Signals that the funding process has been suspended and the construction - of a PSBT that funds the channel PK script is now required. - */ - ReadyForPsbtFunding psbt_fund = 5; - } - - /* - The pending channel ID of the created channel. This value may be used to - further the funding flow manually via the FundingStateStep method. - */ - bytes pending_chan_id = 4; -} - -message KeyLocator { - // The family of key being identified. - int32 key_family = 1; - - // The precise index of the key being identified. - int32 key_index = 2; -} - -message KeyDescriptor { - /* - The raw bytes of the key being identified. - */ - bytes raw_key_bytes = 1; - - /* - The key locator that identifies which key to use for signing. - */ - KeyLocator key_loc = 2; -} - -message ChanPointShim { - /* - The size of the pre-crafted output to be used as the channel point for this - channel funding. - */ - int64 amt = 1; - - // The target channel point to refrence in created commitment transactions. - ChannelPoint chan_point = 2; - - // Our local key to use when creating the multi-sig output. - KeyDescriptor local_key = 3; - - // The key of the remote party to use when creating the multi-sig output. - bytes remote_key = 4; - - /* - If non-zero, then this will be used as the pending channel ID on the wire - protocol to initate the funding request. This is an optional field, and - should only be set if the responder is already expecting a specific pending - channel ID. - */ - bytes pending_chan_id = 5; - - /* - This uint32 indicates if this channel is to be considered 'frozen'. A frozen - channel does not allow a cooperative channel close by the initiator. The - thaw_height is the height that this restriction stops applying to the - channel. The height can be interpreted in two ways: as a relative height if - the value is less than 500,000, or as an absolute height otherwise. - */ - uint32 thaw_height = 6; -} - -message PsbtShim { - /* - A unique identifier of 32 random bytes that will be used as the pending - channel ID to identify the PSBT state machine when interacting with it and - on the wire protocol to initiate the funding request. - */ - bytes pending_chan_id = 1; - - /* - An optional base PSBT the new channel output will be added to. If this is - non-empty, it must be a binary serialized PSBT. - */ - bytes base_psbt = 2; - - /* - If a channel should be part of a batch (multiple channel openings in one - transaction), it can be dangerous if the whole batch transaction is - published too early before all channel opening negotiations are completed. - This flag prevents this particular channel from broadcasting the transaction - after the negotiation with the remote peer. In a batch of channel openings - this flag should be set to true for every channel but the very last. - */ - bool no_publish = 3; -} - -message FundingShim { - oneof shim { - /* - A channel shim where the channel point was fully constructed outside - of lnd's wallet and the transaction might already be published. - */ - ChanPointShim chan_point_shim = 1; - - /* - A channel shim that uses a PSBT to fund and sign the channel funding - transaction. - */ - PsbtShim psbt_shim = 2; - } -} - -message FundingShimCancel { - // The pending channel ID of the channel to cancel the funding shim for. - bytes pending_chan_id = 1; -} - -message FundingPsbtVerify { - /* - The funded but not yet signed PSBT that sends the exact channel capacity - amount to the PK script returned in the open channel message in a previous - step. - */ - bytes funded_psbt = 1; - - // The pending channel ID of the channel to get the PSBT for. - bytes pending_chan_id = 2; - - /* - Can only be used if the no_publish flag was set to true in the OpenChannel - call meaning that the caller is solely responsible for publishing the final - funding transaction. If skip_finalize is set to true then lnd will not wait - for a FundingPsbtFinalize state step and instead assumes that a transaction - with the same TXID as the passed in PSBT will eventually confirm. - IT IS ABSOLUTELY IMPERATIVE that the TXID of the transaction that is - eventually published does have the _same TXID_ as the verified PSBT. That - means no inputs or outputs can change, only signatures can be added. If the - TXID changes between this call and the publish step then the channel will - never be created and the funds will be in limbo. - */ - bool skip_finalize = 3; -} - -message FundingPsbtFinalize { - /* - The funded PSBT that contains all witness data to send the exact channel - capacity amount to the PK script returned in the open channel message in a - previous step. Cannot be set at the same time as final_raw_tx. - */ - bytes signed_psbt = 1; - - // The pending channel ID of the channel to get the PSBT for. - bytes pending_chan_id = 2; - - /* - As an alternative to the signed PSBT with all witness data, the final raw - wire format transaction can also be specified directly. Cannot be set at the - same time as signed_psbt. - */ - bytes final_raw_tx = 3; -} - -message FundingTransitionMsg { - oneof trigger { - /* - The funding shim to register. This should be used before any - channel funding has began by the remote party, as it is intended as a - preparatory step for the full channel funding. - */ - FundingShim shim_register = 1; - - // Used to cancel an existing registered funding shim. - FundingShimCancel shim_cancel = 2; - - /* - Used to continue a funding flow that was initiated to be executed - through a PSBT. This step verifies that the PSBT contains the correct - outputs to fund the channel. - */ - FundingPsbtVerify psbt_verify = 3; - - /* - Used to continue a funding flow that was initiated to be executed - through a PSBT. This step finalizes the funded and signed PSBT, finishes - negotiation with the peer and finally publishes the resulting funding - transaction. - */ - FundingPsbtFinalize psbt_finalize = 4; - } -} - -message FundingStateStepResp { -} - -message PendingHTLC { - // The direction within the channel that the htlc was sent - bool incoming = 1; - - // The total value of the htlc - int64 amount = 2; - - // The final output to be swept back to the user's wallet - string outpoint = 3; - - // The next block height at which we can spend the current stage - uint32 maturity_height = 4; - - /* - The number of blocks remaining until the current stage can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5; - - // Indicates whether the htlc is in its first or second stage of recovery - uint32 stage = 6; -} - -message PendingChannelsRequest { -} -message PendingChannelsResponse { - message PendingChannel { - string remote_node_pub = 1; - string channel_point = 2; - - int64 capacity = 3; - - int64 local_balance = 4; - int64 remote_balance = 5; - - // The minimum satoshis this node is required to reserve in its - // balance. - int64 local_chan_reserve_sat = 6; - - /* - The minimum satoshis the other node is required to reserve in its - balance. - */ - int64 remote_chan_reserve_sat = 7; - - // The party that initiated opening the channel. - Initiator initiator = 8; - - // The commitment type used by this channel. - CommitmentType commitment_type = 9; - - // Total number of forwarding packages created in this channel. - int64 num_forwarding_packages = 10; - - // A set of flags showing the current state of the channel. - string chan_status_flags = 11; - - // Whether this channel is advertised to the network or not. - bool private = 12; - } - - message PendingOpenChannel { - // The pending channel - PendingChannel channel = 1; - - /* - The amount calculated to be paid in fees for the current set of - commitment transactions. The fee amount is persisted with the channel - in order to allow the fee amount to be removed and recalculated with - each channel state update, including updates that happen after a system - restart. - */ - int64 commit_fee = 4; - - // The weight of the commitment transaction - int64 commit_weight = 5; - - /* - The required number of satoshis per kilo-weight that the requester will - pay at all times, for both the funding transaction and commitment - transaction. This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 6; - - // Previously used for confirmation_height. Do not reuse. - reserved 2; - } - - message WaitingCloseChannel { - // The pending channel waiting for closing tx to confirm - PendingChannel channel = 1; - - // The balance in satoshis encumbered in this channel - int64 limbo_balance = 2; - - /* - A list of valid commitment transactions. Any of these can confirm at - this point. - */ - Commitments commitments = 3; - - // The transaction id of the closing transaction - string closing_txid = 4; - } - - message Commitments { - // Hash of the local version of the commitment tx. - string local_txid = 1; - - // Hash of the remote version of the commitment tx. - string remote_txid = 2; - - // Hash of the remote pending version of the commitment tx. - string remote_pending_txid = 3; - - /* - The amount in satoshis calculated to be paid in fees for the local - commitment. - */ - uint64 local_commit_fee_sat = 4; - - /* - The amount in satoshis calculated to be paid in fees for the remote - commitment. - */ - uint64 remote_commit_fee_sat = 5; - - /* - The amount in satoshis calculated to be paid in fees for the remote - pending commitment. - */ - uint64 remote_pending_commit_fee_sat = 6; - } - - message ClosedChannel { - // The pending channel to be closed - PendingChannel channel = 1; - - // The transaction id of the closing transaction - string closing_txid = 2; - } - - message ForceClosedChannel { - // The pending channel to be force closed - PendingChannel channel = 1; - - // The transaction id of the closing transaction - string closing_txid = 2; - - // The balance in satoshis encumbered in this pending channel - int64 limbo_balance = 3; - - // The height at which funds can be swept into the wallet - uint32 maturity_height = 4; - - /* - Remaining # of blocks until the commitment output can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5; - - // The total value of funds successfully recovered from this channel - int64 recovered_balance = 6; - - repeated PendingHTLC pending_htlcs = 8; - - /* - There are three resolution states for the anchor: - limbo, lost and recovered. Derive the current state - from the limbo and recovered balances. - */ - enum AnchorState { - // The recovered_balance is zero and limbo_balance is non-zero. - LIMBO = 0; - // The recovered_balance is non-zero. - RECOVERED = 1; - // A state that is neither LIMBO nor RECOVERED. - LOST = 2; - } - - AnchorState anchor = 9; - } - - // The balance in satoshis encumbered in pending channels - int64 total_limbo_balance = 1; - - // Channels pending opening - repeated PendingOpenChannel pending_open_channels = 2; - - /* - Deprecated: Channels pending closing previously contained cooperatively - closed channels with a single confirmation. These channels are now - considered closed from the time we see them on chain. - */ - repeated ClosedChannel pending_closing_channels = 3 [deprecated = true]; - - // Channels pending force closing - repeated ForceClosedChannel pending_force_closing_channels = 4; - - // Channels waiting for closing tx to confirm - repeated WaitingCloseChannel waiting_close_channels = 5; -} - -message ChannelEventSubscription { -} - -message ChannelEventUpdate { - oneof channel { - Channel open_channel = 1; - ChannelCloseSummary closed_channel = 2; - ChannelPoint active_channel = 3; - ChannelPoint inactive_channel = 4; - PendingUpdate pending_open_channel = 6; - ChannelPoint fully_resolved_channel = 7; - } - - enum UpdateType { - OPEN_CHANNEL = 0; - CLOSED_CHANNEL = 1; - ACTIVE_CHANNEL = 2; - INACTIVE_CHANNEL = 3; - PENDING_OPEN_CHANNEL = 4; - FULLY_RESOLVED_CHANNEL = 5; - } - - UpdateType type = 5; -} - -message WalletAccountBalance { - // The confirmed balance of the account (with >= 1 confirmations). - int64 confirmed_balance = 1; - - // The unconfirmed balance of the account (with 0 confirmations). - int64 unconfirmed_balance = 2; -} - -message WalletBalanceRequest { -} - -message WalletBalanceResponse { - // The balance of the wallet - int64 total_balance = 1; - - // The confirmed balance of a wallet(with >= 1 confirmations) - int64 confirmed_balance = 2; - - // The unconfirmed balance of a wallet(with 0 confirmations) - int64 unconfirmed_balance = 3; - - // The total amount of wallet UTXOs held in outputs that are locked for - // other usage. - int64 locked_balance = 5; - - // The amount of reserve required. - int64 reserved_balance_anchor_chan = 6; - - // A mapping of each wallet account's name to its balance. - map account_balance = 4; -} - -message Amount { - // Value denominated in satoshis. - uint64 sat = 1; - - // Value denominated in milli-satoshis. - uint64 msat = 2; -} - -message ChannelBalanceRequest { -} -message ChannelBalanceResponse { - // Deprecated. Sum of channels balances denominated in satoshis - int64 balance = 1 [deprecated = true]; - - // Deprecated. Sum of channels pending balances denominated in satoshis - int64 pending_open_balance = 2 [deprecated = true]; - - // Sum of channels local balances. - Amount local_balance = 3; - - // Sum of channels remote balances. - Amount remote_balance = 4; - - // Sum of channels local unsettled balances. - Amount unsettled_local_balance = 5; - - // Sum of channels remote unsettled balances. - Amount unsettled_remote_balance = 6; - - // Sum of channels pending local balances. - Amount pending_open_local_balance = 7; - - // Sum of channels pending remote balances. - Amount pending_open_remote_balance = 8; -} - -message QueryRoutesRequest { - // The 33-byte hex-encoded public key for the payment destination - string pub_key = 1; - - /* - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 2; - - /* - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - reserved 3; - - /* - An optional CLTV delta from the current height that should be used for the - timelock of the final hop. Note that unlike SendPayment, QueryRoutes does - not add any additional block padding on top of final_ctlv_delta. This - padding of a few blocks needs to be added manually or otherwise failures may - happen when a block comes in while the payment is in flight. - */ - int32 final_cltv_delta = 4; - - /* - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. If not specified, lnd will use a default value of 100% - fees for small amounts (<=1k sat) or 5% fees for larger amounts. - */ - FeeLimit fee_limit = 5; - - /* - A list of nodes to ignore during path finding. When using REST, these fields - must be encoded as base64. - */ - repeated bytes ignored_nodes = 6; - - /* - Deprecated. A list of edges to ignore during path finding. - */ - repeated EdgeLocator ignored_edges = 7 [deprecated = true]; - - /* - The source node where the request route should originated from. If empty, - self is assumed. - */ - string source_pub_key = 8; - - /* - If set to true, edge probabilities from mission control will be used to get - the optimal route. - */ - bool use_mission_control = 9; - - /* - A list of directed node pairs that will be ignored during path finding. - */ - repeated NodePair ignored_pairs = 10; - - /* - An optional maximum total time lock for the route. If the source is empty or - ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If - zero, then the value of `--max-cltv-expiry` is used as the limit. - */ - uint32 cltv_limit = 11; - - /* - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. If the destination - does not support the specified records, an error will be returned. - Record types are required to be in the custom range >= 65536. When using - REST, the values must be encoded as base64. - */ - map dest_custom_records = 13; - - /* - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; - - /* - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 15; - - /* - Optional route hints to reach the destination through private channels. - */ - repeated lnrpc.RouteHint route_hints = 16; - - /* - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated lnrpc.FeatureBit dest_features = 17; - - /* - The time preference for this payment. Set to -1 to optimize for fees - only, to 1 to optimize for reliability only or a value inbetween for a mix. - */ - double time_pref = 18; -} - -message NodePair { - /* - The sending node of the pair. When using REST, this field must be encoded as - base64. - */ - bytes from = 1; - - /* - The receiving node of the pair. When using REST, this field must be encoded - as base64. - */ - bytes to = 2; -} - -message EdgeLocator { - // The short channel id of this edge. - uint64 channel_id = 1 [jstype = JS_STRING]; - - /* - The direction of this edge. If direction_reverse is false, the direction - of this edge is from the channel endpoint with the lexicographically smaller - pub key to the endpoint with the larger pub key. If direction_reverse is - is true, the edge goes the other way. - */ - bool direction_reverse = 2; -} - -message QueryRoutesResponse { - /* - The route that results from the path finding operation. This is still a - repeated field to retain backwards compatibility. - */ - repeated Route routes = 1; - - /* - The success probability of the returned route based on the current mission - control state. [EXPERIMENTAL] - */ - double success_prob = 2; -} - -message Hop { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - int64 chan_capacity = 2 [deprecated = true]; - int64 amt_to_forward = 3 [deprecated = true]; - int64 fee = 4 [deprecated = true]; - uint32 expiry = 5; - int64 amt_to_forward_msat = 6; - int64 fee_msat = 7; - - /* - An optional public key of the hop. If the public key is given, the payment - can be executed without relying on a copy of the channel graph. - */ - string pub_key = 8; - - /* - If set to true, then this hop will be encoded using the new variable length - TLV format. Note that if any custom tlv_records below are specified, then - this field MUST be set to true for them to be encoded properly. - */ - bool tlv_payload = 9 [deprecated = true]; - - /* - An optional TLV record that signals the use of an MPP payment. If present, - the receiver will enforce that the same mpp_record is included in the final - hop payload of all non-zero payments in the HTLC set. If empty, a regular - single-shot payment is or was attempted. - */ - MPPRecord mpp_record = 10; - - /* - An optional TLV record that signals the use of an AMP payment. If present, - the receiver will treat all received payments including the same - (payment_addr, set_id) pair as being part of one logical payment. The - payment will be settled by XORing the root_share's together and deriving the - child hashes and preimages according to BOLT XX. Must be used in conjunction - with mpp_record. - */ - AMPRecord amp_record = 12; - - /* - An optional set of key-value TLV records. This is useful within the context - of the SendToRoute call as it allows callers to specify arbitrary K-V pairs - to drop off at each hop within the onion. - */ - map custom_records = 11; - - // The payment metadata to send along with the payment to the payee. - bytes metadata = 13; -} - -message MPPRecord { - /* - A unique, random identifier used to authenticate the sender as the intended - payer of a multi-path payment. The payment_addr must be the same for all - subpayments, and match the payment_addr provided in the receiver's invoice. - The same payment_addr must be used on all subpayments. - */ - bytes payment_addr = 11; - - /* - The total amount in milli-satoshis being sent as part of a larger multi-path - payment. The caller is responsible for ensuring subpayments to the same node - and payment_hash sum exactly to total_amt_msat. The same - total_amt_msat must be used on all subpayments. - */ - int64 total_amt_msat = 10; -} - -message AMPRecord { - bytes root_share = 1; - - bytes set_id = 2; - - uint32 child_index = 3; -} - -/* -A path through the channel graph which runs over one or more channels in -succession. This struct carries all the information required to craft the -Sphinx onion packet, and send the payment along the first hop in the path. A -route is only selected as valid if all the channels have sufficient capacity to -carry the initial payment amount after fees are accounted for. -*/ -message Route { - /* - The cumulative (final) time lock across the entire route. This is the CLTV - value that should be extended to the first hop in the route. All other hops - will decrement the time-lock as advertised, leaving enough time for all - hops to wait for or present the payment preimage to complete the payment. - */ - uint32 total_time_lock = 1; - - /* - The sum of the fees paid at each hop within the final route. In the case - of a one-hop payment, this value will be zero as we don't need to pay a fee - to ourselves. - */ - int64 total_fees = 2 [deprecated = true]; - - /* - The total amount of funds required to complete a payment over this route. - This value includes the cumulative fees at each hop. As a result, the HTLC - extended to the first-hop in the route will need to have at least this many - satoshis, otherwise the route will fail at an intermediate node due to an - insufficient amount of fees. - */ - int64 total_amt = 3 [deprecated = true]; - - /* - Contains details concerning the specific forwarding details at each hop. - */ - repeated Hop hops = 4; - - /* - The total fees in millisatoshis. - */ - int64 total_fees_msat = 5; - - /* - The total amount in millisatoshis. - */ - int64 total_amt_msat = 6; -} - -message NodeInfoRequest { - // The 33-byte hex-encoded compressed public of the target node - string pub_key = 1; - - // If true, will include all known channels associated with the node. - bool include_channels = 2; -} - -message NodeInfo { - /* - An individual vertex/node within the channel graph. A node is - connected to other nodes by one or more channel edges emanating from it. As - the graph is directed, a node will also have an incoming edge attached to - it for each outgoing edge. - */ - LightningNode node = 1; - - // The total number of channels for the node. - uint32 num_channels = 2; - - // The sum of all channels capacity for the node, denominated in satoshis. - int64 total_capacity = 3; - - // A list of all public channels for the node. - repeated ChannelEdge channels = 4; -} - -/* -An individual vertex/node within the channel graph. A node is -connected to other nodes by one or more channel edges emanating from it. As the -graph is directed, a node will also have an incoming edge attached to it for -each outgoing edge. -*/ -message LightningNode { - uint32 last_update = 1; - string pub_key = 2; - string alias = 3; - repeated NodeAddress addresses = 4; - string color = 5; - map features = 6; - - // Custom node announcement tlv records. - map custom_records = 7; -} - -message NodeAddress { - string network = 1; - string addr = 2; -} - -message RoutingPolicy { - uint32 time_lock_delta = 1; - int64 min_htlc = 2; - int64 fee_base_msat = 3; - int64 fee_rate_milli_msat = 4; - bool disabled = 5; - uint64 max_htlc_msat = 6; - uint32 last_update = 7; - - // Custom channel update tlv records. - map custom_records = 8; -} - -/* -A fully authenticated channel along with all its unique attributes. -Once an authenticated channel announcement has been processed on the network, -then an instance of ChannelEdgeInfo encapsulating the channels attributes is -stored. The other portions relevant to routing policy of a channel are stored -within a ChannelEdgePolicy for each direction of the channel. -*/ -message ChannelEdge { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 channel_id = 1 [jstype = JS_STRING]; - string chan_point = 2; - - uint32 last_update = 3 [deprecated = true]; - - string node1_pub = 4; - string node2_pub = 5; - - int64 capacity = 6; - - RoutingPolicy node1_policy = 7; - RoutingPolicy node2_policy = 8; - - // Custom channel announcement tlv records. - map custom_records = 9; -} - -message ChannelGraphRequest { - /* - Whether unannounced channels are included in the response or not. If set, - unannounced channels are included. Unannounced channels are both private - channels, and public channels that are not yet announced to the network. - */ - bool include_unannounced = 1; -} - -// Returns a new instance of the directed channel graph. -message ChannelGraph { - // The list of `LightningNode`s in this channel graph - repeated LightningNode nodes = 1; - - // The list of `ChannelEdge`s in this channel graph - repeated ChannelEdge edges = 2; -} - -enum NodeMetricType { - UNKNOWN = 0; - BETWEENNESS_CENTRALITY = 1; -} - -message NodeMetricsRequest { - // The requested node metrics. - repeated NodeMetricType types = 1; -} - -message NodeMetricsResponse { - /* - Betweenness centrality is the sum of the ratio of shortest paths that pass - through the node for each pair of nodes in the graph (not counting paths - starting or ending at this node). - Map of node pubkey to betweenness centrality of the node. Normalized - values are in the [0,1] closed interval. - */ - map betweenness_centrality = 1; -} - -message FloatMetric { - // Arbitrary float value. - double value = 1; - - // The value normalized to [0,1] or [-1,1]. - double normalized_value = 2; -} - -message ChanInfoRequest { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; -} - -message NetworkInfoRequest { -} -message NetworkInfo { - uint32 graph_diameter = 1; - double avg_out_degree = 2; - uint32 max_out_degree = 3; - - uint32 num_nodes = 4; - uint32 num_channels = 5; - - int64 total_network_capacity = 6; - - double avg_channel_size = 7; - int64 min_channel_size = 8; - int64 max_channel_size = 9; - int64 median_channel_size_sat = 10; - - // The number of edges marked as zombies. - uint64 num_zombie_chans = 11; - - // TODO(roasbeef): fee rate info, expiry - // * also additional RPC for tracking fee info once in -} - -message StopRequest { -} -message StopResponse { -} - -message GraphTopologySubscription { -} -message GraphTopologyUpdate { - repeated NodeUpdate node_updates = 1; - repeated ChannelEdgeUpdate channel_updates = 2; - repeated ClosedChannelUpdate closed_chans = 3; -} -message NodeUpdate { - /* - Deprecated, use node_addresses. - */ - repeated string addresses = 1 [deprecated = true]; - - string identity_key = 2; - - /* - Deprecated, use features. - */ - bytes global_features = 3 [deprecated = true]; - - string alias = 4; - string color = 5; - repeated NodeAddress node_addresses = 7; - - /* - Features that the node has advertised in the init message, node - announcements and invoices. - */ - map features = 6; -} -message ChannelEdgeUpdate { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - - ChannelPoint chan_point = 2; - - int64 capacity = 3; - - RoutingPolicy routing_policy = 4; - - string advertising_node = 5; - string connecting_node = 6; -} -message ClosedChannelUpdate { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - int64 capacity = 2; - uint32 closed_height = 3; - ChannelPoint chan_point = 4; -} - -message HopHint { - // The public key of the node at the start of the channel. - string node_id = 1; - - // The unique identifier of the channel. - uint64 chan_id = 2 [jstype = JS_STRING]; - - // The base fee of the channel denominated in millisatoshis. - uint32 fee_base_msat = 3; - - /* - The fee rate of the channel for sending one satoshi across it denominated in - millionths of a satoshi. - */ - uint32 fee_proportional_millionths = 4; - - // The time-lock delta of the channel. - uint32 cltv_expiry_delta = 5; -} - -message SetID { - bytes set_id = 1; -} - -message RouteHint { - /* - A list of hop hints that when chained together can assist in reaching a - specific destination. - */ - repeated HopHint hop_hints = 1; -} - -message AMPInvoiceState { - // The state the HTLCs associated with this setID are in. - InvoiceHTLCState state = 1; - - // The settle index of this HTLC set, if the invoice state is settled. - uint64 settle_index = 2; - - // The time this HTLC set was settled expressed in unix epoch. - int64 settle_time = 3; - - // The total amount paid for the sub-invoice expressed in milli satoshis. - int64 amt_paid_msat = 5; -} - -message Invoice { - /* - An optional memo to attach along with the invoice. Used for record keeping - purposes for the invoice's creator, and will also be set in the description - field of the encoded payment request if the description_hash field is not - being used. - */ - string memo = 1; - - reserved 2; - - /* - The hex-encoded preimage (32 byte) which will allow settling an incoming - HTLC payable to this preimage. When using REST, this field must be encoded - as base64. - */ - bytes r_preimage = 3; - - /* - The hash of the preimage. When using REST, this field must be encoded as - base64. - Note: Output only, don't specify for creating an invoice. - */ - bytes r_hash = 4; - - /* - The value of this invoice in satoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value = 5; - - /* - The value of this invoice in millisatoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value_msat = 23; - - /* - Whether this invoice has been fulfilled - - The field is deprecated. Use the state field instead (compare to SETTLED). - */ - bool settled = 6 [deprecated = true]; - - /* - When this invoice was created. - Note: Output only, don't specify for creating an invoice. - */ - int64 creation_date = 7; - - /* - When this invoice was settled. - Note: Output only, don't specify for creating an invoice. - */ - int64 settle_date = 8; - - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - Note: Output only, don't specify for creating an invoice. - */ - string payment_request = 9; - - /* - Hash (SHA-256) of a description of the payment. Used if the description of - payment (memo) is too long to naturally fit within the description field - of an encoded payment request. When using REST, this field must be encoded - as base64. - */ - bytes description_hash = 10; - - // Payment request expiry time in seconds. Default is 3600 (1 hour). - int64 expiry = 11; - - // Fallback on-chain address. - string fallback_addr = 12; - - // Delta to use for the time-lock of the CLTV extended to the final hop. - uint64 cltv_expiry = 13; - - /* - Route hints that can each be individually used to assist in reaching the - invoice's destination. - */ - repeated RouteHint route_hints = 14; - - // Whether this invoice should include routing hints for private channels. - bool private = 15; - - /* - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - Note: Output only, don't specify for creating an invoice. - */ - uint64 add_index = 16; - - /* - The "settle" index of this invoice. Each newly settled invoice will - increment this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all - settled invoices with an settle_index greater than this one. - Note: Output only, don't specify for creating an invoice. - */ - uint64 settle_index = 17; - - // Deprecated, use amt_paid_sat or amt_paid_msat. - int64 amt_paid = 18 [deprecated = true]; - - /* - The amount that was accepted for this invoice, in satoshis. This will ONLY - be set if this invoice has been settled. We provide this field as if the - invoice was created with a zero value, then we need to record what amount - was ultimately accepted. Additionally, it's possible that the sender paid - MORE that was specified in the original invoice. So we'll record that here - as well. - Note: Output only, don't specify for creating an invoice. - */ - int64 amt_paid_sat = 19; - - /* - The amount that was accepted for this invoice, in millisatoshis. This will - ONLY be set if this invoice has been settled. We provide this field as if - the invoice was created with a zero value, then we need to record what - amount was ultimately accepted. Additionally, it's possible that the sender - paid MORE that was specified in the original invoice. So we'll record that - here as well. - Note: Output only, don't specify for creating an invoice. - */ - int64 amt_paid_msat = 20; - - enum InvoiceState { - OPEN = 0; - SETTLED = 1; - CANCELED = 2; - ACCEPTED = 3; - } - - /* - The state the invoice is in. - Note: Output only, don't specify for creating an invoice. - */ - InvoiceState state = 21; - - /* - List of HTLCs paying to this invoice [EXPERIMENTAL]. - Note: Output only, don't specify for creating an invoice. - */ - repeated InvoiceHTLC htlcs = 22; - - /* - List of features advertised on the invoice. - Note: Output only, don't specify for creating an invoice. - */ - map features = 24; - - /* - Indicates if this invoice was a spontaneous payment that arrived via keysend - [EXPERIMENTAL]. - Note: Output only, don't specify for creating an invoice. - */ - bool is_keysend = 25; - - /* - The payment address of this invoice. This value will be used in MPP - payments, and also for newer invoices that always require the MPP payload - for added end-to-end security. - Note: Output only, don't specify for creating an invoice. - */ - bytes payment_addr = 26; - - /* - Signals whether or not this is an AMP invoice. - */ - bool is_amp = 27; - - /* - [EXPERIMENTAL]: - - Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the - given set ID. This field is always populated for AMP invoices, and can be - used along side LookupInvoice to obtain the HTLC information related to a - given sub-invoice. - Note: Output only, don't specify for creating an invoice. - */ - map amp_invoice_state = 28; -} - -enum InvoiceHTLCState { - ACCEPTED = 0; - SETTLED = 1; - CANCELED = 2; -} - -// Details of an HTLC that paid to an invoice -message InvoiceHTLC { - // Short channel id over which the htlc was received. - uint64 chan_id = 1 [jstype = JS_STRING]; - - // Index identifying the htlc on the channel. - uint64 htlc_index = 2; - - // The amount of the htlc in msat. - uint64 amt_msat = 3; - - // Block height at which this htlc was accepted. - int32 accept_height = 4; - - // Time at which this htlc was accepted. - int64 accept_time = 5; - - // Time at which this htlc was settled or canceled. - int64 resolve_time = 6; - - // Block height at which this htlc expires. - int32 expiry_height = 7; - - // Current state the htlc is in. - InvoiceHTLCState state = 8; - - // Custom tlv records. - map custom_records = 9; - - // The total amount of the mpp payment in msat. - uint64 mpp_total_amt_msat = 10; - - // Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. - AMP amp = 11; -} - -// Details specific to AMP HTLCs. -message AMP { - // An n-of-n secret share of the root seed from which child payment hashes - // and preimages are derived. - bytes root_share = 1; - - // An identifier for the HTLC set that this HTLC belongs to. - bytes set_id = 2; - - // A nonce used to randomize the child preimage and child hash from a given - // root_share. - uint32 child_index = 3; - - // The payment hash of the AMP HTLC. - bytes hash = 4; - - // The preimage used to settle this AMP htlc. This field will only be - // populated if the invoice is in InvoiceState_ACCEPTED or - // InvoiceState_SETTLED. - bytes preimage = 5; -} - -message AddInvoiceResponse { - bytes r_hash = 1; - - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 2; - - /* - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 16; - - /* - The payment address of the generated invoice. This value should be used - in all payments for this invoice as we require it for end to end - security. - */ - bytes payment_addr = 17; -} -message PaymentHash { - /* - The hex-encoded payment hash of the invoice to be looked up. The passed - payment hash must be exactly 32 bytes, otherwise an error is returned. - Deprecated now that the REST gateway supports base64 encoding of bytes - fields. - */ - string r_hash_str = 1 [deprecated = true]; - - /* - The payment hash of the invoice to be looked up. When using REST, this field - must be encoded as base64. - */ - bytes r_hash = 2; -} - -message ListInvoiceRequest { - /* - If set, only invoices that are not settled and not canceled will be returned - in the response. - */ - bool pending_only = 1; - - /* - The index of an invoice that will be used as either the start or end of a - query to determine which invoices should be returned in the response. - */ - uint64 index_offset = 4; - - // The max number of invoices to return in the response to this query. - uint64 num_max_invoices = 5; - - /* - If set, the invoices returned will result from seeking backwards from the - specified index offset. This can be used to paginate backwards. - */ - bool reversed = 6; -} -message ListInvoiceResponse { - /* - A list of invoices from the time slice of the time series specified in the - request. - */ - repeated Invoice invoices = 1; - - /* - The index of the last item in the set of returned invoices. This can be used - to seek further, pagination style. - */ - uint64 last_index_offset = 2; - - /* - The index of the last item in the set of returned invoices. This can be used - to seek backwards, pagination style. - */ - uint64 first_index_offset = 3; -} - -message InvoiceSubscription { - /* - If specified (non-zero), then we'll first start by sending out - notifications for all added indexes with an add_index greater than this - value. This allows callers to catch up on any events they missed while they - weren't connected to the streaming RPC. - */ - uint64 add_index = 1; - - /* - If specified (non-zero), then we'll first start by sending out - notifications for all settled indexes with an settle_index greater than - this value. This allows callers to catch up on any events they missed while - they weren't connected to the streaming RPC. - */ - uint64 settle_index = 2; -} - -enum PaymentFailureReason { - /* - Payment isn't failed (yet). - */ - FAILURE_REASON_NONE = 0; - - /* - There are more routes to try, but the payment timeout was exceeded. - */ - FAILURE_REASON_TIMEOUT = 1; - - /* - All possible routes were tried and failed permanently. Or were no - routes to the destination at all. - */ - FAILURE_REASON_NO_ROUTE = 2; - - /* - A non-recoverable error has occured. - */ - FAILURE_REASON_ERROR = 3; - - /* - Payment details incorrect (unknown hash, invalid amt or - invalid final cltv delta) - */ - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; - - /* - Insufficient local balance. - */ - FAILURE_REASON_INSUFFICIENT_BALANCE = 5; -} - -message Payment { - // The payment hash - string payment_hash = 1; - - // Deprecated, use value_sat or value_msat. - int64 value = 2 [deprecated = true]; - - // Deprecated, use creation_time_ns - int64 creation_date = 3 [deprecated = true]; - - reserved 4; - - // Deprecated, use fee_sat or fee_msat. - int64 fee = 5 [deprecated = true]; - - // The payment preimage - string payment_preimage = 6; - - // The value of the payment in satoshis - int64 value_sat = 7; - - // The value of the payment in milli-satoshis - int64 value_msat = 8; - - // The optional payment request being fulfilled. - string payment_request = 9; - - enum PaymentStatus { - UNKNOWN = 0; - IN_FLIGHT = 1; - SUCCEEDED = 2; - FAILED = 3; - } - - // The status of the payment. - PaymentStatus status = 10; - - // The fee paid for this payment in satoshis - int64 fee_sat = 11; - - // The fee paid for this payment in milli-satoshis - int64 fee_msat = 12; - - // The time in UNIX nanoseconds at which the payment was created. - int64 creation_time_ns = 13; - - // The HTLCs made in attempt to settle the payment. - repeated HTLCAttempt htlcs = 14; - - /* - The creation index of this payment. Each payment can be uniquely identified - by this index, which may not strictly increment by 1 for payments made in - older versions of lnd. - */ - uint64 payment_index = 15; - - PaymentFailureReason failure_reason = 16; -} - -message HTLCAttempt { - // The unique ID that is used for this attempt. - uint64 attempt_id = 7; - - enum HTLCStatus { - IN_FLIGHT = 0; - SUCCEEDED = 1; - FAILED = 2; - } - - // The status of the HTLC. - HTLCStatus status = 1; - - // The route taken by this HTLC. - Route route = 2; - - // The time in UNIX nanoseconds at which this HTLC was sent. - int64 attempt_time_ns = 3; - - /* - The time in UNIX nanoseconds at which this HTLC was settled or failed. - This value will not be set if the HTLC is still IN_FLIGHT. - */ - int64 resolve_time_ns = 4; - - // Detailed htlc failure info. - Failure failure = 5; - - // The preimage that was used to settle the HTLC. - bytes preimage = 6; -} - -message ListPaymentsRequest { - /* - If true, then return payments that have not yet fully completed. This means - that pending payments, as well as failed payments will show up if this - field is set to true. This flag doesn't change the meaning of the indices, - which are tied to individual payments. - */ - bool include_incomplete = 1; - - /* - The index of a payment that will be used as either the start or end of a - query to determine which payments should be returned in the response. The - index_offset is exclusive. In the case of a zero index_offset, the query - will start with the oldest payment when paginating forwards, or will end - with the most recent payment when paginating backwards. - */ - uint64 index_offset = 2; - - // The maximal number of payments returned in the response to this query. - uint64 max_payments = 3; - - /* - If set, the payments returned will result from seeking backwards from the - specified index offset. This can be used to paginate backwards. The order - of the returned payments is always oldest first (ascending index order). - */ - bool reversed = 4; - - /* - If set, all payments (complete and incomplete, independent of the - max_payments parameter) will be counted. Note that setting this to true will - increase the run time of the call significantly on systems that have a lot - of payments, as all of them have to be iterated through to be counted. - */ - bool count_total_payments = 5; -} - -message ListPaymentsResponse { - // The list of payments - repeated Payment payments = 1; - - /* - The index of the first item in the set of returned payments. This can be - used as the index_offset to continue seeking backwards in the next request. - */ - uint64 first_index_offset = 2; - - /* - The index of the last item in the set of returned payments. This can be used - as the index_offset to continue seeking forwards in the next request. - */ - uint64 last_index_offset = 3; - - /* - Will only be set if count_total_payments in the request was set. Represents - the total number of payments (complete and incomplete, independent of the - number of payments requested in the query) currently present in the payments - database. - */ - uint64 total_num_payments = 4; -} - -message DeletePaymentRequest { - // Payment hash to delete. - bytes payment_hash = 1; - - /* - Only delete failed HTLCs from the payment, not the payment itself. - */ - bool failed_htlcs_only = 2; -} - -message DeleteAllPaymentsRequest { - // Only delete failed payments. - bool failed_payments_only = 1; - - /* - Only delete failed HTLCs from payments, not the payment itself. - */ - bool failed_htlcs_only = 2; -} - -message DeletePaymentResponse { -} - -message DeleteAllPaymentsResponse { -} - -message AbandonChannelRequest { - ChannelPoint channel_point = 1; - - bool pending_funding_shim_only = 2; - - /* - Override the requirement for being in dev mode by setting this to true and - confirming the user knows what they are doing and this is a potential foot - gun to lose funds if used on active channels. - */ - bool i_know_what_i_am_doing = 3; -} - -message AbandonChannelResponse { -} - -message DebugLevelRequest { - bool show = 1; - string level_spec = 2; -} -message DebugLevelResponse { - string sub_systems = 1; -} - -message PayReqString { - // The payment request string to be decoded - string pay_req = 1; -} -message PayReq { - string destination = 1; - string payment_hash = 2; - int64 num_satoshis = 3; - int64 timestamp = 4; - int64 expiry = 5; - string description = 6; - string description_hash = 7; - string fallback_addr = 8; - int64 cltv_expiry = 9; - repeated RouteHint route_hints = 10; - bytes payment_addr = 11; - int64 num_msat = 12; - map features = 13; -} - -enum FeatureBit { - DATALOSS_PROTECT_REQ = 0; - DATALOSS_PROTECT_OPT = 1; - INITIAL_ROUING_SYNC = 3; - UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; - UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; - GOSSIP_QUERIES_REQ = 6; - GOSSIP_QUERIES_OPT = 7; - TLV_ONION_REQ = 8; - TLV_ONION_OPT = 9; - EXT_GOSSIP_QUERIES_REQ = 10; - EXT_GOSSIP_QUERIES_OPT = 11; - STATIC_REMOTE_KEY_REQ = 12; - STATIC_REMOTE_KEY_OPT = 13; - PAYMENT_ADDR_REQ = 14; - PAYMENT_ADDR_OPT = 15; - MPP_REQ = 16; - MPP_OPT = 17; - WUMBO_CHANNELS_REQ = 18; - WUMBO_CHANNELS_OPT = 19; - ANCHORS_REQ = 20; - ANCHORS_OPT = 21; - ANCHORS_ZERO_FEE_HTLC_REQ = 22; - ANCHORS_ZERO_FEE_HTLC_OPT = 23; - AMP_REQ = 30; - AMP_OPT = 31; -} - -message Feature { - string name = 2; - bool is_required = 3; - bool is_known = 4; -} - -message FeeReportRequest { -} -message ChannelFeeReport { - // The short channel id that this fee report belongs to. - uint64 chan_id = 5 [jstype = JS_STRING]; - - // The channel that this fee report belongs to. - string channel_point = 1; - - // The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 2; - - // The amount charged per milli-satoshis transferred expressed in - // millionths of a satoshi. - int64 fee_per_mil = 3; - - // The effective fee rate in milli-satoshis. Computed by dividing the - // fee_per_mil value by 1 million. - double fee_rate = 4; -} -message FeeReportResponse { - // An array of channel fee reports which describes the current fee schedule - // for each channel. - repeated ChannelFeeReport channel_fees = 1; - - // The total amount of fee revenue (in satoshis) the switch has collected - // over the past 24 hrs. - uint64 day_fee_sum = 2; - - // The total amount of fee revenue (in satoshis) the switch has collected - // over the past 1 week. - uint64 week_fee_sum = 3; - - // The total amount of fee revenue (in satoshis) the switch has collected - // over the past 1 month. - uint64 month_fee_sum = 4; -} - -message PolicyUpdateRequest { - oneof scope { - // If set, then this update applies to all currently active channels. - bool global = 1; - - // If set, this update will target a specific channel. - ChannelPoint chan_point = 2; - } - - // The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 3; - - // The effective fee rate in milli-satoshis. The precision of this value - // goes up to 6 decimal places, so 1e-6. - double fee_rate = 4; - - // The effective fee rate in micro-satoshis (parts per million). - uint32 fee_rate_ppm = 9; - - // The required timelock delta for HTLCs forwarded over the channel. - uint32 time_lock_delta = 5; - - // If set, the maximum HTLC size in milli-satoshis. If unset, the maximum - // HTLC will be unchanged. - uint64 max_htlc_msat = 6; - - // The minimum HTLC size in milli-satoshis. Only applied if - // min_htlc_msat_specified is true. - uint64 min_htlc_msat = 7; - - // If true, min_htlc_msat is applied. - bool min_htlc_msat_specified = 8; -} -enum UpdateFailure { - UPDATE_FAILURE_UNKNOWN = 0; - UPDATE_FAILURE_PENDING = 1; - UPDATE_FAILURE_NOT_FOUND = 2; - UPDATE_FAILURE_INTERNAL_ERR = 3; - UPDATE_FAILURE_INVALID_PARAMETER = 4; -} - -message FailedUpdate { - // The outpoint in format txid:n - OutPoint outpoint = 1; - - // Reason for the policy update failure. - UpdateFailure reason = 2; - - // A string representation of the policy update error. - string update_error = 3; -} - -message PolicyUpdateResponse { - // List of failed policy updates. - repeated FailedUpdate failed_updates = 1; -} - -message ForwardingHistoryRequest { - // Start time is the starting point of the forwarding history request. All - // records beyond this point will be included, respecting the end time, and - // the index offset. - uint64 start_time = 1; - - // End time is the end point of the forwarding history request. The - // response will carry at most 50k records between the start time and the - // end time. The index offset can be used to implement pagination. - uint64 end_time = 2; - - // Index offset is the offset in the time series to start at. As each - // response can only contain 50k records, callers can use this to skip - // around within a packed time series. - uint32 index_offset = 3; - - // The max number of events to return in the response to this query. - uint32 num_max_events = 4; - - // Informs the server if the peer alias should be looked up for each - // forwarding event. - bool peer_alias_lookup = 5; -} -message ForwardingEvent { - // Timestamp is the time (unix epoch offset) that this circuit was - // completed. Deprecated by timestamp_ns. - uint64 timestamp = 1 [deprecated = true]; - - // The incoming channel ID that carried the HTLC that created the circuit. - uint64 chan_id_in = 2 [jstype = JS_STRING]; - - // The outgoing channel ID that carried the preimage that completed the - // circuit. - uint64 chan_id_out = 4 [jstype = JS_STRING]; - - // The total amount (in satoshis) of the incoming HTLC that created half - // the circuit. - uint64 amt_in = 5; - - // The total amount (in satoshis) of the outgoing HTLC that created the - // second half of the circuit. - uint64 amt_out = 6; - - // The total fee (in satoshis) that this payment circuit carried. - uint64 fee = 7; - - // The total fee (in milli-satoshis) that this payment circuit carried. - uint64 fee_msat = 8; - - // The total amount (in milli-satoshis) of the incoming HTLC that created - // half the circuit. - uint64 amt_in_msat = 9; - - // The total amount (in milli-satoshis) of the outgoing HTLC that created - // the second half of the circuit. - uint64 amt_out_msat = 10; - - // The number of nanoseconds elapsed since January 1, 1970 UTC when this - // circuit was completed. - uint64 timestamp_ns = 11; - - // The peer alias of the incoming channel. - string peer_alias_in = 12; - - // The peer alias of the outgoing channel. - string peer_alias_out = 13; - - // TODO(roasbeef): add settlement latency? - // * use FPE on the chan id? - // * also list failures? -} -message ForwardingHistoryResponse { - // A list of forwarding events from the time slice of the time series - // specified in the request. - repeated ForwardingEvent forwarding_events = 1; - - // The index of the last time in the set of returned forwarding events. Can - // be used to seek further, pagination style. - uint32 last_offset_index = 2; -} - -message ExportChannelBackupRequest { - // The target channel point to obtain a back up for. - ChannelPoint chan_point = 1; -} - -message ChannelBackup { - /* - Identifies the channel that this backup belongs to. - */ - ChannelPoint chan_point = 1; - - /* - Is an encrypted single-chan backup. this can be passed to - RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in - order to trigger the recovery protocol. When using REST, this field must be - encoded as base64. - */ - bytes chan_backup = 2; -} - -message MultiChanBackup { - /* - Is the set of all channels that are included in this multi-channel backup. - */ - repeated ChannelPoint chan_points = 1; - - /* - A single encrypted blob containing all the static channel backups of the - channel listed above. This can be stored as a single file or blob, and - safely be replaced with any prior/future versions. When using REST, this - field must be encoded as base64. - */ - bytes multi_chan_backup = 2; -} - -message ChanBackupExportRequest { -} -message ChanBackupSnapshot { - /* - The set of new channels that have been added since the last channel backup - snapshot was requested. - */ - ChannelBackups single_chan_backups = 1; - - /* - A multi-channel backup that covers all open channels currently known to - lnd. - */ - MultiChanBackup multi_chan_backup = 2; -} - -message ChannelBackups { - /* - A set of single-chan static channel backups. - */ - repeated ChannelBackup chan_backups = 1; -} - -message RestoreChanBackupRequest { - oneof backup { - /* - The channels to restore as a list of channel/backup pairs. - */ - ChannelBackups chan_backups = 1; - - /* - The channels to restore in the packed multi backup format. When using - REST, this field must be encoded as base64. - */ - bytes multi_chan_backup = 2; - } -} -message RestoreBackupResponse { -} - -message ChannelBackupSubscription { -} - -message VerifyChanBackupResponse { -} - -message MacaroonPermission { - // The entity a permission grants access to. - string entity = 1; - - // The action that is granted. - string action = 2; -} -message BakeMacaroonRequest { - // The list of permissions the new macaroon should grant. - repeated MacaroonPermission permissions = 1; - - // The root key ID used to create the macaroon, must be a positive integer. - uint64 root_key_id = 2; - - /* - Informs the RPC on whether to allow external permissions that LND is not - aware of. - */ - bool allow_external_permissions = 3; -} -message BakeMacaroonResponse { - // The hex encoded macaroon, serialized in binary format. - string macaroon = 1; -} - -message ListMacaroonIDsRequest { -} -message ListMacaroonIDsResponse { - // The list of root key IDs that are in use. - repeated uint64 root_key_ids = 1; -} - -message DeleteMacaroonIDRequest { - // The root key ID to be removed. - uint64 root_key_id = 1; -} -message DeleteMacaroonIDResponse { - // A boolean indicates that the deletion is successful. - bool deleted = 1; -} - -message MacaroonPermissionList { - // A list of macaroon permissions. - repeated MacaroonPermission permissions = 1; -} - -message ListPermissionsRequest { -} -message ListPermissionsResponse { - /* - A map between all RPC method URIs and their required macaroon permissions to - access them. - */ - map method_permissions = 1; -} - -message Failure { - enum FailureCode { - /* - The numbers assigned in this enumeration match the failure codes as - defined in BOLT #4. Because protobuf 3 requires enums to start with 0, - a RESERVED value is added. - */ - RESERVED = 0; - - INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; - INCORRECT_PAYMENT_AMOUNT = 2; - FINAL_INCORRECT_CLTV_EXPIRY = 3; - FINAL_INCORRECT_HTLC_AMOUNT = 4; - FINAL_EXPIRY_TOO_SOON = 5; - INVALID_REALM = 6; - EXPIRY_TOO_SOON = 7; - INVALID_ONION_VERSION = 8; - INVALID_ONION_HMAC = 9; - INVALID_ONION_KEY = 10; - AMOUNT_BELOW_MINIMUM = 11; - FEE_INSUFFICIENT = 12; - INCORRECT_CLTV_EXPIRY = 13; - CHANNEL_DISABLED = 14; - TEMPORARY_CHANNEL_FAILURE = 15; - REQUIRED_NODE_FEATURE_MISSING = 16; - REQUIRED_CHANNEL_FEATURE_MISSING = 17; - UNKNOWN_NEXT_PEER = 18; - TEMPORARY_NODE_FAILURE = 19; - PERMANENT_NODE_FAILURE = 20; - PERMANENT_CHANNEL_FAILURE = 21; - EXPIRY_TOO_FAR = 22; - MPP_TIMEOUT = 23; - INVALID_ONION_PAYLOAD = 24; - - /* - An internal error occurred. - */ - INTERNAL_FAILURE = 997; - - /* - The error source is known, but the failure itself couldn't be decoded. - */ - UNKNOWN_FAILURE = 998; - - /* - An unreadable failure result is returned if the received failure message - cannot be decrypted. In that case the error source is unknown. - */ - UNREADABLE_FAILURE = 999; - } - - // Failure code as defined in the Lightning spec - FailureCode code = 1; - - reserved 2; - - // An optional channel update message. - ChannelUpdate channel_update = 3; - - // A failure type-dependent htlc value. - uint64 htlc_msat = 4; - - // The sha256 sum of the onion payload. - bytes onion_sha_256 = 5; - - // A failure type-dependent cltv expiry value. - uint32 cltv_expiry = 6; - - // A failure type-dependent flags value. - uint32 flags = 7; - - /* - The position in the path of the intermediate or final node that generated - the failure message. Position zero is the sender node. - **/ - uint32 failure_source_index = 8; - - // A failure type-dependent block height. - uint32 height = 9; -} - -message ChannelUpdate { - /* - The signature that validates the announced data and proves the ownership - of node id. - */ - bytes signature = 1; - - /* - The target chain that this channel was opened within. This value - should be the genesis hash of the target chain. Along with the short - channel ID, this uniquely identifies the channel globally in a - blockchain. - */ - bytes chain_hash = 2; - - /* - The unique description of the funding transaction. - */ - uint64 chan_id = 3 [jstype = JS_STRING]; - - /* - A timestamp that allows ordering in the case of multiple announcements. - We should ignore the message if timestamp is not greater than the - last-received. - */ - uint32 timestamp = 4; - - /* - The bitfield that describes whether optional fields are present in this - update. Currently, the least-significant bit must be set to 1 if the - optional field MaxHtlc is present. - */ - uint32 message_flags = 10; - - /* - The bitfield that describes additional meta-data concerning how the - update is to be interpreted. Currently, the least-significant bit must be - set to 0 if the creating node corresponds to the first node in the - previously sent channel announcement and 1 otherwise. If the second bit - is set, then the channel is set to be disabled. - */ - uint32 channel_flags = 5; - - /* - The minimum number of blocks this node requires to be added to the expiry - of HTLCs. This is a security parameter determined by the node operator. - This value represents the required gap between the time locks of the - incoming and outgoing HTLC's set to this node. - */ - uint32 time_lock_delta = 6; - - /* - The minimum HTLC value which will be accepted. - */ - uint64 htlc_minimum_msat = 7; - - /* - The base fee that must be used for incoming HTLC's to this particular - channel. This value will be tacked onto the required for a payment - independent of the size of the payment. - */ - uint32 base_fee = 8; - - /* - The fee rate that will be charged per millionth of a satoshi. - */ - uint32 fee_rate = 9; - - /* - The maximum HTLC value which will be accepted. - */ - uint64 htlc_maximum_msat = 11; - - /* - The set of data that was appended to this message, some of which we may - not actually know how to iterate or parse. By holding onto this data, we - ensure that we're able to properly validate the set of signatures that - cover these new fields, and ensure we're able to make upgrades to the - network in a forwards compatible manner. - */ - bytes extra_opaque_data = 12; -} - -message MacaroonId { - bytes nonce = 1; - bytes storageId = 2; - repeated Op ops = 3; -} - -message Op { - string entity = 1; - repeated string actions = 2; -} - -message CheckMacPermRequest { - bytes macaroon = 1; - repeated MacaroonPermission permissions = 2; - string fullMethod = 3; -} - -message CheckMacPermResponse { - bool valid = 1; -} - -message RPCMiddlewareRequest { - /* - The unique ID of the intercepted original gRPC request. Useful for mapping - request to response when implementing full duplex message interception. For - streaming requests, this will be the same ID for all incoming and outgoing - middleware intercept messages of the _same_ stream. - */ - uint64 request_id = 1; - - /* - The raw bytes of the complete macaroon as sent by the gRPC client in the - original request. This might be empty for a request that doesn't require - macaroons such as the wallet unlocker RPCs. - */ - bytes raw_macaroon = 2; - - /* - The parsed condition of the macaroon's custom caveat for convenient access. - This field only contains the value of the custom caveat that the handling - middleware has registered itself for. The condition _must_ be validated for - messages of intercept_type stream_auth and request! - */ - string custom_caveat_condition = 3; - - /* - There are three types of messages that will be sent to the middleware for - inspection and approval: Stream authentication, request and response - interception. The first two can only be accepted (=forward to main RPC - server) or denied (=return error to client). Intercepted responses can also - be replaced/overwritten. - */ - oneof intercept_type { - /* - Intercept stream authentication: each new streaming RPC call that is - initiated against lnd and contains the middleware's custom macaroon - caveat can be approved or denied based upon the macaroon in the stream - header. This message will only be sent for streaming RPCs, unary RPCs - must handle the macaroon authentication in the request interception to - avoid an additional message round trip between lnd and the middleware. - */ - StreamAuth stream_auth = 4; - - /* - Intercept incoming gRPC client request message: all incoming messages, - both on streaming and unary RPCs, are forwarded to the middleware for - inspection. For unary RPC messages the middleware is also expected to - validate the custom macaroon caveat of the request. - */ - RPCMessage request = 5; - - /* - Intercept outgoing gRPC response message: all outgoing messages, both on - streaming and unary RPCs, are forwarded to the middleware for inspection - and amendment. The response in this message is the original response as - it was generated by the main RPC server. It can either be accepted - (=forwarded to the client), replaced/overwritten with a new message of - the same type, or replaced by an error message. - */ - RPCMessage response = 6; - - /* - This is used to indicate to the client that the server has successfully - registered the interceptor. This is only used in the very first message - that the server sends to the client after the client sends the server - the middleware registration message. - */ - bool reg_complete = 8; - } - - /* - The unique message ID of this middleware intercept message. There can be - multiple middleware intercept messages per single gRPC request (one for the - incoming request and one for the outgoing response) or gRPC stream (one for - each incoming message and one for each outgoing response). This message ID - must be referenced when responding (accepting/rejecting/modifying) to an - intercept message. - */ - uint64 msg_id = 7; -} - -message StreamAuth { - /* - The full URI (in the format /./MethodName, for - example /lnrpc.Lightning/GetInfo) of the streaming RPC method that was just - established. - */ - string method_full_uri = 1; -} - -message RPCMessage { - /* - The full URI (in the format /./MethodName, for - example /lnrpc.Lightning/GetInfo) of the RPC method the message was sent - to/from. - */ - string method_full_uri = 1; - - /* - Indicates whether the message was sent over a streaming RPC method or not. - */ - bool stream_rpc = 2; - - /* - The full canonical gRPC name of the message type (in the format - .TypeName, for example lnrpc.GetInfoRequest). In case of an - error being returned from lnd, this simply contains the string "error". - */ - string type_name = 3; - - /* - The full content of the gRPC message, serialized in the binary protobuf - format. - */ - bytes serialized = 4; - - /* - Indicates that the response from lnd was an error, not a gRPC response. If - this is set to true then the type_name contains the string "error" and - serialized contains the error string. - */ - bool is_error = 5; -} - -message RPCMiddlewareResponse { - /* - The request message ID this response refers to. Must always be set when - giving feedback to an intercept but is ignored for the initial registration - message. - */ - uint64 ref_msg_id = 1; - - /* - The middleware can only send two types of messages to lnd: The initial - registration message that identifies the middleware and after that only - feedback messages to requests sent to the middleware. - */ - oneof middleware_message { - /* - The registration message identifies the middleware that's being - registered in lnd. The registration message must be sent immediately - after initiating the RegisterRpcMiddleware stream, otherwise lnd will - time out the attempt and terminate the request. NOTE: The middleware - will only receive interception messages for requests that contain a - macaroon with the custom caveat that the middleware declares it is - responsible for handling in the registration message! As a security - measure, _no_ middleware can intercept requests made with _unencumbered_ - macaroons! - */ - MiddlewareRegistration register = 2; - - /* - The middleware received an interception request and gives feedback to - it. The request_id indicates what message the feedback refers to. - */ - InterceptFeedback feedback = 3; - } -} - -message MiddlewareRegistration { - /* - The name of the middleware to register. The name should be as informative - as possible and is logged on registration. - */ - string middleware_name = 1; - - /* - The name of the custom macaroon caveat that this middleware is responsible - for. Only requests/responses that contain a macaroon with the registered - custom caveat are forwarded for interception to the middleware. The - exception being the read-only mode: All requests/responses are forwarded to - a middleware that requests read-only access but such a middleware won't be - allowed to _alter_ responses. As a security measure, _no_ middleware can - change responses to requests made with _unencumbered_ macaroons! - NOTE: Cannot be used at the same time as read_only_mode. - */ - string custom_macaroon_caveat_name = 2; - - /* - Instead of defining a custom macaroon caveat name a middleware can register - itself for read-only access only. In that mode all requests/responses are - forwarded to the middleware but the middleware isn't allowed to alter any of - the responses. - NOTE: Cannot be used at the same time as custom_macaroon_caveat_name. - */ - bool read_only_mode = 3; -} - -message InterceptFeedback { - /* - The error to return to the user. If this is non-empty, the incoming gRPC - stream/request is aborted and the error is returned to the gRPC client. If - this value is empty, it means the middleware accepts the stream/request/ - response and the processing of it can continue. - */ - string error = 1; - - /* - A boolean indicating that the gRPC message should be replaced/overwritten. - This boolean is needed because in protobuf an empty message is serialized as - a 0-length or nil byte slice and we wouldn't be able to distinguish between - an empty replacement message and the "don't replace anything" case. - */ - bool replace_response = 2; - - /* - If the replace_response field is set to true, this field must contain the - binary serialized gRPC message in the protobuf format. - */ - bytes replacement_serialized = 3; +syntax = "proto3"; + +package lnrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc"; + +/* + * Comments in this file will be directly parsed into the API + * Documentation as descriptions of the associated method, message, or field. + * These descriptions should go right above the definition of the object, and + * can be in either block or // comment format. + * + * An RPC method can be matched to an lncli command by placing a line in the + * beginning of the description in exactly the following format: + * lncli: `methodname` + * + * Failure to specify the exact name of the command will cause documentation + * generation to fail. + * + * More information on how exactly the gRPC documentation is generated from + * this proto file can be found here: + * https://github.com/lightninglabs/lightning-api + */ + +// Lightning is the main RPC server of the daemon. +service Lightning { + /* lncli: `walletbalance` + WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + confirmed unspent outputs and all unconfirmed unspent outputs under control + of the wallet. + */ + rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse); + + /* lncli: `channelbalance` + ChannelBalance returns a report on the total funds across all open channels, + categorized in local/remote, pending local/remote and unsettled local/remote + balances. + */ + rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse); + + /* lncli: `listchaintxns` + GetTransactions returns a list describing all the known transactions + relevant to the wallet. + */ + rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails); + + /* lncli: `estimatefee` + EstimateFee asks the chain backend to estimate the fee rate and total fees + for a transaction that pays to multiple specified outputs. + + When using REST, the `AddrToAmount` map type can be set by appending + `&AddrToAmount[
]=` to the URL. Unfortunately this + map type doesn't appear in the REST API documentation because of a bug in + the grpc-gateway library. + */ + rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse); + + /* lncli: `sendcoins` + SendCoins executes a request to send coins to a particular address. Unlike + SendMany, this RPC call only allows creating a single output at a time. If + neither target_conf, or sat_per_vbyte are set, then the internal wallet will + consult its fee model to determine a fee for the default confirmation + target. + */ + rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse); + + /* lncli: `listunspent` + Deprecated, use walletrpc.ListUnspent instead. + + ListUnspent returns a list of all utxos spendable by the wallet with a + number of confirmations between the specified minimum and maximum. + */ + rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse); + + /* + SubscribeTransactions creates a uni-directional stream from the server to + the client in which any newly discovered transactions relevant to the + wallet are sent over. + */ + rpc SubscribeTransactions (GetTransactionsRequest) + returns (stream Transaction); + + /* lncli: `sendmany` + SendMany handles a request for a transaction that creates multiple specified + outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then + the internal wallet will consult its fee model to determine a fee for the + default confirmation target. + */ + rpc SendMany (SendManyRequest) returns (SendManyResponse); + + /* lncli: `newaddress` + NewAddress creates a new address under control of the local wallet. + */ + rpc NewAddress (NewAddressRequest) returns (NewAddressResponse); + + /* lncli: `signmessage` + SignMessage signs a message with this node's private key. The returned + signature string is `zbase32` encoded and pubkey recoverable, meaning that + only the message digest and signature are needed for verification. + */ + rpc SignMessage (SignMessageRequest) returns (SignMessageResponse); + + /* lncli: `verifymessage` + VerifyMessage verifies a signature over a msg. The signature must be + zbase32 encoded and signed by an active node in the resident node's + channel database. In addition to returning the validity of the signature, + VerifyMessage also returns the recovered pubkey from the signature. + */ + rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse); + + /* lncli: `connect` + ConnectPeer attempts to establish a connection to a remote peer. This is at + the networking level, and is used for communication between nodes. This is + distinct from establishing a channel with a peer. + */ + rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse); + + /* lncli: `disconnect` + DisconnectPeer attempts to disconnect one peer from another identified by a + given pubKey. In the case that we currently have a pending or active channel + with the target peer, then this action will be not be allowed. + */ + rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse); + + /* lncli: `listpeers` + ListPeers returns a verbose listing of all currently active peers. + */ + rpc ListPeers (ListPeersRequest) returns (ListPeersResponse); + + /* + SubscribePeerEvents creates a uni-directional stream from the server to + the client in which any events relevant to the state of peers are sent + over. Events include peers going online and offline. + */ + rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent); + + /* lncli: `getinfo` + GetInfo returns general information concerning the lightning node including + it's identity pubkey, alias, the chains it is connected to, and information + concerning the number of open+pending channels. + */ + rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); + + /** lncli: `getrecoveryinfo` + GetRecoveryInfo returns information concerning the recovery mode including + whether it's in a recovery mode, whether the recovery is finished, and the + progress made so far. + */ + rpc GetRecoveryInfo (GetRecoveryInfoRequest) + returns (GetRecoveryInfoResponse); + + // TODO(roasbeef): merge with below with bool? + /* lncli: `pendingchannels` + PendingChannels returns a list of all the channels that are currently + considered "pending". A channel is pending if it has finished the funding + workflow and is waiting for confirmations for the funding txn, or is in the + process of closure, either initiated cooperatively or non-cooperatively. + */ + rpc PendingChannels (PendingChannelsRequest) + returns (PendingChannelsResponse); + + /* lncli: `listchannels` + ListChannels returns a description of all the open channels that this node + is a participant in. + */ + rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse); + + /* + SubscribeChannelEvents creates a uni-directional stream from the server to + the client in which any updates relevant to the state of the channels are + sent over. Events include new active channels, inactive channels, and closed + channels. + */ + rpc SubscribeChannelEvents (ChannelEventSubscription) + returns (stream ChannelEventUpdate); + + /* lncli: `closedchannels` + ClosedChannels returns a description of all the closed channels that + this node was a participant in. + */ + rpc ClosedChannels (ClosedChannelsRequest) returns (ClosedChannelsResponse); + + /* + OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + call is meant to be consumed by clients to the REST proxy. As with all + other sync calls, all byte slices are intended to be populated as hex + encoded strings. + */ + rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint); + + /* lncli: `openchannel` + OpenChannel attempts to open a singly funded channel specified in the + request to a remote peer. Users are able to specify a target number of + blocks that the funding transaction should be confirmed in, or a manual fee + rate to us for the funding transaction. If neither are specified, then a + lax block confirmation target is used. Each OpenStatusUpdate will return + the pending channel ID of the in-progress channel. Depending on the + arguments specified in the OpenChannelRequest, this pending channel ID can + then be used to manually progress the channel funding flow. + */ + rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate); + + /* lncli: `batchopenchannel` + BatchOpenChannel attempts to open multiple single-funded channels in a + single transaction in an atomic way. This means either all channel open + requests succeed at once or all attempts are aborted if any of them fail. + This is the safer variant of using PSBTs to manually fund a batch of + channels through the OpenChannel RPC. + */ + rpc BatchOpenChannel (BatchOpenChannelRequest) + returns (BatchOpenChannelResponse); + + /* + FundingStateStep is an advanced funding related call that allows the caller + to either execute some preparatory steps for a funding workflow, or + manually progress a funding workflow. The primary way a funding flow is + identified is via its pending channel ID. As an example, this method can be + used to specify that we're expecting a funding flow for a particular + pending channel ID, for which we need to use specific parameters. + Alternatively, this can be used to interactively drive PSBT signing for + funding for partially complete funding transactions. + */ + rpc FundingStateStep (FundingTransitionMsg) returns (FundingStateStepResp); + + /* + ChannelAcceptor dispatches a bi-directional streaming RPC in which + OpenChannel requests are sent to the client and the client responds with + a boolean that tells LND whether or not to accept the channel. This allows + node operators to specify their own criteria for accepting inbound channels + through a single persistent connection. + */ + rpc ChannelAcceptor (stream ChannelAcceptResponse) + returns (stream ChannelAcceptRequest); + + /* lncli: `closechannel` + CloseChannel attempts to close an active channel identified by its channel + outpoint (ChannelPoint). The actions of this method can additionally be + augmented to attempt a force close after a timeout period in the case of an + inactive peer. If a non-force close (cooperative closure) is requested, + then the user can specify either a target number of blocks until the + closure transaction is confirmed, or a manual fee rate. If neither are + specified, then a default lax, block confirmation target is used. + */ + rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate); + + /* lncli: `abandonchannel` + AbandonChannel removes all channel state from the database except for a + close summary. This method can be used to get rid of permanently unusable + channels due to bugs fixed in newer versions of lnd. This method can also be + used to remove externally funded channels where the funding transaction was + never broadcast. Only available for non-externally funded channels in dev + build. + */ + rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse); + + /* lncli: `sendpayment` + Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a + bi-directional streaming RPC for sending payments through the Lightning + Network. A single RPC invocation creates a persistent bi-directional + stream allowing clients to rapidly send payments through the Lightning + Network with a single persistent connection. + */ + rpc SendPayment (stream SendRequest) returns (stream SendResponse) { + option deprecated = true; + } + + /* + SendPaymentSync is the synchronous non-streaming version of SendPayment. + This RPC is intended to be consumed by clients of the REST proxy. + Additionally, this RPC expects the destination's public key and the payment + hash (if any) to be encoded as hex strings. + */ + rpc SendPaymentSync (SendRequest) returns (SendResponse); + + /* lncli: `sendtoroute` + Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional + streaming RPC for sending payment through the Lightning Network. This + method differs from SendPayment in that it allows users to specify a full + route manually. This can be used for things like rebalancing, and atomic + swaps. + */ + rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse) { + option deprecated = true; + } + + /* + SendToRouteSync is a synchronous version of SendToRoute. It Will block + until the payment either fails or succeeds. + */ + rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse); + + /* lncli: `addinvoice` + AddInvoice attempts to add a new invoice to the invoice database. Any + duplicated invoices are rejected, therefore all invoices *must* have a + unique payment preimage. + */ + rpc AddInvoice (Invoice) returns (AddInvoiceResponse); + + /* lncli: `listinvoices` + ListInvoices returns a list of all the invoices currently stored within the + database. Any active debug invoices are ignored. It has full support for + paginated responses, allowing users to query for specific invoices through + their add_index. This can be done by using either the first_index_offset or + last_index_offset fields included in the response as the index_offset of the + next request. By default, the first 100 invoices created will be returned. + Backwards pagination is also supported through the Reversed flag. + */ + rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse); + + /* lncli: `lookupinvoice` + LookupInvoice attempts to look up an invoice according to its payment hash. + The passed payment hash *must* be exactly 32 bytes, if not, an error is + returned. + */ + rpc LookupInvoice (PaymentHash) returns (Invoice); + + /* + SubscribeInvoices returns a uni-directional stream (server -> client) for + notifying the client of newly added/settled invoices. The caller can + optionally specify the add_index and/or the settle_index. If the add_index + is specified, then we'll first start by sending add invoice events for all + invoices with an add_index greater than the specified value. If the + settle_index is specified, the next, we'll send out all settle events for + invoices with a settle_index greater than the specified value. One or both + of these fields can be set. If no fields are set, then we'll only send out + the latest add/settle events. + */ + rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice); + + /* lncli: `decodepayreq` + DecodePayReq takes an encoded payment request string and attempts to decode + it, returning a full description of the conditions encoded within the + payment request. + */ + rpc DecodePayReq (PayReqString) returns (PayReq); + + /* lncli: `listpayments` + ListPayments returns a list of all outgoing payments. + */ + rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse); + + /* + DeletePayment deletes an outgoing payment from DB. Note that it will not + attempt to delete an In-Flight payment, since that would be unsafe. + */ + rpc DeletePayment (DeletePaymentRequest) returns (DeletePaymentResponse); + + /* + DeleteAllPayments deletes all outgoing payments from DB. Note that it will + not attempt to delete In-Flight payments, since that would be unsafe. + */ + rpc DeleteAllPayments (DeleteAllPaymentsRequest) + returns (DeleteAllPaymentsResponse); + + /* lncli: `describegraph` + DescribeGraph returns a description of the latest graph state from the + point of view of the node. The graph information is partitioned into two + components: all the nodes/vertexes, and all the edges that connect the + vertexes themselves. As this is a directed graph, the edges also contain + the node directional specific routing policy which includes: the time lock + delta, fee information, etc. + */ + rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph); + + /* lncli: `getnodemetrics` + GetNodeMetrics returns node metrics calculated from the graph. Currently + the only supported metric is betweenness centrality of individual nodes. + */ + rpc GetNodeMetrics (NodeMetricsRequest) returns (NodeMetricsResponse); + + /* lncli: `getchaninfo` + GetChanInfo returns the latest authenticated network announcement for the + given channel identified by its channel ID: an 8-byte integer which + uniquely identifies the location of transaction's funding output within the + blockchain. + */ + rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge); + + /* lncli: `getnodeinfo` + GetNodeInfo returns the latest advertised, aggregated, and authenticated + channel information for the specified node identified by its public key. + */ + rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo); + + /* lncli: `queryroutes` + QueryRoutes attempts to query the daemon's Channel Router for a possible + route to a target destination capable of carrying a specific amount of + satoshis. The returned route contains the full details required to craft and + send an HTLC, also including the necessary information that should be + present within the Sphinx packet encapsulated within the HTLC. + + When using REST, the `dest_custom_records` map type can be set by appending + `&dest_custom_records[]=` + to the URL. Unfortunately this map type doesn't appear in the REST API + documentation because of a bug in the grpc-gateway library. + */ + rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse); + + /* lncli: `getnetworkinfo` + GetNetworkInfo returns some basic stats about the known channel graph from + the point of view of the node. + */ + rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo); + + /* lncli: `stop` + StopDaemon will send a shutdown request to the interrupt handler, triggering + a graceful shutdown of the daemon. + */ + rpc StopDaemon (StopRequest) returns (StopResponse); + + /* + SubscribeChannelGraph launches a streaming RPC that allows the caller to + receive notifications upon any changes to the channel graph topology from + the point of view of the responding node. Events notified include: new + nodes coming online, nodes updating their authenticated attributes, new + channels being advertised, updates in the routing policy for a directional + channel edge, and when channels are closed on-chain. + */ + rpc SubscribeChannelGraph (GraphTopologySubscription) + returns (stream GraphTopologyUpdate); + + /* lncli: `debuglevel` + DebugLevel allows a caller to programmatically set the logging verbosity of + lnd. The logging can be targeted according to a coarse daemon-wide logging + level, or in a granular fashion to specify the logging for a target + sub-system. + */ + rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse); + + /* lncli: `feereport` + FeeReport allows the caller to obtain a report detailing the current fee + schedule enforced by the node globally for each channel. + */ + rpc FeeReport (FeeReportRequest) returns (FeeReportResponse); + + /* lncli: `updatechanpolicy` + UpdateChannelPolicy allows the caller to update the fee schedule and + channel policies for all channels globally, or a particular channel. + */ + rpc UpdateChannelPolicy (PolicyUpdateRequest) + returns (PolicyUpdateResponse); + + /* lncli: `fwdinghistory` + ForwardingHistory allows the caller to query the htlcswitch for a record of + all HTLCs forwarded within the target time range, and integer offset + within that time range, for a maximum number of events. If no maximum number + of events is specified, up to 100 events will be returned. If no time-range + is specified, then events will be returned in the order that they occured. + + A list of forwarding events are returned. The size of each forwarding event + is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. + As a result each message can only contain 50k entries. Each response has + the index offset of the last entry. The index offset can be provided to the + request to allow the caller to skip a series of records. + */ + rpc ForwardingHistory (ForwardingHistoryRequest) + returns (ForwardingHistoryResponse); + + /* lncli: `exportchanbackup` + ExportChannelBackup attempts to return an encrypted static channel backup + for the target channel identified by it channel point. The backup is + encrypted with a key generated from the aezeed seed of the user. The + returned backup can either be restored using the RestoreChannelBackup + method once lnd is running, or via the InitWallet and UnlockWallet methods + from the WalletUnlocker service. + */ + rpc ExportChannelBackup (ExportChannelBackupRequest) + returns (ChannelBackup); + + /* + ExportAllChannelBackups returns static channel backups for all existing + channels known to lnd. A set of regular singular static channel backups for + each channel are returned. Additionally, a multi-channel backup is returned + as well, which contains a single encrypted blob containing the backups of + each channel. + */ + rpc ExportAllChannelBackups (ChanBackupExportRequest) + returns (ChanBackupSnapshot); + + /* + VerifyChanBackup allows a caller to verify the integrity of a channel backup + snapshot. This method will accept either a packed Single or a packed Multi. + Specifying both will result in an error. + */ + rpc VerifyChanBackup (ChanBackupSnapshot) + returns (VerifyChanBackupResponse); + + /* lncli: `restorechanbackup` + RestoreChannelBackups accepts a set of singular channel backups, or a + single encrypted multi-chan backup and attempts to recover any funds + remaining within the channel. If we are able to unpack the backup, then the + new channel will be shown under listchannels, as well as pending channels. + */ + rpc RestoreChannelBackups (RestoreChanBackupRequest) + returns (RestoreBackupResponse); + + /* + SubscribeChannelBackups allows a client to sub-subscribe to the most up to + date information concerning the state of all channel backups. Each time a + new channel is added, we return the new set of channels, along with a + multi-chan backup containing the backup info for all channels. Each time a + channel is closed, we send a new update, which contains new new chan back + ups, but the updated set of encrypted multi-chan backups with the closed + channel(s) removed. + */ + rpc SubscribeChannelBackups (ChannelBackupSubscription) + returns (stream ChanBackupSnapshot); + + /* lncli: `bakemacaroon` + BakeMacaroon allows the creation of a new macaroon with custom read and + write permissions. No first-party caveats are added since this can be done + offline. + */ + rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse); + + /* lncli: `listmacaroonids` + ListMacaroonIDs returns all root key IDs that are in use. + */ + rpc ListMacaroonIDs (ListMacaroonIDsRequest) + returns (ListMacaroonIDsResponse); + + /* lncli: `deletemacaroonid` + DeleteMacaroonID deletes the specified macaroon ID and invalidates all + macaroons derived from that ID. + */ + rpc DeleteMacaroonID (DeleteMacaroonIDRequest) + returns (DeleteMacaroonIDResponse); + + /* lncli: `listpermissions` + ListPermissions lists all RPC method URIs and their required macaroon + permissions to access them. + */ + rpc ListPermissions (ListPermissionsRequest) + returns (ListPermissionsResponse); + + /* + CheckMacaroonPermissions checks whether a request follows the constraints + imposed on the macaroon and that the macaroon is authorized to follow the + provided permissions. + */ + rpc CheckMacaroonPermissions (CheckMacPermRequest) + returns (CheckMacPermResponse); + + /* + RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A + gRPC middleware is software component external to lnd that aims to add + additional business logic to lnd by observing/intercepting/validating + incoming gRPC client requests and (if needed) replacing/overwriting outgoing + messages before they're sent to the client. When registering the middleware + must identify itself and indicate what custom macaroon caveats it wants to + be responsible for. Only requests that contain a macaroon with that specific + custom caveat are then sent to the middleware for inspection. The other + option is to register for the read-only mode in which all requests/responses + are forwarded for interception to the middleware but the middleware is not + allowed to modify any responses. As a security measure, _no_ middleware can + modify responses for requests made with _unencumbered_ macaroons! + */ + rpc RegisterRPCMiddleware (stream RPCMiddlewareResponse) + returns (stream RPCMiddlewareRequest); + + /* lncli: `sendcustom` + SendCustomMessage sends a custom peer message. + */ + rpc SendCustomMessage (SendCustomMessageRequest) + returns (SendCustomMessageResponse); + + /* lncli: `subscribecustom` + SubscribeCustomMessages subscribes to a stream of incoming custom peer + messages. + */ + rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest) + returns (stream CustomMessage); + + /* lncli: `listaliases` + ListAliases returns the set of all aliases that have ever existed with + their confirmed SCID (if it exists) and/or the base SCID (in the case of + zero conf). + */ + rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse); + + rpc LookupHtlc (LookupHtlcRequest) returns (LookupHtlcResponse); +} + +message LookupHtlcRequest { + uint64 chan_id = 1; + + uint64 htlc_index = 2; +} + +message LookupHtlcResponse { + bool settled = 1; + + bool offchain = 2; +} + +message SubscribeCustomMessagesRequest { +} + +message CustomMessage { + // Peer from which the message originates + bytes peer = 1; + + // Message type. This value will be in the custom range (>= 32768). + uint32 type = 2; + + // Raw message data + bytes data = 3; +} + +message SendCustomMessageRequest { + // Peer to send the message to + bytes peer = 1; + + // Message type. This value needs to be in the custom range (>= 32768). + uint32 type = 2; + + // Raw message data. + bytes data = 3; +} + +message SendCustomMessageResponse { +} + +message Utxo { + // The type of address + AddressType address_type = 1; + + // The address + string address = 2; + + // The value of the unspent coin in satoshis + int64 amount_sat = 3; + + // The pkscript in hex + string pk_script = 4; + + // The outpoint in format txid:n + OutPoint outpoint = 5; + + // The number of confirmations for the Utxo + int64 confirmations = 6; +} + +enum OutputScriptType { + SCRIPT_TYPE_PUBKEY_HASH = 0; + SCRIPT_TYPE_SCRIPT_HASH = 1; + SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; + SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; + SCRIPT_TYPE_PUBKEY = 4; + SCRIPT_TYPE_MULTISIG = 5; + SCRIPT_TYPE_NULLDATA = 6; + SCRIPT_TYPE_NON_STANDARD = 7; + SCRIPT_TYPE_WITNESS_UNKNOWN = 8; + SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9; +} + +message OutputDetail { + // The type of the output + OutputScriptType output_type = 1; + + // The address + string address = 2; + + // The pkscript in hex + string pk_script = 3; + + // The output index used in the raw transaction + int64 output_index = 4; + + // The value of the output coin in satoshis + int64 amount = 5; + + // Denotes if the output is controlled by the internal wallet + bool is_our_address = 6; +} + +message Transaction { + // The transaction hash + string tx_hash = 1; + + // The transaction amount, denominated in satoshis + int64 amount = 2; + + // The number of confirmations + int32 num_confirmations = 3; + + // The hash of the block this transaction was included in + string block_hash = 4; + + // The height of the block this transaction was included in + int32 block_height = 5; + + // Timestamp of this transaction + int64 time_stamp = 6; + + // Fees paid for this transaction + int64 total_fees = 7; + + // Addresses that received funds for this transaction. Deprecated as it is + // now incorporated in the output_details field. + repeated string dest_addresses = 8 [deprecated = true]; + + // Outputs that received funds for this transaction + repeated OutputDetail output_details = 11; + + // The raw transaction hex. + string raw_tx_hex = 9; + + // A label that was optionally set on transaction broadcast. + string label = 10; + + // PreviousOutpoints/Inputs of this transaction. + repeated PreviousOutPoint previous_outpoints = 12; +} + +message GetTransactionsRequest { + /* + The height from which to list transactions, inclusive. If this value is + greater than end_height, transactions will be read in reverse. + */ + int32 start_height = 1; + + /* + The height until which to list transactions, inclusive. To include + unconfirmed transactions, this value should be set to -1, which will + return transactions from start_height until the current chain tip and + unconfirmed transactions. If no end_height is provided, the call will + default to this option. + */ + int32 end_height = 2; + + // An optional filter to only include transactions relevant to an account. + string account = 3; +} + +message TransactionDetails { + // The list of transactions relevant to the wallet. + repeated Transaction transactions = 1; +} + +message FeeLimit { + oneof limit { + /* + The fee limit expressed as a fixed amount of satoshis. + + The fields fixed and fixed_msat are mutually exclusive. + */ + int64 fixed = 1; + + /* + The fee limit expressed as a fixed amount of millisatoshis. + + The fields fixed and fixed_msat are mutually exclusive. + */ + int64 fixed_msat = 3; + + // The fee limit expressed as a percentage of the payment amount. + int64 percent = 2; + } +} + +message SendRequest { + /* + The identity pubkey of the payment recipient. When using REST, this field + must be encoded as base64. + */ + bytes dest = 1; + + /* + The hex-encoded identity pubkey of the payment recipient. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string dest_string = 2 [deprecated = true]; + + /* + The amount to send expressed in satoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt = 3; + + /* + The amount to send expressed in millisatoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt_msat = 12; + + /* + The hash to use within the payment's HTLC. When using REST, this field + must be encoded as base64. + */ + bytes payment_hash = 4; + + /* + The hex-encoded hash to use within the payment's HTLC. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string payment_hash_string = 5 [deprecated = true]; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. + */ + string payment_request = 6; + + /* + The CLTV delta from the current height that should be used to set the + timelock for the final hop. + */ + int32 final_cltv_delta = 7; + + /* + The maximum number of satoshis that will be paid as a fee of the payment. + This value can be represented either as a percentage of the amount being + sent, or as a fixed amount of the maximum fee the user is willing the pay to + send the payment. If not specified, lnd will use a default value of 100% + fees for small amounts (<=1k sat) or 5% fees for larger amounts. + */ + FeeLimit fee_limit = 8; + + /* + The channel id of the channel that must be taken to the first hop. If zero, + any channel may be used. + */ + uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; + + /* + The pubkey of the last hop of the route. If empty, any hop may be used. + */ + bytes last_hop_pubkey = 13; + + /* + An optional maximum total time lock for the route. This should not exceed + lnd's `--max-cltv-expiry` setting. If zero, then the value of + `--max-cltv-expiry` is enforced. + */ + uint32 cltv_limit = 10; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to a peer which understands the new records. This can be used to pass + application specific data during the payment attempt. Record types are + required to be in the custom range >= 65536. When using REST, the values + must be encoded as base64. + */ + map dest_custom_records = 11; + + // If set, circular payments to self are permitted. + bool allow_self_payment = 14; + + /* + Features assumed to be supported by the final node. All transitive feature + dependencies must also be set properly. For a given feature bit pair, either + optional or remote may be set, but not both. If this field is nil or empty, + the router will try to load destination features from the graph as a + fallback. + */ + repeated FeatureBit dest_features = 15; + + /* + The payment address of the generated invoice. + */ + bytes payment_addr = 16; +} + +message SendResponse { + string payment_error = 1; + bytes payment_preimage = 2; + Route payment_route = 3; + bytes payment_hash = 4; +} + +message SendToRouteRequest { + /* + The payment hash to use for the HTLC. When using REST, this field must be + encoded as base64. + */ + bytes payment_hash = 1; + + /* + An optional hex-encoded payment hash to be used for the HTLC. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string payment_hash_string = 2 [deprecated = true]; + + reserved 3; + + // Route that should be used to attempt to complete the payment. + Route route = 4; +} + +message ChannelAcceptRequest { + // The pubkey of the node that wishes to open an inbound channel. + bytes node_pubkey = 1; + + // The hash of the genesis block that the proposed channel resides in. + bytes chain_hash = 2; + + // The pending channel id. + bytes pending_chan_id = 3; + + // The funding amount in satoshis that initiator wishes to use in the + // channel. + uint64 funding_amt = 4; + + // The push amount of the proposed channel in millisatoshis. + uint64 push_amt = 5; + + // The dust limit of the initiator's commitment tx. + uint64 dust_limit = 6; + + // The maximum amount of coins in millisatoshis that can be pending in this + // channel. + uint64 max_value_in_flight = 7; + + // The minimum amount of satoshis the initiator requires us to have at all + // times. + uint64 channel_reserve = 8; + + // The smallest HTLC in millisatoshis that the initiator will accept. + uint64 min_htlc = 9; + + // The initial fee rate that the initiator suggests for both commitment + // transactions. + uint64 fee_per_kw = 10; + + /* + The number of blocks to use for the relative time lock in the pay-to-self + output of both commitment transactions. + */ + uint32 csv_delay = 11; + + // The total number of incoming HTLC's that the initiator will accept. + uint32 max_accepted_htlcs = 12; + + // A bit-field which the initiator uses to specify proposed channel + // behavior. + uint32 channel_flags = 13; + + // The commitment type the initiator wishes to use for the proposed channel. + CommitmentType commitment_type = 14; + + // Whether the initiator wants to open a zero-conf channel via the channel + // type. + bool wants_zero_conf = 15; + + // Whether the initiator wants to use the scid-alias channel type. This is + // separate from the feature bit. + bool wants_scid_alias = 16; +} + +message ChannelAcceptResponse { + // Whether or not the client accepts the channel. + bool accept = 1; + + // The pending channel id to which this response applies. + bytes pending_chan_id = 2; + + /* + An optional error to send the initiating party to indicate why the channel + was rejected. This field *should not* contain sensitive information, it will + be sent to the initiating party. This field should only be set if accept is + false, the channel will be rejected if an error is set with accept=true + because the meaning of this response is ambiguous. Limited to 500 + characters. + */ + string error = 3; + + /* + The upfront shutdown address to use if the initiating peer supports option + upfront shutdown script (see ListPeers for the features supported). Note + that the channel open will fail if this value is set for a peer that does + not support this feature bit. + */ + string upfront_shutdown = 4; + + /* + The csv delay (in blocks) that we require for the remote party. + */ + uint32 csv_delay = 5; + + /* + The reserve amount in satoshis that we require the remote peer to adhere to. + We require that the remote peer always have some reserve amount allocated to + them so that there is always a disincentive to broadcast old state (if they + hold 0 sats on their side of the channel, there is nothing to lose). + */ + uint64 reserve_sat = 6; + + /* + The maximum amount of funds in millisatoshis that we allow the remote peer + to have in outstanding htlcs. + */ + uint64 in_flight_max_msat = 7; + + /* + The maximum number of htlcs that the remote peer can offer us. + */ + uint32 max_htlc_count = 8; + + /* + The minimum value in millisatoshis for incoming htlcs on the channel. + */ + uint64 min_htlc_in = 9; + + /* + The number of confirmations we require before we consider the channel open. + */ + uint32 min_accept_depth = 10; + + /* + Whether the responder wants this to be a zero-conf channel. This will fail + if either side does not have the scid-alias feature bit set. The minimum + depth field must be zero if this is true. + */ + bool zero_conf = 11; +} + +message ChannelPoint { + oneof funding_txid { + /* + Txid of the funding transaction. When using REST, this field must be + encoded as base64. + */ + bytes funding_txid_bytes = 1; + + /* + Hex-encoded string representing the byte-reversed hash of the funding + transaction. + */ + string funding_txid_str = 2; + } + + // The index of the output of the funding transaction + uint32 output_index = 3; +} + +message OutPoint { + // Raw bytes representing the transaction id. + bytes txid_bytes = 1; + + // Reversed, hex-encoded string representing the transaction id. + string txid_str = 2; + + // The index of the output on the transaction. + uint32 output_index = 3; +} + +message PreviousOutPoint { + // The outpoint in format txid:n. + string outpoint = 1; + + // Denotes if the outpoint is controlled by the internal wallet. + // The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. + bool is_our_output = 2; +} + +message LightningAddress { + // The identity pubkey of the Lightning node. + string pubkey = 1; + + // The network location of the lightning node, e.g. `69.69.69.69:1337` or + // `localhost:10011`. + string host = 2; +} + +message EstimateFeeRequest { + // The map from addresses to amounts for the transaction. + map AddrToAmount = 1; + + // The target number of blocks that this transaction should be confirmed + // by. + int32 target_conf = 2; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 3; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 4; +} + +message EstimateFeeResponse { + // The total fee in satoshis. + int64 fee_sat = 1; + + // Deprecated, use sat_per_vbyte. + // The fee rate in satoshi/vbyte. + int64 feerate_sat_per_byte = 2 [deprecated = true]; + + // The fee rate in satoshi/vbyte. + uint64 sat_per_vbyte = 3; +} + +message SendManyRequest { + // The map from addresses to amounts + map AddrToAmount = 1; + + // The target number of blocks that this transaction should be confirmed + // by. + int32 target_conf = 3; + + // A manual fee rate set in sat/vbyte that should be used when crafting the + // transaction. + uint64 sat_per_vbyte = 4; + + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the + // transaction. + int64 sat_per_byte = 5 [deprecated = true]; + + // An optional label for the transaction, limited to 500 characters. + string label = 6; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 7; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 8; +} +message SendManyResponse { + // The id of the transaction + string txid = 1; +} + +message SendCoinsRequest { + // The address to send coins to + string addr = 1; + + // The amount in satoshis to send + int64 amount = 2; + + // The target number of blocks that this transaction should be confirmed + // by. + int32 target_conf = 3; + + // A manual fee rate set in sat/vbyte that should be used when crafting the + // transaction. + uint64 sat_per_vbyte = 4; + + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the + // transaction. + int64 sat_per_byte = 5 [deprecated = true]; + + /* + If set, then the amount field will be ignored, and lnd will attempt to + send all the coins under control of the internal wallet to the specified + address. + */ + bool send_all = 6; + + // An optional label for the transaction, limited to 500 characters. + string label = 7; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 8; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 9; +} +message SendCoinsResponse { + // The transaction ID of the transaction + string txid = 1; +} + +message ListUnspentRequest { + // The minimum number of confirmations to be included. + int32 min_confs = 1; + + // The maximum number of confirmations to be included. + int32 max_confs = 2; + + // An optional filter to only include outputs belonging to an account. + string account = 3; +} +message ListUnspentResponse { + // A list of utxos + repeated Utxo utxos = 1; +} + +/* +`AddressType` has to be one of: + +- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) +- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) +- `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) +*/ +enum AddressType { + WITNESS_PUBKEY_HASH = 0; + NESTED_PUBKEY_HASH = 1; + UNUSED_WITNESS_PUBKEY_HASH = 2; + UNUSED_NESTED_PUBKEY_HASH = 3; + TAPROOT_PUBKEY = 4; + UNUSED_TAPROOT_PUBKEY = 5; +} + +message NewAddressRequest { + // The type of address to generate. + AddressType type = 1; + + /* + The name of the account to generate a new address for. If empty, the + default wallet account is used. + */ + string account = 2; +} +message NewAddressResponse { + // The newly generated wallet address + string address = 1; +} + +message SignMessageRequest { + /* + The message to be signed. When using REST, this field must be encoded as + base64. + */ + bytes msg = 1; + + /* + Instead of the default double-SHA256 hashing of the message before signing, + only use one round of hashing instead. + */ + bool single_hash = 2; +} +message SignMessageResponse { + // The signature for the given message + string signature = 1; +} + +message VerifyMessageRequest { + /* + The message over which the signature is to be verified. When using REST, + this field must be encoded as base64. + */ + bytes msg = 1; + + // The signature to be verified over the given message + string signature = 2; +} +message VerifyMessageResponse { + // Whether the signature was valid over the given message + bool valid = 1; + + // The pubkey recovered from the signature + string pubkey = 2; +} + +message ConnectPeerRequest { + /* + Lightning address of the peer to connect to. + */ + LightningAddress addr = 1; + + /* + If set, the daemon will attempt to persistently connect to the target + peer. Otherwise, the call will be synchronous. + */ + bool perm = 2; + + /* + The connection timeout value (in seconds) for this request. It won't affect + other requests. + */ + uint64 timeout = 3; +} +message ConnectPeerResponse { +} + +message DisconnectPeerRequest { + // The pubkey of the node to disconnect from + string pub_key = 1; +} +message DisconnectPeerResponse { +} + +message HTLC { + bool incoming = 1; + int64 amount = 2; + bytes hash_lock = 3; + uint32 expiration_height = 4; + + // Index identifying the htlc on the channel. + uint64 htlc_index = 5; + + // If this HTLC is involved in a forwarding operation, this field indicates + // the forwarding channel. For an outgoing htlc, it is the incoming channel. + // For an incoming htlc, it is the outgoing channel. When the htlc + // originates from this node or this node is the final destination, + // forwarding_channel will be zero. The forwarding channel will also be zero + // for htlcs that need to be forwarded but don't have a forwarding decision + // persisted yet. + uint64 forwarding_channel = 6; + + // Index identifying the htlc on the forwarding channel. + uint64 forwarding_htlc_index = 7; +} + +enum CommitmentType { + /* + Returned when the commitment type isn't known or unavailable. + */ + UNKNOWN_COMMITMENT_TYPE = 0; + + /* + A channel using the legacy commitment format having tweaked to_remote + keys. + */ + LEGACY = 1; + + /* + A channel that uses the modern commitment format where the key in the + output of the remote party does not change each state. This makes back + up and recovery easier as when the channel is closed, the funds go + directly to that key. + */ + STATIC_REMOTE_KEY = 2; + + /* + A channel that uses a commitment format that has anchor outputs on the + commitments, allowing fee bumping after a force close transaction has + been broadcast. + */ + ANCHORS = 3; + + /* + A channel that uses a commitment type that builds upon the anchors + commitment format, but in addition requires a CLTV clause to spend outputs + paying to the channel initiator. This is intended for use on leased channels + to guarantee that the channel initiator has no incentives to close a leased + channel before its maturity date. + */ + SCRIPT_ENFORCED_LEASE = 4; +} + +message ChannelConstraints { + /* + The CSV delay expressed in relative blocks. If the channel is force closed, + we will need to wait for this many blocks before we can regain our funds. + */ + uint32 csv_delay = 1; + + // The minimum satoshis this node is required to reserve in its balance. + uint64 chan_reserve_sat = 2; + + // The dust limit (in satoshis) of the initiator's commitment tx. + uint64 dust_limit_sat = 3; + + // The maximum amount of coins in millisatoshis that can be pending in this + // channel. + uint64 max_pending_amt_msat = 4; + + // The smallest HTLC in millisatoshis that the initiator will accept. + uint64 min_htlc_msat = 5; + + // The total number of incoming HTLC's that the initiator will accept. + uint32 max_accepted_htlcs = 6; +} + +message Channel { + // Whether this channel is active or not + bool active = 1; + + // The identity pubkey of the remote node + string remote_pubkey = 2; + + /* + The outpoint (txid:index) of the funding transaction. With this value, Bob + will be able to generate a signature for Alice's version of the commitment + transaction. + */ + string channel_point = 3; + + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 4 [jstype = JS_STRING]; + + // The total amount of funds held in this channel + int64 capacity = 5; + + // This node's current balance in this channel + int64 local_balance = 6; + + // The counterparty's current balance in this channel + int64 remote_balance = 7; + + /* + The amount calculated to be paid in fees for the current set of commitment + transactions. The fee amount is persisted with the channel in order to + allow the fee amount to be removed and recalculated with each channel state + update, including updates that happen after a system restart. + */ + int64 commit_fee = 8; + + // The weight of the commitment transaction + int64 commit_weight = 9; + + /* + The required number of satoshis per kilo-weight that the requester will pay + at all times, for both the funding transaction and commitment transaction. + This value can later be updated once the channel is open. + */ + int64 fee_per_kw = 10; + + // The unsettled balance in this channel + int64 unsettled_balance = 11; + + /* + The total number of satoshis we've sent within this channel. + */ + int64 total_satoshis_sent = 12; + + /* + The total number of satoshis we've received within this channel. + */ + int64 total_satoshis_received = 13; + + /* + The total number of updates conducted within this channel. + */ + uint64 num_updates = 14; + + /* + The list of active, uncleared HTLCs currently pending within the channel. + */ + repeated HTLC pending_htlcs = 15; + + /* + Deprecated. The CSV delay expressed in relative blocks. If the channel is + force closed, we will need to wait for this many blocks before we can regain + our funds. + */ + uint32 csv_delay = 16 [deprecated = true]; + + // Whether this channel is advertised to the network or not. + bool private = 17; + + // True if we were the ones that created the channel. + bool initiator = 18; + + // A set of flags showing the current state of the channel. + string chan_status_flags = 19; + + // Deprecated. The minimum satoshis this node is required to reserve in its + // balance. + int64 local_chan_reserve_sat = 20 [deprecated = true]; + + /* + Deprecated. The minimum satoshis the other node is required to reserve in + its balance. + */ + int64 remote_chan_reserve_sat = 21 [deprecated = true]; + + // Deprecated. Use commitment_type. + bool static_remote_key = 22 [deprecated = true]; + + // The commitment type used by this channel. + CommitmentType commitment_type = 26; + + /* + The number of seconds that the channel has been monitored by the channel + scoring system. Scores are currently not persisted, so this value may be + less than the lifetime of the channel [EXPERIMENTAL]. + */ + int64 lifetime = 23; + + /* + The number of seconds that the remote peer has been observed as being online + by the channel scoring system over the lifetime of the channel + [EXPERIMENTAL]. + */ + int64 uptime = 24; + + /* + Close address is the address that we will enforce payout to on cooperative + close if the channel was opened utilizing option upfront shutdown. This + value can be set on channel open by setting close_address in an open channel + request. If this value is not set, you can still choose a payout address by + cooperatively closing with the delivery_address field set. + */ + string close_address = 25; + + /* + The amount that the initiator of the channel optionally pushed to the remote + party on channel open. This amount will be zero if the channel initiator did + not push any funds to the remote peer. If the initiator field is true, we + pushed this amount to our peer, if it is false, the remote peer pushed this + amount to us. + */ + uint64 push_amount_sat = 27; + + /* + This uint32 indicates if this channel is to be considered 'frozen'. A + frozen channel doest not allow a cooperative channel close by the + initiator. The thaw_height is the height that this restriction stops + applying to the channel. This field is optional, not setting it or using a + value of zero will mean the channel has no additional restrictions. The + height can be interpreted in two ways: as a relative height if the value is + less than 500,000, or as an absolute height otherwise. + */ + uint32 thaw_height = 28; + + // List constraints for the local node. + ChannelConstraints local_constraints = 29; + + // List constraints for the remote node. + ChannelConstraints remote_constraints = 30; + + /* + This lists out the set of alias short channel ids that exist for a channel. + This may be empty. + */ + repeated uint64 alias_scids = 31; + + // Whether or not this is a zero-conf channel. + bool zero_conf = 32; + + // This is the confirmed / on-chain zero-conf SCID. + uint64 zero_conf_confirmed_scid = 33; +} + +message ListChannelsRequest { + bool active_only = 1; + bool inactive_only = 2; + bool public_only = 3; + bool private_only = 4; + + /* + Filters the response for channels with a target peer's pubkey. If peer is + empty, all channels will be returned. + */ + bytes peer = 5; +} +message ListChannelsResponse { + // The list of active channels + repeated Channel channels = 11; +} + +message AliasMap { + /* + For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is + the first assigned "base" alias. + */ + uint64 base_scid = 1; + + // The set of all aliases stored for the base SCID. + repeated uint64 aliases = 2; +} +message ListAliasesRequest { +} +message ListAliasesResponse { + repeated AliasMap alias_maps = 1; +} + +enum Initiator { + INITIATOR_UNKNOWN = 0; + INITIATOR_LOCAL = 1; + INITIATOR_REMOTE = 2; + INITIATOR_BOTH = 3; +} + +message ChannelCloseSummary { + // The outpoint (txid:index) of the funding transaction. + string channel_point = 1; + + // The unique channel ID for the channel. + uint64 chan_id = 2 [jstype = JS_STRING]; + + // The hash of the genesis block that this channel resides within. + string chain_hash = 3; + + // The txid of the transaction which ultimately closed this channel. + string closing_tx_hash = 4; + + // Public key of the remote peer that we formerly had a channel with. + string remote_pubkey = 5; + + // Total capacity of the channel. + int64 capacity = 6; + + // Height at which the funding transaction was spent. + uint32 close_height = 7; + + // Settled balance at the time of channel closure + int64 settled_balance = 8; + + // The sum of all the time-locked outputs at the time of channel closure + int64 time_locked_balance = 9; + + enum ClosureType { + COOPERATIVE_CLOSE = 0; + LOCAL_FORCE_CLOSE = 1; + REMOTE_FORCE_CLOSE = 2; + BREACH_CLOSE = 3; + FUNDING_CANCELED = 4; + ABANDONED = 5; + } + + // Details on how the channel was closed. + ClosureType close_type = 10; + + /* + Open initiator is the party that initiated opening the channel. Note that + this value may be unknown if the channel was closed before we migrated to + store open channel information after close. + */ + Initiator open_initiator = 11; + + /* + Close initiator indicates which party initiated the close. This value will + be unknown for channels that were cooperatively closed before we started + tracking cooperative close initiators. Note that this indicates which party + initiated a close, and it is possible for both to initiate cooperative or + force closes, although only one party's close will be confirmed on chain. + */ + Initiator close_initiator = 12; + + repeated Resolution resolutions = 13; + + /* + This lists out the set of alias short channel ids that existed for the + closed channel. This may be empty. + */ + repeated uint64 alias_scids = 14; + + // The confirmed SCID for a zero-conf channel. + uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; +} + +enum ResolutionType { + TYPE_UNKNOWN = 0; + + // We resolved an anchor output. + ANCHOR = 1; + + /* + We are resolving an incoming htlc on chain. This if this htlc is + claimed, we swept the incoming htlc with the preimage. If it is timed + out, our peer swept the timeout path. + */ + INCOMING_HTLC = 2; + + /* + We are resolving an outgoing htlc on chain. If this htlc is claimed, + the remote party swept the htlc with the preimage. If it is timed out, + we swept it with the timeout path. + */ + OUTGOING_HTLC = 3; + + // We force closed and need to sweep our time locked commitment output. + COMMIT = 4; +} + +enum ResolutionOutcome { + // Outcome unknown. + OUTCOME_UNKNOWN = 0; + + // An output was claimed on chain. + CLAIMED = 1; + + // An output was left unclaimed on chain. + UNCLAIMED = 2; + + /* + ResolverOutcomeAbandoned indicates that an output that we did not + claim on chain, for example an anchor that we did not sweep and a + third party claimed on chain, or a htlc that we could not decode + so left unclaimed. + */ + ABANDONED = 3; + + /* + If we force closed our channel, our htlcs need to be claimed in two + stages. This outcome represents the broadcast of a timeout or success + transaction for this two stage htlc claim. + */ + FIRST_STAGE = 4; + + // A htlc was timed out on chain. + TIMEOUT = 5; +} + +message Resolution { + // The type of output we are resolving. + ResolutionType resolution_type = 1; + + // The outcome of our on chain action that resolved the outpoint. + ResolutionOutcome outcome = 2; + + // The outpoint that was spent by the resolution. + OutPoint outpoint = 3; + + // The amount that was claimed by the resolution. + uint64 amount_sat = 4; + + // The hex-encoded transaction ID of the sweep transaction that spent the + // output. + string sweep_txid = 5; +} + +message ClosedChannelsRequest { + bool cooperative = 1; + bool local_force = 2; + bool remote_force = 3; + bool breach = 4; + bool funding_canceled = 5; + bool abandoned = 6; +} + +message ClosedChannelsResponse { + repeated ChannelCloseSummary channels = 1; +} + +message Peer { + // The identity pubkey of the peer + string pub_key = 1; + + // Network address of the peer; eg `127.0.0.1:10011` + string address = 3; + + // Bytes of data transmitted to this peer + uint64 bytes_sent = 4; + + // Bytes of data transmitted from this peer + uint64 bytes_recv = 5; + + // Satoshis sent to this peer + int64 sat_sent = 6; + + // Satoshis received from this peer + int64 sat_recv = 7; + + // A channel is inbound if the counterparty initiated the channel + bool inbound = 8; + + // Ping time to this peer + int64 ping_time = 9; + + enum SyncType { + /* + Denotes that we cannot determine the peer's current sync type. + */ + UNKNOWN_SYNC = 0; + + /* + Denotes that we are actively receiving new graph updates from the peer. + */ + ACTIVE_SYNC = 1; + + /* + Denotes that we are not receiving new graph updates from the peer. + */ + PASSIVE_SYNC = 2; + + /* + Denotes that this peer is pinned into an active sync. + */ + PINNED_SYNC = 3; + } + + // The type of sync we are currently performing with this peer. + SyncType sync_type = 10; + + // Features advertised by the remote peer in their init message. + map features = 11; + + /* + The latest errors received from our peer with timestamps, limited to the 10 + most recent errors. These errors are tracked across peer connections, but + are not persisted across lnd restarts. Note that these errors are only + stored for peers that we have channels open with, to prevent peers from + spamming us with errors at no cost. + */ + repeated TimestampedError errors = 12; + + /* + The number of times we have recorded this peer going offline or coming + online, recorded across restarts. Note that this value is decreased over + time if the peer has not recently flapped, so that we can forgive peers + with historically high flap counts. + */ + int32 flap_count = 13; + + /* + The timestamp of the last flap we observed for this peer. If this value is + zero, we have not observed any flaps for this peer. + */ + int64 last_flap_ns = 14; + + /* + The last ping payload the peer has sent to us. + */ + bytes last_ping_payload = 15; +} + +message TimestampedError { + // The unix timestamp in seconds when the error occurred. + uint64 timestamp = 1; + + // The string representation of the error sent by our peer. + string error = 2; +} + +message ListPeersRequest { + /* + If true, only the last error that our peer sent us will be returned with + the peer's information, rather than the full set of historic errors we have + stored. + */ + bool latest_error = 1; +} +message ListPeersResponse { + // The list of currently connected peers + repeated Peer peers = 1; +} + +message PeerEventSubscription { +} + +message PeerEvent { + // The identity pubkey of the peer. + string pub_key = 1; + + enum EventType { + PEER_ONLINE = 0; + PEER_OFFLINE = 1; + } + + EventType type = 2; +} + +message GetInfoRequest { +} +message GetInfoResponse { + // The version of the LND software that the node is running. + string version = 14; + + // The SHA1 commit hash that the daemon is compiled with. + string commit_hash = 20; + + // The identity pubkey of the current node. + string identity_pubkey = 1; + + // If applicable, the alias of the current node, e.g. "bob" + string alias = 2; + + // The color of the current node in hex code format + string color = 17; + + // Number of pending channels + uint32 num_pending_channels = 3; + + // Number of active channels + uint32 num_active_channels = 4; + + // Number of inactive channels + uint32 num_inactive_channels = 15; + + // Number of peers + uint32 num_peers = 5; + + // The node's current view of the height of the best block + uint32 block_height = 6; + + // The node's current view of the hash of the best block + string block_hash = 8; + + // Timestamp of the block best known to the wallet + int64 best_header_timestamp = 13; + + // Whether the wallet's view is synced to the main chain + bool synced_to_chain = 9; + + // Whether we consider ourselves synced with the public channel graph. + bool synced_to_graph = 18; + + /* + Whether the current node is connected to testnet. This field is + deprecated and the network field should be used instead + **/ + bool testnet = 10 [deprecated = true]; + + reserved 11; + + // A list of active chains the node is connected to + repeated Chain chains = 16; + + // The URIs of the current node. + repeated string uris = 12; + + /* + Features that our node has advertised in our init message, node + announcements and invoices. + */ + map features = 19; + + /* + Indicates whether the HTLC interceptor API is in always-on mode. + */ + bool require_htlc_interceptor = 21; +} + +message GetRecoveryInfoRequest { +} +message GetRecoveryInfoResponse { + // Whether the wallet is in recovery mode + bool recovery_mode = 1; + + // Whether the wallet recovery progress is finished + bool recovery_finished = 2; + + // The recovery progress, ranging from 0 to 1. + double progress = 3; +} + +message Chain { + // The blockchain the node is on (eg bitcoin, litecoin) + string chain = 1; + + // The network the node is on (eg regtest, testnet, mainnet) + string network = 2; +} + +message ConfirmationUpdate { + bytes block_sha = 1; + int32 block_height = 2; + + uint32 num_confs_left = 3; +} + +message ChannelOpenUpdate { + ChannelPoint channel_point = 1; +} + +message ChannelCloseUpdate { + bytes closing_txid = 1; + + bool success = 2; +} + +message CloseChannelRequest { + /* + The outpoint (txid:index) of the funding transaction. With this value, Bob + will be able to generate a signature for Alice's version of the commitment + transaction. + */ + ChannelPoint channel_point = 1; + + // If true, then the channel will be closed forcibly. This means the + // current commitment transaction will be signed and broadcast. + bool force = 2; + + // The target number of blocks that the closure transaction should be + // confirmed by. + int32 target_conf = 3; + + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the + // closure transaction. + int64 sat_per_byte = 4 [deprecated = true]; + + /* + An optional address to send funds to in the case of a cooperative close. + If the channel was opened with an upfront shutdown script and this field + is set, the request to close will fail because the channel must pay out + to the upfront shutdown addresss. + */ + string delivery_address = 5; + + // A manual fee rate set in sat/vbyte that should be used when crafting the + // closure transaction. + uint64 sat_per_vbyte = 6; + + // The maximum fee rate the closer is willing to pay. + // + // NOTE: This field is only respected if we're the initiator of the channel. + uint64 max_fee_per_vbyte = 7; +} + +message CloseStatusUpdate { + oneof update { + PendingUpdate close_pending = 1; + ChannelCloseUpdate chan_close = 3; + } +} + +message PendingUpdate { + bytes txid = 1; + uint32 output_index = 2; +} + +message ReadyForPsbtFunding { + /* + The P2WSH address of the channel funding multisig address that the below + specified amount in satoshis needs to be sent to. + */ + string funding_address = 1; + + /* + The exact amount in satoshis that needs to be sent to the above address to + fund the pending channel. + */ + int64 funding_amount = 2; + + /* + A raw PSBT that contains the pending channel output. If a base PSBT was + provided in the PsbtShim, this is the base PSBT with one additional output. + If no base PSBT was specified, this is an otherwise empty PSBT with exactly + one output. + */ + bytes psbt = 3; +} + +message BatchOpenChannelRequest { + // The list of channels to open. + repeated BatchOpenChannel channels = 1; + + // The target number of blocks that the funding transaction should be + // confirmed by. + int32 target_conf = 2; + + // A manual fee rate set in sat/vByte that should be used when crafting the + // funding transaction. + int64 sat_per_vbyte = 3; + + // The minimum number of confirmations each one of your outputs used for + // the funding transaction must satisfy. + int32 min_confs = 4; + + // Whether unconfirmed outputs should be used as inputs for the funding + // transaction. + bool spend_unconfirmed = 5; + + // An optional label for the batch transaction, limited to 500 characters. + string label = 6; +} + +message BatchOpenChannel { + // The pubkey of the node to open a channel with. When using REST, this + // field must be encoded as base64. + bytes node_pubkey = 1; + + // The number of satoshis the wallet should commit to the channel. + int64 local_funding_amount = 2; + + // The number of satoshis to push to the remote side as part of the initial + // commitment state. + int64 push_sat = 3; + + // Whether this channel should be private, not announced to the greater + // network. + bool private = 4; + + // The minimum value in millisatoshi we will require for incoming HTLCs on + // the channel. + int64 min_htlc_msat = 5; + + // The delay we require on the remote's commitment transaction. If this is + // not set, it will be scaled automatically with the channel size. + uint32 remote_csv_delay = 6; + + /* + Close address is an optional address which specifies the address to which + funds should be paid out to upon cooperative close. This field may only be + set if the peer supports the option upfront feature bit (call listpeers + to check). The remote peer will only accept cooperative closes to this + address if it is set. + + Note: If this value is set on channel creation, you will *not* be able to + cooperatively close out to a different address. + */ + string close_address = 7; + + /* + An optional, unique identifier of 32 random bytes that will be used as the + pending channel ID to identify the channel while it is in the pre-pending + state. + */ + bytes pending_chan_id = 8; + + /* + The explicit commitment type to use. Note this field will only be used if + the remote peer supports explicit channel negotiation. + */ + CommitmentType commitment_type = 9; +} + +message BatchOpenChannelResponse { + repeated PendingUpdate pending_channels = 1; +} + +message OpenChannelRequest { + // A manual fee rate set in sat/vbyte that should be used when crafting the + // funding transaction. + uint64 sat_per_vbyte = 1; + + /* + The pubkey of the node to open a channel with. When using REST, this field + must be encoded as base64. + */ + bytes node_pubkey = 2; + + /* + The hex encoded pubkey of the node to open a channel with. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string node_pubkey_string = 3 [deprecated = true]; + + // The number of satoshis the wallet should commit to the channel + int64 local_funding_amount = 4; + + // The number of satoshis to push to the remote side as part of the initial + // commitment state + int64 push_sat = 5; + + // The target number of blocks that the funding transaction should be + // confirmed by. + int32 target_conf = 6; + + // Deprecated, use sat_per_vbyte. + // A manual fee rate set in sat/vbyte that should be used when crafting the + // funding transaction. + int64 sat_per_byte = 7 [deprecated = true]; + + // Whether this channel should be private, not announced to the greater + // network. + bool private = 8; + + // The minimum value in millisatoshi we will require for incoming HTLCs on + // the channel. + int64 min_htlc_msat = 9; + + // The delay we require on the remote's commitment transaction. If this is + // not set, it will be scaled automatically with the channel size. + uint32 remote_csv_delay = 10; + + // The minimum number of confirmations each one of your outputs used for + // the funding transaction must satisfy. + int32 min_confs = 11; + + // Whether unconfirmed outputs should be used as inputs for the funding + // transaction. + bool spend_unconfirmed = 12; + + /* + Close address is an optional address which specifies the address to which + funds should be paid out to upon cooperative close. This field may only be + set if the peer supports the option upfront feature bit (call listpeers + to check). The remote peer will only accept cooperative closes to this + address if it is set. + + Note: If this value is set on channel creation, you will *not* be able to + cooperatively close out to a different address. + */ + string close_address = 13; + + /* + Funding shims are an optional argument that allow the caller to intercept + certain funding functionality. For example, a shim can be provided to use a + particular key for the commitment key (ideally cold) rather than use one + that is generated by the wallet as normal, or signal that signing will be + carried out in an interactive manner (PSBT based). + */ + FundingShim funding_shim = 14; + + /* + The maximum amount of coins in millisatoshi that can be pending within + the channel. It only applies to the remote party. + */ + uint64 remote_max_value_in_flight_msat = 15; + + /* + The maximum number of concurrent HTLCs we will allow the remote party to add + to the commitment transaction. + */ + uint32 remote_max_htlcs = 16; + + /* + Max local csv is the maximum csv delay we will allow for our own commitment + transaction. + */ + uint32 max_local_csv = 17; + + /* + The explicit commitment type to use. Note this field will only be used if + the remote peer supports explicit channel negotiation. + */ + CommitmentType commitment_type = 18; + + /* + If this is true, then a zero-conf channel open will be attempted. + */ + bool zero_conf = 19; + + /* + If this is true, then an option-scid-alias channel-type open will be + attempted. + */ + bool scid_alias = 20; + + /* + The base fee charged regardless of the number of milli-satoshis sent. + */ + uint64 base_fee = 21; + + /* + The fee rate in ppm (parts per million) that will be charged in + proportion of the value of each forwarded HTLC. + */ + uint64 fee_rate = 22; + + /* + If use_base_fee is true the open channel announcement will update the + channel base fee with the value specified in base_fee. In the case of + a base_fee of 0 use_base_fee is needed downstream to distinguish whether + to use the default base fee value specified in the config or 0. + */ + bool use_base_fee = 23; + + /* + If use_fee_rate is true the open channel announcement will update the + channel fee rate with the value specified in fee_rate. In the case of + a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether + to use the default fee rate value specified in the config or 0. + */ + bool use_fee_rate = 24; + + /* + The number of satoshis we require the remote peer to reserve. This value, + if specified, must be above the dust limit and below 20% of the channel + capacity. + */ + uint64 remote_chan_reserve_sat = 25; +} +message OpenStatusUpdate { + oneof update { + /* + Signals that the channel is now fully negotiated and the funding + transaction published. + */ + PendingUpdate chan_pending = 1; + + /* + Signals that the channel's funding transaction has now reached the + required number of confirmations on chain and can be used. + */ + ChannelOpenUpdate chan_open = 3; + + /* + Signals that the funding process has been suspended and the construction + of a PSBT that funds the channel PK script is now required. + */ + ReadyForPsbtFunding psbt_fund = 5; + } + + /* + The pending channel ID of the created channel. This value may be used to + further the funding flow manually via the FundingStateStep method. + */ + bytes pending_chan_id = 4; +} + +message KeyLocator { + // The family of key being identified. + int32 key_family = 1; + + // The precise index of the key being identified. + int32 key_index = 2; +} + +message KeyDescriptor { + /* + The raw bytes of the key being identified. + */ + bytes raw_key_bytes = 1; + + /* + The key locator that identifies which key to use for signing. + */ + KeyLocator key_loc = 2; +} + +message ChanPointShim { + /* + The size of the pre-crafted output to be used as the channel point for this + channel funding. + */ + int64 amt = 1; + + // The target channel point to refrence in created commitment transactions. + ChannelPoint chan_point = 2; + + // Our local key to use when creating the multi-sig output. + KeyDescriptor local_key = 3; + + // The key of the remote party to use when creating the multi-sig output. + bytes remote_key = 4; + + /* + If non-zero, then this will be used as the pending channel ID on the wire + protocol to initate the funding request. This is an optional field, and + should only be set if the responder is already expecting a specific pending + channel ID. + */ + bytes pending_chan_id = 5; + + /* + This uint32 indicates if this channel is to be considered 'frozen'. A frozen + channel does not allow a cooperative channel close by the initiator. The + thaw_height is the height that this restriction stops applying to the + channel. The height can be interpreted in two ways: as a relative height if + the value is less than 500,000, or as an absolute height otherwise. + */ + uint32 thaw_height = 6; +} + +message PsbtShim { + /* + A unique identifier of 32 random bytes that will be used as the pending + channel ID to identify the PSBT state machine when interacting with it and + on the wire protocol to initiate the funding request. + */ + bytes pending_chan_id = 1; + + /* + An optional base PSBT the new channel output will be added to. If this is + non-empty, it must be a binary serialized PSBT. + */ + bytes base_psbt = 2; + + /* + If a channel should be part of a batch (multiple channel openings in one + transaction), it can be dangerous if the whole batch transaction is + published too early before all channel opening negotiations are completed. + This flag prevents this particular channel from broadcasting the transaction + after the negotiation with the remote peer. In a batch of channel openings + this flag should be set to true for every channel but the very last. + */ + bool no_publish = 3; +} + +message FundingShim { + oneof shim { + /* + A channel shim where the channel point was fully constructed outside + of lnd's wallet and the transaction might already be published. + */ + ChanPointShim chan_point_shim = 1; + + /* + A channel shim that uses a PSBT to fund and sign the channel funding + transaction. + */ + PsbtShim psbt_shim = 2; + } +} + +message FundingShimCancel { + // The pending channel ID of the channel to cancel the funding shim for. + bytes pending_chan_id = 1; +} + +message FundingPsbtVerify { + /* + The funded but not yet signed PSBT that sends the exact channel capacity + amount to the PK script returned in the open channel message in a previous + step. + */ + bytes funded_psbt = 1; + + // The pending channel ID of the channel to get the PSBT for. + bytes pending_chan_id = 2; + + /* + Can only be used if the no_publish flag was set to true in the OpenChannel + call meaning that the caller is solely responsible for publishing the final + funding transaction. If skip_finalize is set to true then lnd will not wait + for a FundingPsbtFinalize state step and instead assumes that a transaction + with the same TXID as the passed in PSBT will eventually confirm. + IT IS ABSOLUTELY IMPERATIVE that the TXID of the transaction that is + eventually published does have the _same TXID_ as the verified PSBT. That + means no inputs or outputs can change, only signatures can be added. If the + TXID changes between this call and the publish step then the channel will + never be created and the funds will be in limbo. + */ + bool skip_finalize = 3; +} + +message FundingPsbtFinalize { + /* + The funded PSBT that contains all witness data to send the exact channel + capacity amount to the PK script returned in the open channel message in a + previous step. Cannot be set at the same time as final_raw_tx. + */ + bytes signed_psbt = 1; + + // The pending channel ID of the channel to get the PSBT for. + bytes pending_chan_id = 2; + + /* + As an alternative to the signed PSBT with all witness data, the final raw + wire format transaction can also be specified directly. Cannot be set at the + same time as signed_psbt. + */ + bytes final_raw_tx = 3; +} + +message FundingTransitionMsg { + oneof trigger { + /* + The funding shim to register. This should be used before any + channel funding has began by the remote party, as it is intended as a + preparatory step for the full channel funding. + */ + FundingShim shim_register = 1; + + // Used to cancel an existing registered funding shim. + FundingShimCancel shim_cancel = 2; + + /* + Used to continue a funding flow that was initiated to be executed + through a PSBT. This step verifies that the PSBT contains the correct + outputs to fund the channel. + */ + FundingPsbtVerify psbt_verify = 3; + + /* + Used to continue a funding flow that was initiated to be executed + through a PSBT. This step finalizes the funded and signed PSBT, finishes + negotiation with the peer and finally publishes the resulting funding + transaction. + */ + FundingPsbtFinalize psbt_finalize = 4; + } +} + +message FundingStateStepResp { +} + +message PendingHTLC { + // The direction within the channel that the htlc was sent + bool incoming = 1; + + // The total value of the htlc + int64 amount = 2; + + // The final output to be swept back to the user's wallet + string outpoint = 3; + + // The next block height at which we can spend the current stage + uint32 maturity_height = 4; + + /* + The number of blocks remaining until the current stage can be swept. + Negative values indicate how many blocks have passed since becoming + mature. + */ + int32 blocks_til_maturity = 5; + + // Indicates whether the htlc is in its first or second stage of recovery + uint32 stage = 6; +} + +message PendingChannelsRequest { +} +message PendingChannelsResponse { + message PendingChannel { + string remote_node_pub = 1; + string channel_point = 2; + + int64 capacity = 3; + + int64 local_balance = 4; + int64 remote_balance = 5; + + // The minimum satoshis this node is required to reserve in its + // balance. + int64 local_chan_reserve_sat = 6; + + /* + The minimum satoshis the other node is required to reserve in its + balance. + */ + int64 remote_chan_reserve_sat = 7; + + // The party that initiated opening the channel. + Initiator initiator = 8; + + // The commitment type used by this channel. + CommitmentType commitment_type = 9; + + // Total number of forwarding packages created in this channel. + int64 num_forwarding_packages = 10; + + // A set of flags showing the current state of the channel. + string chan_status_flags = 11; + + // Whether this channel is advertised to the network or not. + bool private = 12; + } + + message PendingOpenChannel { + // The pending channel + PendingChannel channel = 1; + + /* + The amount calculated to be paid in fees for the current set of + commitment transactions. The fee amount is persisted with the channel + in order to allow the fee amount to be removed and recalculated with + each channel state update, including updates that happen after a system + restart. + */ + int64 commit_fee = 4; + + // The weight of the commitment transaction + int64 commit_weight = 5; + + /* + The required number of satoshis per kilo-weight that the requester will + pay at all times, for both the funding transaction and commitment + transaction. This value can later be updated once the channel is open. + */ + int64 fee_per_kw = 6; + + // Previously used for confirmation_height. Do not reuse. + reserved 2; + } + + message WaitingCloseChannel { + // The pending channel waiting for closing tx to confirm + PendingChannel channel = 1; + + // The balance in satoshis encumbered in this channel + int64 limbo_balance = 2; + + /* + A list of valid commitment transactions. Any of these can confirm at + this point. + */ + Commitments commitments = 3; + + // The transaction id of the closing transaction + string closing_txid = 4; + } + + message Commitments { + // Hash of the local version of the commitment tx. + string local_txid = 1; + + // Hash of the remote version of the commitment tx. + string remote_txid = 2; + + // Hash of the remote pending version of the commitment tx. + string remote_pending_txid = 3; + + /* + The amount in satoshis calculated to be paid in fees for the local + commitment. + */ + uint64 local_commit_fee_sat = 4; + + /* + The amount in satoshis calculated to be paid in fees for the remote + commitment. + */ + uint64 remote_commit_fee_sat = 5; + + /* + The amount in satoshis calculated to be paid in fees for the remote + pending commitment. + */ + uint64 remote_pending_commit_fee_sat = 6; + } + + message ClosedChannel { + // The pending channel to be closed + PendingChannel channel = 1; + + // The transaction id of the closing transaction + string closing_txid = 2; + } + + message ForceClosedChannel { + // The pending channel to be force closed + PendingChannel channel = 1; + + // The transaction id of the closing transaction + string closing_txid = 2; + + // The balance in satoshis encumbered in this pending channel + int64 limbo_balance = 3; + + // The height at which funds can be swept into the wallet + uint32 maturity_height = 4; + + /* + Remaining # of blocks until the commitment output can be swept. + Negative values indicate how many blocks have passed since becoming + mature. + */ + int32 blocks_til_maturity = 5; + + // The total value of funds successfully recovered from this channel + int64 recovered_balance = 6; + + repeated PendingHTLC pending_htlcs = 8; + + /* + There are three resolution states for the anchor: + limbo, lost and recovered. Derive the current state + from the limbo and recovered balances. + */ + enum AnchorState { + // The recovered_balance is zero and limbo_balance is non-zero. + LIMBO = 0; + // The recovered_balance is non-zero. + RECOVERED = 1; + // A state that is neither LIMBO nor RECOVERED. + LOST = 2; + } + + AnchorState anchor = 9; + } + + // The balance in satoshis encumbered in pending channels + int64 total_limbo_balance = 1; + + // Channels pending opening + repeated PendingOpenChannel pending_open_channels = 2; + + /* + Deprecated: Channels pending closing previously contained cooperatively + closed channels with a single confirmation. These channels are now + considered closed from the time we see them on chain. + */ + repeated ClosedChannel pending_closing_channels = 3 [deprecated = true]; + + // Channels pending force closing + repeated ForceClosedChannel pending_force_closing_channels = 4; + + // Channels waiting for closing tx to confirm + repeated WaitingCloseChannel waiting_close_channels = 5; +} + +message ChannelEventSubscription { +} + +message ChannelEventUpdate { + oneof channel { + Channel open_channel = 1; + ChannelCloseSummary closed_channel = 2; + ChannelPoint active_channel = 3; + ChannelPoint inactive_channel = 4; + PendingUpdate pending_open_channel = 6; + ChannelPoint fully_resolved_channel = 7; + } + + enum UpdateType { + OPEN_CHANNEL = 0; + CLOSED_CHANNEL = 1; + ACTIVE_CHANNEL = 2; + INACTIVE_CHANNEL = 3; + PENDING_OPEN_CHANNEL = 4; + FULLY_RESOLVED_CHANNEL = 5; + } + + UpdateType type = 5; +} + +message WalletAccountBalance { + // The confirmed balance of the account (with >= 1 confirmations). + int64 confirmed_balance = 1; + + // The unconfirmed balance of the account (with 0 confirmations). + int64 unconfirmed_balance = 2; +} + +message WalletBalanceRequest { +} + +message WalletBalanceResponse { + // The balance of the wallet + int64 total_balance = 1; + + // The confirmed balance of a wallet(with >= 1 confirmations) + int64 confirmed_balance = 2; + + // The unconfirmed balance of a wallet(with 0 confirmations) + int64 unconfirmed_balance = 3; + + // The total amount of wallet UTXOs held in outputs that are locked for + // other usage. + int64 locked_balance = 5; + + // The amount of reserve required. + int64 reserved_balance_anchor_chan = 6; + + // A mapping of each wallet account's name to its balance. + map account_balance = 4; +} + +message Amount { + // Value denominated in satoshis. + uint64 sat = 1; + + // Value denominated in milli-satoshis. + uint64 msat = 2; +} + +message ChannelBalanceRequest { +} +message ChannelBalanceResponse { + // Deprecated. Sum of channels balances denominated in satoshis + int64 balance = 1 [deprecated = true]; + + // Deprecated. Sum of channels pending balances denominated in satoshis + int64 pending_open_balance = 2 [deprecated = true]; + + // Sum of channels local balances. + Amount local_balance = 3; + + // Sum of channels remote balances. + Amount remote_balance = 4; + + // Sum of channels local unsettled balances. + Amount unsettled_local_balance = 5; + + // Sum of channels remote unsettled balances. + Amount unsettled_remote_balance = 6; + + // Sum of channels pending local balances. + Amount pending_open_local_balance = 7; + + // Sum of channels pending remote balances. + Amount pending_open_remote_balance = 8; +} + +message QueryRoutesRequest { + // The 33-byte hex-encoded public key for the payment destination + string pub_key = 1; + + /* + The amount to send expressed in satoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt = 2; + + /* + The amount to send expressed in millisatoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt_msat = 12; + + reserved 3; + + /* + An optional CLTV delta from the current height that should be used for the + timelock of the final hop. Note that unlike SendPayment, QueryRoutes does + not add any additional block padding on top of final_ctlv_delta. This + padding of a few blocks needs to be added manually or otherwise failures may + happen when a block comes in while the payment is in flight. + */ + int32 final_cltv_delta = 4; + + /* + The maximum number of satoshis that will be paid as a fee of the payment. + This value can be represented either as a percentage of the amount being + sent, or as a fixed amount of the maximum fee the user is willing the pay to + send the payment. If not specified, lnd will use a default value of 100% + fees for small amounts (<=1k sat) or 5% fees for larger amounts. + */ + FeeLimit fee_limit = 5; + + /* + A list of nodes to ignore during path finding. When using REST, these fields + must be encoded as base64. + */ + repeated bytes ignored_nodes = 6; + + /* + Deprecated. A list of edges to ignore during path finding. + */ + repeated EdgeLocator ignored_edges = 7 [deprecated = true]; + + /* + The source node where the request route should originated from. If empty, + self is assumed. + */ + string source_pub_key = 8; + + /* + If set to true, edge probabilities from mission control will be used to get + the optimal route. + */ + bool use_mission_control = 9; + + /* + A list of directed node pairs that will be ignored during path finding. + */ + repeated NodePair ignored_pairs = 10; + + /* + An optional maximum total time lock for the route. If the source is empty or + ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If + zero, then the value of `--max-cltv-expiry` is used as the limit. + */ + uint32 cltv_limit = 11; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to a peer which understands the new records. This can be used to pass + application specific data during the payment attempt. If the destination + does not support the specified records, an error will be returned. + Record types are required to be in the custom range >= 65536. When using + REST, the values must be encoded as base64. + */ + map dest_custom_records = 13; + + /* + The channel id of the channel that must be taken to the first hop. If zero, + any channel may be used. + */ + uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; + + /* + The pubkey of the last hop of the route. If empty, any hop may be used. + */ + bytes last_hop_pubkey = 15; + + /* + Optional route hints to reach the destination through private channels. + */ + repeated lnrpc.RouteHint route_hints = 16; + + /* + Features assumed to be supported by the final node. All transitive feature + dependencies must also be set properly. For a given feature bit pair, either + optional or remote may be set, but not both. If this field is nil or empty, + the router will try to load destination features from the graph as a + fallback. + */ + repeated lnrpc.FeatureBit dest_features = 17; + + /* + The time preference for this payment. Set to -1 to optimize for fees + only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + double time_pref = 18; +} + +message NodePair { + /* + The sending node of the pair. When using REST, this field must be encoded as + base64. + */ + bytes from = 1; + + /* + The receiving node of the pair. When using REST, this field must be encoded + as base64. + */ + bytes to = 2; +} + +message EdgeLocator { + // The short channel id of this edge. + uint64 channel_id = 1 [jstype = JS_STRING]; + + /* + The direction of this edge. If direction_reverse is false, the direction + of this edge is from the channel endpoint with the lexicographically smaller + pub key to the endpoint with the larger pub key. If direction_reverse is + is true, the edge goes the other way. + */ + bool direction_reverse = 2; +} + +message QueryRoutesResponse { + /* + The route that results from the path finding operation. This is still a + repeated field to retain backwards compatibility. + */ + repeated Route routes = 1; + + /* + The success probability of the returned route based on the current mission + control state. [EXPERIMENTAL] + */ + double success_prob = 2; +} + +message Hop { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; + int64 chan_capacity = 2 [deprecated = true]; + int64 amt_to_forward = 3 [deprecated = true]; + int64 fee = 4 [deprecated = true]; + uint32 expiry = 5; + int64 amt_to_forward_msat = 6; + int64 fee_msat = 7; + + /* + An optional public key of the hop. If the public key is given, the payment + can be executed without relying on a copy of the channel graph. + */ + string pub_key = 8; + + /* + If set to true, then this hop will be encoded using the new variable length + TLV format. Note that if any custom tlv_records below are specified, then + this field MUST be set to true for them to be encoded properly. + */ + bool tlv_payload = 9 [deprecated = true]; + + /* + An optional TLV record that signals the use of an MPP payment. If present, + the receiver will enforce that the same mpp_record is included in the final + hop payload of all non-zero payments in the HTLC set. If empty, a regular + single-shot payment is or was attempted. + */ + MPPRecord mpp_record = 10; + + /* + An optional TLV record that signals the use of an AMP payment. If present, + the receiver will treat all received payments including the same + (payment_addr, set_id) pair as being part of one logical payment. The + payment will be settled by XORing the root_share's together and deriving the + child hashes and preimages according to BOLT XX. Must be used in conjunction + with mpp_record. + */ + AMPRecord amp_record = 12; + + /* + An optional set of key-value TLV records. This is useful within the context + of the SendToRoute call as it allows callers to specify arbitrary K-V pairs + to drop off at each hop within the onion. + */ + map custom_records = 11; + + // The payment metadata to send along with the payment to the payee. + bytes metadata = 13; +} + +message MPPRecord { + /* + A unique, random identifier used to authenticate the sender as the intended + payer of a multi-path payment. The payment_addr must be the same for all + subpayments, and match the payment_addr provided in the receiver's invoice. + The same payment_addr must be used on all subpayments. + */ + bytes payment_addr = 11; + + /* + The total amount in milli-satoshis being sent as part of a larger multi-path + payment. The caller is responsible for ensuring subpayments to the same node + and payment_hash sum exactly to total_amt_msat. The same + total_amt_msat must be used on all subpayments. + */ + int64 total_amt_msat = 10; +} + +message AMPRecord { + bytes root_share = 1; + + bytes set_id = 2; + + uint32 child_index = 3; +} + +/* +A path through the channel graph which runs over one or more channels in +succession. This struct carries all the information required to craft the +Sphinx onion packet, and send the payment along the first hop in the path. A +route is only selected as valid if all the channels have sufficient capacity to +carry the initial payment amount after fees are accounted for. +*/ +message Route { + /* + The cumulative (final) time lock across the entire route. This is the CLTV + value that should be extended to the first hop in the route. All other hops + will decrement the time-lock as advertised, leaving enough time for all + hops to wait for or present the payment preimage to complete the payment. + */ + uint32 total_time_lock = 1; + + /* + The sum of the fees paid at each hop within the final route. In the case + of a one-hop payment, this value will be zero as we don't need to pay a fee + to ourselves. + */ + int64 total_fees = 2 [deprecated = true]; + + /* + The total amount of funds required to complete a payment over this route. + This value includes the cumulative fees at each hop. As a result, the HTLC + extended to the first-hop in the route will need to have at least this many + satoshis, otherwise the route will fail at an intermediate node due to an + insufficient amount of fees. + */ + int64 total_amt = 3 [deprecated = true]; + + /* + Contains details concerning the specific forwarding details at each hop. + */ + repeated Hop hops = 4; + + /* + The total fees in millisatoshis. + */ + int64 total_fees_msat = 5; + + /* + The total amount in millisatoshis. + */ + int64 total_amt_msat = 6; +} + +message NodeInfoRequest { + // The 33-byte hex-encoded compressed public of the target node + string pub_key = 1; + + // If true, will include all known channels associated with the node. + bool include_channels = 2; +} + +message NodeInfo { + /* + An individual vertex/node within the channel graph. A node is + connected to other nodes by one or more channel edges emanating from it. As + the graph is directed, a node will also have an incoming edge attached to + it for each outgoing edge. + */ + LightningNode node = 1; + + // The total number of channels for the node. + uint32 num_channels = 2; + + // The sum of all channels capacity for the node, denominated in satoshis. + int64 total_capacity = 3; + + // A list of all public channels for the node. + repeated ChannelEdge channels = 4; +} + +/* +An individual vertex/node within the channel graph. A node is +connected to other nodes by one or more channel edges emanating from it. As the +graph is directed, a node will also have an incoming edge attached to it for +each outgoing edge. +*/ +message LightningNode { + uint32 last_update = 1; + string pub_key = 2; + string alias = 3; + repeated NodeAddress addresses = 4; + string color = 5; + map features = 6; + + // Custom node announcement tlv records. + map custom_records = 7; +} + +message NodeAddress { + string network = 1; + string addr = 2; +} + +message RoutingPolicy { + uint32 time_lock_delta = 1; + int64 min_htlc = 2; + int64 fee_base_msat = 3; + int64 fee_rate_milli_msat = 4; + bool disabled = 5; + uint64 max_htlc_msat = 6; + uint32 last_update = 7; + + // Custom channel update tlv records. + map custom_records = 8; +} + +/* +A fully authenticated channel along with all its unique attributes. +Once an authenticated channel announcement has been processed on the network, +then an instance of ChannelEdgeInfo encapsulating the channels attributes is +stored. The other portions relevant to routing policy of a channel are stored +within a ChannelEdgePolicy for each direction of the channel. +*/ +message ChannelEdge { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 channel_id = 1 [jstype = JS_STRING]; + string chan_point = 2; + + uint32 last_update = 3 [deprecated = true]; + + string node1_pub = 4; + string node2_pub = 5; + + int64 capacity = 6; + + RoutingPolicy node1_policy = 7; + RoutingPolicy node2_policy = 8; + + // Custom channel announcement tlv records. + map custom_records = 9; +} + +message ChannelGraphRequest { + /* + Whether unannounced channels are included in the response or not. If set, + unannounced channels are included. Unannounced channels are both private + channels, and public channels that are not yet announced to the network. + */ + bool include_unannounced = 1; +} + +// Returns a new instance of the directed channel graph. +message ChannelGraph { + // The list of `LightningNode`s in this channel graph + repeated LightningNode nodes = 1; + + // The list of `ChannelEdge`s in this channel graph + repeated ChannelEdge edges = 2; +} + +enum NodeMetricType { + UNKNOWN = 0; + BETWEENNESS_CENTRALITY = 1; +} + +message NodeMetricsRequest { + // The requested node metrics. + repeated NodeMetricType types = 1; +} + +message NodeMetricsResponse { + /* + Betweenness centrality is the sum of the ratio of shortest paths that pass + through the node for each pair of nodes in the graph (not counting paths + starting or ending at this node). + Map of node pubkey to betweenness centrality of the node. Normalized + values are in the [0,1] closed interval. + */ + map betweenness_centrality = 1; +} + +message FloatMetric { + // Arbitrary float value. + double value = 1; + + // The value normalized to [0,1] or [-1,1]. + double normalized_value = 2; +} + +message ChanInfoRequest { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; +} + +message NetworkInfoRequest { +} +message NetworkInfo { + uint32 graph_diameter = 1; + double avg_out_degree = 2; + uint32 max_out_degree = 3; + + uint32 num_nodes = 4; + uint32 num_channels = 5; + + int64 total_network_capacity = 6; + + double avg_channel_size = 7; + int64 min_channel_size = 8; + int64 max_channel_size = 9; + int64 median_channel_size_sat = 10; + + // The number of edges marked as zombies. + uint64 num_zombie_chans = 11; + + // TODO(roasbeef): fee rate info, expiry + // * also additional RPC for tracking fee info once in +} + +message StopRequest { +} +message StopResponse { +} + +message GraphTopologySubscription { +} +message GraphTopologyUpdate { + repeated NodeUpdate node_updates = 1; + repeated ChannelEdgeUpdate channel_updates = 2; + repeated ClosedChannelUpdate closed_chans = 3; +} +message NodeUpdate { + /* + Deprecated, use node_addresses. + */ + repeated string addresses = 1 [deprecated = true]; + + string identity_key = 2; + + /* + Deprecated, use features. + */ + bytes global_features = 3 [deprecated = true]; + + string alias = 4; + string color = 5; + repeated NodeAddress node_addresses = 7; + + /* + Features that the node has advertised in the init message, node + announcements and invoices. + */ + map features = 6; +} +message ChannelEdgeUpdate { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; + + ChannelPoint chan_point = 2; + + int64 capacity = 3; + + RoutingPolicy routing_policy = 4; + + string advertising_node = 5; + string connecting_node = 6; +} +message ClosedChannelUpdate { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; + int64 capacity = 2; + uint32 closed_height = 3; + ChannelPoint chan_point = 4; +} + +message HopHint { + // The public key of the node at the start of the channel. + string node_id = 1; + + // The unique identifier of the channel. + uint64 chan_id = 2 [jstype = JS_STRING]; + + // The base fee of the channel denominated in millisatoshis. + uint32 fee_base_msat = 3; + + /* + The fee rate of the channel for sending one satoshi across it denominated in + millionths of a satoshi. + */ + uint32 fee_proportional_millionths = 4; + + // The time-lock delta of the channel. + uint32 cltv_expiry_delta = 5; +} + +message SetID { + bytes set_id = 1; +} + +message RouteHint { + /* + A list of hop hints that when chained together can assist in reaching a + specific destination. + */ + repeated HopHint hop_hints = 1; +} + +message AMPInvoiceState { + // The state the HTLCs associated with this setID are in. + InvoiceHTLCState state = 1; + + // The settle index of this HTLC set, if the invoice state is settled. + uint64 settle_index = 2; + + // The time this HTLC set was settled expressed in unix epoch. + int64 settle_time = 3; + + // The total amount paid for the sub-invoice expressed in milli satoshis. + int64 amt_paid_msat = 5; +} + +message Invoice { + /* + An optional memo to attach along with the invoice. Used for record keeping + purposes for the invoice's creator, and will also be set in the description + field of the encoded payment request if the description_hash field is not + being used. + */ + string memo = 1; + + reserved 2; + + /* + The hex-encoded preimage (32 byte) which will allow settling an incoming + HTLC payable to this preimage. When using REST, this field must be encoded + as base64. + */ + bytes r_preimage = 3; + + /* + The hash of the preimage. When using REST, this field must be encoded as + base64. + Note: Output only, don't specify for creating an invoice. + */ + bytes r_hash = 4; + + /* + The value of this invoice in satoshis + + The fields value and value_msat are mutually exclusive. + */ + int64 value = 5; + + /* + The value of this invoice in millisatoshis + + The fields value and value_msat are mutually exclusive. + */ + int64 value_msat = 23; + + /* + Whether this invoice has been fulfilled + + The field is deprecated. Use the state field instead (compare to SETTLED). + */ + bool settled = 6 [deprecated = true]; + + /* + When this invoice was created. + Note: Output only, don't specify for creating an invoice. + */ + int64 creation_date = 7; + + /* + When this invoice was settled. + Note: Output only, don't specify for creating an invoice. + */ + int64 settle_date = 8; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. + Note: Output only, don't specify for creating an invoice. + */ + string payment_request = 9; + + /* + Hash (SHA-256) of a description of the payment. Used if the description of + payment (memo) is too long to naturally fit within the description field + of an encoded payment request. When using REST, this field must be encoded + as base64. + */ + bytes description_hash = 10; + + // Payment request expiry time in seconds. Default is 3600 (1 hour). + int64 expiry = 11; + + // Fallback on-chain address. + string fallback_addr = 12; + + // Delta to use for the time-lock of the CLTV extended to the final hop. + uint64 cltv_expiry = 13; + + /* + Route hints that can each be individually used to assist in reaching the + invoice's destination. + */ + repeated RouteHint route_hints = 14; + + // Whether this invoice should include routing hints for private channels. + bool private = 15; + + /* + The "add" index of this invoice. Each newly created invoice will increment + this index making it monotonically increasing. Callers to the + SubscribeInvoices call can use this to instantly get notified of all added + invoices with an add_index greater than this one. + Note: Output only, don't specify for creating an invoice. + */ + uint64 add_index = 16; + + /* + The "settle" index of this invoice. Each newly settled invoice will + increment this index making it monotonically increasing. Callers to the + SubscribeInvoices call can use this to instantly get notified of all + settled invoices with an settle_index greater than this one. + Note: Output only, don't specify for creating an invoice. + */ + uint64 settle_index = 17; + + // Deprecated, use amt_paid_sat or amt_paid_msat. + int64 amt_paid = 18 [deprecated = true]; + + /* + The amount that was accepted for this invoice, in satoshis. This will ONLY + be set if this invoice has been settled. We provide this field as if the + invoice was created with a zero value, then we need to record what amount + was ultimately accepted. Additionally, it's possible that the sender paid + MORE that was specified in the original invoice. So we'll record that here + as well. + Note: Output only, don't specify for creating an invoice. + */ + int64 amt_paid_sat = 19; + + /* + The amount that was accepted for this invoice, in millisatoshis. This will + ONLY be set if this invoice has been settled. We provide this field as if + the invoice was created with a zero value, then we need to record what + amount was ultimately accepted. Additionally, it's possible that the sender + paid MORE that was specified in the original invoice. So we'll record that + here as well. + Note: Output only, don't specify for creating an invoice. + */ + int64 amt_paid_msat = 20; + + enum InvoiceState { + OPEN = 0; + SETTLED = 1; + CANCELED = 2; + ACCEPTED = 3; + } + + /* + The state the invoice is in. + Note: Output only, don't specify for creating an invoice. + */ + InvoiceState state = 21; + + /* + List of HTLCs paying to this invoice [EXPERIMENTAL]. + Note: Output only, don't specify for creating an invoice. + */ + repeated InvoiceHTLC htlcs = 22; + + /* + List of features advertised on the invoice. + Note: Output only, don't specify for creating an invoice. + */ + map features = 24; + + /* + Indicates if this invoice was a spontaneous payment that arrived via keysend + [EXPERIMENTAL]. + Note: Output only, don't specify for creating an invoice. + */ + bool is_keysend = 25; + + /* + The payment address of this invoice. This value will be used in MPP + payments, and also for newer invoices that always require the MPP payload + for added end-to-end security. + Note: Output only, don't specify for creating an invoice. + */ + bytes payment_addr = 26; + + /* + Signals whether or not this is an AMP invoice. + */ + bool is_amp = 27; + + /* + [EXPERIMENTAL]: + + Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the + given set ID. This field is always populated for AMP invoices, and can be + used along side LookupInvoice to obtain the HTLC information related to a + given sub-invoice. + Note: Output only, don't specify for creating an invoice. + */ + map amp_invoice_state = 28; +} + +enum InvoiceHTLCState { + ACCEPTED = 0; + SETTLED = 1; + CANCELED = 2; +} + +// Details of an HTLC that paid to an invoice +message InvoiceHTLC { + // Short channel id over which the htlc was received. + uint64 chan_id = 1 [jstype = JS_STRING]; + + // Index identifying the htlc on the channel. + uint64 htlc_index = 2; + + // The amount of the htlc in msat. + uint64 amt_msat = 3; + + // Block height at which this htlc was accepted. + int32 accept_height = 4; + + // Time at which this htlc was accepted. + int64 accept_time = 5; + + // Time at which this htlc was settled or canceled. + int64 resolve_time = 6; + + // Block height at which this htlc expires. + int32 expiry_height = 7; + + // Current state the htlc is in. + InvoiceHTLCState state = 8; + + // Custom tlv records. + map custom_records = 9; + + // The total amount of the mpp payment in msat. + uint64 mpp_total_amt_msat = 10; + + // Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. + AMP amp = 11; +} + +// Details specific to AMP HTLCs. +message AMP { + // An n-of-n secret share of the root seed from which child payment hashes + // and preimages are derived. + bytes root_share = 1; + + // An identifier for the HTLC set that this HTLC belongs to. + bytes set_id = 2; + + // A nonce used to randomize the child preimage and child hash from a given + // root_share. + uint32 child_index = 3; + + // The payment hash of the AMP HTLC. + bytes hash = 4; + + // The preimage used to settle this AMP htlc. This field will only be + // populated if the invoice is in InvoiceState_ACCEPTED or + // InvoiceState_SETTLED. + bytes preimage = 5; +} + +message AddInvoiceResponse { + bytes r_hash = 1; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. + */ + string payment_request = 2; + + /* + The "add" index of this invoice. Each newly created invoice will increment + this index making it monotonically increasing. Callers to the + SubscribeInvoices call can use this to instantly get notified of all added + invoices with an add_index greater than this one. + */ + uint64 add_index = 16; + + /* + The payment address of the generated invoice. This value should be used + in all payments for this invoice as we require it for end to end + security. + */ + bytes payment_addr = 17; +} +message PaymentHash { + /* + The hex-encoded payment hash of the invoice to be looked up. The passed + payment hash must be exactly 32 bytes, otherwise an error is returned. + Deprecated now that the REST gateway supports base64 encoding of bytes + fields. + */ + string r_hash_str = 1 [deprecated = true]; + + /* + The payment hash of the invoice to be looked up. When using REST, this field + must be encoded as base64. + */ + bytes r_hash = 2; +} + +message ListInvoiceRequest { + /* + If set, only invoices that are not settled and not canceled will be returned + in the response. + */ + bool pending_only = 1; + + /* + The index of an invoice that will be used as either the start or end of a + query to determine which invoices should be returned in the response. + */ + uint64 index_offset = 4; + + // The max number of invoices to return in the response to this query. + uint64 num_max_invoices = 5; + + /* + If set, the invoices returned will result from seeking backwards from the + specified index offset. This can be used to paginate backwards. + */ + bool reversed = 6; +} +message ListInvoiceResponse { + /* + A list of invoices from the time slice of the time series specified in the + request. + */ + repeated Invoice invoices = 1; + + /* + The index of the last item in the set of returned invoices. This can be used + to seek further, pagination style. + */ + uint64 last_index_offset = 2; + + /* + The index of the last item in the set of returned invoices. This can be used + to seek backwards, pagination style. + */ + uint64 first_index_offset = 3; +} + +message InvoiceSubscription { + /* + If specified (non-zero), then we'll first start by sending out + notifications for all added indexes with an add_index greater than this + value. This allows callers to catch up on any events they missed while they + weren't connected to the streaming RPC. + */ + uint64 add_index = 1; + + /* + If specified (non-zero), then we'll first start by sending out + notifications for all settled indexes with an settle_index greater than + this value. This allows callers to catch up on any events they missed while + they weren't connected to the streaming RPC. + */ + uint64 settle_index = 2; +} + +enum PaymentFailureReason { + /* + Payment isn't failed (yet). + */ + FAILURE_REASON_NONE = 0; + + /* + There are more routes to try, but the payment timeout was exceeded. + */ + FAILURE_REASON_TIMEOUT = 1; + + /* + All possible routes were tried and failed permanently. Or were no + routes to the destination at all. + */ + FAILURE_REASON_NO_ROUTE = 2; + + /* + A non-recoverable error has occured. + */ + FAILURE_REASON_ERROR = 3; + + /* + Payment details incorrect (unknown hash, invalid amt or + invalid final cltv delta) + */ + FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; + + /* + Insufficient local balance. + */ + FAILURE_REASON_INSUFFICIENT_BALANCE = 5; +} + +message Payment { + // The payment hash + string payment_hash = 1; + + // Deprecated, use value_sat or value_msat. + int64 value = 2 [deprecated = true]; + + // Deprecated, use creation_time_ns + int64 creation_date = 3 [deprecated = true]; + + reserved 4; + + // Deprecated, use fee_sat or fee_msat. + int64 fee = 5 [deprecated = true]; + + // The payment preimage + string payment_preimage = 6; + + // The value of the payment in satoshis + int64 value_sat = 7; + + // The value of the payment in milli-satoshis + int64 value_msat = 8; + + // The optional payment request being fulfilled. + string payment_request = 9; + + enum PaymentStatus { + UNKNOWN = 0; + IN_FLIGHT = 1; + SUCCEEDED = 2; + FAILED = 3; + } + + // The status of the payment. + PaymentStatus status = 10; + + // The fee paid for this payment in satoshis + int64 fee_sat = 11; + + // The fee paid for this payment in milli-satoshis + int64 fee_msat = 12; + + // The time in UNIX nanoseconds at which the payment was created. + int64 creation_time_ns = 13; + + // The HTLCs made in attempt to settle the payment. + repeated HTLCAttempt htlcs = 14; + + /* + The creation index of this payment. Each payment can be uniquely identified + by this index, which may not strictly increment by 1 for payments made in + older versions of lnd. + */ + uint64 payment_index = 15; + + PaymentFailureReason failure_reason = 16; +} + +message HTLCAttempt { + // The unique ID that is used for this attempt. + uint64 attempt_id = 7; + + enum HTLCStatus { + IN_FLIGHT = 0; + SUCCEEDED = 1; + FAILED = 2; + } + + // The status of the HTLC. + HTLCStatus status = 1; + + // The route taken by this HTLC. + Route route = 2; + + // The time in UNIX nanoseconds at which this HTLC was sent. + int64 attempt_time_ns = 3; + + /* + The time in UNIX nanoseconds at which this HTLC was settled or failed. + This value will not be set if the HTLC is still IN_FLIGHT. + */ + int64 resolve_time_ns = 4; + + // Detailed htlc failure info. + Failure failure = 5; + + // The preimage that was used to settle the HTLC. + bytes preimage = 6; +} + +message ListPaymentsRequest { + /* + If true, then return payments that have not yet fully completed. This means + that pending payments, as well as failed payments will show up if this + field is set to true. This flag doesn't change the meaning of the indices, + which are tied to individual payments. + */ + bool include_incomplete = 1; + + /* + The index of a payment that will be used as either the start or end of a + query to determine which payments should be returned in the response. The + index_offset is exclusive. In the case of a zero index_offset, the query + will start with the oldest payment when paginating forwards, or will end + with the most recent payment when paginating backwards. + */ + uint64 index_offset = 2; + + // The maximal number of payments returned in the response to this query. + uint64 max_payments = 3; + + /* + If set, the payments returned will result from seeking backwards from the + specified index offset. This can be used to paginate backwards. The order + of the returned payments is always oldest first (ascending index order). + */ + bool reversed = 4; + + /* + If set, all payments (complete and incomplete, independent of the + max_payments parameter) will be counted. Note that setting this to true will + increase the run time of the call significantly on systems that have a lot + of payments, as all of them have to be iterated through to be counted. + */ + bool count_total_payments = 5; +} + +message ListPaymentsResponse { + // The list of payments + repeated Payment payments = 1; + + /* + The index of the first item in the set of returned payments. This can be + used as the index_offset to continue seeking backwards in the next request. + */ + uint64 first_index_offset = 2; + + /* + The index of the last item in the set of returned payments. This can be used + as the index_offset to continue seeking forwards in the next request. + */ + uint64 last_index_offset = 3; + + /* + Will only be set if count_total_payments in the request was set. Represents + the total number of payments (complete and incomplete, independent of the + number of payments requested in the query) currently present in the payments + database. + */ + uint64 total_num_payments = 4; +} + +message DeletePaymentRequest { + // Payment hash to delete. + bytes payment_hash = 1; + + /* + Only delete failed HTLCs from the payment, not the payment itself. + */ + bool failed_htlcs_only = 2; +} + +message DeleteAllPaymentsRequest { + // Only delete failed payments. + bool failed_payments_only = 1; + + /* + Only delete failed HTLCs from payments, not the payment itself. + */ + bool failed_htlcs_only = 2; +} + +message DeletePaymentResponse { +} + +message DeleteAllPaymentsResponse { +} + +message AbandonChannelRequest { + ChannelPoint channel_point = 1; + + bool pending_funding_shim_only = 2; + + /* + Override the requirement for being in dev mode by setting this to true and + confirming the user knows what they are doing and this is a potential foot + gun to lose funds if used on active channels. + */ + bool i_know_what_i_am_doing = 3; +} + +message AbandonChannelResponse { +} + +message DebugLevelRequest { + bool show = 1; + string level_spec = 2; +} +message DebugLevelResponse { + string sub_systems = 1; +} + +message PayReqString { + // The payment request string to be decoded + string pay_req = 1; +} +message PayReq { + string destination = 1; + string payment_hash = 2; + int64 num_satoshis = 3; + int64 timestamp = 4; + int64 expiry = 5; + string description = 6; + string description_hash = 7; + string fallback_addr = 8; + int64 cltv_expiry = 9; + repeated RouteHint route_hints = 10; + bytes payment_addr = 11; + int64 num_msat = 12; + map features = 13; +} + +enum FeatureBit { + DATALOSS_PROTECT_REQ = 0; + DATALOSS_PROTECT_OPT = 1; + INITIAL_ROUING_SYNC = 3; + UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; + UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; + GOSSIP_QUERIES_REQ = 6; + GOSSIP_QUERIES_OPT = 7; + TLV_ONION_REQ = 8; + TLV_ONION_OPT = 9; + EXT_GOSSIP_QUERIES_REQ = 10; + EXT_GOSSIP_QUERIES_OPT = 11; + STATIC_REMOTE_KEY_REQ = 12; + STATIC_REMOTE_KEY_OPT = 13; + PAYMENT_ADDR_REQ = 14; + PAYMENT_ADDR_OPT = 15; + MPP_REQ = 16; + MPP_OPT = 17; + WUMBO_CHANNELS_REQ = 18; + WUMBO_CHANNELS_OPT = 19; + ANCHORS_REQ = 20; + ANCHORS_OPT = 21; + ANCHORS_ZERO_FEE_HTLC_REQ = 22; + ANCHORS_ZERO_FEE_HTLC_OPT = 23; + AMP_REQ = 30; + AMP_OPT = 31; +} + +message Feature { + string name = 2; + bool is_required = 3; + bool is_known = 4; +} + +message FeeReportRequest { +} +message ChannelFeeReport { + // The short channel id that this fee report belongs to. + uint64 chan_id = 5 [jstype = JS_STRING]; + + // The channel that this fee report belongs to. + string channel_point = 1; + + // The base fee charged regardless of the number of milli-satoshis sent. + int64 base_fee_msat = 2; + + // The amount charged per milli-satoshis transferred expressed in + // millionths of a satoshi. + int64 fee_per_mil = 3; + + // The effective fee rate in milli-satoshis. Computed by dividing the + // fee_per_mil value by 1 million. + double fee_rate = 4; +} +message FeeReportResponse { + // An array of channel fee reports which describes the current fee schedule + // for each channel. + repeated ChannelFeeReport channel_fees = 1; + + // The total amount of fee revenue (in satoshis) the switch has collected + // over the past 24 hrs. + uint64 day_fee_sum = 2; + + // The total amount of fee revenue (in satoshis) the switch has collected + // over the past 1 week. + uint64 week_fee_sum = 3; + + // The total amount of fee revenue (in satoshis) the switch has collected + // over the past 1 month. + uint64 month_fee_sum = 4; +} + +message PolicyUpdateRequest { + oneof scope { + // If set, then this update applies to all currently active channels. + bool global = 1; + + // If set, this update will target a specific channel. + ChannelPoint chan_point = 2; + } + + // The base fee charged regardless of the number of milli-satoshis sent. + int64 base_fee_msat = 3; + + // The effective fee rate in milli-satoshis. The precision of this value + // goes up to 6 decimal places, so 1e-6. + double fee_rate = 4; + + // The effective fee rate in micro-satoshis (parts per million). + uint32 fee_rate_ppm = 9; + + // The required timelock delta for HTLCs forwarded over the channel. + uint32 time_lock_delta = 5; + + // If set, the maximum HTLC size in milli-satoshis. If unset, the maximum + // HTLC will be unchanged. + uint64 max_htlc_msat = 6; + + // The minimum HTLC size in milli-satoshis. Only applied if + // min_htlc_msat_specified is true. + uint64 min_htlc_msat = 7; + + // If true, min_htlc_msat is applied. + bool min_htlc_msat_specified = 8; +} +enum UpdateFailure { + UPDATE_FAILURE_UNKNOWN = 0; + UPDATE_FAILURE_PENDING = 1; + UPDATE_FAILURE_NOT_FOUND = 2; + UPDATE_FAILURE_INTERNAL_ERR = 3; + UPDATE_FAILURE_INVALID_PARAMETER = 4; +} + +message FailedUpdate { + // The outpoint in format txid:n + OutPoint outpoint = 1; + + // Reason for the policy update failure. + UpdateFailure reason = 2; + + // A string representation of the policy update error. + string update_error = 3; +} + +message PolicyUpdateResponse { + // List of failed policy updates. + repeated FailedUpdate failed_updates = 1; +} + +message ForwardingHistoryRequest { + // Start time is the starting point of the forwarding history request. All + // records beyond this point will be included, respecting the end time, and + // the index offset. + uint64 start_time = 1; + + // End time is the end point of the forwarding history request. The + // response will carry at most 50k records between the start time and the + // end time. The index offset can be used to implement pagination. + uint64 end_time = 2; + + // Index offset is the offset in the time series to start at. As each + // response can only contain 50k records, callers can use this to skip + // around within a packed time series. + uint32 index_offset = 3; + + // The max number of events to return in the response to this query. + uint32 num_max_events = 4; + + // Informs the server if the peer alias should be looked up for each + // forwarding event. + bool peer_alias_lookup = 5; +} +message ForwardingEvent { + // Timestamp is the time (unix epoch offset) that this circuit was + // completed. Deprecated by timestamp_ns. + uint64 timestamp = 1 [deprecated = true]; + + // The incoming channel ID that carried the HTLC that created the circuit. + uint64 chan_id_in = 2 [jstype = JS_STRING]; + + // The outgoing channel ID that carried the preimage that completed the + // circuit. + uint64 chan_id_out = 4 [jstype = JS_STRING]; + + // The total amount (in satoshis) of the incoming HTLC that created half + // the circuit. + uint64 amt_in = 5; + + // The total amount (in satoshis) of the outgoing HTLC that created the + // second half of the circuit. + uint64 amt_out = 6; + + // The total fee (in satoshis) that this payment circuit carried. + uint64 fee = 7; + + // The total fee (in milli-satoshis) that this payment circuit carried. + uint64 fee_msat = 8; + + // The total amount (in milli-satoshis) of the incoming HTLC that created + // half the circuit. + uint64 amt_in_msat = 9; + + // The total amount (in milli-satoshis) of the outgoing HTLC that created + // the second half of the circuit. + uint64 amt_out_msat = 10; + + // The number of nanoseconds elapsed since January 1, 1970 UTC when this + // circuit was completed. + uint64 timestamp_ns = 11; + + // The peer alias of the incoming channel. + string peer_alias_in = 12; + + // The peer alias of the outgoing channel. + string peer_alias_out = 13; + + // TODO(roasbeef): add settlement latency? + // * use FPE on the chan id? + // * also list failures? +} +message ForwardingHistoryResponse { + // A list of forwarding events from the time slice of the time series + // specified in the request. + repeated ForwardingEvent forwarding_events = 1; + + // The index of the last time in the set of returned forwarding events. Can + // be used to seek further, pagination style. + uint32 last_offset_index = 2; +} + +message ExportChannelBackupRequest { + // The target channel point to obtain a back up for. + ChannelPoint chan_point = 1; +} + +message ChannelBackup { + /* + Identifies the channel that this backup belongs to. + */ + ChannelPoint chan_point = 1; + + /* + Is an encrypted single-chan backup. this can be passed to + RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in + order to trigger the recovery protocol. When using REST, this field must be + encoded as base64. + */ + bytes chan_backup = 2; +} + +message MultiChanBackup { + /* + Is the set of all channels that are included in this multi-channel backup. + */ + repeated ChannelPoint chan_points = 1; + + /* + A single encrypted blob containing all the static channel backups of the + channel listed above. This can be stored as a single file or blob, and + safely be replaced with any prior/future versions. When using REST, this + field must be encoded as base64. + */ + bytes multi_chan_backup = 2; +} + +message ChanBackupExportRequest { +} +message ChanBackupSnapshot { + /* + The set of new channels that have been added since the last channel backup + snapshot was requested. + */ + ChannelBackups single_chan_backups = 1; + + /* + A multi-channel backup that covers all open channels currently known to + lnd. + */ + MultiChanBackup multi_chan_backup = 2; +} + +message ChannelBackups { + /* + A set of single-chan static channel backups. + */ + repeated ChannelBackup chan_backups = 1; +} + +message RestoreChanBackupRequest { + oneof backup { + /* + The channels to restore as a list of channel/backup pairs. + */ + ChannelBackups chan_backups = 1; + + /* + The channels to restore in the packed multi backup format. When using + REST, this field must be encoded as base64. + */ + bytes multi_chan_backup = 2; + } +} +message RestoreBackupResponse { +} + +message ChannelBackupSubscription { +} + +message VerifyChanBackupResponse { +} + +message MacaroonPermission { + // The entity a permission grants access to. + string entity = 1; + + // The action that is granted. + string action = 2; +} +message BakeMacaroonRequest { + // The list of permissions the new macaroon should grant. + repeated MacaroonPermission permissions = 1; + + // The root key ID used to create the macaroon, must be a positive integer. + uint64 root_key_id = 2; + + /* + Informs the RPC on whether to allow external permissions that LND is not + aware of. + */ + bool allow_external_permissions = 3; +} +message BakeMacaroonResponse { + // The hex encoded macaroon, serialized in binary format. + string macaroon = 1; +} + +message ListMacaroonIDsRequest { +} +message ListMacaroonIDsResponse { + // The list of root key IDs that are in use. + repeated uint64 root_key_ids = 1; +} + +message DeleteMacaroonIDRequest { + // The root key ID to be removed. + uint64 root_key_id = 1; +} +message DeleteMacaroonIDResponse { + // A boolean indicates that the deletion is successful. + bool deleted = 1; +} + +message MacaroonPermissionList { + // A list of macaroon permissions. + repeated MacaroonPermission permissions = 1; +} + +message ListPermissionsRequest { +} +message ListPermissionsResponse { + /* + A map between all RPC method URIs and their required macaroon permissions to + access them. + */ + map method_permissions = 1; +} + +message Failure { + enum FailureCode { + /* + The numbers assigned in this enumeration match the failure codes as + defined in BOLT #4. Because protobuf 3 requires enums to start with 0, + a RESERVED value is added. + */ + RESERVED = 0; + + INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; + INCORRECT_PAYMENT_AMOUNT = 2; + FINAL_INCORRECT_CLTV_EXPIRY = 3; + FINAL_INCORRECT_HTLC_AMOUNT = 4; + FINAL_EXPIRY_TOO_SOON = 5; + INVALID_REALM = 6; + EXPIRY_TOO_SOON = 7; + INVALID_ONION_VERSION = 8; + INVALID_ONION_HMAC = 9; + INVALID_ONION_KEY = 10; + AMOUNT_BELOW_MINIMUM = 11; + FEE_INSUFFICIENT = 12; + INCORRECT_CLTV_EXPIRY = 13; + CHANNEL_DISABLED = 14; + TEMPORARY_CHANNEL_FAILURE = 15; + REQUIRED_NODE_FEATURE_MISSING = 16; + REQUIRED_CHANNEL_FEATURE_MISSING = 17; + UNKNOWN_NEXT_PEER = 18; + TEMPORARY_NODE_FAILURE = 19; + PERMANENT_NODE_FAILURE = 20; + PERMANENT_CHANNEL_FAILURE = 21; + EXPIRY_TOO_FAR = 22; + MPP_TIMEOUT = 23; + INVALID_ONION_PAYLOAD = 24; + + /* + An internal error occurred. + */ + INTERNAL_FAILURE = 997; + + /* + The error source is known, but the failure itself couldn't be decoded. + */ + UNKNOWN_FAILURE = 998; + + /* + An unreadable failure result is returned if the received failure message + cannot be decrypted. In that case the error source is unknown. + */ + UNREADABLE_FAILURE = 999; + } + + // Failure code as defined in the Lightning spec + FailureCode code = 1; + + reserved 2; + + // An optional channel update message. + ChannelUpdate channel_update = 3; + + // A failure type-dependent htlc value. + uint64 htlc_msat = 4; + + // The sha256 sum of the onion payload. + bytes onion_sha_256 = 5; + + // A failure type-dependent cltv expiry value. + uint32 cltv_expiry = 6; + + // A failure type-dependent flags value. + uint32 flags = 7; + + /* + The position in the path of the intermediate or final node that generated + the failure message. Position zero is the sender node. + **/ + uint32 failure_source_index = 8; + + // A failure type-dependent block height. + uint32 height = 9; +} + +message ChannelUpdate { + /* + The signature that validates the announced data and proves the ownership + of node id. + */ + bytes signature = 1; + + /* + The target chain that this channel was opened within. This value + should be the genesis hash of the target chain. Along with the short + channel ID, this uniquely identifies the channel globally in a + blockchain. + */ + bytes chain_hash = 2; + + /* + The unique description of the funding transaction. + */ + uint64 chan_id = 3 [jstype = JS_STRING]; + + /* + A timestamp that allows ordering in the case of multiple announcements. + We should ignore the message if timestamp is not greater than the + last-received. + */ + uint32 timestamp = 4; + + /* + The bitfield that describes whether optional fields are present in this + update. Currently, the least-significant bit must be set to 1 if the + optional field MaxHtlc is present. + */ + uint32 message_flags = 10; + + /* + The bitfield that describes additional meta-data concerning how the + update is to be interpreted. Currently, the least-significant bit must be + set to 0 if the creating node corresponds to the first node in the + previously sent channel announcement and 1 otherwise. If the second bit + is set, then the channel is set to be disabled. + */ + uint32 channel_flags = 5; + + /* + The minimum number of blocks this node requires to be added to the expiry + of HTLCs. This is a security parameter determined by the node operator. + This value represents the required gap between the time locks of the + incoming and outgoing HTLC's set to this node. + */ + uint32 time_lock_delta = 6; + + /* + The minimum HTLC value which will be accepted. + */ + uint64 htlc_minimum_msat = 7; + + /* + The base fee that must be used for incoming HTLC's to this particular + channel. This value will be tacked onto the required for a payment + independent of the size of the payment. + */ + uint32 base_fee = 8; + + /* + The fee rate that will be charged per millionth of a satoshi. + */ + uint32 fee_rate = 9; + + /* + The maximum HTLC value which will be accepted. + */ + uint64 htlc_maximum_msat = 11; + + /* + The set of data that was appended to this message, some of which we may + not actually know how to iterate or parse. By holding onto this data, we + ensure that we're able to properly validate the set of signatures that + cover these new fields, and ensure we're able to make upgrades to the + network in a forwards compatible manner. + */ + bytes extra_opaque_data = 12; +} + +message MacaroonId { + bytes nonce = 1; + bytes storageId = 2; + repeated Op ops = 3; +} + +message Op { + string entity = 1; + repeated string actions = 2; +} + +message CheckMacPermRequest { + bytes macaroon = 1; + repeated MacaroonPermission permissions = 2; + string fullMethod = 3; +} + +message CheckMacPermResponse { + bool valid = 1; +} + +message RPCMiddlewareRequest { + /* + The unique ID of the intercepted original gRPC request. Useful for mapping + request to response when implementing full duplex message interception. For + streaming requests, this will be the same ID for all incoming and outgoing + middleware intercept messages of the _same_ stream. + */ + uint64 request_id = 1; + + /* + The raw bytes of the complete macaroon as sent by the gRPC client in the + original request. This might be empty for a request that doesn't require + macaroons such as the wallet unlocker RPCs. + */ + bytes raw_macaroon = 2; + + /* + The parsed condition of the macaroon's custom caveat for convenient access. + This field only contains the value of the custom caveat that the handling + middleware has registered itself for. The condition _must_ be validated for + messages of intercept_type stream_auth and request! + */ + string custom_caveat_condition = 3; + + /* + There are three types of messages that will be sent to the middleware for + inspection and approval: Stream authentication, request and response + interception. The first two can only be accepted (=forward to main RPC + server) or denied (=return error to client). Intercepted responses can also + be replaced/overwritten. + */ + oneof intercept_type { + /* + Intercept stream authentication: each new streaming RPC call that is + initiated against lnd and contains the middleware's custom macaroon + caveat can be approved or denied based upon the macaroon in the stream + header. This message will only be sent for streaming RPCs, unary RPCs + must handle the macaroon authentication in the request interception to + avoid an additional message round trip between lnd and the middleware. + */ + StreamAuth stream_auth = 4; + + /* + Intercept incoming gRPC client request message: all incoming messages, + both on streaming and unary RPCs, are forwarded to the middleware for + inspection. For unary RPC messages the middleware is also expected to + validate the custom macaroon caveat of the request. + */ + RPCMessage request = 5; + + /* + Intercept outgoing gRPC response message: all outgoing messages, both on + streaming and unary RPCs, are forwarded to the middleware for inspection + and amendment. The response in this message is the original response as + it was generated by the main RPC server. It can either be accepted + (=forwarded to the client), replaced/overwritten with a new message of + the same type, or replaced by an error message. + */ + RPCMessage response = 6; + + /* + This is used to indicate to the client that the server has successfully + registered the interceptor. This is only used in the very first message + that the server sends to the client after the client sends the server + the middleware registration message. + */ + bool reg_complete = 8; + } + + /* + The unique message ID of this middleware intercept message. There can be + multiple middleware intercept messages per single gRPC request (one for the + incoming request and one for the outgoing response) or gRPC stream (one for + each incoming message and one for each outgoing response). This message ID + must be referenced when responding (accepting/rejecting/modifying) to an + intercept message. + */ + uint64 msg_id = 7; +} + +message StreamAuth { + /* + The full URI (in the format /./MethodName, for + example /lnrpc.Lightning/GetInfo) of the streaming RPC method that was just + established. + */ + string method_full_uri = 1; +} + +message RPCMessage { + /* + The full URI (in the format /./MethodName, for + example /lnrpc.Lightning/GetInfo) of the RPC method the message was sent + to/from. + */ + string method_full_uri = 1; + + /* + Indicates whether the message was sent over a streaming RPC method or not. + */ + bool stream_rpc = 2; + + /* + The full canonical gRPC name of the message type (in the format + .TypeName, for example lnrpc.GetInfoRequest). In case of an + error being returned from lnd, this simply contains the string "error". + */ + string type_name = 3; + + /* + The full content of the gRPC message, serialized in the binary protobuf + format. + */ + bytes serialized = 4; + + /* + Indicates that the response from lnd was an error, not a gRPC response. If + this is set to true then the type_name contains the string "error" and + serialized contains the error string. + */ + bool is_error = 5; +} + +message RPCMiddlewareResponse { + /* + The request message ID this response refers to. Must always be set when + giving feedback to an intercept but is ignored for the initial registration + message. + */ + uint64 ref_msg_id = 1; + + /* + The middleware can only send two types of messages to lnd: The initial + registration message that identifies the middleware and after that only + feedback messages to requests sent to the middleware. + */ + oneof middleware_message { + /* + The registration message identifies the middleware that's being + registered in lnd. The registration message must be sent immediately + after initiating the RegisterRpcMiddleware stream, otherwise lnd will + time out the attempt and terminate the request. NOTE: The middleware + will only receive interception messages for requests that contain a + macaroon with the custom caveat that the middleware declares it is + responsible for handling in the registration message! As a security + measure, _no_ middleware can intercept requests made with _unencumbered_ + macaroons! + */ + MiddlewareRegistration register = 2; + + /* + The middleware received an interception request and gives feedback to + it. The request_id indicates what message the feedback refers to. + */ + InterceptFeedback feedback = 3; + } +} + +message MiddlewareRegistration { + /* + The name of the middleware to register. The name should be as informative + as possible and is logged on registration. + */ + string middleware_name = 1; + + /* + The name of the custom macaroon caveat that this middleware is responsible + for. Only requests/responses that contain a macaroon with the registered + custom caveat are forwarded for interception to the middleware. The + exception being the read-only mode: All requests/responses are forwarded to + a middleware that requests read-only access but such a middleware won't be + allowed to _alter_ responses. As a security measure, _no_ middleware can + change responses to requests made with _unencumbered_ macaroons! + NOTE: Cannot be used at the same time as read_only_mode. + */ + string custom_macaroon_caveat_name = 2; + + /* + Instead of defining a custom macaroon caveat name a middleware can register + itself for read-only access only. In that mode all requests/responses are + forwarded to the middleware but the middleware isn't allowed to alter any of + the responses. + NOTE: Cannot be used at the same time as custom_macaroon_caveat_name. + */ + bool read_only_mode = 3; +} + +message InterceptFeedback { + /* + The error to return to the user. If this is non-empty, the incoming gRPC + stream/request is aborted and the error is returned to the gRPC client. If + this value is empty, it means the middleware accepts the stream/request/ + response and the processing of it can continue. + */ + string error = 1; + + /* + A boolean indicating that the gRPC message should be replaced/overwritten. + This boolean is needed because in protobuf an empty message is serialized as + a 0-length or nil byte slice and we wouldn't be able to distinguish between + an empty replacement message and the "don't replace anything" case. + */ + bool replace_response = 2; + + /* + If the replace_response field is set to true, this field must contain the + binary serialized gRPC message in the protobuf format. + */ + bytes replacement_serialized = 3; } \ No newline at end of file diff --git a/proto/others/router.proto b/proto/others/router.proto index 1105fd63..16cb769f 100644 --- a/proto/others/router.proto +++ b/proto/others/router.proto @@ -1,866 +1,866 @@ -syntax = "proto3"; - -import "lightning.proto"; - -package routerrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc/routerrpc"; - -// Router is a service that offers advanced interaction with the router -// subsystem of the daemon. -service Router { - /* - SendPaymentV2 attempts to route a payment described by the passed - PaymentRequest to the final destination. The call returns a stream of - payment updates. - */ - rpc SendPaymentV2 (SendPaymentRequest) returns (stream lnrpc.Payment); - - /* - TrackPaymentV2 returns an update stream for the payment identified by the - payment hash. - */ - rpc TrackPaymentV2 (TrackPaymentRequest) returns (stream lnrpc.Payment); - - /* - TrackPayments returns an update stream for every payment that is not in a - terminal state. Note that if payments are in-flight while starting a new - subscription, the start of the payment stream could produce out-of-order - and/or duplicate events. In order to get updates for every in-flight - payment attempt make sure to subscribe to this method before initiating any - payments. - */ - rpc TrackPayments (TrackPaymentsRequest) returns (stream lnrpc.Payment); - - /* - EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it - may cost to send an HTLC to the target end destination. - */ - rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse); - - /* - Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - the specified route. This method differs from SendPayment in that it - allows users to specify a full route manually. This can be used for - things like rebalancing, and atomic swaps. It differs from the newer - SendToRouteV2 in that it doesn't return the full HTLC information. - */ - rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse) { - option deprecated = true; - } - - /* - SendToRouteV2 attempts to make a payment via the specified route. This - method differs from SendPayment in that it allows users to specify a full - route manually. This can be used for things like rebalancing, and atomic - swaps. - */ - rpc SendToRouteV2 (SendToRouteRequest) returns (lnrpc.HTLCAttempt); - - /* - ResetMissionControl clears all mission control state and starts with a clean - slate. - */ - rpc ResetMissionControl (ResetMissionControlRequest) - returns (ResetMissionControlResponse); - - /* - QueryMissionControl exposes the internal mission control state to callers. - It is a development feature. - */ - rpc QueryMissionControl (QueryMissionControlRequest) - returns (QueryMissionControlResponse); - - /* - XImportMissionControl is an experimental API that imports the state provided - to the internal mission control's state, using all results which are more - recent than our existing values. These values will only be imported - in-memory, and will not be persisted across restarts. - */ - rpc XImportMissionControl (XImportMissionControlRequest) - returns (XImportMissionControlResponse); - - /* - GetMissionControlConfig returns mission control's current config. - */ - rpc GetMissionControlConfig (GetMissionControlConfigRequest) - returns (GetMissionControlConfigResponse); - - /* - SetMissionControlConfig will set mission control's config, if the config - provided is valid. - */ - rpc SetMissionControlConfig (SetMissionControlConfigRequest) - returns (SetMissionControlConfigResponse); - - /* - QueryProbability returns the current success probability estimate for a - given node pair and amount. - */ - rpc QueryProbability (QueryProbabilityRequest) - returns (QueryProbabilityResponse); - - /* - BuildRoute builds a fully specified route based on a list of hop public - keys. It retrieves the relevant channel policies from the graph in order to - calculate the correct fees and time locks. - */ - rpc BuildRoute (BuildRouteRequest) returns (BuildRouteResponse); - - /* - SubscribeHtlcEvents creates a uni-directional stream from the server to - the client which delivers a stream of htlc events. - */ - rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest) - returns (stream HtlcEvent); - - /* - Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - described by the passed PaymentRequest to the final destination. The call - returns a stream of payment status updates. - */ - rpc SendPayment (SendPaymentRequest) returns (stream PaymentStatus) { - option deprecated = true; - } - - /* - Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - the payment identified by the payment hash. - */ - rpc TrackPayment (TrackPaymentRequest) returns (stream PaymentStatus) { - option deprecated = true; - } - - /** - HtlcInterceptor dispatches a bi-directional streaming RPC in which - Forwarded HTLC requests are sent to the client and the client responds with - a boolean that tells LND if this htlc should be intercepted. - In case of interception, the htlc can be either settled, cancelled or - resumed later by using the ResolveHoldForward endpoint. - */ - rpc HtlcInterceptor (stream ForwardHtlcInterceptResponse) - returns (stream ForwardHtlcInterceptRequest); - - /* - UpdateChanStatus attempts to manually set the state of a channel - (enabled, disabled, or auto). A manual "disable" request will cause the - channel to stay disabled until a subsequent manual request of either - "enable" or "auto". - */ - rpc UpdateChanStatus (UpdateChanStatusRequest) - returns (UpdateChanStatusResponse); -} - -message SendPaymentRequest { - // The identity pubkey of the payment recipient - bytes dest = 1; - - /* - Number of satoshis to send. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 2; - - /* - Number of millisatoshis to send. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - // The hash to use within the payment's HTLC - bytes payment_hash = 3; - - /* - The CLTV delta from the current height that should be used to set the - timelock for the final hop. - */ - int32 final_cltv_delta = 4; - - // An optional payment addr to be included within the last hop of the route. - bytes payment_addr = 20; - - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. The amount in the payment request may be zero. In - that case it is required to set the amt field as well. If no payment request - is specified, the following fields are required: dest, amt and payment_hash. - */ - string payment_request = 5; - - /* - An upper limit on the amount of time we should spend when attempting to - fulfill the payment. This is expressed in seconds. If we cannot make a - successful payment within this time frame, an error will be returned. - This field must be non-zero. - */ - int32 timeout_seconds = 6; - - /* - The maximum number of satoshis that will be paid as a fee of the payment. - If this field is left to the default value of 0, only zero-fee routes will - be considered. This usually means single hop routes connecting directly to - the destination. To send the payment without a fee limit, use max int here. - - The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - */ - int64 fee_limit_sat = 7; - - /* - The maximum number of millisatoshis that will be paid as a fee of the - payment. If this field is left to the default value of 0, only zero-fee - routes will be considered. This usually means single hop routes connecting - directly to the destination. To send the payment without a fee limit, use - max int here. - - The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - */ - int64 fee_limit_msat = 13; - - /* - Deprecated, use outgoing_chan_ids. The channel id of the channel that must - be taken to the first hop. If zero, any channel may be used (unless - outgoing_chan_ids are set). - */ - uint64 outgoing_chan_id = 8 [jstype = JS_STRING, deprecated = true]; - - /* - The channel ids of the channels are allowed for the first hop. If empty, - any channel may be used. - */ - repeated uint64 outgoing_chan_ids = 19; - - /* - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 14; - - /* - An optional maximum total time lock for the route. This should not exceed - lnd's `--max-cltv-expiry` setting. If zero, then the value of - `--max-cltv-expiry` is enforced. - */ - int32 cltv_limit = 9; - - /* - Optional route hints to reach the destination through private channels. - */ - repeated lnrpc.RouteHint route_hints = 10; - - /* - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. Record types are - required to be in the custom range >= 65536. When using REST, the values - must be encoded as base64. - */ - map dest_custom_records = 11; - - // If set, circular payments to self are permitted. - bool allow_self_payment = 15; - - /* - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated lnrpc.FeatureBit dest_features = 16; - - /* - The maximum number of partial payments that may be use to complete the full - amount. - */ - uint32 max_parts = 17; - - /* - If set, only the final payment update is streamed back. Intermediate updates - that show which htlcs are still in flight are suppressed. - */ - bool no_inflight_updates = 18; - - /* - The largest payment split that should be attempted when making a payment if - splitting is necessary. Setting this value will effectively cause lnd to - split more aggressively, vs only when it thinks it needs to. Note that this - value is in milli-satoshis. - */ - uint64 max_shard_size_msat = 21; - - /* - If set, an AMP-payment will be attempted. - */ - bool amp = 22; - - /* - The time preference for this payment. Set to -1 to optimize for fees - only, to 1 to optimize for reliability only or a value inbetween for a mix. - */ - double time_pref = 23; -} - -message TrackPaymentRequest { - // The hash of the payment to look up. - bytes payment_hash = 1; - - /* - If set, only the final payment update is streamed back. Intermediate updates - that show which htlcs are still in flight are suppressed. - */ - bool no_inflight_updates = 2; -} - -message TrackPaymentsRequest { - /* - If set, only the final payment updates are streamed back. Intermediate - updates that show which htlcs are still in flight are suppressed. - */ - bool no_inflight_updates = 1; -} - -message RouteFeeRequest { - /* - The destination once wishes to obtain a routing fee quote to. - */ - bytes dest = 1; - - /* - The amount one wishes to send to the target destination. - */ - int64 amt_sat = 2; -} - -message RouteFeeResponse { - /* - A lower bound of the estimated fee to the target destination within the - network, expressed in milli-satoshis. - */ - int64 routing_fee_msat = 1; - - /* - An estimate of the worst case time delay that can occur. Note that callers - will still need to factor in the final CLTV delta of the last hop into this - value. - */ - int64 time_lock_delay = 2; -} - -message SendToRouteRequest { - // The payment hash to use for the HTLC. - bytes payment_hash = 1; - - // Route that should be used to attempt to complete the payment. - lnrpc.Route route = 2; - - /* - Whether the payment should be marked as failed when a temporary error is - returned from the given route. Set it to true so the payment won't be - failed unless a terminal error is occurred, such as payment timeout, no - routes, incorrect payment details, or insufficient funds. - */ - bool skip_temp_err = 3; -} - -message SendToRouteResponse { - // The preimage obtained by making the payment. - bytes preimage = 1; - - // The failure message in case the payment failed. - lnrpc.Failure failure = 2; -} - -message ResetMissionControlRequest { -} - -message ResetMissionControlResponse { -} - -message QueryMissionControlRequest { -} - -// QueryMissionControlResponse contains mission control state. -message QueryMissionControlResponse { - reserved 1; - - // Node pair-level mission control state. - repeated PairHistory pairs = 2; -} - -message XImportMissionControlRequest { - // Node pair-level mission control state to be imported. - repeated PairHistory pairs = 1; - - // Whether to force override MC pair history. Note that even with force - // override the failure pair is imported before the success pair and both - // still clamp existing failure/success amounts. - bool force = 2; -} - -message XImportMissionControlResponse { -} - -// PairHistory contains the mission control state for a particular node pair. -message PairHistory { - // The source node pubkey of the pair. - bytes node_from = 1; - - // The destination node pubkey of the pair. - bytes node_to = 2; - - reserved 3, 4, 5, 6; - - PairData history = 7; -} - -message PairData { - // Time of last failure. - int64 fail_time = 1; - - /* - Lowest amount that failed to forward rounded to whole sats. This may be - set to zero if the failure is independent of amount. - */ - int64 fail_amt_sat = 2; - - /* - Lowest amount that failed to forward in millisats. This may be - set to zero if the failure is independent of amount. - */ - int64 fail_amt_msat = 4; - - reserved 3; - - // Time of last success. - int64 success_time = 5; - - // Highest amount that we could successfully forward rounded to whole sats. - int64 success_amt_sat = 6; - - // Highest amount that we could successfully forward in millisats. - int64 success_amt_msat = 7; -} - -message GetMissionControlConfigRequest { -} - -message GetMissionControlConfigResponse { - /* - Mission control's currently active config. - */ - MissionControlConfig config = 1; -} - -message SetMissionControlConfigRequest { - /* - The config to set for mission control. Note that all values *must* be set, - because the full config will be applied. - */ - MissionControlConfig config = 1; -} - -message SetMissionControlConfigResponse { -} - -message MissionControlConfig { - /* - The amount of time mission control will take to restore a penalized node - or channel back to 50% success probability, expressed in seconds. Setting - this value to a higher value will penalize failures for longer, making - mission control less likely to route through nodes and channels that we - have previously recorded failures for. - */ - uint64 half_life_seconds = 1; - - /* - The probability of success mission control should assign to hop in a route - where it has no other information available. Higher values will make mission - control more willing to try hops that we have no information about, lower - values will discourage trying these hops. - */ - float hop_probability = 2; - - /* - The importance that mission control should place on historical results, - expressed as a value in [0;1]. Setting this value to 1 will ignore all - historical payments and just use the hop probability to assess the - probability of success for each hop. A zero value ignores hop probability - completely and relies entirely on historical results, unless none are - available. - */ - float weight = 3; - - /* - The maximum number of payment results that mission control will store. - */ - uint32 maximum_payment_results = 4; - - /* - The minimum time that must have passed since the previously recorded failure - before we raise the failure amount. - */ - uint64 minimum_failure_relax_interval = 5; -} - -message QueryProbabilityRequest { - // The source node pubkey of the pair. - bytes from_node = 1; - - // The destination node pubkey of the pair. - bytes to_node = 2; - - // The amount for which to calculate a probability. - int64 amt_msat = 3; -} - -message QueryProbabilityResponse { - // The success probability for the requested pair. - double probability = 1; - - // The historical data for the requested pair. - PairData history = 2; -} - -message BuildRouteRequest { - /* - The amount to send expressed in msat. If set to zero, the minimum routable - amount is used. - */ - int64 amt_msat = 1; - - /* - CLTV delta from the current height that should be used for the timelock - of the final hop - */ - int32 final_cltv_delta = 2; - - /* - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; - - /* - A list of hops that defines the route. This does not include the source hop - pubkey. - */ - repeated bytes hop_pubkeys = 4; - - // An optional payment addr to be included within the last hop of the route. - bytes payment_addr = 5; -} - -message BuildRouteResponse { - /* - Fully specified route that can be used to execute the payment. - */ - lnrpc.Route route = 1; -} - -message SubscribeHtlcEventsRequest { -} - -/* -HtlcEvent contains the htlc event that was processed. These are served on a -best-effort basis; events are not persisted, delivery is not guaranteed -(in the event of a crash in the switch, forward events may be lost) and -some events may be replayed upon restart. Events consumed from this package -should be de-duplicated by the htlc's unique combination of incoming and -outgoing channel id and htlc id. [EXPERIMENTAL] -*/ -message HtlcEvent { - /* - The short channel id that the incoming htlc arrived at our node on. This - value is zero for sends. - */ - uint64 incoming_channel_id = 1; - - /* - The short channel id that the outgoing htlc left our node on. This value - is zero for receives. - */ - uint64 outgoing_channel_id = 2; - - /* - Incoming id is the index of the incoming htlc in the incoming channel. - This value is zero for sends. - */ - uint64 incoming_htlc_id = 3; - - /* - Outgoing id is the index of the outgoing htlc in the outgoing channel. - This value is zero for receives. - */ - uint64 outgoing_htlc_id = 4; - - /* - The time in unix nanoseconds that the event occurred. - */ - uint64 timestamp_ns = 5; - - enum EventType { - UNKNOWN = 0; - SEND = 1; - RECEIVE = 2; - FORWARD = 3; - } - - /* - The event type indicates whether the htlc was part of a send, receive or - forward. - */ - EventType event_type = 6; - - oneof event { - ForwardEvent forward_event = 7; - ForwardFailEvent forward_fail_event = 8; - SettleEvent settle_event = 9; - LinkFailEvent link_fail_event = 10; - SubscribedEvent subscribed_event = 11; - FinalHtlcEvent final_htlc_event = 12; - } -} - -message HtlcInfo { - // The timelock on the incoming htlc. - uint32 incoming_timelock = 1; - - // The timelock on the outgoing htlc. - uint32 outgoing_timelock = 2; - - // The amount of the incoming htlc. - uint64 incoming_amt_msat = 3; - - // The amount of the outgoing htlc. - uint64 outgoing_amt_msat = 4; -} - -message ForwardEvent { - // Info contains details about the htlc that was forwarded. - HtlcInfo info = 1; -} - -message ForwardFailEvent { -} - -message SettleEvent { - // The revealed preimage. - bytes preimage = 1; -} - -message FinalHtlcEvent { - bool settled = 1; - bool offchain = 2; -} - -message SubscribedEvent { -} - -message LinkFailEvent { - // Info contains details about the htlc that we failed. - HtlcInfo info = 1; - - // FailureCode is the BOLT error code for the failure. - lnrpc.Failure.FailureCode wire_failure = 2; - - /* - FailureDetail provides additional information about the reason for the - failure. This detail enriches the information provided by the wire message - and may be 'no detail' if the wire message requires no additional metadata. - */ - FailureDetail failure_detail = 3; - - // A string representation of the link failure. - string failure_string = 4; -} - -enum FailureDetail { - UNKNOWN = 0; - NO_DETAIL = 1; - ONION_DECODE = 2; - LINK_NOT_ELIGIBLE = 3; - ON_CHAIN_TIMEOUT = 4; - HTLC_EXCEEDS_MAX = 5; - INSUFFICIENT_BALANCE = 6; - INCOMPLETE_FORWARD = 7; - HTLC_ADD_FAILED = 8; - FORWARDS_DISABLED = 9; - INVOICE_CANCELED = 10; - INVOICE_UNDERPAID = 11; - INVOICE_EXPIRY_TOO_SOON = 12; - INVOICE_NOT_OPEN = 13; - MPP_INVOICE_TIMEOUT = 14; - ADDRESS_MISMATCH = 15; - SET_TOTAL_MISMATCH = 16; - SET_TOTAL_TOO_LOW = 17; - SET_OVERPAID = 18; - UNKNOWN_INVOICE = 19; - INVALID_KEYSEND = 20; - MPP_IN_PROGRESS = 21; - CIRCULAR_ROUTE = 22; -} - -enum PaymentState { - /* - Payment is still in flight. - */ - IN_FLIGHT = 0; - - /* - Payment completed successfully. - */ - SUCCEEDED = 1; - - /* - There are more routes to try, but the payment timeout was exceeded. - */ - FAILED_TIMEOUT = 2; - - /* - All possible routes were tried and failed permanently. Or were no - routes to the destination at all. - */ - FAILED_NO_ROUTE = 3; - - /* - A non-recoverable error has occurred. - */ - FAILED_ERROR = 4; - - /* - Payment details incorrect (unknown hash, invalid amt or - invalid final cltv delta) - */ - FAILED_INCORRECT_PAYMENT_DETAILS = 5; - - /* - Insufficient local balance. - */ - FAILED_INSUFFICIENT_BALANCE = 6; -} - -message PaymentStatus { - // Current state the payment is in. - PaymentState state = 1; - - /* - The pre-image of the payment when state is SUCCEEDED. - */ - bytes preimage = 2; - - reserved 3; - - /* - The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. - */ - repeated lnrpc.HTLCAttempt htlcs = 4; -} - -message CircuitKey { - /// The id of the channel that the is part of this circuit. - uint64 chan_id = 1; - - /// The index of the incoming htlc in the incoming channel. - uint64 htlc_id = 2; -} - -message ForwardHtlcInterceptRequest { - /* - The key of this forwarded htlc. It defines the incoming channel id and - the index in this channel. - */ - CircuitKey incoming_circuit_key = 1; - - // The incoming htlc amount. - uint64 incoming_amount_msat = 5; - - // The incoming htlc expiry. - uint32 incoming_expiry = 6; - - /* - The htlc payment hash. This value is not guaranteed to be unique per - request. - */ - bytes payment_hash = 2; - - // The requested outgoing channel id for this forwarded htlc. Because of - // non-strict forwarding, this isn't necessarily the channel over which the - // packet will be forwarded eventually. A different channel to the same peer - // may be selected as well. - uint64 outgoing_requested_chan_id = 7; - - // The outgoing htlc amount. - uint64 outgoing_amount_msat = 3; - - // The outgoing htlc expiry. - uint32 outgoing_expiry = 4; - - // Any custom records that were present in the payload. - map custom_records = 8; - - // The onion blob for the next hop - bytes onion_blob = 9; - - // The block height at which this htlc will be auto-failed to prevent the - // channel from force-closing. - int32 auto_fail_height = 10; -} - -/** -ForwardHtlcInterceptResponse enables the caller to resolve a previously hold -forward. The caller can choose either to: -- `Resume`: Execute the default behavior (usually forward). -- `Reject`: Fail the htlc backwards. -- `Settle`: Settle this htlc with a given preimage. -*/ -message ForwardHtlcInterceptResponse { - /** - The key of this forwarded htlc. It defines the incoming channel id and - the index in this channel. - */ - CircuitKey incoming_circuit_key = 1; - - // The resolve action for this intercepted htlc. - ResolveHoldForwardAction action = 2; - - // The preimage in case the resolve action is Settle. - bytes preimage = 3; - - // Encrypted failure message in case the resolve action is Fail. - // - // If failure_message is specified, the failure_code field must be set - // to zero. - bytes failure_message = 4; - - // Return the specified failure code in case the resolve action is Fail. The - // message data fields are populated automatically. - // - // If a non-zero failure_code is specified, failure_message must not be set. - // - // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the - // default value for this field. - lnrpc.Failure.FailureCode failure_code = 5; -} - -enum ResolveHoldForwardAction { - SETTLE = 0; - FAIL = 1; - RESUME = 2; -} - -message UpdateChanStatusRequest { - lnrpc.ChannelPoint chan_point = 1; - - ChanStatusAction action = 2; -} - -enum ChanStatusAction { - ENABLE = 0; - DISABLE = 1; - AUTO = 2; -} - -message UpdateChanStatusResponse { +syntax = "proto3"; + +import "lightning.proto"; + +package routerrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc/routerrpc"; + +// Router is a service that offers advanced interaction with the router +// subsystem of the daemon. +service Router { + /* + SendPaymentV2 attempts to route a payment described by the passed + PaymentRequest to the final destination. The call returns a stream of + payment updates. + */ + rpc SendPaymentV2 (SendPaymentRequest) returns (stream lnrpc.Payment); + + /* + TrackPaymentV2 returns an update stream for the payment identified by the + payment hash. + */ + rpc TrackPaymentV2 (TrackPaymentRequest) returns (stream lnrpc.Payment); + + /* + TrackPayments returns an update stream for every payment that is not in a + terminal state. Note that if payments are in-flight while starting a new + subscription, the start of the payment stream could produce out-of-order + and/or duplicate events. In order to get updates for every in-flight + payment attempt make sure to subscribe to this method before initiating any + payments. + */ + rpc TrackPayments (TrackPaymentsRequest) returns (stream lnrpc.Payment); + + /* + EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + may cost to send an HTLC to the target end destination. + */ + rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse); + + /* + Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + the specified route. This method differs from SendPayment in that it + allows users to specify a full route manually. This can be used for + things like rebalancing, and atomic swaps. It differs from the newer + SendToRouteV2 in that it doesn't return the full HTLC information. + */ + rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse) { + option deprecated = true; + } + + /* + SendToRouteV2 attempts to make a payment via the specified route. This + method differs from SendPayment in that it allows users to specify a full + route manually. This can be used for things like rebalancing, and atomic + swaps. + */ + rpc SendToRouteV2 (SendToRouteRequest) returns (lnrpc.HTLCAttempt); + + /* + ResetMissionControl clears all mission control state and starts with a clean + slate. + */ + rpc ResetMissionControl (ResetMissionControlRequest) + returns (ResetMissionControlResponse); + + /* + QueryMissionControl exposes the internal mission control state to callers. + It is a development feature. + */ + rpc QueryMissionControl (QueryMissionControlRequest) + returns (QueryMissionControlResponse); + + /* + XImportMissionControl is an experimental API that imports the state provided + to the internal mission control's state, using all results which are more + recent than our existing values. These values will only be imported + in-memory, and will not be persisted across restarts. + */ + rpc XImportMissionControl (XImportMissionControlRequest) + returns (XImportMissionControlResponse); + + /* + GetMissionControlConfig returns mission control's current config. + */ + rpc GetMissionControlConfig (GetMissionControlConfigRequest) + returns (GetMissionControlConfigResponse); + + /* + SetMissionControlConfig will set mission control's config, if the config + provided is valid. + */ + rpc SetMissionControlConfig (SetMissionControlConfigRequest) + returns (SetMissionControlConfigResponse); + + /* + QueryProbability returns the current success probability estimate for a + given node pair and amount. + */ + rpc QueryProbability (QueryProbabilityRequest) + returns (QueryProbabilityResponse); + + /* + BuildRoute builds a fully specified route based on a list of hop public + keys. It retrieves the relevant channel policies from the graph in order to + calculate the correct fees and time locks. + */ + rpc BuildRoute (BuildRouteRequest) returns (BuildRouteResponse); + + /* + SubscribeHtlcEvents creates a uni-directional stream from the server to + the client which delivers a stream of htlc events. + */ + rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest) + returns (stream HtlcEvent); + + /* + Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + described by the passed PaymentRequest to the final destination. The call + returns a stream of payment status updates. + */ + rpc SendPayment (SendPaymentRequest) returns (stream PaymentStatus) { + option deprecated = true; + } + + /* + Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + the payment identified by the payment hash. + */ + rpc TrackPayment (TrackPaymentRequest) returns (stream PaymentStatus) { + option deprecated = true; + } + + /** + HtlcInterceptor dispatches a bi-directional streaming RPC in which + Forwarded HTLC requests are sent to the client and the client responds with + a boolean that tells LND if this htlc should be intercepted. + In case of interception, the htlc can be either settled, cancelled or + resumed later by using the ResolveHoldForward endpoint. + */ + rpc HtlcInterceptor (stream ForwardHtlcInterceptResponse) + returns (stream ForwardHtlcInterceptRequest); + + /* + UpdateChanStatus attempts to manually set the state of a channel + (enabled, disabled, or auto). A manual "disable" request will cause the + channel to stay disabled until a subsequent manual request of either + "enable" or "auto". + */ + rpc UpdateChanStatus (UpdateChanStatusRequest) + returns (UpdateChanStatusResponse); +} + +message SendPaymentRequest { + // The identity pubkey of the payment recipient + bytes dest = 1; + + /* + Number of satoshis to send. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt = 2; + + /* + Number of millisatoshis to send. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt_msat = 12; + + // The hash to use within the payment's HTLC + bytes payment_hash = 3; + + /* + The CLTV delta from the current height that should be used to set the + timelock for the final hop. + */ + int32 final_cltv_delta = 4; + + // An optional payment addr to be included within the last hop of the route. + bytes payment_addr = 20; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. The amount in the payment request may be zero. In + that case it is required to set the amt field as well. If no payment request + is specified, the following fields are required: dest, amt and payment_hash. + */ + string payment_request = 5; + + /* + An upper limit on the amount of time we should spend when attempting to + fulfill the payment. This is expressed in seconds. If we cannot make a + successful payment within this time frame, an error will be returned. + This field must be non-zero. + */ + int32 timeout_seconds = 6; + + /* + The maximum number of satoshis that will be paid as a fee of the payment. + If this field is left to the default value of 0, only zero-fee routes will + be considered. This usually means single hop routes connecting directly to + the destination. To send the payment without a fee limit, use max int here. + + The fields fee_limit_sat and fee_limit_msat are mutually exclusive. + */ + int64 fee_limit_sat = 7; + + /* + The maximum number of millisatoshis that will be paid as a fee of the + payment. If this field is left to the default value of 0, only zero-fee + routes will be considered. This usually means single hop routes connecting + directly to the destination. To send the payment without a fee limit, use + max int here. + + The fields fee_limit_sat and fee_limit_msat are mutually exclusive. + */ + int64 fee_limit_msat = 13; + + /* + Deprecated, use outgoing_chan_ids. The channel id of the channel that must + be taken to the first hop. If zero, any channel may be used (unless + outgoing_chan_ids are set). + */ + uint64 outgoing_chan_id = 8 [jstype = JS_STRING, deprecated = true]; + + /* + The channel ids of the channels are allowed for the first hop. If empty, + any channel may be used. + */ + repeated uint64 outgoing_chan_ids = 19; + + /* + The pubkey of the last hop of the route. If empty, any hop may be used. + */ + bytes last_hop_pubkey = 14; + + /* + An optional maximum total time lock for the route. This should not exceed + lnd's `--max-cltv-expiry` setting. If zero, then the value of + `--max-cltv-expiry` is enforced. + */ + int32 cltv_limit = 9; + + /* + Optional route hints to reach the destination through private channels. + */ + repeated lnrpc.RouteHint route_hints = 10; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to a peer which understands the new records. This can be used to pass + application specific data during the payment attempt. Record types are + required to be in the custom range >= 65536. When using REST, the values + must be encoded as base64. + */ + map dest_custom_records = 11; + + // If set, circular payments to self are permitted. + bool allow_self_payment = 15; + + /* + Features assumed to be supported by the final node. All transitive feature + dependencies must also be set properly. For a given feature bit pair, either + optional or remote may be set, but not both. If this field is nil or empty, + the router will try to load destination features from the graph as a + fallback. + */ + repeated lnrpc.FeatureBit dest_features = 16; + + /* + The maximum number of partial payments that may be use to complete the full + amount. + */ + uint32 max_parts = 17; + + /* + If set, only the final payment update is streamed back. Intermediate updates + that show which htlcs are still in flight are suppressed. + */ + bool no_inflight_updates = 18; + + /* + The largest payment split that should be attempted when making a payment if + splitting is necessary. Setting this value will effectively cause lnd to + split more aggressively, vs only when it thinks it needs to. Note that this + value is in milli-satoshis. + */ + uint64 max_shard_size_msat = 21; + + /* + If set, an AMP-payment will be attempted. + */ + bool amp = 22; + + /* + The time preference for this payment. Set to -1 to optimize for fees + only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + double time_pref = 23; +} + +message TrackPaymentRequest { + // The hash of the payment to look up. + bytes payment_hash = 1; + + /* + If set, only the final payment update is streamed back. Intermediate updates + that show which htlcs are still in flight are suppressed. + */ + bool no_inflight_updates = 2; +} + +message TrackPaymentsRequest { + /* + If set, only the final payment updates are streamed back. Intermediate + updates that show which htlcs are still in flight are suppressed. + */ + bool no_inflight_updates = 1; +} + +message RouteFeeRequest { + /* + The destination once wishes to obtain a routing fee quote to. + */ + bytes dest = 1; + + /* + The amount one wishes to send to the target destination. + */ + int64 amt_sat = 2; +} + +message RouteFeeResponse { + /* + A lower bound of the estimated fee to the target destination within the + network, expressed in milli-satoshis. + */ + int64 routing_fee_msat = 1; + + /* + An estimate of the worst case time delay that can occur. Note that callers + will still need to factor in the final CLTV delta of the last hop into this + value. + */ + int64 time_lock_delay = 2; +} + +message SendToRouteRequest { + // The payment hash to use for the HTLC. + bytes payment_hash = 1; + + // Route that should be used to attempt to complete the payment. + lnrpc.Route route = 2; + + /* + Whether the payment should be marked as failed when a temporary error is + returned from the given route. Set it to true so the payment won't be + failed unless a terminal error is occurred, such as payment timeout, no + routes, incorrect payment details, or insufficient funds. + */ + bool skip_temp_err = 3; +} + +message SendToRouteResponse { + // The preimage obtained by making the payment. + bytes preimage = 1; + + // The failure message in case the payment failed. + lnrpc.Failure failure = 2; +} + +message ResetMissionControlRequest { +} + +message ResetMissionControlResponse { +} + +message QueryMissionControlRequest { +} + +// QueryMissionControlResponse contains mission control state. +message QueryMissionControlResponse { + reserved 1; + + // Node pair-level mission control state. + repeated PairHistory pairs = 2; +} + +message XImportMissionControlRequest { + // Node pair-level mission control state to be imported. + repeated PairHistory pairs = 1; + + // Whether to force override MC pair history. Note that even with force + // override the failure pair is imported before the success pair and both + // still clamp existing failure/success amounts. + bool force = 2; +} + +message XImportMissionControlResponse { +} + +// PairHistory contains the mission control state for a particular node pair. +message PairHistory { + // The source node pubkey of the pair. + bytes node_from = 1; + + // The destination node pubkey of the pair. + bytes node_to = 2; + + reserved 3, 4, 5, 6; + + PairData history = 7; +} + +message PairData { + // Time of last failure. + int64 fail_time = 1; + + /* + Lowest amount that failed to forward rounded to whole sats. This may be + set to zero if the failure is independent of amount. + */ + int64 fail_amt_sat = 2; + + /* + Lowest amount that failed to forward in millisats. This may be + set to zero if the failure is independent of amount. + */ + int64 fail_amt_msat = 4; + + reserved 3; + + // Time of last success. + int64 success_time = 5; + + // Highest amount that we could successfully forward rounded to whole sats. + int64 success_amt_sat = 6; + + // Highest amount that we could successfully forward in millisats. + int64 success_amt_msat = 7; +} + +message GetMissionControlConfigRequest { +} + +message GetMissionControlConfigResponse { + /* + Mission control's currently active config. + */ + MissionControlConfig config = 1; +} + +message SetMissionControlConfigRequest { + /* + The config to set for mission control. Note that all values *must* be set, + because the full config will be applied. + */ + MissionControlConfig config = 1; +} + +message SetMissionControlConfigResponse { +} + +message MissionControlConfig { + /* + The amount of time mission control will take to restore a penalized node + or channel back to 50% success probability, expressed in seconds. Setting + this value to a higher value will penalize failures for longer, making + mission control less likely to route through nodes and channels that we + have previously recorded failures for. + */ + uint64 half_life_seconds = 1; + + /* + The probability of success mission control should assign to hop in a route + where it has no other information available. Higher values will make mission + control more willing to try hops that we have no information about, lower + values will discourage trying these hops. + */ + float hop_probability = 2; + + /* + The importance that mission control should place on historical results, + expressed as a value in [0;1]. Setting this value to 1 will ignore all + historical payments and just use the hop probability to assess the + probability of success for each hop. A zero value ignores hop probability + completely and relies entirely on historical results, unless none are + available. + */ + float weight = 3; + + /* + The maximum number of payment results that mission control will store. + */ + uint32 maximum_payment_results = 4; + + /* + The minimum time that must have passed since the previously recorded failure + before we raise the failure amount. + */ + uint64 minimum_failure_relax_interval = 5; +} + +message QueryProbabilityRequest { + // The source node pubkey of the pair. + bytes from_node = 1; + + // The destination node pubkey of the pair. + bytes to_node = 2; + + // The amount for which to calculate a probability. + int64 amt_msat = 3; +} + +message QueryProbabilityResponse { + // The success probability for the requested pair. + double probability = 1; + + // The historical data for the requested pair. + PairData history = 2; +} + +message BuildRouteRequest { + /* + The amount to send expressed in msat. If set to zero, the minimum routable + amount is used. + */ + int64 amt_msat = 1; + + /* + CLTV delta from the current height that should be used for the timelock + of the final hop + */ + int32 final_cltv_delta = 2; + + /* + The channel id of the channel that must be taken to the first hop. If zero, + any channel may be used. + */ + uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; + + /* + A list of hops that defines the route. This does not include the source hop + pubkey. + */ + repeated bytes hop_pubkeys = 4; + + // An optional payment addr to be included within the last hop of the route. + bytes payment_addr = 5; +} + +message BuildRouteResponse { + /* + Fully specified route that can be used to execute the payment. + */ + lnrpc.Route route = 1; +} + +message SubscribeHtlcEventsRequest { +} + +/* +HtlcEvent contains the htlc event that was processed. These are served on a +best-effort basis; events are not persisted, delivery is not guaranteed +(in the event of a crash in the switch, forward events may be lost) and +some events may be replayed upon restart. Events consumed from this package +should be de-duplicated by the htlc's unique combination of incoming and +outgoing channel id and htlc id. [EXPERIMENTAL] +*/ +message HtlcEvent { + /* + The short channel id that the incoming htlc arrived at our node on. This + value is zero for sends. + */ + uint64 incoming_channel_id = 1; + + /* + The short channel id that the outgoing htlc left our node on. This value + is zero for receives. + */ + uint64 outgoing_channel_id = 2; + + /* + Incoming id is the index of the incoming htlc in the incoming channel. + This value is zero for sends. + */ + uint64 incoming_htlc_id = 3; + + /* + Outgoing id is the index of the outgoing htlc in the outgoing channel. + This value is zero for receives. + */ + uint64 outgoing_htlc_id = 4; + + /* + The time in unix nanoseconds that the event occurred. + */ + uint64 timestamp_ns = 5; + + enum EventType { + UNKNOWN = 0; + SEND = 1; + RECEIVE = 2; + FORWARD = 3; + } + + /* + The event type indicates whether the htlc was part of a send, receive or + forward. + */ + EventType event_type = 6; + + oneof event { + ForwardEvent forward_event = 7; + ForwardFailEvent forward_fail_event = 8; + SettleEvent settle_event = 9; + LinkFailEvent link_fail_event = 10; + SubscribedEvent subscribed_event = 11; + FinalHtlcEvent final_htlc_event = 12; + } +} + +message HtlcInfo { + // The timelock on the incoming htlc. + uint32 incoming_timelock = 1; + + // The timelock on the outgoing htlc. + uint32 outgoing_timelock = 2; + + // The amount of the incoming htlc. + uint64 incoming_amt_msat = 3; + + // The amount of the outgoing htlc. + uint64 outgoing_amt_msat = 4; +} + +message ForwardEvent { + // Info contains details about the htlc that was forwarded. + HtlcInfo info = 1; +} + +message ForwardFailEvent { +} + +message SettleEvent { + // The revealed preimage. + bytes preimage = 1; +} + +message FinalHtlcEvent { + bool settled = 1; + bool offchain = 2; +} + +message SubscribedEvent { +} + +message LinkFailEvent { + // Info contains details about the htlc that we failed. + HtlcInfo info = 1; + + // FailureCode is the BOLT error code for the failure. + lnrpc.Failure.FailureCode wire_failure = 2; + + /* + FailureDetail provides additional information about the reason for the + failure. This detail enriches the information provided by the wire message + and may be 'no detail' if the wire message requires no additional metadata. + */ + FailureDetail failure_detail = 3; + + // A string representation of the link failure. + string failure_string = 4; +} + +enum FailureDetail { + UNKNOWN = 0; + NO_DETAIL = 1; + ONION_DECODE = 2; + LINK_NOT_ELIGIBLE = 3; + ON_CHAIN_TIMEOUT = 4; + HTLC_EXCEEDS_MAX = 5; + INSUFFICIENT_BALANCE = 6; + INCOMPLETE_FORWARD = 7; + HTLC_ADD_FAILED = 8; + FORWARDS_DISABLED = 9; + INVOICE_CANCELED = 10; + INVOICE_UNDERPAID = 11; + INVOICE_EXPIRY_TOO_SOON = 12; + INVOICE_NOT_OPEN = 13; + MPP_INVOICE_TIMEOUT = 14; + ADDRESS_MISMATCH = 15; + SET_TOTAL_MISMATCH = 16; + SET_TOTAL_TOO_LOW = 17; + SET_OVERPAID = 18; + UNKNOWN_INVOICE = 19; + INVALID_KEYSEND = 20; + MPP_IN_PROGRESS = 21; + CIRCULAR_ROUTE = 22; +} + +enum PaymentState { + /* + Payment is still in flight. + */ + IN_FLIGHT = 0; + + /* + Payment completed successfully. + */ + SUCCEEDED = 1; + + /* + There are more routes to try, but the payment timeout was exceeded. + */ + FAILED_TIMEOUT = 2; + + /* + All possible routes were tried and failed permanently. Or were no + routes to the destination at all. + */ + FAILED_NO_ROUTE = 3; + + /* + A non-recoverable error has occurred. + */ + FAILED_ERROR = 4; + + /* + Payment details incorrect (unknown hash, invalid amt or + invalid final cltv delta) + */ + FAILED_INCORRECT_PAYMENT_DETAILS = 5; + + /* + Insufficient local balance. + */ + FAILED_INSUFFICIENT_BALANCE = 6; +} + +message PaymentStatus { + // Current state the payment is in. + PaymentState state = 1; + + /* + The pre-image of the payment when state is SUCCEEDED. + */ + bytes preimage = 2; + + reserved 3; + + /* + The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. + */ + repeated lnrpc.HTLCAttempt htlcs = 4; +} + +message CircuitKey { + /// The id of the channel that the is part of this circuit. + uint64 chan_id = 1; + + /// The index of the incoming htlc in the incoming channel. + uint64 htlc_id = 2; +} + +message ForwardHtlcInterceptRequest { + /* + The key of this forwarded htlc. It defines the incoming channel id and + the index in this channel. + */ + CircuitKey incoming_circuit_key = 1; + + // The incoming htlc amount. + uint64 incoming_amount_msat = 5; + + // The incoming htlc expiry. + uint32 incoming_expiry = 6; + + /* + The htlc payment hash. This value is not guaranteed to be unique per + request. + */ + bytes payment_hash = 2; + + // The requested outgoing channel id for this forwarded htlc. Because of + // non-strict forwarding, this isn't necessarily the channel over which the + // packet will be forwarded eventually. A different channel to the same peer + // may be selected as well. + uint64 outgoing_requested_chan_id = 7; + + // The outgoing htlc amount. + uint64 outgoing_amount_msat = 3; + + // The outgoing htlc expiry. + uint32 outgoing_expiry = 4; + + // Any custom records that were present in the payload. + map custom_records = 8; + + // The onion blob for the next hop + bytes onion_blob = 9; + + // The block height at which this htlc will be auto-failed to prevent the + // channel from force-closing. + int32 auto_fail_height = 10; +} + +/** +ForwardHtlcInterceptResponse enables the caller to resolve a previously hold +forward. The caller can choose either to: +- `Resume`: Execute the default behavior (usually forward). +- `Reject`: Fail the htlc backwards. +- `Settle`: Settle this htlc with a given preimage. +*/ +message ForwardHtlcInterceptResponse { + /** + The key of this forwarded htlc. It defines the incoming channel id and + the index in this channel. + */ + CircuitKey incoming_circuit_key = 1; + + // The resolve action for this intercepted htlc. + ResolveHoldForwardAction action = 2; + + // The preimage in case the resolve action is Settle. + bytes preimage = 3; + + // Encrypted failure message in case the resolve action is Fail. + // + // If failure_message is specified, the failure_code field must be set + // to zero. + bytes failure_message = 4; + + // Return the specified failure code in case the resolve action is Fail. The + // message data fields are populated automatically. + // + // If a non-zero failure_code is specified, failure_message must not be set. + // + // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the + // default value for this field. + lnrpc.Failure.FailureCode failure_code = 5; +} + +enum ResolveHoldForwardAction { + SETTLE = 0; + FAIL = 1; + RESUME = 2; +} + +message UpdateChanStatusRequest { + lnrpc.ChannelPoint chan_point = 1; + + ChanStatusAction action = 2; +} + +enum ChanStatusAction { + ENABLE = 0; + DISABLE = 1; + AUTO = 2; +} + +message UpdateChanStatusResponse { } \ No newline at end of file diff --git a/proto/service/methods.proto b/proto/service/methods.proto index 9e8c08ad..9260c4cd 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -1,386 +1,386 @@ -syntax = "proto3"; - -package methods; - -import "google/protobuf/descriptor.proto"; -import "structs.proto"; - -option go_package = "github.com/shocknet/lightning.pub"; -option (file_options) = { - supported_http_methods:["post", "get"]; - supported_auths:[ - { - id: "guest" - name: "Guest" - context:[] - }, - { - id: "user" - name: "User", - context:[{ - key:"user_id", - value:"string" - },{ - key:"app_id", - value:"string" - },{ - key:"app_user_id", - value:"string" - }] - }, - { - id: "admin", - name: "Admin", - //encrypted:true, - context:{ - key:"admin_id", - value:"string" - } - }, - { - id: "metrics", - name: "Metrics", - //encrypted:true, - context:{ - key:"operator_id", - value:"string" - } - }, - { - id:"app", - name:"App", - context:{ - key:"app_id", - value: "string" - } - } - ]; -}; - -message MethodQueryOptions { - repeated string items = 1; -} - -extend google.protobuf.MethodOptions { // TODO: move this stuff to dep repo? - string auth_type = 50003; - string http_method = 50004; - string http_route = 50005; - MethodQueryOptions query = 50006; - bool nostr = 50007; - bool batch = 50008; - -} - -message ProtoFileOptions { - message SupportedAuth { - string id = 1; - string name = 2; - bool encrypted = 3; - map context = 4; - } - repeated SupportedAuth supported_auths = 1; - repeated string supported_http_methods = 2; -} - -extend google.protobuf.FileOptions { - ProtoFileOptions file_options = 50004; -} - -service LightningPub { - // - rpc LndGetInfo(structs.LndGetInfoRequest) returns (structs.LndGetInfoResponse){ - option (auth_type) = "Admin"; - option (http_method) = "post"; - option (http_route) = "/api/admin/lnd/getinfo"; - }; - - rpc AddApp(structs.AddAppRequest) returns (structs.AuthApp) { - option (auth_type) = "Admin"; - option (http_method) = "post"; - option (http_route) = "/api/admin/app/add"; - }; - - rpc AuthApp(structs.AuthAppRequest) returns (structs.AuthApp) { - option (auth_type) = "Admin"; - option (http_method) = "post"; - option (http_route) = "/api/admin/app/auth"; - } - - rpc BanUser(structs.BanUserRequest) returns (structs.BanUserResponse) { - option (auth_type) = "Admin"; - option (http_method) = "post"; - option (http_route) = "/api/admin/user/ban"; - } - - rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) { - option (auth_type) = "Metrics"; - option (http_method) = "post"; - option (http_route) = "/api/reports/usage"; - } - - rpc GetAppsMetrics(structs.AppsMetricsRequest) returns (structs.AppsMetrics) { - option (auth_type) = "Metrics"; - option (http_method) = "post"; - option (http_route) = "/api/reports/apps"; - } - - rpc GetLndMetrics(structs.LndMetricsRequest) returns (structs.LndMetrics) { - option (auth_type) = "Metrics"; - option (http_method) = "post"; - option (http_route) = "/api/reports/lnd"; - } - - - // - - // - rpc Health(structs.Empty) returns (structs.Empty){ - option (auth_type) = "Guest"; - option (http_method) = "get"; - option (http_route) = "/api/health"; - }; - rpc EncryptionExchange(structs.EncryptionExchangeRequest) returns (structs.Empty){ - option (auth_type) = "Guest"; - option (http_method) = "post"; - option (http_route) = "/api/encryption/exchange"; - }; - - rpc SetMockInvoiceAsPaid(structs.SetMockInvoiceAsPaidRequest) returns (structs.Empty) { - option (auth_type) = "Guest"; - option (http_method) = "post"; - option (http_route) = "/api/lnd/mock/invoice/paid"; - } - rpc GetLnurlWithdrawInfo(structs.Empty) returns (structs.LnurlWithdrawInfoResponse){ - option (auth_type) = "Guest"; - option (http_method) = "get"; - option (http_route) = "/api/guest/lnurl_withdraw/info"; - option (query) = {items: ["k1"]}; - } - rpc HandleLnurlWithdraw(structs.Empty) returns (structs.Empty){ - option (auth_type) = "Guest"; - option (http_method) = "get"; - option (http_route) = "/api/guest/lnurl_withdraw/handle"; - option (query) = {items: ["k1", "pr"]}; - } - rpc GetLnurlPayInfo(structs.Empty)returns (structs.LnurlPayInfoResponse) { - option (auth_type) = "Guest"; - option (http_method) = "get"; - option (http_route) = "/api/guest/lnurl_pay/info"; - option (query) = {items: ["k1"]}; - } - rpc HandleLnurlPay(structs.Empty)returns (structs.HandleLnurlPayResponse) { - option (auth_type) = "Guest"; - option (http_method) = "get"; - option (http_route) = "/api/guest/lnurl_pay/handle"; - option (query) = {items: ["k1", "amount", "nostr", "lnurl"]}; - } - rpc HandleLnurlAddress(structs.Empty)returns (structs.LnurlPayInfoResponse) { - option (auth_type) = "Guest"; - option (http_method) = "get"; - option (http_route) = "/.well-known/lnurlp/:address_name"; - } - - rpc LinkNPubThroughToken(structs.LinkNPubThroughTokenRequest) returns (structs.Empty) { - option (auth_type) = "User"; - option(http_method) = "post"; - option (http_route) = "/api/guest/npub/link"; - option (nostr) = true; - } - // - - // - rpc GetApp(structs.Empty) returns (structs.Application) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/get"; - } - - rpc AddAppUser(structs.AddAppUserRequest)returns (structs.AppUser) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/user/add"; - }; - - rpc AddAppInvoice(structs.AddAppInvoiceRequest) returns (structs.NewInvoiceResponse) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/add/invoice"; - } - - rpc AddAppUserInvoice(structs.AddAppUserInvoiceRequest) returns (structs.NewInvoiceResponse) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/user/add/invoice"; - } - - rpc GetAppUser(structs.GetAppUserRequest) returns (structs.AppUser) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/user/get"; - } - - rpc PayAppUserInvoice(structs.PayAppUserInvoiceRequest) returns (structs.PayInvoiceResponse) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/invoice/pay"; - } - - rpc SendAppUserToAppUserPayment(structs.SendAppUserToAppUserPaymentRequest) returns (structs.Empty) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/user/internal/pay"; - } - - rpc SendAppUserToAppPayment(structs.SendAppUserToAppPaymentRequest) returns (structs.Empty) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/internal/pay"; - } - - rpc GetAppUserLNURLInfo(structs.GetAppUserLNURLInfoRequest) returns (structs.LnurlPayInfoResponse) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/user/lnurl/pay/info"; - } - rpc SetMockAppUserBalance(structs.SetMockAppUserBalanceRequest) returns (structs.Empty) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/mock/user/blance/set"; - } - rpc SetMockAppBalance(structs.SetMockAppBalanceRequest) returns (structs.Empty) { - option (auth_type) = "App"; - option (http_method) = "post"; - option (http_route) = "/api/app/mock/blance/set"; - } - rpc RequestNPubLinkingToken(structs.RequestNPubLinkingTokenRequest) returns (structs.RequestNPubLinkingTokenResponse) { - option (auth_type) = "App"; - option(http_method) = "post"; - option (http_route) = "/api/app/user/npub/token"; - } - // - - // - rpc UserHealth(structs.Empty)returns(structs.Empty){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/health"; - option (nostr) = true; - } - rpc GetUserInfo(structs.Empty)returns(structs.UserInfo){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/info"; - option (nostr) = true; - } - - rpc AddProduct(structs.AddProductRequest) returns (structs.Product){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/product/add"; - option (nostr) = true; - }; - - rpc NewProductInvoice(structs.Empty) returns (structs.NewInvoiceResponse){ - option (auth_type) = "User"; - option (http_method) = "get"; - option (http_route) = "/api/user/product/get/invoice"; - option (query) = {items: ["id"]}; - option (nostr) = true; - }; - - rpc GetUserOperations(structs.GetUserOperationsRequest) returns (structs.GetUserOperationsResponse) { - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/operations"; - option (nostr) = true; - } - - rpc NewAddress(structs.NewAddressRequest) returns (structs.NewAddressResponse) { - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/chain/new"; - option (nostr) = true; - } - - rpc PayAddress(structs.PayAddressRequest) returns (structs.PayAddressResponse){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/chain/pay"; - option (nostr) = true; - } - - rpc NewInvoice(structs.NewInvoiceRequest) returns (structs.NewInvoiceResponse){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/invoice/new"; - option (nostr) = true; - } - - rpc DecodeInvoice(structs.DecodeInvoiceRequest) returns (structs.DecodeInvoiceResponse){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/invoice/decode"; - option (nostr) = true; - } - - rpc PayInvoice(structs.PayInvoiceRequest) returns (structs.PayInvoiceResponse){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/invoice/pay"; - option (nostr) = true; - } - - rpc OpenChannel(structs.OpenChannelRequest) returns (structs.OpenChannelResponse){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/open/channel"; - option (nostr) = true; - } - - rpc GetLnurlWithdrawLink(structs.Empty) returns (structs.LnurlLinkResponse){ - option (auth_type) = "User"; - option (http_method) = "get"; - option (http_route) = "/api/user/lnurl_withdraw/link"; - option (nostr) = true; - } - - rpc GetLnurlPayLink(structs.Empty) returns (structs.LnurlLinkResponse){ - option (auth_type) = "User"; - option (http_method) = "get"; - option (http_route) = "/api/user/lnurl_pay/link"; - option (nostr) = true; - } - - rpc GetLNURLChannelLink(structs.Empty) returns (structs.LnurlLinkResponse){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/lnurl_channel/url"; - option (nostr) = true; - } - rpc GetLiveUserOperations(structs.Empty) returns (stream structs.LiveUserOperation){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/operations/sub"; - option (nostr) = true; - } - rpc GetMigrationUpdate(structs.Empty) returns (stream structs.MigrationUpdate){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/migrations/sub"; - option (nostr) = true; - } - rpc GetHttpCreds(structs.Empty) returns (stream structs.HttpCreds){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/http_creds"; - option (nostr) = true; - } - rpc BatchUser(structs.Empty) returns (structs.Empty){ - option (auth_type) = "User"; - option (http_method) = "post"; - option (http_route) = "/api/user/batch"; - option (nostr) = true; - option (batch) = true; - } - // +syntax = "proto3"; + +package methods; + +import "google/protobuf/descriptor.proto"; +import "structs.proto"; + +option go_package = "github.com/shocknet/lightning.pub"; +option (file_options) = { + supported_http_methods:["post", "get"]; + supported_auths:[ + { + id: "guest" + name: "Guest" + context:[] + }, + { + id: "user" + name: "User", + context:[{ + key:"user_id", + value:"string" + },{ + key:"app_id", + value:"string" + },{ + key:"app_user_id", + value:"string" + }] + }, + { + id: "admin", + name: "Admin", + //encrypted:true, + context:{ + key:"admin_id", + value:"string" + } + }, + { + id: "metrics", + name: "Metrics", + //encrypted:true, + context:{ + key:"operator_id", + value:"string" + } + }, + { + id:"app", + name:"App", + context:{ + key:"app_id", + value: "string" + } + } + ]; +}; + +message MethodQueryOptions { + repeated string items = 1; +} + +extend google.protobuf.MethodOptions { // TODO: move this stuff to dep repo? + string auth_type = 50003; + string http_method = 50004; + string http_route = 50005; + MethodQueryOptions query = 50006; + bool nostr = 50007; + bool batch = 50008; + +} + +message ProtoFileOptions { + message SupportedAuth { + string id = 1; + string name = 2; + bool encrypted = 3; + map context = 4; + } + repeated SupportedAuth supported_auths = 1; + repeated string supported_http_methods = 2; +} + +extend google.protobuf.FileOptions { + ProtoFileOptions file_options = 50004; +} + +service LightningPub { + // + rpc LndGetInfo(structs.LndGetInfoRequest) returns (structs.LndGetInfoResponse){ + option (auth_type) = "Admin"; + option (http_method) = "post"; + option (http_route) = "/api/admin/lnd/getinfo"; + }; + + rpc AddApp(structs.AddAppRequest) returns (structs.AuthApp) { + option (auth_type) = "Admin"; + option (http_method) = "post"; + option (http_route) = "/api/admin/app/add"; + }; + + rpc AuthApp(structs.AuthAppRequest) returns (structs.AuthApp) { + option (auth_type) = "Admin"; + option (http_method) = "post"; + option (http_route) = "/api/admin/app/auth"; + } + + rpc BanUser(structs.BanUserRequest) returns (structs.BanUserResponse) { + option (auth_type) = "Admin"; + option (http_method) = "post"; + option (http_route) = "/api/admin/user/ban"; + } + + rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) { + option (auth_type) = "Metrics"; + option (http_method) = "post"; + option (http_route) = "/api/reports/usage"; + } + + rpc GetAppsMetrics(structs.AppsMetricsRequest) returns (structs.AppsMetrics) { + option (auth_type) = "Metrics"; + option (http_method) = "post"; + option (http_route) = "/api/reports/apps"; + } + + rpc GetLndMetrics(structs.LndMetricsRequest) returns (structs.LndMetrics) { + option (auth_type) = "Metrics"; + option (http_method) = "post"; + option (http_route) = "/api/reports/lnd"; + } + + + // + + // + rpc Health(structs.Empty) returns (structs.Empty){ + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/health"; + }; + rpc EncryptionExchange(structs.EncryptionExchangeRequest) returns (structs.Empty){ + option (auth_type) = "Guest"; + option (http_method) = "post"; + option (http_route) = "/api/encryption/exchange"; + }; + + rpc SetMockInvoiceAsPaid(structs.SetMockInvoiceAsPaidRequest) returns (structs.Empty) { + option (auth_type) = "Guest"; + option (http_method) = "post"; + option (http_route) = "/api/lnd/mock/invoice/paid"; + } + rpc GetLnurlWithdrawInfo(structs.Empty) returns (structs.LnurlWithdrawInfoResponse){ + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_withdraw/info"; + option (query) = {items: ["k1"]}; + } + rpc HandleLnurlWithdraw(structs.Empty) returns (structs.Empty){ + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_withdraw/handle"; + option (query) = {items: ["k1", "pr"]}; + } + rpc GetLnurlPayInfo(structs.Empty)returns (structs.LnurlPayInfoResponse) { + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_pay/info"; + option (query) = {items: ["k1"]}; + } + rpc HandleLnurlPay(structs.Empty)returns (structs.HandleLnurlPayResponse) { + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_pay/handle"; + option (query) = {items: ["k1", "amount", "nostr", "lnurl"]}; + } + rpc HandleLnurlAddress(structs.Empty)returns (structs.LnurlPayInfoResponse) { + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/.well-known/lnurlp/:address_name"; + } + + rpc LinkNPubThroughToken(structs.LinkNPubThroughTokenRequest) returns (structs.Empty) { + option (auth_type) = "User"; + option(http_method) = "post"; + option (http_route) = "/api/guest/npub/link"; + option (nostr) = true; + } + // + + // + rpc GetApp(structs.Empty) returns (structs.Application) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/get"; + } + + rpc AddAppUser(structs.AddAppUserRequest)returns (structs.AppUser) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/user/add"; + }; + + rpc AddAppInvoice(structs.AddAppInvoiceRequest) returns (structs.NewInvoiceResponse) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/add/invoice"; + } + + rpc AddAppUserInvoice(structs.AddAppUserInvoiceRequest) returns (structs.NewInvoiceResponse) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/user/add/invoice"; + } + + rpc GetAppUser(structs.GetAppUserRequest) returns (structs.AppUser) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/user/get"; + } + + rpc PayAppUserInvoice(structs.PayAppUserInvoiceRequest) returns (structs.PayInvoiceResponse) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/invoice/pay"; + } + + rpc SendAppUserToAppUserPayment(structs.SendAppUserToAppUserPaymentRequest) returns (structs.Empty) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/user/internal/pay"; + } + + rpc SendAppUserToAppPayment(structs.SendAppUserToAppPaymentRequest) returns (structs.Empty) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/internal/pay"; + } + + rpc GetAppUserLNURLInfo(structs.GetAppUserLNURLInfoRequest) returns (structs.LnurlPayInfoResponse) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/user/lnurl/pay/info"; + } + rpc SetMockAppUserBalance(structs.SetMockAppUserBalanceRequest) returns (structs.Empty) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/mock/user/blance/set"; + } + rpc SetMockAppBalance(structs.SetMockAppBalanceRequest) returns (structs.Empty) { + option (auth_type) = "App"; + option (http_method) = "post"; + option (http_route) = "/api/app/mock/blance/set"; + } + rpc RequestNPubLinkingToken(structs.RequestNPubLinkingTokenRequest) returns (structs.RequestNPubLinkingTokenResponse) { + option (auth_type) = "App"; + option(http_method) = "post"; + option (http_route) = "/api/app/user/npub/token"; + } + // + + // + rpc UserHealth(structs.Empty)returns(structs.Empty){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/health"; + option (nostr) = true; + } + rpc GetUserInfo(structs.Empty)returns(structs.UserInfo){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/info"; + option (nostr) = true; + } + + rpc AddProduct(structs.AddProductRequest) returns (structs.Product){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/product/add"; + option (nostr) = true; + }; + + rpc NewProductInvoice(structs.Empty) returns (structs.NewInvoiceResponse){ + option (auth_type) = "User"; + option (http_method) = "get"; + option (http_route) = "/api/user/product/get/invoice"; + option (query) = {items: ["id"]}; + option (nostr) = true; + }; + + rpc GetUserOperations(structs.GetUserOperationsRequest) returns (structs.GetUserOperationsResponse) { + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/operations"; + option (nostr) = true; + } + + rpc NewAddress(structs.NewAddressRequest) returns (structs.NewAddressResponse) { + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/chain/new"; + option (nostr) = true; + } + + rpc PayAddress(structs.PayAddressRequest) returns (structs.PayAddressResponse){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/chain/pay"; + option (nostr) = true; + } + + rpc NewInvoice(structs.NewInvoiceRequest) returns (structs.NewInvoiceResponse){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/invoice/new"; + option (nostr) = true; + } + + rpc DecodeInvoice(structs.DecodeInvoiceRequest) returns (structs.DecodeInvoiceResponse){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/invoice/decode"; + option (nostr) = true; + } + + rpc PayInvoice(structs.PayInvoiceRequest) returns (structs.PayInvoiceResponse){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/invoice/pay"; + option (nostr) = true; + } + + rpc OpenChannel(structs.OpenChannelRequest) returns (structs.OpenChannelResponse){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/open/channel"; + option (nostr) = true; + } + + rpc GetLnurlWithdrawLink(structs.Empty) returns (structs.LnurlLinkResponse){ + option (auth_type) = "User"; + option (http_method) = "get"; + option (http_route) = "/api/user/lnurl_withdraw/link"; + option (nostr) = true; + } + + rpc GetLnurlPayLink(structs.Empty) returns (structs.LnurlLinkResponse){ + option (auth_type) = "User"; + option (http_method) = "get"; + option (http_route) = "/api/user/lnurl_pay/link"; + option (nostr) = true; + } + + rpc GetLNURLChannelLink(structs.Empty) returns (structs.LnurlLinkResponse){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/lnurl_channel/url"; + option (nostr) = true; + } + rpc GetLiveUserOperations(structs.Empty) returns (stream structs.LiveUserOperation){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/operations/sub"; + option (nostr) = true; + } + rpc GetMigrationUpdate(structs.Empty) returns (stream structs.MigrationUpdate){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/migrations/sub"; + option (nostr) = true; + } + rpc GetHttpCreds(structs.Empty) returns (stream structs.HttpCreds){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/http_creds"; + option (nostr) = true; + } + rpc BatchUser(structs.Empty) returns (structs.Empty){ + option (auth_type) = "User"; + option (http_method) = "post"; + option (http_route) = "/api/user/batch"; + option (nostr) = true; + option (batch) = true; + } + // } \ No newline at end of file diff --git a/proto/service/structs.proto b/proto/service/structs.proto index 43be5a49..af493ab8 100644 --- a/proto/service/structs.proto +++ b/proto/service/structs.proto @@ -1,449 +1,449 @@ -syntax = "proto3"; - -package structs; - -option go_package = "github.com/shocknet/lightning.pub"; - -message Empty {} - - -message EncryptionExchangeRequest { - string publicKey = 1; - string deviceId = 2; -} - -message UsageMetric { - int64 processed_at_ms = 1; - int64 parsed_in_nano = 2; - int64 auth_in_nano = 3; - int64 validate_in_nano = 4; - int64 handle_in_nano = 5; - string rpc_name = 6; - bool batch = 7; - bool nostr = 8; - int64 batch_size = 9; -} - -message UsageMetrics { - repeated UsageMetric metrics = 1; -} - -message AppsMetricsRequest { - optional int64 from_unix = 1; - optional int64 to_unix = 2; - optional bool include_operations = 3; -} - -message UsersInfo { - int64 total = 1; - int64 no_balance = 2; - int64 negative_balance = 3; - int64 always_been_inactive = 4; - - int64 balance_avg = 5; - int64 balance_median = 6; - -} - -message AppMetrics { - Application app = 1; - - UsersInfo users = 2; - - int64 received = 5; - int64 spent = 6; - int64 available = 7; - int64 fees = 8; - int64 invoices = 9; - - int64 total_fees = 10; - - repeated UserOperation operations = 100; -} - -message AppsMetrics { - repeated AppMetrics apps = 1; -} - -message LndMetricsRequest { - optional int64 from_unix = 1; - optional int64 to_unix = 2; -} - -message RoutingEvent { - int64 incoming_channel_id = 1; - int64 incoming_htlc_id=2; - int64 outgoing_channel_id = 3; - int64 outgoing_htlc_id =4; - int64 timestamp_ns = 5; - string event_type = 6; - int64 incoming_amt_msat = 7; - int64 outgoing_amt_msat = 8; - string failure_string = 9; - bool settled = 10; - bool offchain = 11; - bool forward_fail_event = 12; -} -message ChannelBalanceEvent { - int64 block_height = 1; - string channel_id = 2; - int64 local_balance_sats = 3; - int64 remote_balance_sats = 4; -} - -message ChainBalanceEvent { - int64 block_height = 1; - int64 confirmed_balance = 2; - int64 unconfirmed_balance = 3; - int64 total_balance = 4; -} - -message OpenChannel { - string channel_id = 1; - int64 capacity = 2; - bool active = 3; - int64 lifetime =4 ; - int64 local_balance=5; - int64 remote_balance = 6; -} -message ClosedChannel { - string channel_id = 1; - int64 capacity = 2; - int64 closed_height =4; -} - -message ChannelRouting { - string channel_id = 1; - int64 send_errors = 2; - int64 receive_errors = 3; - int64 forward_errors_as_input = 4; - int64 forward_errors_as_output = 5; - int64 missed_forward_fee_as_input = 6; - int64 missed_forward_fee_as_output = 7; - int64 forward_fee_as_input = 8; - int64 forward_fee_as_output = 9; - int64 events_number = 10; -} - -message LndNodeMetrics { - repeated ChannelBalanceEvent channels_balance_events = 1; - repeated ChainBalanceEvent chain_balance_events = 2; - int64 offline_channels = 4; - int64 online_channels = 5; - int64 pending_channels = 6; - int64 closing_channels = 7; - repeated OpenChannel open_channels = 8; - repeated ClosedChannel closed_channels = 9; - repeated ChannelRouting channel_routing = 10; -} - -message LndMetrics { - repeated LndNodeMetrics nodes = 1; - -} - -message LndGetInfoRequest { - int64 nodeId = 1; -} - -message SetMockInvoiceAsPaidRequest { - string invoice = 1; - int64 amount =2; -} - -message LndGetInfoResponse { - string alias = 1; -} - -message BanUserRequest { - string user_id = 1; -} -message BannedAppUser { - string app_name = 1; - string app_id = 2; - string user_identifier = 3; - string nostr_pub = 4; - -} -message BanUserResponse { - int64 balance_sats = 1; - repeated BannedAppUser banned_app_users = 2; -} - -message AddAppRequest { - string name = 1; - bool allow_user_creation = 2; -} - -message AuthAppRequest { - string name = 1; - optional bool allow_user_creation = 2; -} - -message Application { - string name = 1; - string id = 2; - int64 balance = 3; - string npub = 4; -} - -message AuthApp { - Application app = 1; - string auth_token = 2; -} - - -message AddAppUserRequest { - string identifier = 1; - bool fail_if_exists = 2; - int64 balance = 3; -} - -message AppUser { - string identifier = 1; - UserInfo info = 2; - int64 max_withdrawable = 3; -} - -message AddAppInvoiceRequest { - string payer_identifier = 1; - string http_callback_url = 2; - NewInvoiceRequest invoice_req = 3; -} - -message AddAppUserInvoiceRequest { - string receiver_identifier = 1; - string payer_identifier = 2; - string http_callback_url = 3; - NewInvoiceRequest invoice_req = 4; -} - -message GetAppUserRequest { - string user_identifier = 1; -} - -message PayAppUserInvoiceRequest { - string user_identifier = 1; - string invoice = 2; - int64 amount = 3; -} - -message SendAppUserToAppUserPaymentRequest { - string from_user_identifier = 1; - string to_user_identifier = 2; - int64 amount = 3; -} - -message SendAppUserToAppPaymentRequest { - string from_user_identifier = 1; - int64 amount = 2; -} - -message GetAppUserLNURLInfoRequest { - string user_identifier = 1; - string base_url_override = 2; -} - -message SetMockAppUserBalanceRequest { - string user_identifier = 1; - int64 amount = 2; -} - -message SetMockAppBalanceRequest { - int64 amount = 1; -} - -enum AddressType { - WITNESS_PUBKEY_HASH = 0; - NESTED_PUBKEY_HASH = 1; - TAPROOT_PUBKEY = 2; -} -message NewAddressRequest { - AddressType addressType = 1; -} -message NewAddressResponse{ - string address = 1; -} -message PayAddressRequest{ - string address = 1; - int64 amoutSats = 2; - int64 satsPerVByte = 3; -} - -message PayAddressResponse{ - string txId = 1; - string operation_id = 2; - int64 service_fee = 3; - int64 network_fee = 4; -} - -message NewInvoiceRequest{ - int64 amountSats = 1; - string memo = 2; -} - -message NewInvoiceResponse{ - string invoice = 1; -} -message DecodeInvoiceRequest{ - string invoice = 1; -} -message DecodeInvoiceResponse{ - int64 amount=1; -} -message PayInvoiceRequest{ - string invoice = 1; - int64 amount = 2; -} - -message PayInvoiceResponse{ - string preimage = 1; - int64 amount_paid = 2; - string operation_id = 3; - int64 service_fee = 4; - int64 network_fee = 5; -} - -message OpenChannelRequest{ - string destination = 1; - int64 fundingAmount = 2; - int64 pushAmount = 3; - string closeAddress = 4; -} - -message OpenChannelResponse{ - string channelId = 1; -} - -message LnurlLinkResponse{ - string lnurl = 1; - string k1 = 2; -} - -message LnurlWithdrawInfoResponse { - string tag = 1; - string callback = 2; - string k1 = 3; - string defaultDescription = 4; - int64 minWithdrawable = 5; // millisatoshi - unsafe overflow possible, but very unlikely - int64 maxWithdrawable = 6; // millisatoshi - unsafe overflow possible, but very unlikely - string balanceCheck = 7; - string payLink = 8; -} -message LnurlPayInfoResponse { - string tag = 1; - string callback = 2; - int64 maxSendable = 3; // millisatoshi - unsafe overflow possible, but very unlikely - int64 minSendable = 4; // millisatoshi - unsafe overflow possible, but very unlikely - string metadata = 5; - bool allowsNostr = 6; - string nostrPubkey = 7; -} -message HandleLnurlPayResponse { - string pr = 1; - repeated Empty routes = 2; -} - -message UserInfo{ - string userId = 1; - int64 balance = 2; - int64 max_withdrawable = 3; - string user_identifier = 4; -} - -message GetUserOperationsRequest{ - int64 latestIncomingInvoice = 1; - int64 latestOutgoingInvoice = 2; - int64 latestIncomingTx = 3; - int64 latestOutgoingTx = 4; - int64 latestIncomingUserToUserPayment = 5; - int64 latestOutgoingUserToUserPayment = 6; - int64 max_size = 7; -} -enum UserOperationType { - INCOMING_TX =0; - OUTGOING_TX =1; - INCOMING_INVOICE =2; - OUTGOING_INVOICE=3; - OUTGOING_USER_TO_USER=4; - INCOMING_USER_TO_USER=5; -} - -message UserOperation { - int64 paidAtUnix=1; - UserOperationType type = 2; - bool inbound =3; - int64 amount = 4; - string identifier = 5; - string operationId = 6; - int64 service_fee = 7; - int64 network_fee = 8; - bool confirmed = 9; - string tx_hash = 10; - bool internal = 11; -} -message UserOperations { - int64 fromIndex=1; - int64 toIndex=2; - repeated UserOperation operations=3; -} -message GetUserOperationsResponse{ - UserOperations latestOutgoingInvoiceOperations=1; - UserOperations latestIncomingInvoiceOperations=2; - UserOperations latestOutgoingTxOperations=3; - UserOperations latestIncomingTxOperations=4; - UserOperations latestOutgoingUserToUserPayemnts=5; - UserOperations latestIncomingUserToUserPayemnts=6; -} - -message AddProductRequest { - string name = 1; - int64 price_sats = 2; -} - -message Product { - string id = 1; - string name = 2; - int64 price_sats = 3; -} - -message GetProductBuyLinkResponse { - string link = 1; -} - -message LiveUserOperation { - UserOperation operation = 1; -} -message MigrationUpdate { - optional ClosureMigration closure = 1; - optional RelaysMigration relays = 2; -} - -message ClosureMigration { - int64 closes_at_unix = 1; -} - -message RelaysMigration { - repeated string relays = 1; -} - - -message RequestNPubLinkingTokenRequest { - string user_identifier = 1; -} - -message RequestNPubLinkingTokenResponse { - string token = 1; -} - - - -message LinkNPubThroughTokenRequest { - string token = 1; - string nostr_pub = 2; -} - -message HttpCreds { - string url = 1; - string token = 2; +syntax = "proto3"; + +package structs; + +option go_package = "github.com/shocknet/lightning.pub"; + +message Empty {} + + +message EncryptionExchangeRequest { + string publicKey = 1; + string deviceId = 2; +} + +message UsageMetric { + int64 processed_at_ms = 1; + int64 parsed_in_nano = 2; + int64 auth_in_nano = 3; + int64 validate_in_nano = 4; + int64 handle_in_nano = 5; + string rpc_name = 6; + bool batch = 7; + bool nostr = 8; + int64 batch_size = 9; +} + +message UsageMetrics { + repeated UsageMetric metrics = 1; +} + +message AppsMetricsRequest { + optional int64 from_unix = 1; + optional int64 to_unix = 2; + optional bool include_operations = 3; +} + +message UsersInfo { + int64 total = 1; + int64 no_balance = 2; + int64 negative_balance = 3; + int64 always_been_inactive = 4; + + int64 balance_avg = 5; + int64 balance_median = 6; + +} + +message AppMetrics { + Application app = 1; + + UsersInfo users = 2; + + int64 received = 5; + int64 spent = 6; + int64 available = 7; + int64 fees = 8; + int64 invoices = 9; + + int64 total_fees = 10; + + repeated UserOperation operations = 100; +} + +message AppsMetrics { + repeated AppMetrics apps = 1; +} + +message LndMetricsRequest { + optional int64 from_unix = 1; + optional int64 to_unix = 2; +} + +message RoutingEvent { + int64 incoming_channel_id = 1; + int64 incoming_htlc_id=2; + int64 outgoing_channel_id = 3; + int64 outgoing_htlc_id =4; + int64 timestamp_ns = 5; + string event_type = 6; + int64 incoming_amt_msat = 7; + int64 outgoing_amt_msat = 8; + string failure_string = 9; + bool settled = 10; + bool offchain = 11; + bool forward_fail_event = 12; +} +message ChannelBalanceEvent { + int64 block_height = 1; + string channel_id = 2; + int64 local_balance_sats = 3; + int64 remote_balance_sats = 4; +} + +message ChainBalanceEvent { + int64 block_height = 1; + int64 confirmed_balance = 2; + int64 unconfirmed_balance = 3; + int64 total_balance = 4; +} + +message OpenChannel { + string channel_id = 1; + int64 capacity = 2; + bool active = 3; + int64 lifetime =4 ; + int64 local_balance=5; + int64 remote_balance = 6; +} +message ClosedChannel { + string channel_id = 1; + int64 capacity = 2; + int64 closed_height =4; +} + +message ChannelRouting { + string channel_id = 1; + int64 send_errors = 2; + int64 receive_errors = 3; + int64 forward_errors_as_input = 4; + int64 forward_errors_as_output = 5; + int64 missed_forward_fee_as_input = 6; + int64 missed_forward_fee_as_output = 7; + int64 forward_fee_as_input = 8; + int64 forward_fee_as_output = 9; + int64 events_number = 10; +} + +message LndNodeMetrics { + repeated ChannelBalanceEvent channels_balance_events = 1; + repeated ChainBalanceEvent chain_balance_events = 2; + int64 offline_channels = 4; + int64 online_channels = 5; + int64 pending_channels = 6; + int64 closing_channels = 7; + repeated OpenChannel open_channels = 8; + repeated ClosedChannel closed_channels = 9; + repeated ChannelRouting channel_routing = 10; +} + +message LndMetrics { + repeated LndNodeMetrics nodes = 1; + +} + +message LndGetInfoRequest { + int64 nodeId = 1; +} + +message SetMockInvoiceAsPaidRequest { + string invoice = 1; + int64 amount =2; +} + +message LndGetInfoResponse { + string alias = 1; +} + +message BanUserRequest { + string user_id = 1; +} +message BannedAppUser { + string app_name = 1; + string app_id = 2; + string user_identifier = 3; + string nostr_pub = 4; + +} +message BanUserResponse { + int64 balance_sats = 1; + repeated BannedAppUser banned_app_users = 2; +} + +message AddAppRequest { + string name = 1; + bool allow_user_creation = 2; +} + +message AuthAppRequest { + string name = 1; + optional bool allow_user_creation = 2; +} + +message Application { + string name = 1; + string id = 2; + int64 balance = 3; + string npub = 4; +} + +message AuthApp { + Application app = 1; + string auth_token = 2; +} + + +message AddAppUserRequest { + string identifier = 1; + bool fail_if_exists = 2; + int64 balance = 3; +} + +message AppUser { + string identifier = 1; + UserInfo info = 2; + int64 max_withdrawable = 3; +} + +message AddAppInvoiceRequest { + string payer_identifier = 1; + string http_callback_url = 2; + NewInvoiceRequest invoice_req = 3; +} + +message AddAppUserInvoiceRequest { + string receiver_identifier = 1; + string payer_identifier = 2; + string http_callback_url = 3; + NewInvoiceRequest invoice_req = 4; +} + +message GetAppUserRequest { + string user_identifier = 1; +} + +message PayAppUserInvoiceRequest { + string user_identifier = 1; + string invoice = 2; + int64 amount = 3; +} + +message SendAppUserToAppUserPaymentRequest { + string from_user_identifier = 1; + string to_user_identifier = 2; + int64 amount = 3; +} + +message SendAppUserToAppPaymentRequest { + string from_user_identifier = 1; + int64 amount = 2; +} + +message GetAppUserLNURLInfoRequest { + string user_identifier = 1; + string base_url_override = 2; +} + +message SetMockAppUserBalanceRequest { + string user_identifier = 1; + int64 amount = 2; +} + +message SetMockAppBalanceRequest { + int64 amount = 1; +} + +enum AddressType { + WITNESS_PUBKEY_HASH = 0; + NESTED_PUBKEY_HASH = 1; + TAPROOT_PUBKEY = 2; +} +message NewAddressRequest { + AddressType addressType = 1; +} +message NewAddressResponse{ + string address = 1; +} +message PayAddressRequest{ + string address = 1; + int64 amoutSats = 2; + int64 satsPerVByte = 3; +} + +message PayAddressResponse{ + string txId = 1; + string operation_id = 2; + int64 service_fee = 3; + int64 network_fee = 4; +} + +message NewInvoiceRequest{ + int64 amountSats = 1; + string memo = 2; +} + +message NewInvoiceResponse{ + string invoice = 1; +} +message DecodeInvoiceRequest{ + string invoice = 1; +} +message DecodeInvoiceResponse{ + int64 amount=1; +} +message PayInvoiceRequest{ + string invoice = 1; + int64 amount = 2; +} + +message PayInvoiceResponse{ + string preimage = 1; + int64 amount_paid = 2; + string operation_id = 3; + int64 service_fee = 4; + int64 network_fee = 5; +} + +message OpenChannelRequest{ + string destination = 1; + int64 fundingAmount = 2; + int64 pushAmount = 3; + string closeAddress = 4; +} + +message OpenChannelResponse{ + string channelId = 1; +} + +message LnurlLinkResponse{ + string lnurl = 1; + string k1 = 2; +} + +message LnurlWithdrawInfoResponse { + string tag = 1; + string callback = 2; + string k1 = 3; + string defaultDescription = 4; + int64 minWithdrawable = 5; // millisatoshi - unsafe overflow possible, but very unlikely + int64 maxWithdrawable = 6; // millisatoshi - unsafe overflow possible, but very unlikely + string balanceCheck = 7; + string payLink = 8; +} +message LnurlPayInfoResponse { + string tag = 1; + string callback = 2; + int64 maxSendable = 3; // millisatoshi - unsafe overflow possible, but very unlikely + int64 minSendable = 4; // millisatoshi - unsafe overflow possible, but very unlikely + string metadata = 5; + bool allowsNostr = 6; + string nostrPubkey = 7; +} +message HandleLnurlPayResponse { + string pr = 1; + repeated Empty routes = 2; +} + +message UserInfo{ + string userId = 1; + int64 balance = 2; + int64 max_withdrawable = 3; + string user_identifier = 4; +} + +message GetUserOperationsRequest{ + int64 latestIncomingInvoice = 1; + int64 latestOutgoingInvoice = 2; + int64 latestIncomingTx = 3; + int64 latestOutgoingTx = 4; + int64 latestIncomingUserToUserPayment = 5; + int64 latestOutgoingUserToUserPayment = 6; + int64 max_size = 7; +} +enum UserOperationType { + INCOMING_TX =0; + OUTGOING_TX =1; + INCOMING_INVOICE =2; + OUTGOING_INVOICE=3; + OUTGOING_USER_TO_USER=4; + INCOMING_USER_TO_USER=5; +} + +message UserOperation { + int64 paidAtUnix=1; + UserOperationType type = 2; + bool inbound =3; + int64 amount = 4; + string identifier = 5; + string operationId = 6; + int64 service_fee = 7; + int64 network_fee = 8; + bool confirmed = 9; + string tx_hash = 10; + bool internal = 11; +} +message UserOperations { + int64 fromIndex=1; + int64 toIndex=2; + repeated UserOperation operations=3; +} +message GetUserOperationsResponse{ + UserOperations latestOutgoingInvoiceOperations=1; + UserOperations latestIncomingInvoiceOperations=2; + UserOperations latestOutgoingTxOperations=3; + UserOperations latestIncomingTxOperations=4; + UserOperations latestOutgoingUserToUserPayemnts=5; + UserOperations latestIncomingUserToUserPayemnts=6; +} + +message AddProductRequest { + string name = 1; + int64 price_sats = 2; +} + +message Product { + string id = 1; + string name = 2; + int64 price_sats = 3; +} + +message GetProductBuyLinkResponse { + string link = 1; +} + +message LiveUserOperation { + UserOperation operation = 1; +} +message MigrationUpdate { + optional ClosureMigration closure = 1; + optional RelaysMigration relays = 2; +} + +message ClosureMigration { + int64 closes_at_unix = 1; +} + +message RelaysMigration { + repeated string relays = 1; +} + + +message RequestNPubLinkingTokenRequest { + string user_identifier = 1; +} + +message RequestNPubLinkingTokenResponse { + string token = 1; +} + + + +message LinkNPubThroughTokenRequest { + string token = 1; + string nostr_pub = 2; +} + +message HttpCreds { + string url = 1; + string token = 2; } \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index 36e32043..492526ab 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,72 +1,72 @@ -import express from 'express'; -import path from 'path'; -import { ServerOptions } from "../proto/autogenerated/ts/express_server"; -import { AdminContext, MetricsContext } from "../proto/autogenerated/ts/types"; -import Main from './services/main' -import { ERROR, getLogger } from './services/helpers/logger.js' -const serverOptions = (mainHandler: Main): ServerOptions => { - const log = getLogger({}) - return { - logger: { log, error: err => log(ERROR, err) }, - staticFiles: path.resolve('static'), - AdminAuthGuard: adminAuth, - MetricsAuthGuard: metricsAuth, - AppAuthGuard: async (authHeader) => { return { app_id: mainHandler.applicationManager.DecodeAppToken(stripBearer(authHeader)) } }, - UserAuthGuard: async (authHeader) => { return mainHandler.appUserManager.DecodeUserToken(stripBearer(authHeader)) }, - GuestAuthGuard: async (_) => ({}), - metricsCallback: metrics => mainHandler.settings.recordPerformance ? mainHandler.metricsManager.AddMetrics(metrics) : null, - allowCors: true, - logMethod: true, - logBody: true - //throwErrors: true - } -} - -const stripBearer = (header?: string) => { - if (!header) { - return "" - } - if (header.startsWith("Bearer ")) { - return header.substring("Bearer ".length) - } - return header -} - -const adminAuth = async (header: string | undefined): Promise => { - const AdminToken = process.env.ADMIN_TOKEN - if (!AdminToken) { - throw new Error("admin auth disabled") - } - if (!header) { - throw new Error("admin header not found") - } - let h = header - - if (header.startsWith("Bearer ")) { - h = header.substring("Bearer ".length) - } - if (h !== AdminToken) { - throw new Error("admin token invalid") - } - return { admin_id: "admin1" } -} - -const metricsAuth = async (header: string | undefined): Promise => { - const metricsToken = process.env.METRICS_TOKEN || process.env.ADMIN_TOKEN - if (!metricsToken) { - throw new Error("metrics auth disabled") - } - if (!header) { - throw new Error("metrics header not found") - } - let h = header - - if (header.startsWith("Bearer ")) { - h = header.substring("Bearer ".length) - } - if (h !== metricsToken) { - throw new Error("metrics token invalid") - } - return { operator_id: "metrics1" } -} +import express from 'express'; +import path from 'path'; +import { ServerOptions } from "../proto/autogenerated/ts/express_server"; +import { AdminContext, MetricsContext } from "../proto/autogenerated/ts/types"; +import Main from './services/main' +import { ERROR, getLogger } from './services/helpers/logger.js' +const serverOptions = (mainHandler: Main): ServerOptions => { + const log = getLogger({}) + return { + logger: { log, error: err => log(ERROR, err) }, + staticFiles: path.resolve('static'), + AdminAuthGuard: adminAuth, + MetricsAuthGuard: metricsAuth, + AppAuthGuard: async (authHeader) => { return { app_id: mainHandler.applicationManager.DecodeAppToken(stripBearer(authHeader)) } }, + UserAuthGuard: async (authHeader) => { return mainHandler.appUserManager.DecodeUserToken(stripBearer(authHeader)) }, + GuestAuthGuard: async (_) => ({}), + metricsCallback: metrics => mainHandler.settings.recordPerformance ? mainHandler.metricsManager.AddMetrics(metrics) : null, + allowCors: true, + logMethod: true, + logBody: true + //throwErrors: true + } +} + +const stripBearer = (header?: string) => { + if (!header) { + return "" + } + if (header.startsWith("Bearer ")) { + return header.substring("Bearer ".length) + } + return header +} + +const adminAuth = async (header: string | undefined): Promise => { + const AdminToken = process.env.ADMIN_TOKEN + if (!AdminToken) { + throw new Error("admin auth disabled") + } + if (!header) { + throw new Error("admin header not found") + } + let h = header + + if (header.startsWith("Bearer ")) { + h = header.substring("Bearer ".length) + } + if (h !== AdminToken) { + throw new Error("admin token invalid") + } + return { admin_id: "admin1" } +} + +const metricsAuth = async (header: string | undefined): Promise => { + const metricsToken = process.env.METRICS_TOKEN || process.env.ADMIN_TOKEN + if (!metricsToken) { + throw new Error("metrics auth disabled") + } + if (!header) { + throw new Error("metrics header not found") + } + let h = header + + if (header.startsWith("Bearer ")) { + h = header.substring("Bearer ".length) + } + if (h !== metricsToken) { + throw new Error("metrics token invalid") + } + return { operator_id: "metrics1" } +} export default serverOptions \ No newline at end of file diff --git a/src/custom-nip19.ts b/src/custom-nip19.ts index 62c7c56a..d9c5a9b0 100644 --- a/src/custom-nip19.ts +++ b/src/custom-nip19.ts @@ -1,88 +1,88 @@ -/* - This file contains functions that deal with encoding and decoding nprofiles, - but with he addition of bridge urls in the nprofile. - These functions are basically the same functions from nostr-tools package - but with some tweaks to allow for the bridge inclusion. -*/ -import { bytesToHex, concatBytes, hexToBytes } from '@noble/hashes/utils'; -import { bech32 } from 'bech32'; - -export const utf8Decoder = new TextDecoder('utf-8') -export const utf8Encoder = new TextEncoder() - - -export type CustomProfilePointer = { - pubkey: string - relays?: string[] - bridge?: string[] // one bridge -} - - - -type TLV = { [t: number]: Uint8Array[] } - - -const encodeTLV = (tlv: TLV): Uint8Array => { - const entries: Uint8Array[] = [] - - Object.entries(tlv) - /* - the original function does a reverse() here, - but here it causes the nprofile string to be different, - even though it would still decode to the correct original inputs - */ - //.reverse() - .forEach(([t, vs]) => { - vs.forEach(v => { - const entry = new Uint8Array(v.length + 2) - entry.set([parseInt(t)], 0) - entry.set([v.length], 1) - entry.set(v, 2) - entries.push(entry) - }) - }) - return concatBytes(...entries); -} - -export const encodeNprofile = (profile: CustomProfilePointer): string => { - const data = encodeTLV({ - 0: [hexToBytes(profile.pubkey)], - 1: (profile.relays || []).map(url => utf8Encoder.encode(url)), - 2: (profile.bridge || []).map(url => utf8Encoder.encode(url)) - }); - const words = bech32.toWords(data) - return bech32.encode("nprofile", words, 5000); -} - -const parseTLV = (data: Uint8Array): TLV => { - const result: TLV = {} - let rest = data - while (rest.length > 0) { - const t = rest[0] - const l = rest[1] - const v = rest.slice(2, 2 + l) - rest = rest.slice(2 + l) - if (v.length < l) throw new Error(`not enough data to read on TLV ${t}`) - result[t] = result[t] || [] - result[t].push(v) - } - return result -} - -export const decodeNprofile = (nprofile: string): CustomProfilePointer => { - const { prefix, words } = bech32.decode(nprofile, 5000) - if (prefix !== "nprofile") { - throw new Error ("Expected nprofile prefix"); - } - const data = new Uint8Array(bech32.fromWords(words)) - - const tlv = parseTLV(data); - if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nprofile') - if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes') - - return { - pubkey: bytesToHex(tlv[0][0]), - relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [], - bridge: tlv[2] ? tlv[2].map(d => utf8Decoder.decode(d)): [] - } +/* + This file contains functions that deal with encoding and decoding nprofiles, + but with he addition of bridge urls in the nprofile. + These functions are basically the same functions from nostr-tools package + but with some tweaks to allow for the bridge inclusion. +*/ +import { bytesToHex, concatBytes, hexToBytes } from '@noble/hashes/utils'; +import { bech32 } from 'bech32'; + +export const utf8Decoder = new TextDecoder('utf-8') +export const utf8Encoder = new TextEncoder() + + +export type CustomProfilePointer = { + pubkey: string + relays?: string[] + bridge?: string[] // one bridge +} + + + +type TLV = { [t: number]: Uint8Array[] } + + +const encodeTLV = (tlv: TLV): Uint8Array => { + const entries: Uint8Array[] = [] + + Object.entries(tlv) + /* + the original function does a reverse() here, + but here it causes the nprofile string to be different, + even though it would still decode to the correct original inputs + */ + //.reverse() + .forEach(([t, vs]) => { + vs.forEach(v => { + const entry = new Uint8Array(v.length + 2) + entry.set([parseInt(t)], 0) + entry.set([v.length], 1) + entry.set(v, 2) + entries.push(entry) + }) + }) + return concatBytes(...entries); +} + +export const encodeNprofile = (profile: CustomProfilePointer): string => { + const data = encodeTLV({ + 0: [hexToBytes(profile.pubkey)], + 1: (profile.relays || []).map(url => utf8Encoder.encode(url)), + 2: (profile.bridge || []).map(url => utf8Encoder.encode(url)) + }); + const words = bech32.toWords(data) + return bech32.encode("nprofile", words, 5000); +} + +const parseTLV = (data: Uint8Array): TLV => { + const result: TLV = {} + let rest = data + while (rest.length > 0) { + const t = rest[0] + const l = rest[1] + const v = rest.slice(2, 2 + l) + rest = rest.slice(2 + l) + if (v.length < l) throw new Error(`not enough data to read on TLV ${t}`) + result[t] = result[t] || [] + result[t].push(v) + } + return result +} + +export const decodeNprofile = (nprofile: string): CustomProfilePointer => { + const { prefix, words } = bech32.decode(nprofile, 5000) + if (prefix !== "nprofile") { + throw new Error ("Expected nprofile prefix"); + } + const data = new Uint8Array(bech32.fromWords(words)) + + const tlv = parseTLV(data); + if (!tlv[0]?.[0]) throw new Error('missing TLV 0 for nprofile') + if (tlv[0][0].length !== 32) throw new Error('TLV 0 should be 32 bytes') + + return { + pubkey: bytesToHex(tlv[0][0]), + relays: tlv[1] ? tlv[1].map(d => utf8Decoder.decode(d)) : [], + bridge: tlv[2] ? tlv[2].map(d => utf8Decoder.decode(d)): [] + } } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index d60ae63e..9a248900 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,31 +1,31 @@ -import 'dotenv/config' -import NewServer from '../proto/autogenerated/ts/express_server.js' -import GetServerMethods from './services/serverMethods/index.js' -import serverOptions from './auth.js'; -import { LoadNosrtSettingsFromEnv } from './services/nostr/index.js' -import nostrMiddleware from './nostrMiddleware.js' -import { getLogger } from './services/helpers/logger.js'; -import { initMainHandler } from './services/main/init.js'; -import { LoadMainSettingsFromEnv } from './services/main/settings.js'; - -const start = async () => { - const log = getLogger({}) - const mainSettings = LoadMainSettingsFromEnv() - const keepOn = await initMainHandler(log, mainSettings) - if (!keepOn) { - log("manual process ended") - return - } - const { apps, mainHandler, liquidityProviderInfo } = keepOn - const serverMethods = GetServerMethods(mainHandler) - const nostrSettings = LoadNosrtSettingsFromEnv() - const { Send } = nostrMiddleware(serverMethods, mainHandler, - { ...nostrSettings, apps, clients: [liquidityProviderInfo] }, - (e, p) => mainHandler.liquidProvider.onEvent(e, p) - ) - mainHandler.attachNostrSend(Send) - mainHandler.StartBeacons() - const Server = NewServer(serverMethods, serverOptions(mainHandler)) - Server.Listen(mainSettings.servicePort) -} -start() +import 'dotenv/config' +import NewServer from '../proto/autogenerated/ts/express_server.js' +import GetServerMethods from './services/serverMethods/index.js' +import serverOptions from './auth.js'; +import { LoadNosrtSettingsFromEnv } from './services/nostr/index.js' +import nostrMiddleware from './nostrMiddleware.js' +import { getLogger } from './services/helpers/logger.js'; +import { initMainHandler } from './services/main/init.js'; +import { LoadMainSettingsFromEnv } from './services/main/settings.js'; + +const start = async () => { + const log = getLogger({}) + const mainSettings = LoadMainSettingsFromEnv() + const keepOn = await initMainHandler(log, mainSettings) + if (!keepOn) { + log("manual process ended") + return + } + const { apps, mainHandler, liquidityProviderInfo } = keepOn + const serverMethods = GetServerMethods(mainHandler) + const nostrSettings = LoadNosrtSettingsFromEnv() + const { Send } = nostrMiddleware(serverMethods, mainHandler, + { ...nostrSettings, apps, clients: [liquidityProviderInfo] }, + (e, p) => mainHandler.liquidProvider.onEvent(e, p) + ) + mainHandler.attachNostrSend(Send) + mainHandler.StartBeacons() + const Server = NewServer(serverMethods, serverOptions(mainHandler)) + Server.Listen(mainSettings.servicePort) +} +start() diff --git a/src/nostrMiddleware.ts b/src/nostrMiddleware.ts index 56dd9ecf..a8d6e82c 100644 --- a/src/nostrMiddleware.ts +++ b/src/nostrMiddleware.ts @@ -1,41 +1,41 @@ -import Main from "./services/main/index.js" -import Nostr from "./services/nostr/index.js" -import { NostrSend, NostrSettings } from "./services/nostr/handler.js" -import * as Types from '../proto/autogenerated/ts/types.js' -import NewNostrTransport, { NostrRequest } from '../proto/autogenerated/ts/nostr_transport.js'; -import { ERROR, getLogger } from "./services/helpers/logger.js"; - -export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSettings: NostrSettings, onClientEvent: (e: { requestId: string }, fromPub: string) => void): { Stop: () => void, Send: NostrSend } => { - const log = getLogger({}) - const nostrTransport = NewNostrTransport(serverMethods, { - NostrUserAuthGuard: async (appId, pub) => { - const app = await mainHandler.storage.applicationStorage.GetApplication(appId || "") - const nostrUser = await mainHandler.storage.applicationStorage.GetOrCreateNostrAppUser(app, pub || "") - return { user_id: nostrUser.user.user_id, app_user_id: nostrUser.identifier, app_id: appId || "" } - }, - metricsCallback: metrics => mainHandler.settings.recordPerformance ? mainHandler.metricsManager.AddMetrics(metrics) : null, - logger: { log: console.log, error: err => log(ERROR, err) } - }) - const nostr = new Nostr(nostrSettings, event => { - let j: NostrRequest - try { - j = JSON.parse(event.content) - log("nostr event", j.rpcName || 'no rpc name') - } catch { - log(ERROR, "invalid json event received", event.content) - return - } - if (!j.rpcName) { - onClientEvent(j as { requestId: string }, event.pub) - return - } - if (j.authIdentifier !== event.pub) { - log(ERROR, "authIdentifier does not match", j.authIdentifier || "--", event.pub) - return - } - nostrTransport({ ...j, appId: event.appId }, res => { - nostr.Send({ type: 'app', appId: event.appId }, { type: 'content', pub: event.pub, content: JSON.stringify({ ...res, requestId: j.requestId }) }) - }, event.startAtNano, event.startAtMs) - }) - return { Stop: () => nostr.Stop, Send: (...args) => nostr.Send(...args) } +import Main from "./services/main/index.js" +import Nostr from "./services/nostr/index.js" +import { NostrSend, NostrSettings } from "./services/nostr/handler.js" +import * as Types from '../proto/autogenerated/ts/types.js' +import NewNostrTransport, { NostrRequest } from '../proto/autogenerated/ts/nostr_transport.js'; +import { ERROR, getLogger } from "./services/helpers/logger.js"; + +export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSettings: NostrSettings, onClientEvent: (e: { requestId: string }, fromPub: string) => void): { Stop: () => void, Send: NostrSend } => { + const log = getLogger({}) + const nostrTransport = NewNostrTransport(serverMethods, { + NostrUserAuthGuard: async (appId, pub) => { + const app = await mainHandler.storage.applicationStorage.GetApplication(appId || "") + const nostrUser = await mainHandler.storage.applicationStorage.GetOrCreateNostrAppUser(app, pub || "") + return { user_id: nostrUser.user.user_id, app_user_id: nostrUser.identifier, app_id: appId || "" } + }, + metricsCallback: metrics => mainHandler.settings.recordPerformance ? mainHandler.metricsManager.AddMetrics(metrics) : null, + logger: { log: console.log, error: err => log(ERROR, err) } + }) + const nostr = new Nostr(nostrSettings, event => { + let j: NostrRequest + try { + j = JSON.parse(event.content) + log("nostr event", j.rpcName || 'no rpc name') + } catch { + log(ERROR, "invalid json event received", event.content) + return + } + if (!j.rpcName) { + onClientEvent(j as { requestId: string }, event.pub) + return + } + if (j.authIdentifier !== event.pub) { + log(ERROR, "authIdentifier does not match", j.authIdentifier || "--", event.pub) + return + } + nostrTransport({ ...j, appId: event.appId }, res => { + nostr.Send({ type: 'app', appId: event.appId }, { type: 'content', pub: event.pub, content: JSON.stringify({ ...res, requestId: j.requestId }) }) + }, event.startAtNano, event.startAtMs) + }) + return { Stop: () => nostr.Stop, Send: (...args) => nostr.Send(...args) } } \ No newline at end of file diff --git a/src/services/helpers/envParser.ts b/src/services/helpers/envParser.ts index fa8a4e92..12705ea5 100644 --- a/src/services/helpers/envParser.ts +++ b/src/services/helpers/envParser.ts @@ -1,28 +1,28 @@ -export const EnvMustBeNonEmptyString = (name: string): string => { - const env = process.env[name] - if (!env) throw new Error(`${name} ENV must be non empty`) - return env -} -export const EnvMustBeInteger = (name: string): number => { - const env = EnvMustBeNonEmptyString(name) - if (isNaN(+env) || !Number.isInteger(+env)) { - throw new Error(`${name} ENV must be an integer number`); - } - return +env -} -export const EnvCanBeInteger = (name: string, defaultValue = 0): number => { - const env = process.env[name] - if (!env) { - return defaultValue - } - const envNum = +env - if (isNaN(envNum) || !Number.isInteger(envNum)) { - throw new Error(`${name} ENV must be an integer number or nothing`); - } - return envNum -} -export const EnvCanBeBoolean = (name: string): boolean => { - const env = process.env[name] - if (!env) return false - return env.toLowerCase() === 'true' +export const EnvMustBeNonEmptyString = (name: string): string => { + const env = process.env[name] + if (!env) throw new Error(`${name} ENV must be non empty`) + return env +} +export const EnvMustBeInteger = (name: string): number => { + const env = EnvMustBeNonEmptyString(name) + if (isNaN(+env) || !Number.isInteger(+env)) { + throw new Error(`${name} ENV must be an integer number`); + } + return +env +} +export const EnvCanBeInteger = (name: string, defaultValue = 0): number => { + const env = process.env[name] + if (!env) { + return defaultValue + } + const envNum = +env + if (isNaN(envNum) || !Number.isInteger(envNum)) { + throw new Error(`${name} ENV must be an integer number or nothing`); + } + return envNum +} +export const EnvCanBeBoolean = (name: string): boolean => { + const env = process.env[name] + if (!env) return false + return env.toLowerCase() === 'true' } \ No newline at end of file diff --git a/src/services/helpers/functionQueue.ts b/src/services/helpers/functionQueue.ts index 00170e2c..b2360571 100644 --- a/src/services/helpers/functionQueue.ts +++ b/src/services/helpers/functionQueue.ts @@ -1,34 +1,34 @@ -import { PubLogger, getLogger } from "../helpers/logger.js" - -type Item = { res: (v: T) => void, rej: (message: string) => void } -export default class FunctionQueue { - log: PubLogger - queue: Item[] = [] - running: boolean = false - f: () => Promise - constructor(name: string, f: () => Promise) { - this.log = getLogger({ component: name }) - this.f = f - } - - Run = (item: Item) => { - this.queue.push(item) - if (!this.running) { - this.execF() - } - } - - execF = async () => { - this.running = true - try { - const res = await this.f() - this.queue.forEach(q => q.res(res)) - } catch (err) { - this.queue.forEach(q => q.rej((err as any).message)) - } - this.queue = [] - this.running = false - } -} - - +import { PubLogger, getLogger } from "../helpers/logger.js" + +type Item = { res: (v: T) => void, rej: (message: string) => void } +export default class FunctionQueue { + log: PubLogger + queue: Item[] = [] + running: boolean = false + f: () => Promise + constructor(name: string, f: () => Promise) { + this.log = getLogger({ component: name }) + this.f = f + } + + Run = (item: Item) => { + this.queue.push(item) + if (!this.running) { + this.execF() + } + } + + execF = async () => { + this.running = true + try { + const res = await this.f() + this.queue.forEach(q => q.res(res)) + } catch (err) { + this.queue.forEach(q => q.rej((err as any).message)) + } + this.queue = [] + this.running = false + } +} + + diff --git a/src/services/helpers/logger.ts b/src/services/helpers/logger.ts index c7a42584..83d73785 100644 --- a/src/services/helpers/logger.ts +++ b/src/services/helpers/logger.ts @@ -1,105 +1,105 @@ -import fs from 'fs' -export const DEBUG = Symbol("DEBUG") -export const ERROR = Symbol("ERROR") -export const WARN = Symbol("WARN") -type LoggerParams = { appName?: string, userId?: string, component?: string } -export type PubLogger = (...message: (string | number | object | symbol)[]) => void -type Writer = (message: string) => void -const logsDir = process.env.LOGS_DIR || "logs" -const logLevel = process.env.LOG_LEVEL || "DEBUG" -try { - fs.mkdirSync(logsDir) -} catch { } -if (logLevel !== "DEBUG" && logLevel !== "WARN" && logLevel !== "ERROR") { - throw new Error("Invalid log level " + logLevel + " must be one of (DEBUG, WARN, ERROR)") -} -const z = (n: number) => n < 10 ? `0${n}` : `${n}` -const openWriter = (fileName: string): Writer => { - const now = new Date() - const date = `${now.getFullYear()}-${z(now.getMonth() + 1)}-${z(now.getDate())}` - const logStream = fs.createWriteStream(`${logsDir}/${fileName}_${date}.log`, { flags: 'a' }); - return (message) => { - logStream.write(message + "\n") - } -} -const rootWriter = openWriter("ROOT.log") -if (!fs.existsSync(`${logsDir}/apps`)) { - fs.mkdirSync(`${logsDir}/apps`, { recursive: true }); -} -if (!fs.existsSync(`${logsDir}/users`)) { - fs.mkdirSync(`${logsDir}/users`, { recursive: true }); -} -if (!fs.existsSync(`${logsDir}/components`)) { - fs.mkdirSync(`${logsDir}/components`, { recursive: true }); -} -export const getLogger = (params: LoggerParams): PubLogger => { - const writers: Writer[] = [] - if (params.appName) { - writers.push(openWriter(`apps/${params.appName}`)) - } - if (params.userId) { - writers.push(openWriter(`users/${params.userId}`)) - } - if (params.component) { - writers.push(openWriter(`components/${params.component}`)) - } - if (writers.length === 0) { - writers.push(rootWriter) - } - - return (...message) => { - switch (message[0]) { - case DEBUG: - if (logLevel !== "DEBUG") { - return - } - message[0] = "DEBUG" - break; - case WARN: - if (logLevel === "ERROR") { - return - } - message[0] = "WARN" - break; - case ERROR: - message[0] = "ERROR" - break; - default: - if (logLevel !== "DEBUG") { - return - } - } - const now = new Date() - const timestamp = `${now.getFullYear()}-${z(now.getMonth() + 1)}-${z(now.getDate())} ${z(now.getHours())}:${z(now.getMinutes())}:${z(now.getSeconds())}` - const toLog = [timestamp] - if (params.appName) { - if (disabledApps.includes(params.appName)) { - return - } - toLog.push(params.appName) - } - if (params.component) { - if (disabledComponents.includes(params.component)) { - return - } - toLog.push(params.component) - } - if (params.userId) { - toLog.push(params.userId) - } - const parsed = message.map(m => typeof m === 'object' ? JSON.stringify(m, (_, v) => typeof v === 'bigint' ? v.toString() : v) : m) - const final = `${toLog.join(" ")} >> ${parsed.join(" ")}` - console.log(final) - writers.forEach(w => w(final)) - } -} -let disabledApps: string[] = [] -let disabledComponents: string[] = [] -export const resetDisabledLoggers = () => { - disabledApps = [] - disabledComponents = [] -} -export const disableLoggers = (appNamesToDisable: string[], componentsToDisable: string[]) => { - disabledApps.push(...appNamesToDisable) - disabledComponents.push(...componentsToDisable) +import fs from 'fs' +export const DEBUG = Symbol("DEBUG") +export const ERROR = Symbol("ERROR") +export const WARN = Symbol("WARN") +type LoggerParams = { appName?: string, userId?: string, component?: string } +export type PubLogger = (...message: (string | number | object | symbol)[]) => void +type Writer = (message: string) => void +const logsDir = process.env.LOGS_DIR || "logs" +const logLevel = process.env.LOG_LEVEL || "DEBUG" +try { + fs.mkdirSync(logsDir) +} catch { } +if (logLevel !== "DEBUG" && logLevel !== "WARN" && logLevel !== "ERROR") { + throw new Error("Invalid log level " + logLevel + " must be one of (DEBUG, WARN, ERROR)") +} +const z = (n: number) => n < 10 ? `0${n}` : `${n}` +const openWriter = (fileName: string): Writer => { + const now = new Date() + const date = `${now.getFullYear()}-${z(now.getMonth() + 1)}-${z(now.getDate())}` + const logStream = fs.createWriteStream(`${logsDir}/${fileName}_${date}.log`, { flags: 'a' }); + return (message) => { + logStream.write(message + "\n") + } +} +const rootWriter = openWriter("ROOT.log") +if (!fs.existsSync(`${logsDir}/apps`)) { + fs.mkdirSync(`${logsDir}/apps`, { recursive: true }); +} +if (!fs.existsSync(`${logsDir}/users`)) { + fs.mkdirSync(`${logsDir}/users`, { recursive: true }); +} +if (!fs.existsSync(`${logsDir}/components`)) { + fs.mkdirSync(`${logsDir}/components`, { recursive: true }); +} +export const getLogger = (params: LoggerParams): PubLogger => { + const writers: Writer[] = [] + if (params.appName) { + writers.push(openWriter(`apps/${params.appName}`)) + } + if (params.userId) { + writers.push(openWriter(`users/${params.userId}`)) + } + if (params.component) { + writers.push(openWriter(`components/${params.component}`)) + } + if (writers.length === 0) { + writers.push(rootWriter) + } + + return (...message) => { + switch (message[0]) { + case DEBUG: + if (logLevel !== "DEBUG") { + return + } + message[0] = "DEBUG" + break; + case WARN: + if (logLevel === "ERROR") { + return + } + message[0] = "WARN" + break; + case ERROR: + message[0] = "ERROR" + break; + default: + if (logLevel !== "DEBUG") { + return + } + } + const now = new Date() + const timestamp = `${now.getFullYear()}-${z(now.getMonth() + 1)}-${z(now.getDate())} ${z(now.getHours())}:${z(now.getMinutes())}:${z(now.getSeconds())}` + const toLog = [timestamp] + if (params.appName) { + if (disabledApps.includes(params.appName)) { + return + } + toLog.push(params.appName) + } + if (params.component) { + if (disabledComponents.includes(params.component)) { + return + } + toLog.push(params.component) + } + if (params.userId) { + toLog.push(params.userId) + } + const parsed = message.map(m => typeof m === 'object' ? JSON.stringify(m, (_, v) => typeof v === 'bigint' ? v.toString() : v) : m) + const final = `${toLog.join(" ")} >> ${parsed.join(" ")}` + console.log(final) + writers.forEach(w => w(final)) + } +} +let disabledApps: string[] = [] +let disabledComponents: string[] = [] +export const resetDisabledLoggers = () => { + disabledApps = [] + disabledComponents = [] +} +export const disableLoggers = (appNamesToDisable: string[], componentsToDisable: string[]) => { + disabledApps.push(...appNamesToDisable) + disabledComponents.push(...componentsToDisable) } \ No newline at end of file diff --git a/src/services/lnd/addInvoiceReq.ts b/src/services/lnd/addInvoiceReq.ts index 75193308..f3056a39 100644 --- a/src/services/lnd/addInvoiceReq.ts +++ b/src/services/lnd/addInvoiceReq.ts @@ -1,34 +1,34 @@ -import { OpenChannelRequest, Invoice } from "../../../proto/lnd/lightning"; - -export const AddInvoiceReq = (value: number, expiry = 60 * 60, privateHints = false, memo?: string): Invoice => ({ - expiry: BigInt(expiry), - memo: memo || "", - private: privateHints, - value: BigInt(value), - - fallbackAddr: "", - cltvExpiry: 0n, - descriptionHash: Buffer.alloc(0), - features: {}, - isAmp: false, - rPreimage: Buffer.alloc(0), - routeHints: [], - valueMsat: 0n, - - addIndex: 0n, - ampInvoiceState: {}, - amtPaidMsat: 0n, - amtPaidSat: 0n, - creationDate: 0n, - htlcs: [], - isKeysend: false, - paymentAddr: Buffer.alloc(0), - paymentRequest: "", - rHash: Buffer.alloc(0), - settleDate: 0n, - settleIndex: 0n, - state: 0, - - amtPaid: 0n, - settled: false, +import { OpenChannelRequest, Invoice } from "../../../proto/lnd/lightning"; + +export const AddInvoiceReq = (value: number, expiry = 60 * 60, privateHints = false, memo?: string): Invoice => ({ + expiry: BigInt(expiry), + memo: memo || "", + private: privateHints, + value: BigInt(value), + + fallbackAddr: "", + cltvExpiry: 0n, + descriptionHash: Buffer.alloc(0), + features: {}, + isAmp: false, + rPreimage: Buffer.alloc(0), + routeHints: [], + valueMsat: 0n, + + addIndex: 0n, + ampInvoiceState: {}, + amtPaidMsat: 0n, + amtPaidSat: 0n, + creationDate: 0n, + htlcs: [], + isKeysend: false, + paymentAddr: Buffer.alloc(0), + paymentRequest: "", + rHash: Buffer.alloc(0), + settleDate: 0n, + settleIndex: 0n, + state: 0, + + amtPaid: 0n, + settled: false, }) \ No newline at end of file diff --git a/src/services/lnd/index.ts b/src/services/lnd/index.ts index 48886058..451ae6ef 100644 --- a/src/services/lnd/index.ts +++ b/src/services/lnd/index.ts @@ -1,22 +1,22 @@ -import { EnvMustBeNonEmptyString, EnvMustBeInteger, EnvCanBeBoolean, EnvCanBeInteger } from '../helpers/envParser.js' -import { LndSettings } from './settings.js' -import os from 'os' -import path from 'path' - -const resolveHome = (filepath: string) => { - if (filepath[0] === '~') { - return path.join(os.homedir(), filepath.slice(1)) - } - return filepath -} - -export const LoadLndSettingsFromEnv = (): LndSettings => { - const lndAddr = process.env.LND_ADDRESS || "127.0.0.1:10009" - const lndCertPath = process.env.LND_CERT_PATH || resolveHome("~/.lnd/tls.cert") - const lndMacaroonPath = process.env.LND_MACAROON_PATH || resolveHome("~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon") - const feeRateLimit = EnvCanBeInteger("OUTBOUND_MAX_FEE_BPS", 60) / 10000 - const feeFixedLimit = EnvCanBeInteger("OUTBOUND_MAX_FEE_EXTRA_SATS", 100) - const mockLnd = EnvCanBeBoolean("MOCK_LND") - const liquidityProviderPub = process.env.LIQUIDITY_PROVIDER_PUB || "" - return { mainNode: { lndAddr, lndCertPath, lndMacaroonPath }, feeRateLimit, feeFixedLimit, mockLnd, liquidityProviderPub, useOnlyLiquidityProvider: false } -} +import { EnvMustBeNonEmptyString, EnvMustBeInteger, EnvCanBeBoolean, EnvCanBeInteger } from '../helpers/envParser.js' +import { LndSettings } from './settings.js' +import os from 'os' +import path from 'path' + +const resolveHome = (filepath: string) => { + if (filepath[0] === '~') { + return path.join(os.homedir(), filepath.slice(1)) + } + return filepath +} + +export const LoadLndSettingsFromEnv = (): LndSettings => { + const lndAddr = process.env.LND_ADDRESS || "127.0.0.1:10009" + const lndCertPath = process.env.LND_CERT_PATH || resolveHome("~/.lnd/tls.cert") + const lndMacaroonPath = process.env.LND_MACAROON_PATH || resolveHome("~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon") + const feeRateLimit = EnvCanBeInteger("OUTBOUND_MAX_FEE_BPS", 60) / 10000 + const feeFixedLimit = EnvCanBeInteger("OUTBOUND_MAX_FEE_EXTRA_SATS", 100) + const mockLnd = EnvCanBeBoolean("MOCK_LND") + const liquidityProviderPub = process.env.LIQUIDITY_PROVIDER_PUB || "" + return { mainNode: { lndAddr, lndCertPath, lndMacaroonPath }, feeRateLimit, feeFixedLimit, mockLnd, liquidityProviderPub, useOnlyLiquidityProvider: false } +} diff --git a/src/services/lnd/liquidityProvider.ts b/src/services/lnd/liquidityProvider.ts index 92a9fc1f..0eb5ba5a 100644 --- a/src/services/lnd/liquidityProvider.ts +++ b/src/services/lnd/liquidityProvider.ts @@ -1,226 +1,226 @@ -import newNostrClient from '../../../proto/autogenerated/ts/nostr_client.js' -import { NostrRequest } from '../../../proto/autogenerated/ts/nostr_transport.js' -import * as Types from '../../../proto/autogenerated/ts/types.js' -import { decodeNprofile } from '../../custom-nip19.js' -import { getLogger } from '../helpers/logger.js' -import { NostrEvent, NostrSend } from '../nostr/handler.js' -import { relayInit } from '../nostr/tools/relay.js' -import { InvoicePaidCb } from './settings.js' - -export type LiquidityRequest = { action: 'spend' | 'receive', amount: number } - -export type nostrCallback = { startedAtMillis: number, type: 'single' | 'stream', f: (res: T) => void } -export class LiquidityProvider { - client: ReturnType - clientCbs: Record> = {} - clientId: string = "" - myPub: string = "" - log = getLogger({ component: 'liquidityProvider' }) - nostrSend: NostrSend | null = null - ready = false - pubDestination: string - latestMaxWithdrawable: number | null = null - invoicePaidCb: InvoicePaidCb - connecting = false - readyInterval: NodeJS.Timeout - // make the sub process accept client - constructor(pubDestination: string, invoicePaidCb: InvoicePaidCb) { - if (!pubDestination) { - this.log("No pub provider to liquidity provider, will not be initialized") - } - this.pubDestination = pubDestination - this.invoicePaidCb = invoicePaidCb - this.client = newNostrClient({ - pubDestination: this.pubDestination, - retrieveNostrUserAuth: async () => this.myPub, - }, this.clientSend, this.clientSub) - - this.readyInterval = setInterval(() => { - if (this.ready) { - clearInterval(this.readyInterval) - this.Connect() - } - }, 1000) - } - - Stop = () => { - clearInterval(this.readyInterval) - } - - Connect = async () => { - await new Promise(res => setTimeout(res, 2000)) - this.log("ready") - await this.CheckUserState() - if (this.latestMaxWithdrawable === null) { - return - } - this.log("subbing to user operations") - this.client.GetLiveUserOperations(res => { - console.log("got user operation", res) - if (res.status === 'ERROR') { - this.log("error getting user operations", res.reason) - return - } - this.log("got user operation", res.operation) - if (res.operation.type === Types.UserOperationType.INCOMING_INVOICE) { - this.log("invoice was paid", res.operation.identifier) - this.invoicePaidCb(res.operation.identifier, res.operation.amount, false) - } - }) - } - - CheckUserState = async () => { - const res = await this.client.GetUserInfo() - if (res.status === 'ERROR') { - this.log("error getting user info", res) - return - } - this.latestMaxWithdrawable = res.max_withdrawable - this.log("latest provider balance:", res.max_withdrawable) - return res - } - - CanProviderHandle = (req: LiquidityRequest) => { - if (this.latestMaxWithdrawable === null) { - return false - } - if (req.action === 'spend') { - return this.latestMaxWithdrawable > req.amount - } - return true - } - - AddInvoice = async (amount: number, memo: string) => { - const res = await this.client.NewInvoice({ amountSats: amount, memo }) - if (res.status === 'ERROR') { - this.log("error creating invoice", res.reason) - throw new Error(res.reason) - } - this.log("new invoice", res.invoice) - this.CheckUserState() - return res.invoice - } - - PayInvoice = async (invoice: string) => { - const res = await this.client.PayInvoice({ invoice, amount: 0 }) - if (res.status === 'ERROR') { - this.log("error paying invoice", res.reason) - throw new Error(res.reason) - } - this.log("paid invoice", res) - this.CheckUserState() - return res - } - - setNostrInfo = ({ clientId, myPub }: { myPub: string, clientId: string }) => { - this.clientId = clientId - this.myPub = myPub - this.setSetIfReady() - } - - - - attachNostrSend(f: NostrSend) { - this.nostrSend = f - this.setSetIfReady() - } - - setSetIfReady = () => { - if (this.nostrSend && !!this.pubDestination && !!this.clientId && !!this.myPub) { - this.ready = true - this.log("ready to send to ", this.pubDestination) - } - } - - onEvent = async (res: { requestId: string }, fromPub: string) => { - if (fromPub !== this.pubDestination) { - this.log("got event from invalid pub", fromPub, this.pubDestination) - return false - } - if (this.clientCbs[res.requestId]) { - const cb = this.clientCbs[res.requestId] - cb.f(res) - if (cb.type === 'single') { - delete this.clientCbs[res.requestId] - this.log(this.getSingleSubs(), "single subs left") - } - return true - } - return false - } - - clientSend = (to: string, message: NostrRequest): Promise => { - if (!this.ready || !this.nostrSend) { - throw new Error("liquidity provider not initialized") - } - if (!message.requestId) { - message.requestId = makeId(16) - } - const reqId = message.requestId - if (this.clientCbs[reqId]) { - throw new Error("request was already sent") - } - this.nostrSend({ type: 'client', clientId: this.clientId }, { - type: 'content', - pub: to, - content: JSON.stringify(message) - }) - - //this.nostrSend(this.relays, to, JSON.stringify(message), this.settings) - - this.log("subbing to single send", reqId, message.rpcName || 'no rpc name') - return new Promise(res => { - this.clientCbs[reqId] = { - startedAtMillis: Date.now(), - type: 'single', - f: (response: any) => { res(response) }, - } - }) - } - - clientSub = (to: string, message: NostrRequest, cb: (res: any) => void): void => { - if (!this.ready || !this.nostrSend) { - throw new Error("liquidity provider not initialized") - } - if (!message.requestId) { - message.requestId = message.rpcName - } - const reqId = message.requestId - if (!reqId) { - throw new Error("invalid sub") - } - if (this.clientCbs[reqId]) { - this.clientCbs[reqId] = { - startedAtMillis: Date.now(), - type: 'stream', - f: (response: any) => { cb(response) }, - } - this.log("sub for", reqId, "was already registered, overriding") - return - } - this.nostrSend({ type: 'client', clientId: this.clientId }, { - type: 'content', - pub: to, - content: JSON.stringify(message) - }) - this.log("subbing to stream", reqId) - this.clientCbs[reqId] = { - startedAtMillis: Date.now(), - type: 'stream', - f: (response: any) => { cb(response) } - } - } - getSingleSubs = () => { - return Object.entries(this.clientCbs).filter(([_, cb]) => cb.type === 'single') - } -} - -export const makeId = (length: number) => { - let result = ''; - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - const charactersLength = characters.length; - for (let i = 0; i < length; i++) { - result += characters.charAt(Math.floor(Math.random() * charactersLength)); - } - return result; +import newNostrClient from '../../../proto/autogenerated/ts/nostr_client.js' +import { NostrRequest } from '../../../proto/autogenerated/ts/nostr_transport.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' +import { decodeNprofile } from '../../custom-nip19.js' +import { getLogger } from '../helpers/logger.js' +import { NostrEvent, NostrSend } from '../nostr/handler.js' +import { relayInit } from '../nostr/tools/relay.js' +import { InvoicePaidCb } from './settings.js' + +export type LiquidityRequest = { action: 'spend' | 'receive', amount: number } + +export type nostrCallback = { startedAtMillis: number, type: 'single' | 'stream', f: (res: T) => void } +export class LiquidityProvider { + client: ReturnType + clientCbs: Record> = {} + clientId: string = "" + myPub: string = "" + log = getLogger({ component: 'liquidityProvider' }) + nostrSend: NostrSend | null = null + ready = false + pubDestination: string + latestMaxWithdrawable: number | null = null + invoicePaidCb: InvoicePaidCb + connecting = false + readyInterval: NodeJS.Timeout + // make the sub process accept client + constructor(pubDestination: string, invoicePaidCb: InvoicePaidCb) { + if (!pubDestination) { + this.log("No pub provider to liquidity provider, will not be initialized") + } + this.pubDestination = pubDestination + this.invoicePaidCb = invoicePaidCb + this.client = newNostrClient({ + pubDestination: this.pubDestination, + retrieveNostrUserAuth: async () => this.myPub, + }, this.clientSend, this.clientSub) + + this.readyInterval = setInterval(() => { + if (this.ready) { + clearInterval(this.readyInterval) + this.Connect() + } + }, 1000) + } + + Stop = () => { + clearInterval(this.readyInterval) + } + + Connect = async () => { + await new Promise(res => setTimeout(res, 2000)) + this.log("ready") + await this.CheckUserState() + if (this.latestMaxWithdrawable === null) { + return + } + this.log("subbing to user operations") + this.client.GetLiveUserOperations(res => { + console.log("got user operation", res) + if (res.status === 'ERROR') { + this.log("error getting user operations", res.reason) + return + } + this.log("got user operation", res.operation) + if (res.operation.type === Types.UserOperationType.INCOMING_INVOICE) { + this.log("invoice was paid", res.operation.identifier) + this.invoicePaidCb(res.operation.identifier, res.operation.amount, false) + } + }) + } + + CheckUserState = async () => { + const res = await this.client.GetUserInfo() + if (res.status === 'ERROR') { + this.log("error getting user info", res) + return + } + this.latestMaxWithdrawable = res.max_withdrawable + this.log("latest provider balance:", res.max_withdrawable) + return res + } + + CanProviderHandle = (req: LiquidityRequest) => { + if (this.latestMaxWithdrawable === null) { + return false + } + if (req.action === 'spend') { + return this.latestMaxWithdrawable > req.amount + } + return true + } + + AddInvoice = async (amount: number, memo: string) => { + const res = await this.client.NewInvoice({ amountSats: amount, memo }) + if (res.status === 'ERROR') { + this.log("error creating invoice", res.reason) + throw new Error(res.reason) + } + this.log("new invoice", res.invoice) + this.CheckUserState() + return res.invoice + } + + PayInvoice = async (invoice: string) => { + const res = await this.client.PayInvoice({ invoice, amount: 0 }) + if (res.status === 'ERROR') { + this.log("error paying invoice", res.reason) + throw new Error(res.reason) + } + this.log("paid invoice", res) + this.CheckUserState() + return res + } + + setNostrInfo = ({ clientId, myPub }: { myPub: string, clientId: string }) => { + this.clientId = clientId + this.myPub = myPub + this.setSetIfReady() + } + + + + attachNostrSend(f: NostrSend) { + this.nostrSend = f + this.setSetIfReady() + } + + setSetIfReady = () => { + if (this.nostrSend && !!this.pubDestination && !!this.clientId && !!this.myPub) { + this.ready = true + this.log("ready to send to ", this.pubDestination) + } + } + + onEvent = async (res: { requestId: string }, fromPub: string) => { + if (fromPub !== this.pubDestination) { + this.log("got event from invalid pub", fromPub, this.pubDestination) + return false + } + if (this.clientCbs[res.requestId]) { + const cb = this.clientCbs[res.requestId] + cb.f(res) + if (cb.type === 'single') { + delete this.clientCbs[res.requestId] + this.log(this.getSingleSubs(), "single subs left") + } + return true + } + return false + } + + clientSend = (to: string, message: NostrRequest): Promise => { + if (!this.ready || !this.nostrSend) { + throw new Error("liquidity provider not initialized") + } + if (!message.requestId) { + message.requestId = makeId(16) + } + const reqId = message.requestId + if (this.clientCbs[reqId]) { + throw new Error("request was already sent") + } + this.nostrSend({ type: 'client', clientId: this.clientId }, { + type: 'content', + pub: to, + content: JSON.stringify(message) + }) + + //this.nostrSend(this.relays, to, JSON.stringify(message), this.settings) + + this.log("subbing to single send", reqId, message.rpcName || 'no rpc name') + return new Promise(res => { + this.clientCbs[reqId] = { + startedAtMillis: Date.now(), + type: 'single', + f: (response: any) => { res(response) }, + } + }) + } + + clientSub = (to: string, message: NostrRequest, cb: (res: any) => void): void => { + if (!this.ready || !this.nostrSend) { + throw new Error("liquidity provider not initialized") + } + if (!message.requestId) { + message.requestId = message.rpcName + } + const reqId = message.requestId + if (!reqId) { + throw new Error("invalid sub") + } + if (this.clientCbs[reqId]) { + this.clientCbs[reqId] = { + startedAtMillis: Date.now(), + type: 'stream', + f: (response: any) => { cb(response) }, + } + this.log("sub for", reqId, "was already registered, overriding") + return + } + this.nostrSend({ type: 'client', clientId: this.clientId }, { + type: 'content', + pub: to, + content: JSON.stringify(message) + }) + this.log("subbing to stream", reqId) + this.clientCbs[reqId] = { + startedAtMillis: Date.now(), + type: 'stream', + f: (response: any) => { cb(response) } + } + } + getSingleSubs = () => { + return Object.entries(this.clientCbs).filter(([_, cb]) => cb.type === 'single') + } +} + +export const makeId = (length: number) => { + let result = ''; + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const charactersLength = characters.length; + for (let i = 0; i < length; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; } \ No newline at end of file diff --git a/src/services/lnd/lnd.ts b/src/services/lnd/lnd.ts index 58fa0db2..6da3c47f 100644 --- a/src/services/lnd/lnd.ts +++ b/src/services/lnd/lnd.ts @@ -1,437 +1,437 @@ -//const grpc = require('@grpc/grpc-js'); -import crypto from 'crypto' -import { credentials, Metadata } from '@grpc/grpc-js' -import { GrpcTransport } from "@protobuf-ts/grpc-transport"; -import fs from 'fs' -import * as Types from '../../../proto/autogenerated/ts/types.js' -import { LightningClient } from '../../../proto/lnd/lightning.client.js' -import { InvoicesClient } from '../../../proto/lnd/invoices.client.js' -import { RouterClient } from '../../../proto/lnd/router.client.js' -import { ChainNotifierClient } from '../../../proto/lnd/chainnotifier.client.js' -import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment, PaymentFailureReason, SendCoinsResponse, EstimateFeeResponse, ChannelBalanceResponse, TransactionDetails, ListChannelsResponse, ClosedChannelsResponse, PendingChannelsResponse, ForwardingHistoryResponse } from '../../../proto/lnd/lightning.js' -import { OpenChannelReq } from './openChannelReq.js'; -import { AddInvoiceReq } from './addInvoiceReq.js'; -import { PayInvoiceReq } from './payInvoiceReq.js'; -import { SendCoinsReq } from './sendCoinsReq.js'; -import { LndSettings, AddressPaidCb, InvoicePaidCb, NodeInfo, Invoice, DecodedInvoice, PaidInvoice, NewBlockCb, HtlcCb, BalanceInfo } from './settings.js'; -import { getLogger } from '../helpers/logger.js'; -import { HtlcEvent_EventType } from '../../../proto/lnd/router.js'; -import { LiquidityProvider, LiquidityRequest } from './liquidityProvider.js'; -const DeadLineMetadata = (deadline = 10 * 1000) => ({ deadline: Date.now() + deadline }) -const deadLndRetrySeconds = 5 -export default class { - lightning: LightningClient - invoices: InvoicesClient - router: RouterClient - chainNotifier: ChainNotifierClient - settings: LndSettings - ready = false - latestKnownBlockHeigh = 0 - latestKnownSettleIndex = 0 - abortController = new AbortController() - addressPaidCb: AddressPaidCb - invoicePaidCb: InvoicePaidCb - newBlockCb: NewBlockCb - htlcCb: HtlcCb - log = getLogger({ component: 'lndManager' }) - outgoingOpsLocked = false - liquidProvider: LiquidityProvider - constructor(settings: LndSettings, liquidProvider: LiquidityProvider, addressPaidCb: AddressPaidCb, invoicePaidCb: InvoicePaidCb, newBlockCb: NewBlockCb, htlcCb: HtlcCb) { - this.settings = settings - this.addressPaidCb = addressPaidCb - this.invoicePaidCb = invoicePaidCb - this.newBlockCb = newBlockCb - this.htlcCb = htlcCb - const { lndAddr, lndCertPath, lndMacaroonPath } = this.settings.mainNode - const lndCert = fs.readFileSync(lndCertPath); - const macaroon = fs.readFileSync(lndMacaroonPath).toString('hex'); - const sslCreds = credentials.createSsl(lndCert); - const macaroonCreds = credentials.createFromMetadataGenerator( - function (args: any, callback: any) { - let metadata = new Metadata(); - metadata.add('macaroon', macaroon); - callback(null, metadata); - }, - ); - const creds = credentials.combineChannelCredentials( - sslCreds, - macaroonCreds, - ); - const transport = new GrpcTransport({ host: lndAddr, channelCredentials: creds }) - this.lightning = new LightningClient(transport) - this.invoices = new InvoicesClient(transport) - this.router = new RouterClient(transport) - this.chainNotifier = new ChainNotifierClient(transport) - this.liquidProvider = liquidProvider - } - - LockOutgoingOperations(): void { - this.outgoingOpsLocked = true - } - UnlockOutgoingOperations(): void { - this.outgoingOpsLocked = false - } - - SetMockInvoiceAsPaid(invoice: string, amount: number): Promise { - throw new Error("SetMockInvoiceAsPaid only available in mock mode") - } - Stop() { - this.abortController.abort() - this.liquidProvider.Stop() - } - - async ShouldUseLiquidityProvider(req: LiquidityRequest): Promise { - if (this.settings.useOnlyLiquidityProvider) { - return true - } - if (!this.liquidProvider.CanProviderHandle(req)) { - return false - } - const channels = await this.ListChannels() - if (channels.channels.length === 0) { - this.log("no channels, will use liquidity provider") - return true - } - return false - } - async Warmup() { - this.SubscribeAddressPaid() - this.SubscribeInvoicePaid() - this.SubscribeNewBlock() - this.SubscribeHtlcEvents() - const now = Date.now() - return new Promise((res, rej) => { - const interval = setInterval(async () => { - try { - await this.GetInfo() - clearInterval(interval) - this.ready = true - res() - } catch (err) { - this.log("LND is not ready yet, will try again in 1 second") - if (Date.now() - now > 1000 * 60) { - rej(new Error("LND not ready after 1 minute")) - } - } - }, 1000) - }) - } - - async GetInfo(): Promise { - const res = await this.lightning.getInfo({}, DeadLineMetadata()) - return res.response - } - async ListPendingChannels(): Promise { - const res = await this.lightning.pendingChannels({}, DeadLineMetadata()) - return res.response - } - async ListChannels(): Promise { - const res = await this.lightning.listChannels({ - activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0) - }, DeadLineMetadata()) - return res.response - } - async ListClosedChannels(): Promise { - const res = await this.lightning.closedChannels({ - abandoned: true, - breach: true, - cooperative: true, - fundingCanceled: true, - localForce: true, - remoteForce: true - }, DeadLineMetadata()) - return res.response - } - - async Health(): Promise { - if (!this.ready) { - throw new Error("not ready") - } - const info = await this.GetInfo() - if (!info.syncedToChain || !info.syncedToGraph) { - throw new Error("not synced") - } - } - - RestartStreams() { - if (!this.ready) { - return - } - this.log("LND is dead, will try to reconnect in", deadLndRetrySeconds, "seconds") - const interval = setInterval(async () => { - try { - await this.Health() - this.log("LND is back online") - clearInterval(interval) - this.Warmup() - } catch (err) { - this.log("LND still dead, will try again in", deadLndRetrySeconds, "seconds") - } - }, deadLndRetrySeconds * 1000) - } - - async SubscribeHtlcEvents() { - const stream = this.router.subscribeHtlcEvents({}, { abort: this.abortController.signal }) - stream.responses.onMessage(htlc => { - this.htlcCb(htlc) - }) - stream.responses.onError(error => { - this.log("Error with subscribeHtlcEvents stream") - }) - stream.responses.onComplete(() => { - this.log("subscribeHtlcEvents stream closed") - }) - } - - async SubscribeNewBlock() { - const { blockHeight } = await this.GetInfo() - const stream = this.chainNotifier.registerBlockEpochNtfn({ height: blockHeight, hash: Buffer.alloc(0) }, { abort: this.abortController.signal }) - stream.responses.onMessage(block => { - this.newBlockCb(block.height) - }) - stream.responses.onError(error => { - this.log("Error with onchain tx stream") - }) - stream.responses.onComplete(() => { - this.log("onchain tx stream closed") - }) - } - - SubscribeAddressPaid(): void { - const stream = this.lightning.subscribeTransactions({ - account: "", - endHeight: 0, - startHeight: this.latestKnownBlockHeigh, - }, { abort: this.abortController.signal }) - stream.responses.onMessage(tx => { - if (tx.blockHeight > this.latestKnownBlockHeigh) { - this.latestKnownBlockHeigh = tx.blockHeight - } - if (tx.numConfirmations === 0) { // only process pending transactions, confirmed transaction are processed by the newBlock CB - tx.outputDetails.forEach(output => { - if (output.isOurAddress) { - this.log("received chan TX", Number(output.amount), "sats", "for", output.address) - this.addressPaidCb({ hash: tx.txHash, index: Number(output.outputIndex) }, output.address, Number(output.amount), false) - } - }) - } - }) - stream.responses.onError(error => { - this.log("Error with onchain tx stream") - }) - stream.responses.onComplete(() => { - this.log("onchain tx stream closed") - }) - } - - SubscribeInvoicePaid(): void { - const stream = this.lightning.subscribeInvoices({ - settleIndex: BigInt(this.latestKnownSettleIndex), - addIndex: 0n, - }, { abort: this.abortController.signal }) - stream.responses.onMessage(invoice => { - if (invoice.state === Invoice_InvoiceState.SETTLED) { - this.log("An invoice was paid for", Number(invoice.amtPaidSat), "sats", invoice.paymentRequest) - this.latestKnownSettleIndex = Number(invoice.settleIndex) - this.invoicePaidCb(invoice.paymentRequest, Number(invoice.amtPaidSat), false) - } - }) - stream.responses.onError(error => { - this.log("Error with invoice stream") - }) - stream.responses.onComplete(() => { - this.log("invoice stream closed") - this.RestartStreams() - }) - } - - async NewAddress(addressType: Types.AddressType): Promise { - this.log("generating new address") - await this.Health() - let lndAddressType: AddressType - switch (addressType) { - case Types.AddressType.NESTED_PUBKEY_HASH: - lndAddressType = AddressType.NESTED_PUBKEY_HASH - break; - case Types.AddressType.WITNESS_PUBKEY_HASH: - lndAddressType = AddressType.WITNESS_PUBKEY_HASH - break; - case Types.AddressType.TAPROOT_PUBKEY: - lndAddressType = AddressType.TAPROOT_PUBKEY - break; - default: - throw new Error("unknown address type " + addressType) - } - const res = await this.lightning.newAddress({ account: "", type: lndAddressType }, DeadLineMetadata()) - this.log("new address", res.response.address) - return res.response - } - - async NewInvoice(value: number, memo: string, expiry: number): Promise { - this.log("generating new invoice for", value, "sats") - await this.Health() - const shouldUseLiquidityProvider = await this.ShouldUseLiquidityProvider({ action: 'receive', amount: value }) - if (shouldUseLiquidityProvider) { - const invoice = await this.liquidProvider.AddInvoice(value, memo) - return { payRequest: invoice } - } - const res = await this.lightning.addInvoice(AddInvoiceReq(value, expiry, false, memo), DeadLineMetadata()) - this.log("new invoice", res.response.paymentRequest) - return { payRequest: res.response.paymentRequest } - } - - async DecodeInvoice(paymentRequest: string): Promise { - const res = await this.lightning.decodePayReq({ payReq: paymentRequest }, DeadLineMetadata()) - return { numSatoshis: Number(res.response.numSatoshis), paymentHash: res.response.paymentHash } - } - - GetFeeLimitAmount(amount: number): number { - return Math.ceil(amount * this.settings.feeRateLimit + this.settings.feeFixedLimit); - } - - GetMaxWithinLimit(amount: number): number { - return Math.max(0, Math.floor(amount * (1 - this.settings.feeRateLimit) - this.settings.feeFixedLimit)) - } - - async ChannelBalance(): Promise<{ local: number, remote: number }> { - const res = await this.lightning.channelBalance({}) - const r = res.response - return { local: r.localBalance ? Number(r.localBalance.sat) : 0, remote: r.remoteBalance ? Number(r.remoteBalance.sat) : 0 } - } - async PayInvoice(invoice: string, amount: number, feeLimit: number): Promise { - if (this.outgoingOpsLocked) { - this.log("outgoing ops locked, rejecting payment request") - throw new Error("lnd node is currently out of sync") - } - await this.Health() - this.log("paying invoice", invoice, "for", amount, "sats") - const shouldUseLiquidityProvider = await this.ShouldUseLiquidityProvider({ action: 'spend', amount }) - if (shouldUseLiquidityProvider) { - const res = await this.liquidProvider.PayInvoice(invoice) - return { feeSat: res.network_fee + res.service_fee, valueSat: res.amount_paid, paymentPreimage: res.preimage } - } - const abortController = new AbortController() - const req = PayInvoiceReq(invoice, amount, feeLimit) - const stream = this.router.sendPaymentV2(req, { abort: abortController.signal }) - return new Promise((res, rej) => { - stream.responses.onError(error => { - this.log("invoice payment failed", error) - rej(error) - }) - stream.responses.onMessage(payment => { - switch (payment.status) { - case Payment_PaymentStatus.FAILED: - console.log(payment) - this.log("invoice payment failed", payment.failureReason) - rej(PaymentFailureReason[payment.failureReason]) - return - case Payment_PaymentStatus.SUCCEEDED: - this.log("invoice payment succeded", Number(payment.valueSat)) - res({ feeSat: Math.ceil(Number(payment.feeMsat) / 1000), valueSat: Number(payment.valueSat), paymentPreimage: payment.paymentPreimage }) - } - }) - }) - } - - async EstimateChainFees(address: string, amount: number, targetConf: number): Promise { - await this.Health() - const res = await this.lightning.estimateFee({ - addrToAmount: { [address]: BigInt(amount) }, - minConfs: 1, - spendUnconfirmed: false, - targetConf: targetConf - }) - return res.response - } - - async PayAddress(address: string, amount: number, satPerVByte: number, label = ""): Promise { - if (this.outgoingOpsLocked) { - this.log("outgoing ops locked, rejecting payment request") - throw new Error("lnd node is currently out of sync") - } - await this.Health() - this.log("sending chain TX for", amount, "sats", "to", address) - const res = await this.lightning.sendCoins(SendCoinsReq(address, amount, satPerVByte, label), DeadLineMetadata()) - this.log("sent chain TX for", amount, "sats", "to", address) - return res.response - } - - async GetTransactions(startHeight: number): Promise { - await this.Health() - const res = await this.lightning.getTransactions({ startHeight, endHeight: 0, account: "" }, DeadLineMetadata()) - return res.response - } - - async GetChannelBalance() { - const res = await this.lightning.channelBalance({}, DeadLineMetadata()) - return res.response - } - - async GetWalletBalance() { - const res = await this.lightning.walletBalance({}, DeadLineMetadata()) - return res.response - } - - async GetBalance(): Promise { - const wRes = await this.lightning.walletBalance({}, DeadLineMetadata()) - const { confirmedBalance, unconfirmedBalance, totalBalance } = wRes.response - const { response } = await this.lightning.listChannels({ - activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0) - }, DeadLineMetadata()) - const channelsBalance = response.channels.map(c => ({ - channelId: c.chanId, - localBalanceSats: Number(c.localBalance), - remoteBalanceSats: Number(c.remoteBalance), - htlcs: c.pendingHtlcs.map(htlc => ({ incoming: htlc.incoming, amount: Number(htlc.amount), index: Number(htlc.htlcIndex), fwIndex: Number(htlc.forwardingHtlcIndex) })) - })) - return { confirmedBalance: Number(confirmedBalance), unconfirmedBalance: Number(unconfirmedBalance), totalBalance: Number(totalBalance), channelsBalance } - } - - async GetForwardingHistory(indexOffset: number, startTime = 0): Promise { - const { response } = await this.lightning.forwardingHistory({ indexOffset, numMaxEvents: 0, startTime: BigInt(startTime), endTime: 0n, peerAliasLookup: false }, DeadLineMetadata()) - return response - } - - async GetAllPaidInvoices(max: number) { - const res = await this.lightning.listInvoices({ indexOffset: 0n, numMaxInvoices: BigInt(max), pendingOnly: false, reversed: true }, DeadLineMetadata()) - return res.response - } - async GetAllPayments(max: number) { - const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset: 0n, maxPayments: BigInt(max), reversed: true }) - return res.response - } - - async ConnectPeer(addr: { pubkey: string, host: string }) { - const res = await this.lightning.connectPeer({ - addr, - perm: true, - timeout: 0n - }, DeadLineMetadata()) - return res.response - } - - async ListPeers() { - const res = await this.lightning.listPeers({ latestError: true }, DeadLineMetadata()) - return res.response - } - - async OpenChannel(destination: string, closeAddress: string, fundingAmount: number, pushSats: number) { - const abortController = new AbortController() - const req = OpenChannelReq(destination, closeAddress, fundingAmount, pushSats) - const stream = this.lightning.openChannel(req, { abort: abortController.signal }) - return new Promise((res, rej) => { - stream.responses.onMessage(message => { - console.log("message", message) - switch (message.update.oneofKind) { - case 'chanPending': - res(Buffer.from(message.pendingChanId).toString('base64')) - break - } - }) - stream.responses.onError(error => { - console.log("error", error) - rej(error) - }) - }) - } -} +//const grpc = require('@grpc/grpc-js'); +import crypto from 'crypto' +import { credentials, Metadata } from '@grpc/grpc-js' +import { GrpcTransport } from "@protobuf-ts/grpc-transport"; +import fs from 'fs' +import * as Types from '../../../proto/autogenerated/ts/types.js' +import { LightningClient } from '../../../proto/lnd/lightning.client.js' +import { InvoicesClient } from '../../../proto/lnd/invoices.client.js' +import { RouterClient } from '../../../proto/lnd/router.client.js' +import { ChainNotifierClient } from '../../../proto/lnd/chainnotifier.client.js' +import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment, PaymentFailureReason, SendCoinsResponse, EstimateFeeResponse, ChannelBalanceResponse, TransactionDetails, ListChannelsResponse, ClosedChannelsResponse, PendingChannelsResponse, ForwardingHistoryResponse } from '../../../proto/lnd/lightning.js' +import { OpenChannelReq } from './openChannelReq.js'; +import { AddInvoiceReq } from './addInvoiceReq.js'; +import { PayInvoiceReq } from './payInvoiceReq.js'; +import { SendCoinsReq } from './sendCoinsReq.js'; +import { LndSettings, AddressPaidCb, InvoicePaidCb, NodeInfo, Invoice, DecodedInvoice, PaidInvoice, NewBlockCb, HtlcCb, BalanceInfo } from './settings.js'; +import { getLogger } from '../helpers/logger.js'; +import { HtlcEvent_EventType } from '../../../proto/lnd/router.js'; +import { LiquidityProvider, LiquidityRequest } from './liquidityProvider.js'; +const DeadLineMetadata = (deadline = 10 * 1000) => ({ deadline: Date.now() + deadline }) +const deadLndRetrySeconds = 5 +export default class { + lightning: LightningClient + invoices: InvoicesClient + router: RouterClient + chainNotifier: ChainNotifierClient + settings: LndSettings + ready = false + latestKnownBlockHeigh = 0 + latestKnownSettleIndex = 0 + abortController = new AbortController() + addressPaidCb: AddressPaidCb + invoicePaidCb: InvoicePaidCb + newBlockCb: NewBlockCb + htlcCb: HtlcCb + log = getLogger({ component: 'lndManager' }) + outgoingOpsLocked = false + liquidProvider: LiquidityProvider + constructor(settings: LndSettings, liquidProvider: LiquidityProvider, addressPaidCb: AddressPaidCb, invoicePaidCb: InvoicePaidCb, newBlockCb: NewBlockCb, htlcCb: HtlcCb) { + this.settings = settings + this.addressPaidCb = addressPaidCb + this.invoicePaidCb = invoicePaidCb + this.newBlockCb = newBlockCb + this.htlcCb = htlcCb + const { lndAddr, lndCertPath, lndMacaroonPath } = this.settings.mainNode + const lndCert = fs.readFileSync(lndCertPath); + const macaroon = fs.readFileSync(lndMacaroonPath).toString('hex'); + const sslCreds = credentials.createSsl(lndCert); + const macaroonCreds = credentials.createFromMetadataGenerator( + function (args: any, callback: any) { + let metadata = new Metadata(); + metadata.add('macaroon', macaroon); + callback(null, metadata); + }, + ); + const creds = credentials.combineChannelCredentials( + sslCreds, + macaroonCreds, + ); + const transport = new GrpcTransport({ host: lndAddr, channelCredentials: creds }) + this.lightning = new LightningClient(transport) + this.invoices = new InvoicesClient(transport) + this.router = new RouterClient(transport) + this.chainNotifier = new ChainNotifierClient(transport) + this.liquidProvider = liquidProvider + } + + LockOutgoingOperations(): void { + this.outgoingOpsLocked = true + } + UnlockOutgoingOperations(): void { + this.outgoingOpsLocked = false + } + + SetMockInvoiceAsPaid(invoice: string, amount: number): Promise { + throw new Error("SetMockInvoiceAsPaid only available in mock mode") + } + Stop() { + this.abortController.abort() + this.liquidProvider.Stop() + } + + async ShouldUseLiquidityProvider(req: LiquidityRequest): Promise { + if (this.settings.useOnlyLiquidityProvider) { + return true + } + if (!this.liquidProvider.CanProviderHandle(req)) { + return false + } + const channels = await this.ListChannels() + if (channels.channels.length === 0) { + this.log("no channels, will use liquidity provider") + return true + } + return false + } + async Warmup() { + this.SubscribeAddressPaid() + this.SubscribeInvoicePaid() + this.SubscribeNewBlock() + this.SubscribeHtlcEvents() + const now = Date.now() + return new Promise((res, rej) => { + const interval = setInterval(async () => { + try { + await this.GetInfo() + clearInterval(interval) + this.ready = true + res() + } catch (err) { + this.log("LND is not ready yet, will try again in 1 second") + if (Date.now() - now > 1000 * 60) { + rej(new Error("LND not ready after 1 minute")) + } + } + }, 1000) + }) + } + + async GetInfo(): Promise { + const res = await this.lightning.getInfo({}, DeadLineMetadata()) + return res.response + } + async ListPendingChannels(): Promise { + const res = await this.lightning.pendingChannels({}, DeadLineMetadata()) + return res.response + } + async ListChannels(): Promise { + const res = await this.lightning.listChannels({ + activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0) + }, DeadLineMetadata()) + return res.response + } + async ListClosedChannels(): Promise { + const res = await this.lightning.closedChannels({ + abandoned: true, + breach: true, + cooperative: true, + fundingCanceled: true, + localForce: true, + remoteForce: true + }, DeadLineMetadata()) + return res.response + } + + async Health(): Promise { + if (!this.ready) { + throw new Error("not ready") + } + const info = await this.GetInfo() + if (!info.syncedToChain || !info.syncedToGraph) { + throw new Error("not synced") + } + } + + RestartStreams() { + if (!this.ready) { + return + } + this.log("LND is dead, will try to reconnect in", deadLndRetrySeconds, "seconds") + const interval = setInterval(async () => { + try { + await this.Health() + this.log("LND is back online") + clearInterval(interval) + this.Warmup() + } catch (err) { + this.log("LND still dead, will try again in", deadLndRetrySeconds, "seconds") + } + }, deadLndRetrySeconds * 1000) + } + + async SubscribeHtlcEvents() { + const stream = this.router.subscribeHtlcEvents({}, { abort: this.abortController.signal }) + stream.responses.onMessage(htlc => { + this.htlcCb(htlc) + }) + stream.responses.onError(error => { + this.log("Error with subscribeHtlcEvents stream") + }) + stream.responses.onComplete(() => { + this.log("subscribeHtlcEvents stream closed") + }) + } + + async SubscribeNewBlock() { + const { blockHeight } = await this.GetInfo() + const stream = this.chainNotifier.registerBlockEpochNtfn({ height: blockHeight, hash: Buffer.alloc(0) }, { abort: this.abortController.signal }) + stream.responses.onMessage(block => { + this.newBlockCb(block.height) + }) + stream.responses.onError(error => { + this.log("Error with onchain tx stream") + }) + stream.responses.onComplete(() => { + this.log("onchain tx stream closed") + }) + } + + SubscribeAddressPaid(): void { + const stream = this.lightning.subscribeTransactions({ + account: "", + endHeight: 0, + startHeight: this.latestKnownBlockHeigh, + }, { abort: this.abortController.signal }) + stream.responses.onMessage(tx => { + if (tx.blockHeight > this.latestKnownBlockHeigh) { + this.latestKnownBlockHeigh = tx.blockHeight + } + if (tx.numConfirmations === 0) { // only process pending transactions, confirmed transaction are processed by the newBlock CB + tx.outputDetails.forEach(output => { + if (output.isOurAddress) { + this.log("received chan TX", Number(output.amount), "sats", "for", output.address) + this.addressPaidCb({ hash: tx.txHash, index: Number(output.outputIndex) }, output.address, Number(output.amount), false) + } + }) + } + }) + stream.responses.onError(error => { + this.log("Error with onchain tx stream") + }) + stream.responses.onComplete(() => { + this.log("onchain tx stream closed") + }) + } + + SubscribeInvoicePaid(): void { + const stream = this.lightning.subscribeInvoices({ + settleIndex: BigInt(this.latestKnownSettleIndex), + addIndex: 0n, + }, { abort: this.abortController.signal }) + stream.responses.onMessage(invoice => { + if (invoice.state === Invoice_InvoiceState.SETTLED) { + this.log("An invoice was paid for", Number(invoice.amtPaidSat), "sats", invoice.paymentRequest) + this.latestKnownSettleIndex = Number(invoice.settleIndex) + this.invoicePaidCb(invoice.paymentRequest, Number(invoice.amtPaidSat), false) + } + }) + stream.responses.onError(error => { + this.log("Error with invoice stream") + }) + stream.responses.onComplete(() => { + this.log("invoice stream closed") + this.RestartStreams() + }) + } + + async NewAddress(addressType: Types.AddressType): Promise { + this.log("generating new address") + await this.Health() + let lndAddressType: AddressType + switch (addressType) { + case Types.AddressType.NESTED_PUBKEY_HASH: + lndAddressType = AddressType.NESTED_PUBKEY_HASH + break; + case Types.AddressType.WITNESS_PUBKEY_HASH: + lndAddressType = AddressType.WITNESS_PUBKEY_HASH + break; + case Types.AddressType.TAPROOT_PUBKEY: + lndAddressType = AddressType.TAPROOT_PUBKEY + break; + default: + throw new Error("unknown address type " + addressType) + } + const res = await this.lightning.newAddress({ account: "", type: lndAddressType }, DeadLineMetadata()) + this.log("new address", res.response.address) + return res.response + } + + async NewInvoice(value: number, memo: string, expiry: number): Promise { + this.log("generating new invoice for", value, "sats") + await this.Health() + const shouldUseLiquidityProvider = await this.ShouldUseLiquidityProvider({ action: 'receive', amount: value }) + if (shouldUseLiquidityProvider) { + const invoice = await this.liquidProvider.AddInvoice(value, memo) + return { payRequest: invoice } + } + const res = await this.lightning.addInvoice(AddInvoiceReq(value, expiry, false, memo), DeadLineMetadata()) + this.log("new invoice", res.response.paymentRequest) + return { payRequest: res.response.paymentRequest } + } + + async DecodeInvoice(paymentRequest: string): Promise { + const res = await this.lightning.decodePayReq({ payReq: paymentRequest }, DeadLineMetadata()) + return { numSatoshis: Number(res.response.numSatoshis), paymentHash: res.response.paymentHash } + } + + GetFeeLimitAmount(amount: number): number { + return Math.ceil(amount * this.settings.feeRateLimit + this.settings.feeFixedLimit); + } + + GetMaxWithinLimit(amount: number): number { + return Math.max(0, Math.floor(amount * (1 - this.settings.feeRateLimit) - this.settings.feeFixedLimit)) + } + + async ChannelBalance(): Promise<{ local: number, remote: number }> { + const res = await this.lightning.channelBalance({}) + const r = res.response + return { local: r.localBalance ? Number(r.localBalance.sat) : 0, remote: r.remoteBalance ? Number(r.remoteBalance.sat) : 0 } + } + async PayInvoice(invoice: string, amount: number, feeLimit: number): Promise { + if (this.outgoingOpsLocked) { + this.log("outgoing ops locked, rejecting payment request") + throw new Error("lnd node is currently out of sync") + } + await this.Health() + this.log("paying invoice", invoice, "for", amount, "sats") + const shouldUseLiquidityProvider = await this.ShouldUseLiquidityProvider({ action: 'spend', amount }) + if (shouldUseLiquidityProvider) { + const res = await this.liquidProvider.PayInvoice(invoice) + return { feeSat: res.network_fee + res.service_fee, valueSat: res.amount_paid, paymentPreimage: res.preimage } + } + const abortController = new AbortController() + const req = PayInvoiceReq(invoice, amount, feeLimit) + const stream = this.router.sendPaymentV2(req, { abort: abortController.signal }) + return new Promise((res, rej) => { + stream.responses.onError(error => { + this.log("invoice payment failed", error) + rej(error) + }) + stream.responses.onMessage(payment => { + switch (payment.status) { + case Payment_PaymentStatus.FAILED: + console.log(payment) + this.log("invoice payment failed", payment.failureReason) + rej(PaymentFailureReason[payment.failureReason]) + return + case Payment_PaymentStatus.SUCCEEDED: + this.log("invoice payment succeded", Number(payment.valueSat)) + res({ feeSat: Math.ceil(Number(payment.feeMsat) / 1000), valueSat: Number(payment.valueSat), paymentPreimage: payment.paymentPreimage }) + } + }) + }) + } + + async EstimateChainFees(address: string, amount: number, targetConf: number): Promise { + await this.Health() + const res = await this.lightning.estimateFee({ + addrToAmount: { [address]: BigInt(amount) }, + minConfs: 1, + spendUnconfirmed: false, + targetConf: targetConf + }) + return res.response + } + + async PayAddress(address: string, amount: number, satPerVByte: number, label = ""): Promise { + if (this.outgoingOpsLocked) { + this.log("outgoing ops locked, rejecting payment request") + throw new Error("lnd node is currently out of sync") + } + await this.Health() + this.log("sending chain TX for", amount, "sats", "to", address) + const res = await this.lightning.sendCoins(SendCoinsReq(address, amount, satPerVByte, label), DeadLineMetadata()) + this.log("sent chain TX for", amount, "sats", "to", address) + return res.response + } + + async GetTransactions(startHeight: number): Promise { + await this.Health() + const res = await this.lightning.getTransactions({ startHeight, endHeight: 0, account: "" }, DeadLineMetadata()) + return res.response + } + + async GetChannelBalance() { + const res = await this.lightning.channelBalance({}, DeadLineMetadata()) + return res.response + } + + async GetWalletBalance() { + const res = await this.lightning.walletBalance({}, DeadLineMetadata()) + return res.response + } + + async GetBalance(): Promise { + const wRes = await this.lightning.walletBalance({}, DeadLineMetadata()) + const { confirmedBalance, unconfirmedBalance, totalBalance } = wRes.response + const { response } = await this.lightning.listChannels({ + activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0) + }, DeadLineMetadata()) + const channelsBalance = response.channels.map(c => ({ + channelId: c.chanId, + localBalanceSats: Number(c.localBalance), + remoteBalanceSats: Number(c.remoteBalance), + htlcs: c.pendingHtlcs.map(htlc => ({ incoming: htlc.incoming, amount: Number(htlc.amount), index: Number(htlc.htlcIndex), fwIndex: Number(htlc.forwardingHtlcIndex) })) + })) + return { confirmedBalance: Number(confirmedBalance), unconfirmedBalance: Number(unconfirmedBalance), totalBalance: Number(totalBalance), channelsBalance } + } + + async GetForwardingHistory(indexOffset: number, startTime = 0): Promise { + const { response } = await this.lightning.forwardingHistory({ indexOffset, numMaxEvents: 0, startTime: BigInt(startTime), endTime: 0n, peerAliasLookup: false }, DeadLineMetadata()) + return response + } + + async GetAllPaidInvoices(max: number) { + const res = await this.lightning.listInvoices({ indexOffset: 0n, numMaxInvoices: BigInt(max), pendingOnly: false, reversed: true }, DeadLineMetadata()) + return res.response + } + async GetAllPayments(max: number) { + const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset: 0n, maxPayments: BigInt(max), reversed: true }) + return res.response + } + + async ConnectPeer(addr: { pubkey: string, host: string }) { + const res = await this.lightning.connectPeer({ + addr, + perm: true, + timeout: 0n + }, DeadLineMetadata()) + return res.response + } + + async ListPeers() { + const res = await this.lightning.listPeers({ latestError: true }, DeadLineMetadata()) + return res.response + } + + async OpenChannel(destination: string, closeAddress: string, fundingAmount: number, pushSats: number) { + const abortController = new AbortController() + const req = OpenChannelReq(destination, closeAddress, fundingAmount, pushSats) + const stream = this.lightning.openChannel(req, { abort: abortController.signal }) + return new Promise((res, rej) => { + stream.responses.onMessage(message => { + console.log("message", message) + switch (message.update.oneofKind) { + case 'chanPending': + res(Buffer.from(message.pendingChanId).toString('base64')) + break + } + }) + stream.responses.onError(error => { + console.log("error", error) + rej(error) + }) + }) + } +} diff --git a/src/services/lnd/lsp.ts b/src/services/lnd/lsp.ts index 87f6a99c..1b448a8b 100644 --- a/src/services/lnd/lsp.ts +++ b/src/services/lnd/lsp.ts @@ -1,29 +1,29 @@ -import fetch from "node-fetch" - -export class LSP { - serviceUrl: string - constructor(serviceUrl: string) { - this.serviceUrl = serviceUrl - } - - getInfo = async () => { - const res = await fetch(`${this.serviceUrl}/getinfo`) - const json = await res.json() as { options: {}, uris: string[] } - } - - createOrder = async (req: { public_key: string }) => { - const res = await fetch(`${this.serviceUrl}/create_order`, { - method: "POST", - body: JSON.stringify(req), - headers: { "Content-Type": "application/json" } - }) - const json = await res.json() as {} - return json - } - - getOrder = async (orderId: string) => { - const res = await fetch(`${this.serviceUrl}/get_order&order_id=${orderId}`) - const json = await res.json() as {} - return json - } +import fetch from "node-fetch" + +export class LSP { + serviceUrl: string + constructor(serviceUrl: string) { + this.serviceUrl = serviceUrl + } + + getInfo = async () => { + const res = await fetch(`${this.serviceUrl}/getinfo`) + const json = await res.json() as { options: {}, uris: string[] } + } + + createOrder = async (req: { public_key: string }) => { + const res = await fetch(`${this.serviceUrl}/create_order`, { + method: "POST", + body: JSON.stringify(req), + headers: { "Content-Type": "application/json" } + }) + const json = await res.json() as {} + return json + } + + getOrder = async (orderId: string) => { + const res = await fetch(`${this.serviceUrl}/get_order&order_id=${orderId}`) + const json = await res.json() as {} + return json + } } \ No newline at end of file diff --git a/src/services/lnd/openChannelReq.ts b/src/services/lnd/openChannelReq.ts index 471518a6..e6269cf5 100644 --- a/src/services/lnd/openChannelReq.ts +++ b/src/services/lnd/openChannelReq.ts @@ -1,33 +1,33 @@ -import { CommitmentType, OpenChannelRequest } from "../../../proto/lnd/lightning.js"; - -export const OpenChannelReq = (destination: string, closeAddress: string, fundingAmount: number, pushSats: number): OpenChannelRequest => ({ - nodePubkey: Buffer.from(destination, 'hex'), - closeAddress: closeAddress, - localFundingAmount: BigInt(fundingAmount), - pushSat: BigInt(pushSats), - - satPerVbyte: 0n, // TBD - private: false, - minConfs: 0, // TBD - baseFee: 1n, // TBD - feeRate: 1n, // TBD - targetConf: 0, - zeroConf: false, - maxLocalCsv: 0, - remoteCsvDelay: 0, - spendUnconfirmed: false, - minHtlcMsat: 1n, - remoteChanReserveSat: 10000n, - remoteMaxHtlcs: 483, - remoteMaxValueInFlightMsat: 990000000n, - useBaseFee: true, - useFeeRate: true, - - // Default stuff - commitmentType: CommitmentType.ANCHORS, - scidAlias: false, - nodePubkeyString: "", - satPerByte: 0n, - - fundingShim: undefined +import { CommitmentType, OpenChannelRequest } from "../../../proto/lnd/lightning.js"; + +export const OpenChannelReq = (destination: string, closeAddress: string, fundingAmount: number, pushSats: number): OpenChannelRequest => ({ + nodePubkey: Buffer.from(destination, 'hex'), + closeAddress: closeAddress, + localFundingAmount: BigInt(fundingAmount), + pushSat: BigInt(pushSats), + + satPerVbyte: 0n, // TBD + private: false, + minConfs: 0, // TBD + baseFee: 1n, // TBD + feeRate: 1n, // TBD + targetConf: 0, + zeroConf: false, + maxLocalCsv: 0, + remoteCsvDelay: 0, + spendUnconfirmed: false, + minHtlcMsat: 1n, + remoteChanReserveSat: 10000n, + remoteMaxHtlcs: 483, + remoteMaxValueInFlightMsat: 990000000n, + useBaseFee: true, + useFeeRate: true, + + // Default stuff + commitmentType: CommitmentType.ANCHORS, + scidAlias: false, + nodePubkeyString: "", + satPerByte: 0n, + + fundingShim: undefined }) \ No newline at end of file diff --git a/src/services/lnd/payInvoiceReq.ts b/src/services/lnd/payInvoiceReq.ts index dd45dad1..6192ee92 100644 --- a/src/services/lnd/payInvoiceReq.ts +++ b/src/services/lnd/payInvoiceReq.ts @@ -1,30 +1,30 @@ -import { OpenChannelRequest } from "../../../proto/lnd/lightning"; -import { SendPaymentRequest } from "../../../proto/lnd/router"; - -export const PayInvoiceReq = (invoice: string, amount: number, feeLimit: number): SendPaymentRequest => ({ - amt: BigInt(amount), - feeLimitSat: BigInt(feeLimit), - noInflightUpdates: true, - paymentRequest: invoice, - maxParts: 3, - timeoutSeconds: 50, - - allowSelfPayment: false, - amp: false, - amtMsat: 0n, - cltvLimit: 0, - dest: Buffer.alloc(0), - destCustomRecords: {}, - destFeatures: [], - feeLimitMsat: 0n, - finalCltvDelta: 0, - lastHopPubkey: Buffer.alloc(0), - maxShardSizeMsat: 0n, - outgoingChanIds: [], - paymentAddr: Buffer.alloc(0), - paymentHash: Buffer.alloc(0), - routeHints: [], - timePref: 0, - - outgoingChanId: '0' +import { OpenChannelRequest } from "../../../proto/lnd/lightning"; +import { SendPaymentRequest } from "../../../proto/lnd/router"; + +export const PayInvoiceReq = (invoice: string, amount: number, feeLimit: number): SendPaymentRequest => ({ + amt: BigInt(amount), + feeLimitSat: BigInt(feeLimit), + noInflightUpdates: true, + paymentRequest: invoice, + maxParts: 3, + timeoutSeconds: 50, + + allowSelfPayment: false, + amp: false, + amtMsat: 0n, + cltvLimit: 0, + dest: Buffer.alloc(0), + destCustomRecords: {}, + destFeatures: [], + feeLimitMsat: 0n, + finalCltvDelta: 0, + lastHopPubkey: Buffer.alloc(0), + maxShardSizeMsat: 0n, + outgoingChanIds: [], + paymentAddr: Buffer.alloc(0), + paymentHash: Buffer.alloc(0), + routeHints: [], + timePref: 0, + + outgoingChanId: '0' }) \ No newline at end of file diff --git a/src/services/lnd/sendCoinsReq.ts b/src/services/lnd/sendCoinsReq.ts index 93aacd24..b748182b 100644 --- a/src/services/lnd/sendCoinsReq.ts +++ b/src/services/lnd/sendCoinsReq.ts @@ -1,13 +1,13 @@ -import { SendCoinsRequest } from "../../../proto/lnd/lightning"; - -export const SendCoinsReq = (address: string, amount: number, satPerVByte: number, label = ""): SendCoinsRequest => ({ - addr: address, - amount: BigInt(amount), - label: label, - satPerVbyte: BigInt(satPerVByte), - targetConf: 0, - minConfs: 1, - sendAll: false, - spendUnconfirmed: false, - satPerByte: BigInt(0) +import { SendCoinsRequest } from "../../../proto/lnd/lightning"; + +export const SendCoinsReq = (address: string, amount: number, satPerVByte: number, label = ""): SendCoinsRequest => ({ + addr: address, + amount: BigInt(amount), + label: label, + satPerVbyte: BigInt(satPerVByte), + targetConf: 0, + minConfs: 1, + sendAll: false, + spendUnconfirmed: false, + satPerByte: BigInt(0) }) \ No newline at end of file diff --git a/src/services/lnd/settings.ts b/src/services/lnd/settings.ts index f89062bc..380ec28b 100644 --- a/src/services/lnd/settings.ts +++ b/src/services/lnd/settings.ts @@ -1,60 +1,60 @@ -import { HtlcEvent } from "../../../proto/lnd/router" -export type NodeSettings = { - lndAddr: string - lndCertPath: string - lndMacaroonPath: string -} -export type LndSettings = { - mainNode: NodeSettings - feeRateLimit: number - feeFixedLimit: number - mockLnd: boolean - liquidityProviderPub: string - useOnlyLiquidityProvider: boolean - - otherNode?: NodeSettings - thirdNode?: NodeSettings -} -type TxOutput = { - hash: string - index: number -} -export type ChannelBalance = { - channelId: string; - localBalanceSats: number; - remoteBalanceSats: number; - htlcs: { incoming: boolean, amount: number }[] -} -export type BalanceInfo = { - confirmedBalance: number; - unconfirmedBalance: number; - totalBalance: number; - channelsBalance: ChannelBalance[]; -} - -export type AddressPaidCb = (txOutput: TxOutput, address: string, amount: number, internal: boolean) => void -export type InvoicePaidCb = (paymentRequest: string, amount: number, internal: boolean) => void -export type NewBlockCb = (height: number) => void -export type HtlcCb = (event: HtlcEvent) => void - -export type NodeInfo = { - alias: string - syncedToChain: boolean - syncedToGraph: boolean - blockHeight: number - blockHash: string - identityPubkey: string - uris: string[] -} -export type Invoice = { - payRequest: string -} -export type DecodedInvoice = { - numSatoshis: number - paymentHash: string -} -export type PaidInvoice = { - feeSat: number - valueSat: number - paymentPreimage: string +import { HtlcEvent } from "../../../proto/lnd/router" +export type NodeSettings = { + lndAddr: string + lndCertPath: string + lndMacaroonPath: string +} +export type LndSettings = { + mainNode: NodeSettings + feeRateLimit: number + feeFixedLimit: number + mockLnd: boolean + liquidityProviderPub: string + useOnlyLiquidityProvider: boolean + + otherNode?: NodeSettings + thirdNode?: NodeSettings +} +type TxOutput = { + hash: string + index: number +} +export type ChannelBalance = { + channelId: string; + localBalanceSats: number; + remoteBalanceSats: number; + htlcs: { incoming: boolean, amount: number }[] +} +export type BalanceInfo = { + confirmedBalance: number; + unconfirmedBalance: number; + totalBalance: number; + channelsBalance: ChannelBalance[]; +} + +export type AddressPaidCb = (txOutput: TxOutput, address: string, amount: number, internal: boolean) => void +export type InvoicePaidCb = (paymentRequest: string, amount: number, internal: boolean) => void +export type NewBlockCb = (height: number) => void +export type HtlcCb = (event: HtlcEvent) => void + +export type NodeInfo = { + alias: string + syncedToChain: boolean + syncedToGraph: boolean + blockHeight: number + blockHash: string + identityPubkey: string + uris: string[] +} +export type Invoice = { + payRequest: string +} +export type DecodedInvoice = { + numSatoshis: number + paymentHash: string +} +export type PaidInvoice = { + feeSat: number + valueSat: number + paymentPreimage: string } \ No newline at end of file diff --git a/src/services/main/appUserManager.ts b/src/services/main/appUserManager.ts index 7db1ee3e..680718a9 100644 --- a/src/services/main/appUserManager.ts +++ b/src/services/main/appUserManager.ts @@ -1,86 +1,86 @@ -import jwt from 'jsonwebtoken' -import Storage from '../storage/index.js' -import * as Types from '../../../proto/autogenerated/ts/types.js' - -import { MainSettings } from './settings.js' -import ApplicationManager from './applicationManager.js' -export default class { - storage: Storage - settings: MainSettings - applicationManager: ApplicationManager - constructor(storage: Storage, settings: MainSettings, applicationManager: ApplicationManager) { - this.storage = storage - this.settings = settings - this.applicationManager = applicationManager - } - SignUserToken(userId: string, appId: string, userIdentifier: string): string { - return jwt.sign({ user_id: userId, app_id: appId, app_user_id: userIdentifier }, this.settings.jwtSecret); - } - - DecodeUserToken(token?: string): { user_id: string, app_id: string, app_user_id: string } { - if (!token) throw new Error("empty user token provided") - let t = token - if (token.startsWith("Bearer ")) { - t = token.substring("Bearer ".length) - } - if (!t) throw new Error("no user token provided") - const decoded = jwt.verify(token, this.settings.jwtSecret) as { user_id: string, app_id: string, app_user_id: string } - if (!decoded.user_id || !decoded.app_id || !decoded.app_user_id) { - throw new Error("the provided token is not a valid app user token token") - } - return decoded - } - - async BanUser(userId: string): Promise { - const banned = await this.storage.userStorage.BanUser(userId) - const appUsers = await this.storage.applicationStorage.GetAllAppUsersFromUser(userId) - return { - balance_sats: banned.balance_sats, - banned_app_users: appUsers.map(appUser => ({ - app_id: appUser.application.app_id, - app_name: appUser.application.name, - user_identifier: appUser.identifier, - nostr_pub: appUser.nostr_public_key || "" - })) - } - } - - async GetUserInfo(ctx: Types.UserContext): Promise { - const user = await this.storage.userStorage.GetUser(ctx.user_id) - const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) - const appUser = await this.storage.applicationStorage.GetAppUserFromUser(app, user.user_id) - if (!appUser) { - throw new Error(`app user ${ctx.user_id} not found`) // TODO: fix logs doxing - } - return { - userId: ctx.user_id, - balance: user.balance_sats, - max_withdrawable: this.applicationManager.paymentManager.GetMaxPayableInvoice(user.balance_sats, true), - user_identifier: appUser.identifier - } - } - - async NewInvoice(ctx: Types.UserContext, req: Types.NewInvoiceRequest): Promise { - return this.applicationManager.AddAppUserInvoice(ctx.app_id, { - http_callback_url: "", - invoice_req: req, - payer_identifier: ctx.app_user_id, - receiver_identifier: ctx.app_user_id - }) - } - - async PayInvoice(ctx: Types.UserContext, req: Types.PayInvoiceRequest): Promise { - return this.applicationManager.PayAppUserInvoice(ctx.app_id, { - amount: req.amount, - invoice: req.invoice, - user_identifier: ctx.app_user_id - }) - } - async PayAddress(ctx: Types.UserContext, req: Types.PayInvoiceRequest): Promise { - return this.applicationManager.PayAppUserInvoice(ctx.app_id, { - amount: req.amount, - invoice: req.invoice, - user_identifier: ctx.app_user_id - }) - } +import jwt from 'jsonwebtoken' +import Storage from '../storage/index.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' + +import { MainSettings } from './settings.js' +import ApplicationManager from './applicationManager.js' +export default class { + storage: Storage + settings: MainSettings + applicationManager: ApplicationManager + constructor(storage: Storage, settings: MainSettings, applicationManager: ApplicationManager) { + this.storage = storage + this.settings = settings + this.applicationManager = applicationManager + } + SignUserToken(userId: string, appId: string, userIdentifier: string): string { + return jwt.sign({ user_id: userId, app_id: appId, app_user_id: userIdentifier }, this.settings.jwtSecret); + } + + DecodeUserToken(token?: string): { user_id: string, app_id: string, app_user_id: string } { + if (!token) throw new Error("empty user token provided") + let t = token + if (token.startsWith("Bearer ")) { + t = token.substring("Bearer ".length) + } + if (!t) throw new Error("no user token provided") + const decoded = jwt.verify(token, this.settings.jwtSecret) as { user_id: string, app_id: string, app_user_id: string } + if (!decoded.user_id || !decoded.app_id || !decoded.app_user_id) { + throw new Error("the provided token is not a valid app user token token") + } + return decoded + } + + async BanUser(userId: string): Promise { + const banned = await this.storage.userStorage.BanUser(userId) + const appUsers = await this.storage.applicationStorage.GetAllAppUsersFromUser(userId) + return { + balance_sats: banned.balance_sats, + banned_app_users: appUsers.map(appUser => ({ + app_id: appUser.application.app_id, + app_name: appUser.application.name, + user_identifier: appUser.identifier, + nostr_pub: appUser.nostr_public_key || "" + })) + } + } + + async GetUserInfo(ctx: Types.UserContext): Promise { + const user = await this.storage.userStorage.GetUser(ctx.user_id) + const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) + const appUser = await this.storage.applicationStorage.GetAppUserFromUser(app, user.user_id) + if (!appUser) { + throw new Error(`app user ${ctx.user_id} not found`) // TODO: fix logs doxing + } + return { + userId: ctx.user_id, + balance: user.balance_sats, + max_withdrawable: this.applicationManager.paymentManager.GetMaxPayableInvoice(user.balance_sats, true), + user_identifier: appUser.identifier + } + } + + async NewInvoice(ctx: Types.UserContext, req: Types.NewInvoiceRequest): Promise { + return this.applicationManager.AddAppUserInvoice(ctx.app_id, { + http_callback_url: "", + invoice_req: req, + payer_identifier: ctx.app_user_id, + receiver_identifier: ctx.app_user_id + }) + } + + async PayInvoice(ctx: Types.UserContext, req: Types.PayInvoiceRequest): Promise { + return this.applicationManager.PayAppUserInvoice(ctx.app_id, { + amount: req.amount, + invoice: req.invoice, + user_identifier: ctx.app_user_id + }) + } + async PayAddress(ctx: Types.UserContext, req: Types.PayInvoiceRequest): Promise { + return this.applicationManager.PayAppUserInvoice(ctx.app_id, { + amount: req.amount, + invoice: req.invoice, + user_identifier: ctx.app_user_id + }) + } } \ No newline at end of file diff --git a/src/services/main/applicationManager.ts b/src/services/main/applicationManager.ts index 15498d08..ff97e6a4 100644 --- a/src/services/main/applicationManager.ts +++ b/src/services/main/applicationManager.ts @@ -1,265 +1,265 @@ -import jwt from 'jsonwebtoken' -import Storage from '../storage/index.js' -import * as Types from '../../../proto/autogenerated/ts/types.js' -import { MainSettings } from './settings.js' -import PaymentManager from './paymentManager.js' -import { InboundOptionals, defaultInvoiceExpiry } from '../storage/paymentStorage.js' -import { ApplicationUser } from '../storage/entity/ApplicationUser.js' -import { PubLogger, getLogger } from '../helpers/logger.js' -import crypto from 'crypto' -import { Application } from '../storage/entity/Application.js' - -const TOKEN_EXPIRY_TIME = 2 * 60 * 1000 // 2 minutes, in milliseconds - -type NsecLinkingData = { - serialId: number, - expiry: number -} -export default class { - storage: Storage - settings: MainSettings - paymentManager: PaymentManager - nPubLinkingTokens = new Map(); - linkingTokenInterval: NodeJS.Timeout | null = null - serviceBeaconInterval: NodeJS.Timeout | null = null - log: PubLogger - constructor(storage: Storage, settings: MainSettings, paymentManager: PaymentManager) { - this.log = getLogger({ component: "ApplicationManager" }) - this.storage = storage - this.settings = settings - this.paymentManager = paymentManager - this.StartLinkingTokenInterval() - } - - StartLinkingTokenInterval() { - this.linkingTokenInterval = setInterval(() => { - const now = Date.now(); - for (let [token, data] of this.nPubLinkingTokens) { - if (data.expiry <= now) { - const copy = { ...data } - if (this.nPubLinkingTokens.delete(token)) { - console.log("Expired an npub linking token for user serial id: ", copy.serialId) - } - } - } - }, 60 * 1000); // 1 minute - } - - async StartAppsServiceBeacon(publishBeacon: (app: Application) => void) { - this.serviceBeaconInterval = setInterval(async () => { - try { - const apps = await this.storage.applicationStorage.GetApplications() - apps.forEach(app => { - publishBeacon(app) - }) - } catch (e) { - this.log("error in beacon", (e as any).message) - } - }, 60 * 1000) - } - - Stop() { - if (this.linkingTokenInterval) { - clearInterval(this.linkingTokenInterval) - } - if (this.serviceBeaconInterval) { - clearInterval(this.serviceBeaconInterval) - } - } - SignAppToken(appId: string): string { - return jwt.sign({ appId }, this.settings.jwtSecret); - } - DecodeAppToken(token?: string): string { - if (!token) throw new Error("empty app token provided") - let t = token - if (token.startsWith("Bearer ")) { - t = token.substring("Bearer ".length) - } - if (!t) throw new Error("no app token provided") - const decoded = jwt.verify(token, this.settings.jwtSecret) as { appId?: string } - if (!decoded.appId) { - throw new Error("the provided token is not an app token") - } - return decoded.appId - } - - async SetMockAppUserBalance(appId: string, req: Types.SetMockAppUserBalanceRequest) { - const app = await this.storage.applicationStorage.GetApplication(appId) - const { user } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.user_identifier, 0) - await this.paymentManager.SetMockUserBalance(user.user.user_id, req.amount) - } - - async SetMockAppBalance(appId: string, req: Types.SetMockAppBalanceRequest) { - const app = await this.storage.applicationStorage.GetApplication(appId) - await this.paymentManager.SetMockUserBalance(app.owner.user_id, req.amount) - } - - - async AddApp(req: Types.AddAppRequest): Promise { - const app = await this.storage.applicationStorage.AddApplication(req.name, req.allow_user_creation) - getLogger({ appName: app.name })("app created") - - return { - app: { - id: app.app_id, - name: app.name, - balance: app.owner.balance_sats, - npub: app.nostr_public_key || "" - }, - auth_token: this.SignAppToken(app.app_id) - } - } - - async AuthApp(req: Types.AuthAppRequest): Promise { - const app = await this.storage.applicationStorage.GetApplicationByName(req.name) - if (typeof req.allow_user_creation === 'boolean') { - await this.storage.applicationStorage.UpdateApplication(app, { allow_user_creation: req.allow_user_creation }) - } - return { - app: { - id: app.app_id, - name: app.name, - balance: app.owner.balance_sats, - npub: app.nostr_public_key || "" - }, - auth_token: this.SignAppToken(app.app_id) - } - } - - async GetApp(appId: string): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - return { - name: app.name, - id: app.app_id, - balance: app.owner.balance_sats, - npub: app.nostr_public_key || "" - } - } - - async AddAppUser(appId: string, req: Types.AddAppUserRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const log = getLogger({ appName: app.name }) - let u: ApplicationUser - if (req.fail_if_exists) { - u = await this.storage.applicationStorage.AddApplicationUser(app, req.identifier, req.balance) - log(u.identifier, u.user.user_id, "user created") - } else { - const { user, created } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.identifier, req.balance) - u = user - if (created) log(u.identifier, u.user.user_id, "user created") - } - return { - identifier: u.identifier, - info: { - userId: u.user.user_id, - balance: u.user.balance_sats, - max_withdrawable: this.paymentManager.GetMaxPayableInvoice(u.user.balance_sats, true), - user_identifier: u.identifier - }, - max_withdrawable: this.paymentManager.GetMaxPayableInvoice(u.user.balance_sats, true) - } - } - - async AddAppInvoice(appId: string, req: Types.AddAppInvoiceRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const { user: payer } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.payer_identifier, 0) - const opts: InboundOptionals = { callbackUrl: req.http_callback_url, expiry: defaultInvoiceExpiry, expectedPayer: payer.user, linkedApplication: app } - const invoice = await this.paymentManager.NewInvoice(app.owner.user_id, req.invoice_req, opts) - getLogger({ appName: app.name })("app invoice created to be paid by", payer.identifier) - return invoice - } - - async AddAppUserInvoice(appId: string, req: Types.AddAppUserInvoiceRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const log = getLogger({ appName: app.name }) - const receiver = await this.storage.applicationStorage.GetApplicationUser(app, req.receiver_identifier) - const { user: payer } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.payer_identifier, 0) - const opts: InboundOptionals = { callbackUrl: req.http_callback_url, expiry: defaultInvoiceExpiry, expectedPayer: payer.user, linkedApplication: app } - log("generating invoice...") - const appUserInvoice = await this.paymentManager.NewInvoice(receiver.user.user_id, req.invoice_req, opts) - log(receiver.identifier, "invoice created to be paid by", payer.identifier) - return { - invoice: appUserInvoice.invoice - } - } - - async GetAppUser(appId: string, req: Types.GetAppUserRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier) - const max = this.paymentManager.GetMaxPayableInvoice(user.user.balance_sats, true) - return { - max_withdrawable: max, identifier: req.user_identifier, info: { - userId: user.user.user_id, balance: user.user.balance_sats, - max_withdrawable: this.paymentManager.GetMaxPayableInvoice(user.user.balance_sats, true), - user_identifier: user.identifier - } - } - } - - async PayAppUserInvoice(appId: string, req: Types.PayAppUserInvoiceRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const appUser = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier) - const paid = await this.paymentManager.PayInvoice(appUser.user.user_id, req, app) - getLogger({ appName: app.name })(appUser.identifier, "invoice paid", paid.amount_paid, "sats") - return paid - } - - async SendAppUserToAppUserPayment(appId: string, req: Types.SendAppUserToAppUserPaymentRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const fromUser = await this.storage.applicationStorage.GetApplicationUser(app, req.from_user_identifier) - const { user: toUser } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.to_user_identifier, 0) - await this.paymentManager.SendUserToUserPayment(fromUser.user.user_id, toUser.user.user_id, req.amount, app) - getLogger({ appName: app.name })(toUser.identifier, "received internal payment by", fromUser.identifier, "of", req.amount, "sats") - } - - async SendAppUserToAppPayment(appId: string, req: Types.SendAppUserToAppPaymentRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const fromUser = await this.storage.applicationStorage.GetApplicationUser(app, req.from_user_identifier) - await this.paymentManager.SendUserToUserPayment(fromUser.user.user_id, app.owner.user_id, req.amount, app) - getLogger({ appName: app.name })("app received internal payment by", fromUser.identifier, "of", req.amount, "sats") - } - async GetAppUserLNURLInfo(appId: string, req: Types.GetAppUserLNURLInfoRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId) - const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier) - return this.paymentManager.GetLnurlPayInfoFromUser(user.user.user_id, app, req.base_url_override) - } - async RequestNPubLinkingToken(appId: string, req: Types.RequestNPubLinkingTokenRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(appId); - const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier); - if (Array.from(this.nPubLinkingTokens.values()).find(t => t.serialId === user.serial_id)) { - throw new Error("App user already waiting on linking"); - } - if (user.nostr_public_key) { - throw new Error("User already has an npub"); - } - const token = crypto.randomBytes(32).toString("hex"); - this.nPubLinkingTokens.set(token, { serialId: user.serial_id, expiry: Date.now() + TOKEN_EXPIRY_TIME }) - return { token }; - } - - - - async LinkNpubThroughToken(ctx: Types.UserContext, req: Types.LinkNPubThroughTokenRequest): Promise { - const { app_id: appId, app_user_id: appUserId } = ctx - const app = await this.storage.applicationStorage.GetApplication(appId) - const appUser = await this.storage.applicationStorage.GetApplicationUser(app, appUserId) - await this.storage.txQueue.PushToQueue({ - dbTx: true, - exec: async tx => { - await this.storage.applicationStorage.RemoveApplicationUserAndBaseUser(appUser, tx); - const entry = this.nPubLinkingTokens.get(req.token) - if (entry && entry.expiry > Date.now()) { - const copy = { ...entry } - const deleted = this.nPubLinkingTokens.delete(req.token) - if (deleted) { - await this.storage.applicationStorage.AddNPubToApplicationUser(copy.serialId, req.nostr_pub, tx) - } else { - throw new Error("An uknown error occured") - } - } else { - throw new Error("Token invalid or expired") - } - } - }) - } +import jwt from 'jsonwebtoken' +import Storage from '../storage/index.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' +import { MainSettings } from './settings.js' +import PaymentManager from './paymentManager.js' +import { InboundOptionals, defaultInvoiceExpiry } from '../storage/paymentStorage.js' +import { ApplicationUser } from '../storage/entity/ApplicationUser.js' +import { PubLogger, getLogger } from '../helpers/logger.js' +import crypto from 'crypto' +import { Application } from '../storage/entity/Application.js' + +const TOKEN_EXPIRY_TIME = 2 * 60 * 1000 // 2 minutes, in milliseconds + +type NsecLinkingData = { + serialId: number, + expiry: number +} +export default class { + storage: Storage + settings: MainSettings + paymentManager: PaymentManager + nPubLinkingTokens = new Map(); + linkingTokenInterval: NodeJS.Timeout | null = null + serviceBeaconInterval: NodeJS.Timeout | null = null + log: PubLogger + constructor(storage: Storage, settings: MainSettings, paymentManager: PaymentManager) { + this.log = getLogger({ component: "ApplicationManager" }) + this.storage = storage + this.settings = settings + this.paymentManager = paymentManager + this.StartLinkingTokenInterval() + } + + StartLinkingTokenInterval() { + this.linkingTokenInterval = setInterval(() => { + const now = Date.now(); + for (let [token, data] of this.nPubLinkingTokens) { + if (data.expiry <= now) { + const copy = { ...data } + if (this.nPubLinkingTokens.delete(token)) { + console.log("Expired an npub linking token for user serial id: ", copy.serialId) + } + } + } + }, 60 * 1000); // 1 minute + } + + async StartAppsServiceBeacon(publishBeacon: (app: Application) => void) { + this.serviceBeaconInterval = setInterval(async () => { + try { + const apps = await this.storage.applicationStorage.GetApplications() + apps.forEach(app => { + publishBeacon(app) + }) + } catch (e) { + this.log("error in beacon", (e as any).message) + } + }, 60 * 1000) + } + + Stop() { + if (this.linkingTokenInterval) { + clearInterval(this.linkingTokenInterval) + } + if (this.serviceBeaconInterval) { + clearInterval(this.serviceBeaconInterval) + } + } + SignAppToken(appId: string): string { + return jwt.sign({ appId }, this.settings.jwtSecret); + } + DecodeAppToken(token?: string): string { + if (!token) throw new Error("empty app token provided") + let t = token + if (token.startsWith("Bearer ")) { + t = token.substring("Bearer ".length) + } + if (!t) throw new Error("no app token provided") + const decoded = jwt.verify(token, this.settings.jwtSecret) as { appId?: string } + if (!decoded.appId) { + throw new Error("the provided token is not an app token") + } + return decoded.appId + } + + async SetMockAppUserBalance(appId: string, req: Types.SetMockAppUserBalanceRequest) { + const app = await this.storage.applicationStorage.GetApplication(appId) + const { user } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.user_identifier, 0) + await this.paymentManager.SetMockUserBalance(user.user.user_id, req.amount) + } + + async SetMockAppBalance(appId: string, req: Types.SetMockAppBalanceRequest) { + const app = await this.storage.applicationStorage.GetApplication(appId) + await this.paymentManager.SetMockUserBalance(app.owner.user_id, req.amount) + } + + + async AddApp(req: Types.AddAppRequest): Promise { + const app = await this.storage.applicationStorage.AddApplication(req.name, req.allow_user_creation) + getLogger({ appName: app.name })("app created") + + return { + app: { + id: app.app_id, + name: app.name, + balance: app.owner.balance_sats, + npub: app.nostr_public_key || "" + }, + auth_token: this.SignAppToken(app.app_id) + } + } + + async AuthApp(req: Types.AuthAppRequest): Promise { + const app = await this.storage.applicationStorage.GetApplicationByName(req.name) + if (typeof req.allow_user_creation === 'boolean') { + await this.storage.applicationStorage.UpdateApplication(app, { allow_user_creation: req.allow_user_creation }) + } + return { + app: { + id: app.app_id, + name: app.name, + balance: app.owner.balance_sats, + npub: app.nostr_public_key || "" + }, + auth_token: this.SignAppToken(app.app_id) + } + } + + async GetApp(appId: string): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + return { + name: app.name, + id: app.app_id, + balance: app.owner.balance_sats, + npub: app.nostr_public_key || "" + } + } + + async AddAppUser(appId: string, req: Types.AddAppUserRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const log = getLogger({ appName: app.name }) + let u: ApplicationUser + if (req.fail_if_exists) { + u = await this.storage.applicationStorage.AddApplicationUser(app, req.identifier, req.balance) + log(u.identifier, u.user.user_id, "user created") + } else { + const { user, created } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.identifier, req.balance) + u = user + if (created) log(u.identifier, u.user.user_id, "user created") + } + return { + identifier: u.identifier, + info: { + userId: u.user.user_id, + balance: u.user.balance_sats, + max_withdrawable: this.paymentManager.GetMaxPayableInvoice(u.user.balance_sats, true), + user_identifier: u.identifier + }, + max_withdrawable: this.paymentManager.GetMaxPayableInvoice(u.user.balance_sats, true) + } + } + + async AddAppInvoice(appId: string, req: Types.AddAppInvoiceRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const { user: payer } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.payer_identifier, 0) + const opts: InboundOptionals = { callbackUrl: req.http_callback_url, expiry: defaultInvoiceExpiry, expectedPayer: payer.user, linkedApplication: app } + const invoice = await this.paymentManager.NewInvoice(app.owner.user_id, req.invoice_req, opts) + getLogger({ appName: app.name })("app invoice created to be paid by", payer.identifier) + return invoice + } + + async AddAppUserInvoice(appId: string, req: Types.AddAppUserInvoiceRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const log = getLogger({ appName: app.name }) + const receiver = await this.storage.applicationStorage.GetApplicationUser(app, req.receiver_identifier) + const { user: payer } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.payer_identifier, 0) + const opts: InboundOptionals = { callbackUrl: req.http_callback_url, expiry: defaultInvoiceExpiry, expectedPayer: payer.user, linkedApplication: app } + log("generating invoice...") + const appUserInvoice = await this.paymentManager.NewInvoice(receiver.user.user_id, req.invoice_req, opts) + log(receiver.identifier, "invoice created to be paid by", payer.identifier) + return { + invoice: appUserInvoice.invoice + } + } + + async GetAppUser(appId: string, req: Types.GetAppUserRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier) + const max = this.paymentManager.GetMaxPayableInvoice(user.user.balance_sats, true) + return { + max_withdrawable: max, identifier: req.user_identifier, info: { + userId: user.user.user_id, balance: user.user.balance_sats, + max_withdrawable: this.paymentManager.GetMaxPayableInvoice(user.user.balance_sats, true), + user_identifier: user.identifier + } + } + } + + async PayAppUserInvoice(appId: string, req: Types.PayAppUserInvoiceRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const appUser = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier) + const paid = await this.paymentManager.PayInvoice(appUser.user.user_id, req, app) + getLogger({ appName: app.name })(appUser.identifier, "invoice paid", paid.amount_paid, "sats") + return paid + } + + async SendAppUserToAppUserPayment(appId: string, req: Types.SendAppUserToAppUserPaymentRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const fromUser = await this.storage.applicationStorage.GetApplicationUser(app, req.from_user_identifier) + const { user: toUser } = await this.storage.applicationStorage.GetOrCreateApplicationUser(app, req.to_user_identifier, 0) + await this.paymentManager.SendUserToUserPayment(fromUser.user.user_id, toUser.user.user_id, req.amount, app) + getLogger({ appName: app.name })(toUser.identifier, "received internal payment by", fromUser.identifier, "of", req.amount, "sats") + } + + async SendAppUserToAppPayment(appId: string, req: Types.SendAppUserToAppPaymentRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const fromUser = await this.storage.applicationStorage.GetApplicationUser(app, req.from_user_identifier) + await this.paymentManager.SendUserToUserPayment(fromUser.user.user_id, app.owner.user_id, req.amount, app) + getLogger({ appName: app.name })("app received internal payment by", fromUser.identifier, "of", req.amount, "sats") + } + async GetAppUserLNURLInfo(appId: string, req: Types.GetAppUserLNURLInfoRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId) + const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier) + return this.paymentManager.GetLnurlPayInfoFromUser(user.user.user_id, app, req.base_url_override) + } + async RequestNPubLinkingToken(appId: string, req: Types.RequestNPubLinkingTokenRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(appId); + const user = await this.storage.applicationStorage.GetApplicationUser(app, req.user_identifier); + if (Array.from(this.nPubLinkingTokens.values()).find(t => t.serialId === user.serial_id)) { + throw new Error("App user already waiting on linking"); + } + if (user.nostr_public_key) { + throw new Error("User already has an npub"); + } + const token = crypto.randomBytes(32).toString("hex"); + this.nPubLinkingTokens.set(token, { serialId: user.serial_id, expiry: Date.now() + TOKEN_EXPIRY_TIME }) + return { token }; + } + + + + async LinkNpubThroughToken(ctx: Types.UserContext, req: Types.LinkNPubThroughTokenRequest): Promise { + const { app_id: appId, app_user_id: appUserId } = ctx + const app = await this.storage.applicationStorage.GetApplication(appId) + const appUser = await this.storage.applicationStorage.GetApplicationUser(app, appUserId) + await this.storage.txQueue.PushToQueue({ + dbTx: true, + exec: async tx => { + await this.storage.applicationStorage.RemoveApplicationUserAndBaseUser(appUser, tx); + const entry = this.nPubLinkingTokens.get(req.token) + if (entry && entry.expiry > Date.now()) { + const copy = { ...entry } + const deleted = this.nPubLinkingTokens.delete(req.token) + if (deleted) { + await this.storage.applicationStorage.AddNPubToApplicationUser(copy.serialId, req.nostr_pub, tx) + } else { + throw new Error("An uknown error occured") + } + } else { + throw new Error("Token invalid or expired") + } + } + }) + } } \ No newline at end of file diff --git a/src/services/main/index.ts b/src/services/main/index.ts index f530bdef..dab1703b 100644 --- a/src/services/main/index.ts +++ b/src/services/main/index.ts @@ -1,253 +1,253 @@ -import fetch from "node-fetch" -import Storage, { LoadStorageSettingsFromEnv } from '../storage/index.js' -import * as Types from '../../../proto/autogenerated/ts/types.js' -import ProductManager from './productManager.js' -import ApplicationManager from './applicationManager.js' -import PaymentManager, { PendingTx } from './paymentManager.js' -import { MainSettings } from './settings.js' -import LND from "../lnd/lnd.js" -import { AddressPaidCb, HtlcCb, InvoicePaidCb, NewBlockCb } from "../lnd/settings.js" -import { ERROR, getLogger, PubLogger } from "../helpers/logger.js" -import AppUserManager from "./appUserManager.js" -import { Application } from '../storage/entity/Application.js' -import { UserReceivingInvoice } from '../storage/entity/UserReceivingInvoice.js' -import { UnsignedEvent } from '../nostr/tools/event.js' -import { NostrSend } from '../nostr/handler.js' -import MetricsManager from '../metrics/index.js' -import { LoggedEvent } from '../storage/eventsLog.js' -import { LiquidityProvider } from "../lnd/liquidityProvider.js" - -type UserOperationsSub = { - id: string - newIncomingInvoice: (operation: Types.UserOperation) => void - newOutgoingInvoice: (operation: Types.UserOperation) => void - newIncomingTx: (operation: Types.UserOperation) => void - newOutgoingTx: (operation: Types.UserOperation) => void -} -const appTag = "Lightning.Pub" -export default class { - storage: Storage - lnd: LND - settings: MainSettings - userOperationsSub: UserOperationsSub | null = null - productManager: ProductManager - applicationManager: ApplicationManager - appUserManager: AppUserManager - paymentManager: PaymentManager - paymentSubs: Record void) | null> = {} - metricsManager: MetricsManager - liquidProvider: LiquidityProvider - nostrSend: NostrSend = () => { getLogger({})("nostr send not initialized yet") } - constructor(settings: MainSettings, storage: Storage) { - this.settings = settings - this.storage = storage - this.liquidProvider = new LiquidityProvider(settings.lndSettings.liquidityProviderPub, this.invoicePaidCb) - this.lnd = new LND(settings.lndSettings, this.liquidProvider, this.addressPaidCb, this.invoicePaidCb, this.newBlockCb, this.htlcCb) - this.metricsManager = new MetricsManager(this.storage, this.lnd) - - this.paymentManager = new PaymentManager(this.storage, this.lnd, this.settings, this.addressPaidCb, this.invoicePaidCb) - this.productManager = new ProductManager(this.storage, this.paymentManager, this.settings) - this.applicationManager = new ApplicationManager(this.storage, this.settings, this.paymentManager) - this.appUserManager = new AppUserManager(this.storage, this.settings, this.applicationManager) - - } - Stop() { - this.lnd.Stop() - this.applicationManager.Stop() - this.paymentManager.Stop() - } - - StartBeacons() { - this.applicationManager.StartAppsServiceBeacon(app => { - this.UpdateBeacon(app, { type: 'service', name: app.name }) - }) - } - - attachNostrSend(f: NostrSend) { - this.nostrSend = f - this.liquidProvider.attachNostrSend(f) - } - - htlcCb: HtlcCb = (e) => { - this.metricsManager.HtlcCb(e) - } - - newBlockCb: NewBlockCb = (height) => { - this.NewBlockHandler(height) - } - - NewBlockHandler = async (height: number) => { - let confirmed: (PendingTx & { confs: number; })[] - let log = getLogger({}) - - try { - const balanceEvents = await this.paymentManager.GetLndBalance() - await this.metricsManager.NewBlockCb(height, balanceEvents) - confirmed = await this.paymentManager.CheckNewlyConfirmedTxs(height) - } catch (err: any) { - log(ERROR, "failed to check transactions after new block", err.message || err) - return - } - await Promise.all(confirmed.map(async c => { - if (c.type === 'outgoing') { - await this.storage.paymentStorage.UpdateUserTransactionPayment(c.tx.serial_id, { confs: c.confs }) - const { linkedApplication, user, address, paid_amount: amount, service_fees: serviceFee, serial_id: serialId, chain_fees } = c.tx; - const operationId = `${Types.UserOperationType.OUTGOING_TX}-${serialId}` - const op = { amount, paidAtUnix: Date.now() / 1000, inbound: false, type: Types.UserOperationType.OUTGOING_TX, identifier: address, operationId, network_fee: chain_fees, service_fee: serviceFee, confirmed: true, tx_hash: c.tx.tx_hash, internal: c.tx.internal } - this.sendOperationToNostr(linkedApplication!, user.user_id, op) - } else { - this.storage.StartTransaction(async tx => { - const { user_address: userAddress, paid_amount: amount, service_fee: serviceFee, serial_id: serialId, tx_hash } = c.tx - if (!userAddress.linkedApplication) { - log(ERROR, "an address was paid, that has no linked application") - return - } - const updateResult = await this.storage.paymentStorage.UpdateAddressReceivingTransaction(serialId, { confs: c.confs }, tx) - if (!updateResult.affected) { - throw new Error("unable to flag chain transaction as paid") - } - const addressData = `${userAddress.address}:${tx_hash}` - this.storage.eventsLog.LogEvent({ type: 'address_paid', userId: userAddress.user.user_id, appId: userAddress.linkedApplication.app_id, appUserId: "", balance: userAddress.user.balance_sats, data: addressData, amount }) - await this.storage.userStorage.IncrementUserBalance(userAddress.user.user_id, amount - serviceFee, addressData, tx) - if (serviceFee > 0) { - await this.storage.userStorage.IncrementUserBalance(userAddress.linkedApplication.owner.user_id, serviceFee, 'fees', tx) - } - const operationId = `${Types.UserOperationType.INCOMING_TX}-${serialId}` - const op = { amount, paidAtUnix: Date.now() / 1000, inbound: true, type: Types.UserOperationType.INCOMING_TX, identifier: userAddress.address, operationId, network_fee: 0, service_fee: serviceFee, confirmed: true, tx_hash: c.tx.tx_hash, internal: c.tx.internal } - this.sendOperationToNostr(userAddress.linkedApplication!, userAddress.user.user_id, op) - }) - } - })) - } - - addressPaidCb: AddressPaidCb = (txOutput, address, amount, internal) => { - this.storage.StartTransaction(async tx => { - const { blockHeight } = await this.lnd.GetInfo() - const userAddress = await this.storage.paymentStorage.GetAddressOwner(address, tx) - if (!userAddress) { return } - let log = getLogger({}) - if (!userAddress.linkedApplication) { - log(ERROR, "an address was paid, that has no linked application") - return - } - log = getLogger({ appName: userAddress.linkedApplication.name }) - const isAppUserPayment = userAddress.user.user_id !== userAddress.linkedApplication.owner.user_id - let fee = this.paymentManager.getServiceFee(Types.UserOperationType.INCOMING_TX, amount, isAppUserPayment) - if (userAddress.linkedApplication && userAddress.linkedApplication.owner.user_id === userAddress.user.user_id) { - fee = 0 - } - try { - // This call will fail if the transaction is already registered - const addedTx = await this.storage.paymentStorage.AddAddressReceivingTransaction(userAddress, txOutput.hash, txOutput.index, amount, fee, internal, blockHeight, tx) - if (internal) { - const addressData = `${address}:${txOutput.hash}` - this.storage.eventsLog.LogEvent({ type: 'address_paid', userId: userAddress.user.user_id, appId: userAddress.linkedApplication.app_id, appUserId: "", balance: userAddress.user.balance_sats, data: addressData, amount }) - await this.storage.userStorage.IncrementUserBalance(userAddress.user.user_id, addedTx.paid_amount - fee, addressData, tx) - if (fee > 0) { - await this.storage.userStorage.IncrementUserBalance(userAddress.linkedApplication.owner.user_id, fee, 'fees', tx) - } - - } - const operationId = `${Types.UserOperationType.INCOMING_TX}-${addedTx.serial_id}` - const op = { amount, paidAtUnix: Date.now() / 1000, inbound: true, type: Types.UserOperationType.INCOMING_TX, identifier: userAddress.address, operationId, network_fee: 0, service_fee: fee, confirmed: internal, tx_hash: txOutput.hash, internal: false } - this.sendOperationToNostr(userAddress.linkedApplication, userAddress.user.user_id, op) - } catch { - log(ERROR, "cannot process address paid transaction, already registered") - } - }) - } - - invoicePaidCb: InvoicePaidCb = (paymentRequest, amount, internal) => { - this.storage.StartTransaction(async tx => { - let log = getLogger({}) - const userInvoice = await this.storage.paymentStorage.GetInvoiceOwner(paymentRequest, tx) - if (!userInvoice) { return } - if (userInvoice.paid_at_unix > 0 && internal) { log("cannot pay internally, invoice already paid"); return } - if (userInvoice.paid_at_unix > 0 && !internal && userInvoice.paidByLnd) { log("invoice already paid by lnd"); return } - if (!userInvoice.linkedApplication) { - log(ERROR, "an invoice was paid, that has no linked application") - return - } - log = getLogger({ appName: userInvoice.linkedApplication.name }) - const isAppUserPayment = userInvoice.user.user_id !== userInvoice.linkedApplication.owner.user_id - let fee = this.paymentManager.getServiceFee(Types.UserOperationType.INCOMING_INVOICE, amount, isAppUserPayment) - if (userInvoice.linkedApplication && userInvoice.linkedApplication.owner.user_id === userInvoice.user.user_id) { - fee = 0 - } - try { - await this.storage.paymentStorage.FlagInvoiceAsPaid(userInvoice, amount, fee, internal, tx) - this.storage.eventsLog.LogEvent({ type: 'invoice_paid', userId: userInvoice.user.user_id, appId: userInvoice.linkedApplication.app_id, appUserId: "", balance: userInvoice.user.balance_sats, data: paymentRequest, amount }) - await this.storage.userStorage.IncrementUserBalance(userInvoice.user.user_id, amount - fee, userInvoice.invoice, tx) - if (fee > 0) { - await this.storage.userStorage.IncrementUserBalance(userInvoice.linkedApplication.owner.user_id, fee, 'fees', tx) - } - await this.triggerPaidCallback(log, userInvoice.callbackUrl) - const operationId = `${Types.UserOperationType.INCOMING_INVOICE}-${userInvoice.serial_id}` - const op = { amount, paidAtUnix: Date.now() / 1000, inbound: true, type: Types.UserOperationType.INCOMING_INVOICE, identifier: userInvoice.invoice, operationId, network_fee: 0, service_fee: fee, confirmed: true, tx_hash: "", internal } - this.sendOperationToNostr(userInvoice.linkedApplication, userInvoice.user.user_id, op) - this.createZapReceipt(log, userInvoice) - log("paid invoice processed successfully") - } catch (err: any) { - log(ERROR, "cannot process paid invoice", err.message || "") - } - }) - } - - async triggerPaidCallback(log: PubLogger, url: string) { - if (!url) { - return - } - try { - await fetch(url + "&ok=true") - } catch (err: any) { - log(ERROR, "error sending paid callback for invoice", err.message || "") - } - } - - async sendOperationToNostr(app: Application, userId: string, op: Types.UserOperation) { - const user = await this.storage.applicationStorage.GetAppUserFromUser(app, userId) - if (!user || !user.nostr_public_key) { - getLogger({ appName: app.name })("cannot notify user, not a nostr user") - return - } - const message: Types.LiveUserOperation & { requestId: string, status: 'OK' } = { operation: op, requestId: "GetLiveUserOperations", status: 'OK' } - this.nostrSend({ type: 'app', appId: app.app_id }, { type: 'content', content: JSON.stringify(message), pub: user.nostr_public_key }) - } - - async UpdateBeacon(app: Application, content: { type: 'service', name: string }) { - if (!app.nostr_public_key) { - getLogger({ appName: app.name })("cannot update beacon, public key not set") - return - } - const tags = [["d", appTag]] - const event: UnsignedEvent = { - content: JSON.stringify(content), - created_at: Math.floor(Date.now() / 1000), - kind: 30078, - pubkey: app.nostr_public_key, - tags, - } - this.nostrSend({ type: 'app', appId: app.app_id }, { type: 'event', event }) - } - - async createZapReceipt(log: PubLogger, invoice: UserReceivingInvoice) { - const zapInfo = invoice.zap_info - if (!zapInfo || !invoice.linkedApplication || !invoice.linkedApplication.nostr_public_key) { - log(ERROR, "no zap info linked to payment") - return - } - const tags = [["p", zapInfo.pub], ["bolt11", invoice.invoice], ["description", zapInfo.description]] - if (zapInfo.eventId) { - tags.push(["e", zapInfo.eventId]) - } - const event: UnsignedEvent = { - content: "", - created_at: invoice.paid_at_unix, - kind: 9735, - pubkey: invoice.linkedApplication.nostr_public_key, - tags, - } - log({ unsigned: event }) - this.nostrSend({ type: 'app', appId: invoice.linkedApplication.app_id }, { type: 'event', event }) - } -} +import fetch from "node-fetch" +import Storage, { LoadStorageSettingsFromEnv } from '../storage/index.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' +import ProductManager from './productManager.js' +import ApplicationManager from './applicationManager.js' +import PaymentManager, { PendingTx } from './paymentManager.js' +import { MainSettings } from './settings.js' +import LND from "../lnd/lnd.js" +import { AddressPaidCb, HtlcCb, InvoicePaidCb, NewBlockCb } from "../lnd/settings.js" +import { ERROR, getLogger, PubLogger } from "../helpers/logger.js" +import AppUserManager from "./appUserManager.js" +import { Application } from '../storage/entity/Application.js' +import { UserReceivingInvoice } from '../storage/entity/UserReceivingInvoice.js' +import { UnsignedEvent } from '../nostr/tools/event.js' +import { NostrSend } from '../nostr/handler.js' +import MetricsManager from '../metrics/index.js' +import { LoggedEvent } from '../storage/eventsLog.js' +import { LiquidityProvider } from "../lnd/liquidityProvider.js" + +type UserOperationsSub = { + id: string + newIncomingInvoice: (operation: Types.UserOperation) => void + newOutgoingInvoice: (operation: Types.UserOperation) => void + newIncomingTx: (operation: Types.UserOperation) => void + newOutgoingTx: (operation: Types.UserOperation) => void +} +const appTag = "Lightning.Pub" +export default class { + storage: Storage + lnd: LND + settings: MainSettings + userOperationsSub: UserOperationsSub | null = null + productManager: ProductManager + applicationManager: ApplicationManager + appUserManager: AppUserManager + paymentManager: PaymentManager + paymentSubs: Record void) | null> = {} + metricsManager: MetricsManager + liquidProvider: LiquidityProvider + nostrSend: NostrSend = () => { getLogger({})("nostr send not initialized yet") } + constructor(settings: MainSettings, storage: Storage) { + this.settings = settings + this.storage = storage + this.liquidProvider = new LiquidityProvider(settings.lndSettings.liquidityProviderPub, this.invoicePaidCb) + this.lnd = new LND(settings.lndSettings, this.liquidProvider, this.addressPaidCb, this.invoicePaidCb, this.newBlockCb, this.htlcCb) + this.metricsManager = new MetricsManager(this.storage, this.lnd) + + this.paymentManager = new PaymentManager(this.storage, this.lnd, this.settings, this.addressPaidCb, this.invoicePaidCb) + this.productManager = new ProductManager(this.storage, this.paymentManager, this.settings) + this.applicationManager = new ApplicationManager(this.storage, this.settings, this.paymentManager) + this.appUserManager = new AppUserManager(this.storage, this.settings, this.applicationManager) + + } + Stop() { + this.lnd.Stop() + this.applicationManager.Stop() + this.paymentManager.Stop() + } + + StartBeacons() { + this.applicationManager.StartAppsServiceBeacon(app => { + this.UpdateBeacon(app, { type: 'service', name: app.name }) + }) + } + + attachNostrSend(f: NostrSend) { + this.nostrSend = f + this.liquidProvider.attachNostrSend(f) + } + + htlcCb: HtlcCb = (e) => { + this.metricsManager.HtlcCb(e) + } + + newBlockCb: NewBlockCb = (height) => { + this.NewBlockHandler(height) + } + + NewBlockHandler = async (height: number) => { + let confirmed: (PendingTx & { confs: number; })[] + let log = getLogger({}) + + try { + const balanceEvents = await this.paymentManager.GetLndBalance() + await this.metricsManager.NewBlockCb(height, balanceEvents) + confirmed = await this.paymentManager.CheckNewlyConfirmedTxs(height) + } catch (err: any) { + log(ERROR, "failed to check transactions after new block", err.message || err) + return + } + await Promise.all(confirmed.map(async c => { + if (c.type === 'outgoing') { + await this.storage.paymentStorage.UpdateUserTransactionPayment(c.tx.serial_id, { confs: c.confs }) + const { linkedApplication, user, address, paid_amount: amount, service_fees: serviceFee, serial_id: serialId, chain_fees } = c.tx; + const operationId = `${Types.UserOperationType.OUTGOING_TX}-${serialId}` + const op = { amount, paidAtUnix: Date.now() / 1000, inbound: false, type: Types.UserOperationType.OUTGOING_TX, identifier: address, operationId, network_fee: chain_fees, service_fee: serviceFee, confirmed: true, tx_hash: c.tx.tx_hash, internal: c.tx.internal } + this.sendOperationToNostr(linkedApplication!, user.user_id, op) + } else { + this.storage.StartTransaction(async tx => { + const { user_address: userAddress, paid_amount: amount, service_fee: serviceFee, serial_id: serialId, tx_hash } = c.tx + if (!userAddress.linkedApplication) { + log(ERROR, "an address was paid, that has no linked application") + return + } + const updateResult = await this.storage.paymentStorage.UpdateAddressReceivingTransaction(serialId, { confs: c.confs }, tx) + if (!updateResult.affected) { + throw new Error("unable to flag chain transaction as paid") + } + const addressData = `${userAddress.address}:${tx_hash}` + this.storage.eventsLog.LogEvent({ type: 'address_paid', userId: userAddress.user.user_id, appId: userAddress.linkedApplication.app_id, appUserId: "", balance: userAddress.user.balance_sats, data: addressData, amount }) + await this.storage.userStorage.IncrementUserBalance(userAddress.user.user_id, amount - serviceFee, addressData, tx) + if (serviceFee > 0) { + await this.storage.userStorage.IncrementUserBalance(userAddress.linkedApplication.owner.user_id, serviceFee, 'fees', tx) + } + const operationId = `${Types.UserOperationType.INCOMING_TX}-${serialId}` + const op = { amount, paidAtUnix: Date.now() / 1000, inbound: true, type: Types.UserOperationType.INCOMING_TX, identifier: userAddress.address, operationId, network_fee: 0, service_fee: serviceFee, confirmed: true, tx_hash: c.tx.tx_hash, internal: c.tx.internal } + this.sendOperationToNostr(userAddress.linkedApplication!, userAddress.user.user_id, op) + }) + } + })) + } + + addressPaidCb: AddressPaidCb = (txOutput, address, amount, internal) => { + this.storage.StartTransaction(async tx => { + const { blockHeight } = await this.lnd.GetInfo() + const userAddress = await this.storage.paymentStorage.GetAddressOwner(address, tx) + if (!userAddress) { return } + let log = getLogger({}) + if (!userAddress.linkedApplication) { + log(ERROR, "an address was paid, that has no linked application") + return + } + log = getLogger({ appName: userAddress.linkedApplication.name }) + const isAppUserPayment = userAddress.user.user_id !== userAddress.linkedApplication.owner.user_id + let fee = this.paymentManager.getServiceFee(Types.UserOperationType.INCOMING_TX, amount, isAppUserPayment) + if (userAddress.linkedApplication && userAddress.linkedApplication.owner.user_id === userAddress.user.user_id) { + fee = 0 + } + try { + // This call will fail if the transaction is already registered + const addedTx = await this.storage.paymentStorage.AddAddressReceivingTransaction(userAddress, txOutput.hash, txOutput.index, amount, fee, internal, blockHeight, tx) + if (internal) { + const addressData = `${address}:${txOutput.hash}` + this.storage.eventsLog.LogEvent({ type: 'address_paid', userId: userAddress.user.user_id, appId: userAddress.linkedApplication.app_id, appUserId: "", balance: userAddress.user.balance_sats, data: addressData, amount }) + await this.storage.userStorage.IncrementUserBalance(userAddress.user.user_id, addedTx.paid_amount - fee, addressData, tx) + if (fee > 0) { + await this.storage.userStorage.IncrementUserBalance(userAddress.linkedApplication.owner.user_id, fee, 'fees', tx) + } + + } + const operationId = `${Types.UserOperationType.INCOMING_TX}-${addedTx.serial_id}` + const op = { amount, paidAtUnix: Date.now() / 1000, inbound: true, type: Types.UserOperationType.INCOMING_TX, identifier: userAddress.address, operationId, network_fee: 0, service_fee: fee, confirmed: internal, tx_hash: txOutput.hash, internal: false } + this.sendOperationToNostr(userAddress.linkedApplication, userAddress.user.user_id, op) + } catch { + log(ERROR, "cannot process address paid transaction, already registered") + } + }) + } + + invoicePaidCb: InvoicePaidCb = (paymentRequest, amount, internal) => { + this.storage.StartTransaction(async tx => { + let log = getLogger({}) + const userInvoice = await this.storage.paymentStorage.GetInvoiceOwner(paymentRequest, tx) + if (!userInvoice) { return } + if (userInvoice.paid_at_unix > 0 && internal) { log("cannot pay internally, invoice already paid"); return } + if (userInvoice.paid_at_unix > 0 && !internal && userInvoice.paidByLnd) { log("invoice already paid by lnd"); return } + if (!userInvoice.linkedApplication) { + log(ERROR, "an invoice was paid, that has no linked application") + return + } + log = getLogger({ appName: userInvoice.linkedApplication.name }) + const isAppUserPayment = userInvoice.user.user_id !== userInvoice.linkedApplication.owner.user_id + let fee = this.paymentManager.getServiceFee(Types.UserOperationType.INCOMING_INVOICE, amount, isAppUserPayment) + if (userInvoice.linkedApplication && userInvoice.linkedApplication.owner.user_id === userInvoice.user.user_id) { + fee = 0 + } + try { + await this.storage.paymentStorage.FlagInvoiceAsPaid(userInvoice, amount, fee, internal, tx) + this.storage.eventsLog.LogEvent({ type: 'invoice_paid', userId: userInvoice.user.user_id, appId: userInvoice.linkedApplication.app_id, appUserId: "", balance: userInvoice.user.balance_sats, data: paymentRequest, amount }) + await this.storage.userStorage.IncrementUserBalance(userInvoice.user.user_id, amount - fee, userInvoice.invoice, tx) + if (fee > 0) { + await this.storage.userStorage.IncrementUserBalance(userInvoice.linkedApplication.owner.user_id, fee, 'fees', tx) + } + await this.triggerPaidCallback(log, userInvoice.callbackUrl) + const operationId = `${Types.UserOperationType.INCOMING_INVOICE}-${userInvoice.serial_id}` + const op = { amount, paidAtUnix: Date.now() / 1000, inbound: true, type: Types.UserOperationType.INCOMING_INVOICE, identifier: userInvoice.invoice, operationId, network_fee: 0, service_fee: fee, confirmed: true, tx_hash: "", internal } + this.sendOperationToNostr(userInvoice.linkedApplication, userInvoice.user.user_id, op) + this.createZapReceipt(log, userInvoice) + log("paid invoice processed successfully") + } catch (err: any) { + log(ERROR, "cannot process paid invoice", err.message || "") + } + }) + } + + async triggerPaidCallback(log: PubLogger, url: string) { + if (!url) { + return + } + try { + await fetch(url + "&ok=true") + } catch (err: any) { + log(ERROR, "error sending paid callback for invoice", err.message || "") + } + } + + async sendOperationToNostr(app: Application, userId: string, op: Types.UserOperation) { + const user = await this.storage.applicationStorage.GetAppUserFromUser(app, userId) + if (!user || !user.nostr_public_key) { + getLogger({ appName: app.name })("cannot notify user, not a nostr user") + return + } + const message: Types.LiveUserOperation & { requestId: string, status: 'OK' } = { operation: op, requestId: "GetLiveUserOperations", status: 'OK' } + this.nostrSend({ type: 'app', appId: app.app_id }, { type: 'content', content: JSON.stringify(message), pub: user.nostr_public_key }) + } + + async UpdateBeacon(app: Application, content: { type: 'service', name: string }) { + if (!app.nostr_public_key) { + getLogger({ appName: app.name })("cannot update beacon, public key not set") + return + } + const tags = [["d", appTag]] + const event: UnsignedEvent = { + content: JSON.stringify(content), + created_at: Math.floor(Date.now() / 1000), + kind: 30078, + pubkey: app.nostr_public_key, + tags, + } + this.nostrSend({ type: 'app', appId: app.app_id }, { type: 'event', event }) + } + + async createZapReceipt(log: PubLogger, invoice: UserReceivingInvoice) { + const zapInfo = invoice.zap_info + if (!zapInfo || !invoice.linkedApplication || !invoice.linkedApplication.nostr_public_key) { + log(ERROR, "no zap info linked to payment") + return + } + const tags = [["p", zapInfo.pub], ["bolt11", invoice.invoice], ["description", zapInfo.description]] + if (zapInfo.eventId) { + tags.push(["e", zapInfo.eventId]) + } + const event: UnsignedEvent = { + content: "", + created_at: invoice.paid_at_unix, + kind: 9735, + pubkey: invoice.linkedApplication.nostr_public_key, + tags, + } + log({ unsigned: event }) + this.nostrSend({ type: 'app', appId: invoice.linkedApplication.app_id }, { type: 'event', event }) + } +} diff --git a/src/services/main/init.ts b/src/services/main/init.ts index 488a34cc..5dbf31be 100644 --- a/src/services/main/init.ts +++ b/src/services/main/init.ts @@ -1,73 +1,73 @@ -import { PubLogger, getLogger } from "../helpers/logger.js" -import { LiquidityProvider } from "../lnd/liquidityProvider.js" -import Storage from "../storage/index.js" -import { TypeOrmMigrationRunner } from "../storage/migrations/runner.js" -import Main from "./index.js" -import SanityChecker from "./sanityChecker.js" -import { MainSettings } from "./settings.js" -export type AppData = { - privateKey: string; - publicKey: string; - appId: string; - name: string; -} -export const initMainHandler = async (log: PubLogger, mainSettings: MainSettings) => { - const storageManager = new Storage(mainSettings.storageSettings) - const manualMigration = await TypeOrmMigrationRunner(log, storageManager, mainSettings.storageSettings.dbSettings, process.argv[2]) - if (manualMigration) { - return - } - - const mainHandler = new Main(mainSettings, storageManager) - await mainHandler.lnd.Warmup() - if (!mainSettings.skipSanityCheck) { - const sanityChecker = new SanityChecker(storageManager, mainHandler.lnd) - await sanityChecker.VerifyEventsLog() - } - await mainHandler.paymentManager.watchDog.Start() - const appsData = await mainHandler.storage.applicationStorage.GetApplications() - const existingWalletApp = await appsData.find(app => app.name === 'wallet' || app.name === 'wallet-test') - if (!existingWalletApp) { - log("no default wallet app found, creating one...") - const newWalletApp = await mainHandler.storage.applicationStorage.AddApplication('wallet', true) - appsData.push(newWalletApp) - } - const apps: AppData[] = await Promise.all(appsData.map(app => { - if (!app.nostr_private_key || !app.nostr_public_key) { // TMP -- - return mainHandler.storage.applicationStorage.GenerateApplicationKeys(app); - } // -- - else { - return { privateKey: app.nostr_private_key, publicKey: app.nostr_public_key, appId: app.app_id, name: app.name } - } - })) - const liquidityProviderApp = apps.find(app => app.name === 'wallet' || app.name === 'wallet-test') - if (!liquidityProviderApp) { - throw new Error("wallet app not initialized correctly") - } - const liquidityProviderInfo = { - privateKey: liquidityProviderApp.privateKey, - publicKey: liquidityProviderApp.publicKey, - name: "liquidity_provider", clientId: `client_${liquidityProviderApp.appId}` - } - mainHandler.liquidProvider.setNostrInfo({ clientId: liquidityProviderInfo.clientId, myPub: liquidityProviderInfo.publicKey }) - const stop = await processArgs(mainHandler) - if (stop) { - return - } - return { mainHandler, apps, liquidityProviderInfo, liquidityProviderApp } -} - -const processArgs = async (mainHandler: Main) => { - switch (process.argv[2]) { - case 'updateUserBalance': - await mainHandler.storage.userStorage.UpdateUser(process.argv[3], { balance_sats: +process.argv[4] }) - getLogger({ userId: process.argv[3] })(`user balance updated correctly`) - return false - case 'unlock': - await mainHandler.storage.userStorage.UnbanUser(process.argv[3]) - getLogger({ userId: process.argv[3] })(`user unlocked`) - return false - default: - return false - } +import { PubLogger, getLogger } from "../helpers/logger.js" +import { LiquidityProvider } from "../lnd/liquidityProvider.js" +import Storage from "../storage/index.js" +import { TypeOrmMigrationRunner } from "../storage/migrations/runner.js" +import Main from "./index.js" +import SanityChecker from "./sanityChecker.js" +import { MainSettings } from "./settings.js" +export type AppData = { + privateKey: string; + publicKey: string; + appId: string; + name: string; +} +export const initMainHandler = async (log: PubLogger, mainSettings: MainSettings) => { + const storageManager = new Storage(mainSettings.storageSettings) + const manualMigration = await TypeOrmMigrationRunner(log, storageManager, mainSettings.storageSettings.dbSettings, process.argv[2]) + if (manualMigration) { + return + } + + const mainHandler = new Main(mainSettings, storageManager) + await mainHandler.lnd.Warmup() + if (!mainSettings.skipSanityCheck) { + const sanityChecker = new SanityChecker(storageManager, mainHandler.lnd) + await sanityChecker.VerifyEventsLog() + } + await mainHandler.paymentManager.watchDog.Start() + const appsData = await mainHandler.storage.applicationStorage.GetApplications() + const existingWalletApp = await appsData.find(app => app.name === 'wallet' || app.name === 'wallet-test') + if (!existingWalletApp) { + log("no default wallet app found, creating one...") + const newWalletApp = await mainHandler.storage.applicationStorage.AddApplication('wallet', true) + appsData.push(newWalletApp) + } + const apps: AppData[] = await Promise.all(appsData.map(app => { + if (!app.nostr_private_key || !app.nostr_public_key) { // TMP -- + return mainHandler.storage.applicationStorage.GenerateApplicationKeys(app); + } // -- + else { + return { privateKey: app.nostr_private_key, publicKey: app.nostr_public_key, appId: app.app_id, name: app.name } + } + })) + const liquidityProviderApp = apps.find(app => app.name === 'wallet' || app.name === 'wallet-test') + if (!liquidityProviderApp) { + throw new Error("wallet app not initialized correctly") + } + const liquidityProviderInfo = { + privateKey: liquidityProviderApp.privateKey, + publicKey: liquidityProviderApp.publicKey, + name: "liquidity_provider", clientId: `client_${liquidityProviderApp.appId}` + } + mainHandler.liquidProvider.setNostrInfo({ clientId: liquidityProviderInfo.clientId, myPub: liquidityProviderInfo.publicKey }) + const stop = await processArgs(mainHandler) + if (stop) { + return + } + return { mainHandler, apps, liquidityProviderInfo, liquidityProviderApp } +} + +const processArgs = async (mainHandler: Main) => { + switch (process.argv[2]) { + case 'updateUserBalance': + await mainHandler.storage.userStorage.UpdateUser(process.argv[3], { balance_sats: +process.argv[4] }) + getLogger({ userId: process.argv[3] })(`user balance updated correctly`) + return false + case 'unlock': + await mainHandler.storage.userStorage.UnbanUser(process.argv[3]) + getLogger({ userId: process.argv[3] })(`user unlocked`) + return false + default: + return false + } } \ No newline at end of file diff --git a/src/services/main/paymentManager.ts b/src/services/main/paymentManager.ts index 3a8e37c7..bc83aa44 100644 --- a/src/services/main/paymentManager.ts +++ b/src/services/main/paymentManager.ts @@ -1,618 +1,618 @@ -import { bech32 } from 'bech32' -import crypto from 'crypto' -import Storage from '../storage/index.js' -import * as Types from '../../../proto/autogenerated/ts/types.js' -import { MainSettings } from './settings.js' -import { InboundOptionals, defaultInvoiceExpiry } from '../storage/paymentStorage.js' -import LND from '../lnd/lnd.js' -import { Application } from '../storage/entity/Application.js' -import { getLogger } from '../helpers/logger.js' -import { UserReceivingAddress } from '../storage/entity/UserReceivingAddress.js' -import { AddressPaidCb, InvoicePaidCb, PaidInvoice } from '../lnd/settings.js' -import { UserReceivingInvoice, ZapInfo } from '../storage/entity/UserReceivingInvoice.js' -import { SendCoinsResponse } from '../../../proto/lnd/lightning.js' -import { Event, verifiedSymbol, verifySignature } from '../nostr/tools/event.js' -import { AddressReceivingTransaction } from '../storage/entity/AddressReceivingTransaction.js' -import { UserTransactionPayment } from '../storage/entity/UserTransactionPayment.js' -import { Watchdog } from './watchdog.js' -import { LiquidityProvider } from '../lnd/liquidityProvider.js' -interface UserOperationInfo { - serial_id: number - paid_amount: number - paid_at_unix: number - invoice?: string - address?: string - from_user?: { user_id: string } - to_user?: { user_id: string } - service_fee?: number - service_fees?: number - routing_fees?: number - chain_fees?: number - confs?: number - tx_hash?: string; - user_address?: { - address: string - }; - internal?: boolean; -} -export type PendingTx = { type: 'incoming', tx: AddressReceivingTransaction } | { type: 'outgoing', tx: UserTransactionPayment } -const defaultLnurlPayMetadata = `[["text/plain", "lnurl pay to Lightning.pub"]]` -const confInOne = 1000 * 1000 -const confInTwo = 100 * 1000 * 1000 -export default class { - storage: Storage - settings: MainSettings - lnd: LND - addressPaidCb: AddressPaidCb - invoicePaidCb: InvoicePaidCb - log = getLogger({ component: "PaymentManager" }) - watchDog: Watchdog - constructor(storage: Storage, lnd: LND, settings: MainSettings, addressPaidCb: AddressPaidCb, invoicePaidCb: InvoicePaidCb) { - this.storage = storage - this.settings = settings - this.lnd = lnd - this.watchDog = new Watchdog(settings.watchDogSettings, lnd, storage) - this.addressPaidCb = addressPaidCb - this.invoicePaidCb = invoicePaidCb - } - Stop() { - this.watchDog.Stop() - } - - getServiceFee(action: Types.UserOperationType, amount: number, appUser: boolean): number { - switch (action) { - case Types.UserOperationType.INCOMING_TX: - return Math.ceil(this.settings.incomingTxFee * amount) - case Types.UserOperationType.OUTGOING_TX: - return Math.ceil(this.settings.outgoingTxFee * amount) - case Types.UserOperationType.INCOMING_INVOICE: - if (appUser) { - return Math.ceil(this.settings.incomingAppUserInvoiceFee * amount) - } - return Math.ceil(this.settings.incomingAppInvoiceFee * amount) - case Types.UserOperationType.OUTGOING_INVOICE: - if (appUser) { - return Math.ceil(this.settings.outgoingAppUserInvoiceFee * amount) - } - return Math.ceil(this.settings.outgoingAppInvoiceFee * amount) - case Types.UserOperationType.OUTGOING_USER_TO_USER || Types.UserOperationType.INCOMING_USER_TO_USER: - if (appUser) { - return Math.ceil(this.settings.userToUserFee * amount) - } - return Math.ceil(this.settings.appToUserFee * amount) - default: - throw new Error("Unknown service action type") - } - } - - async SetMockInvoiceAsPaid(req: Types.SetMockInvoiceAsPaidRequest) { - if (!this.settings.lndSettings.mockLnd) { - throw new Error("mock disabled, cannot set invoice as paid") - } - await this.lnd.SetMockInvoiceAsPaid(req.invoice, req.amount) - } - - async SetMockUserBalance(userId: string, balance: number) { - if (!this.settings.lndSettings.mockLnd) { - throw new Error("mock disabled, cannot set invoice as paid") - } - getLogger({})("setting mock balance...") - await this.storage.userStorage.UpdateUser(userId, { balance_sats: balance }) - } - - async NewAddress(ctx: Types.UserContext, req: Types.NewAddressRequest): Promise { - const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) - const user = await this.storage.userStorage.GetUser(ctx.user_id) - if (user.locked) { - throw new Error("user is banned, cannot generate address") - } - const existingAddress = await this.storage.paymentStorage.GetExistingUserAddress(ctx.user_id, app) - if (existingAddress) { - return { address: existingAddress.address } - } - const res = await this.lnd.NewAddress(req.addressType) - const userAddress = await this.storage.paymentStorage.AddUserAddress(user, res.address, { linkedApplication: app }) - this.storage.eventsLog.LogEvent({ type: 'new_address', userId: user.user_id, appUserId: "", appId: app.app_id, balance: user.balance_sats, data: res.address, amount: 0 }) - return { address: userAddress.address } - } - - async NewInvoice(userId: string, req: Types.NewInvoiceRequest, options: InboundOptionals = { expiry: defaultInvoiceExpiry }): Promise { - const user = await this.storage.userStorage.GetUser(userId) - if (user.locked) { - throw new Error("user is banned, cannot generate invoice") - } - const res = await this.lnd.NewInvoice(req.amountSats, req.memo, options.expiry) - const userInvoice = await this.storage.paymentStorage.AddUserInvoice(user, res.payRequest, options) - const appId = options.linkedApplication ? options.linkedApplication.app_id : "" - this.storage.eventsLog.LogEvent({ type: 'new_invoice', userId: user.user_id, appUserId: "", appId, balance: user.balance_sats, data: userInvoice.invoice, amount: req.amountSats }) - return { - invoice: userInvoice.invoice - } - } - - GetMaxPayableInvoice(balance: number, appUser: boolean): number { - let maxWithinServiceFee = 0 - if (appUser) { - maxWithinServiceFee = Math.max(0, Math.floor(balance * (1 - this.settings.outgoingAppUserInvoiceFee))) - } else { - maxWithinServiceFee = Math.max(0, Math.floor(balance * (1 - this.settings.outgoingAppInvoiceFee))) - } - return this.lnd.GetMaxWithinLimit(maxWithinServiceFee) - } - async DecodeInvoice(req: Types.DecodeInvoiceRequest): Promise { - const decoded = await this.lnd.DecodeInvoice(req.invoice) - return { - amount: Number(decoded.numSatoshis) - } - } - - async PayInvoice(userId: string, req: Types.PayInvoiceRequest, linkedApplication: Application): Promise { - this.log("paying invoice", req.invoice, "for user", userId, "with amount", req.amount) - await this.watchDog.PaymentRequested() - const maybeBanned = await this.storage.userStorage.GetUser(userId) - if (maybeBanned.locked) { - throw new Error("user is banned, cannot send payment") - } - const decoded = await this.lnd.DecodeInvoice(req.invoice) - if (decoded.numSatoshis !== 0 && req.amount !== 0) { - throw new Error("invoice has value, do not provide amount the the request") - } - if (decoded.numSatoshis === 0 && req.amount === 0) { - throw new Error("invoice has no value, an amount must be provided in the request") - } - const payAmount = req.amount !== 0 ? req.amount : Number(decoded.numSatoshis) - const isAppUserPayment = userId !== linkedApplication.owner.user_id - const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_INVOICE, payAmount, isAppUserPayment) - const internalInvoice = await this.storage.paymentStorage.GetInvoiceOwner(req.invoice) - let paymentInfo = { preimage: "", amtPaid: 0, networkFee: 0, serialId: 0 } - if (internalInvoice) { - paymentInfo = await this.PayInternalInvoice(userId, internalInvoice, { payAmount, serviceFee }, linkedApplication) - } else { - paymentInfo = await this.PayExternalInvoice(userId, req.invoice, { payAmount, serviceFee, amountForLnd: req.amount }, linkedApplication) - } - if (isAppUserPayment && serviceFee > 0) { - await this.storage.userStorage.IncrementUserBalance(linkedApplication.owner.user_id, serviceFee, "fees") - } - const user = await this.storage.userStorage.GetUser(userId) - this.storage.eventsLog.LogEvent({ type: 'invoice_payment', userId, appId: linkedApplication.app_id, appUserId: "", balance: user.balance_sats, data: req.invoice, amount: payAmount }) - return { - preimage: paymentInfo.preimage, - amount_paid: paymentInfo.amtPaid, - operation_id: `${Types.UserOperationType.OUTGOING_INVOICE}-${paymentInfo.serialId}`, - network_fee: paymentInfo.networkFee, - service_fee: serviceFee - } - } - - async PayExternalInvoice(userId: string, invoice: string, amounts: { payAmount: number, serviceFee: number, amountForLnd: number }, linkedApplication: Application) { - if (this.settings.disableExternalPayments) { - throw new Error("something went wrong sending payment, please try again later") - } - const { amountForLnd, payAmount, serviceFee } = amounts - const totalAmountToDecrement = payAmount + serviceFee - this.log("paying external invoice", invoice) - const routingFeeLimit = this.lnd.GetFeeLimitAmount(payAmount) - await this.storage.userStorage.DecrementUserBalance(userId, totalAmountToDecrement + routingFeeLimit, invoice) - const pendingPayment = await this.storage.paymentStorage.AddPendingExternalPayment(userId, invoice, payAmount, linkedApplication) - try { - const payment = await this.lnd.PayInvoice(invoice, amountForLnd, routingFeeLimit) - - if (routingFeeLimit - payment.feeSat > 0) { - this.log("refund routing fee", routingFeeLimit, payment.feeSat, "sats") - await this.storage.userStorage.IncrementUserBalance(userId, routingFeeLimit - payment.feeSat, "routing_fee_refund:" + invoice) - } - await this.storage.paymentStorage.UpdateExternalPayment(pendingPayment.serial_id, payment.feeSat, serviceFee, true) - - return { preimage: payment.paymentPreimage, amtPaid: payment.valueSat, networkFee: payment.feeSat, serialId: pendingPayment.serial_id } - - } catch (err) { - await this.storage.userStorage.IncrementUserBalance(userId, totalAmountToDecrement + routingFeeLimit, "payment_refund:" + invoice) - await this.storage.paymentStorage.UpdateExternalPayment(pendingPayment.serial_id, 0, 0, false) - throw err - } - } - - async PayInternalInvoice(userId: string, internalInvoice: UserReceivingInvoice, amounts: { payAmount: number, serviceFee: number }, linkedApplication: Application) { - this.log("paying internal invoice", internalInvoice.invoice) - if (internalInvoice.paid_at_unix > 0) { - throw new Error("this invoice was already paid") - } - const { payAmount, serviceFee } = amounts - const totalAmountToDecrement = payAmount + serviceFee - await this.storage.userStorage.DecrementUserBalance(userId, totalAmountToDecrement, internalInvoice.invoice) - this.invoicePaidCb(internalInvoice.invoice, payAmount, true) - const newPayment = await this.storage.paymentStorage.AddInternalPayment(userId, internalInvoice.invoice, payAmount, serviceFee, linkedApplication) - return { preimage: "", amtPaid: payAmount, networkFee: 0, serialId: newPayment.serial_id } - } - - - async PayAddress(ctx: Types.UserContext, req: Types.PayAddressRequest): Promise { - throw new Error("address payment currently disabled, use Lightning instead") - await this.watchDog.PaymentRequested() - this.log("paying address", req.address, "for user", ctx.user_id, "with amount", req.amoutSats) - const maybeBanned = await this.storage.userStorage.GetUser(ctx.user_id) - if (maybeBanned.locked) { - throw new Error("user is banned, cannot send chain tx") - } - const { blockHeight } = await this.lnd.GetInfo() - const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) - const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_TX, req.amoutSats, false) - const isAppUserPayment = ctx.user_id !== app.owner.user_id - const internalAddress = await this.storage.paymentStorage.GetAddressOwner(req.address) - let txId = "" - let chainFees = 0 - if (!internalAddress) { - this.log("paying external address") - const estimate = await this.lnd.EstimateChainFees(req.address, req.amoutSats, 1) - const vBytes = Math.ceil(Number(estimate.feeSat / estimate.satPerVbyte)) - chainFees = vBytes * req.satsPerVByte - const total = req.amoutSats + chainFees - // WARNING, before re-enabling this, make sure to add the tx_hash to the DecrementUserBalance "reason"!! - this.storage.userStorage.DecrementUserBalance(ctx.user_id, total + serviceFee, req.address) - try { - const payment = await this.lnd.PayAddress(req.address, req.amoutSats, req.satsPerVByte) - txId = payment.txid - } catch (err) { - // WARNING, before re-enabling this, make sure to add the tx_hash to the IncrementUserBalance "reason"!! - await this.storage.userStorage.IncrementUserBalance(ctx.user_id, total + serviceFee, req.address) - throw err - } - } else { - this.log("paying internal address") - txId = crypto.randomBytes(32).toString("hex") - const addressData = `${req.address}:${txId}` - await this.storage.userStorage.DecrementUserBalance(ctx.user_id, req.amoutSats + serviceFee, addressData) - this.addressPaidCb({ hash: txId, index: 0 }, req.address, req.amoutSats, true) - } - - if (isAppUserPayment && serviceFee > 0) { - await this.storage.userStorage.IncrementUserBalance(app.owner.user_id, serviceFee, 'fees') - } - - const newTx = await this.storage.paymentStorage.AddUserTransactionPayment(ctx.user_id, req.address, txId, 0, req.amoutSats, chainFees, serviceFee, !!internalAddress, blockHeight, app) - const user = await this.storage.userStorage.GetUser(ctx.user_id) - const txData = `${newTx.address}:${newTx.tx_hash}` - this.storage.eventsLog.LogEvent({ type: 'address_payment', userId: ctx.user_id, appId: app.app_id, appUserId: "", balance: user.balance_sats, data: txData, amount: req.amoutSats }) - return { - txId: txId, - operation_id: `${Types.UserOperationType.OUTGOING_TX}-${newTx.serial_id}`, - network_fee: chainFees, - service_fee: serviceFee - } - } - - balanceCheckUrl(k1: string): string { - return `${this.settings.serviceUrl}/api/guest/lnurl_withdraw/info?k1=${k1}` - } - - isDefaultServiceUrl(): boolean { - if ( - this.settings.serviceUrl.includes("localhost") - || - this.settings.serviceUrl.includes("127.0.0.1") - ) { - return true - } - return false; - } - - async GetLnurlWithdrawLink(ctx: Types.UserContext): Promise { - if (this.isDefaultServiceUrl()) { - throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") - } - const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) - const key = await this.storage.paymentStorage.AddUserEphemeralKey(ctx.user_id, 'balanceCheck', app) - return { - lnurl: this.encodeLnurl(this.balanceCheckUrl(key.key)), - k1: key.key - } - } - - async GetLnurlWithdrawInfo(balanceCheckK1: string): Promise { - throw new Error("LNURL withdraw currenlty not supported for non application users") - /*const key = await this.storage.paymentStorage.UseUserEphemeralKey(balanceCheckK1, 'balanceCheck') - const maxWithdrawable = this.GetMaxPayableInvoice(key.user.balance_sats) - const callbackK1 = await this.storage.paymentStorage.AddUserEphemeralKey(key.user.user_id, 'withdraw') - const newBalanceCheckK1 = await this.storage.paymentStorage.AddUserEphemeralKey(key.user.user_id, 'balanceCheck') - const payInfoK1 = await this.storage.paymentStorage.AddUserEphemeralKey(key.user.user_id, 'pay') - return { - tag: "withdrawRequest", - callback: `${this.settings.serviceUrl}/api/guest/lnurl_withdraw/handle`, - defaultDescription: "lnurl withdraw from lightning.pub", - k1: callbackK1.key, - maxWithdrawable: maxWithdrawable * 1000, - minWithdrawable: 10000, - balanceCheck: this.balanceCheckUrl(newBalanceCheckK1.key), - payLink: `${this.settings.serviceUrl}/api/guest/lnurl_pay/info?k1=${payInfoK1.key}`, - }*/ - } - - async HandleLnurlWithdraw(k1: string, invoice: string): Promise { - const key = await this.storage.paymentStorage.UseUserEphemeralKey(k1, 'withdraw') - if (!key.linkedApplication) { - throw new Error("found lnurl key entry with no linked application") - } - try { - await this.PayInvoice(key.user.user_id, { invoice: invoice, amount: 0 }, key.linkedApplication) - } catch (err: any) { - console.error("error sending payment for lnurl withdraw to ", key.user.user_id, err) - throw new Error("failed to pay invoice") - } - } - - lnurlPayUrl(k1: string): string { - return `${this.settings.serviceUrl}/api/guest/lnurl_pay/info?k1=${k1}` - } - - async GetLnurlPayLink(ctx: Types.UserContext): Promise { - if (this.isDefaultServiceUrl()) { - throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") - } - getLogger({})("getting lnurl pay link") - const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) - const key = await this.storage.paymentStorage.AddUserEphemeralKey(ctx.user_id, 'pay', app) - const lnurl = this.encodeLnurl(this.lnurlPayUrl(key.key)) - getLogger({})("got lnurl pay link: ", lnurl) - return { - lnurl, - k1: key.key - } - } - - async GetLnurlPayInfoFromUser(userId: string, linkedApplication: Application, baseUrl?: string): Promise { - if (this.isDefaultServiceUrl()) { - throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") - } - const payK1 = await this.storage.paymentStorage.AddUserEphemeralKey(userId, 'pay', linkedApplication) - const url = baseUrl ? baseUrl : `${this.settings.serviceUrl}/api/guest/lnurl_pay/handle` - const { remote } = await this.lnd.ChannelBalance() - return { - tag: 'payRequest', - callback: `${url}?k1=${payK1.key}`, - maxSendable: remote * 1000, - minSendable: 10000, - metadata: defaultLnurlPayMetadata, - allowsNostr: !!linkedApplication.nostr_public_key, - nostrPubkey: linkedApplication.nostr_public_key || "" - } - } - - async GetLnurlPayInfo(payInfoK1: string): Promise { - if (this.isDefaultServiceUrl()) { - throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") - } - const key = await this.storage.paymentStorage.UseUserEphemeralKey(payInfoK1, 'pay', true) - if (!key.linkedApplication) { - throw new Error("invalid lnurl request") - } - const { remote } = await this.lnd.ChannelBalance() - return { - tag: 'payRequest', - callback: `${this.settings.serviceUrl}/api/guest/lnurl_pay/handle?k1=${payInfoK1}`, - maxSendable: remote * 1000, - minSendable: 10000, - metadata: defaultLnurlPayMetadata, - allowsNostr: !!key.linkedApplication.nostr_public_key, - nostrPubkey: key.linkedApplication.nostr_public_key || "" - } - } - - parseTags(tag: string, tags: string[][], opts: { multiples?: boolean, required?: boolean } = {}): string[] { - const { multiples, required } = opts - const found = tags.filter(t => t && t.length >= 2 && t[0] === tag) - if (found.length === 0) { - if (required) { - throw new Error(`missing tag for "${tag}"`) - } - return [] - } - if (found.length === 1) { - const elements = found[0] - elements.shift() - if (elements.length === 0) { - throw new Error(`invalid content for "${tag}" tag`) - } - if (!multiples && elements.length !== 1) { - throw new Error(`too many contents for "${tag}" tag`) - - } - return elements - } - throw new Error(`too many entries for "${tag}" tag`) - } - - validateZapEvent(event: string, amt: number): ZapInfo { - const nostrEvent = JSON.parse(event) as Event - delete nostrEvent[verifiedSymbol] - const verified = verifySignature(nostrEvent) - if (!verified) { - throw new Error("nostr event not valid") - } - const p = this.parseTags("p", nostrEvent.tags, { required: true }) - const e = this.parseTags("e", nostrEvent.tags) - const relays = this.parseTags("relays", nostrEvent.tags, { required: true, multiples: true }) - const amount = this.parseTags("amount", nostrEvent.tags) - if (+amount !== amt) { - throw new Error("amount mismatch") - } - return { pub: p[0], eventId: e.length > 0 ? e[0] : "", relays, description: event } - } - - async HandleLnurlPay(ctx: Types.HandleLnurlPay_Query): Promise { - if (!ctx.k1 || !ctx.amount) { - throw new Error("invalid lnurl pay to handle") - } - const amountMillis = +ctx.amount - if (isNaN(amountMillis)) { - throw new Error("invalid amount in lnurl pay to handle") - } - let zapInfo: ZapInfo | undefined - if (ctx.nostr) { - zapInfo = this.validateZapEvent(ctx.nostr, amountMillis) - } - const key = await this.storage.paymentStorage.UseUserEphemeralKey(ctx.k1, 'pay', true) - const sats = amountMillis / 1000 - if (!Number.isInteger(sats)) { - throw new Error("millisats amount must be integer sats amount") - } - if (!key.linkedApplication) { - throw new Error("cannot handle lnurl for non application user") - } - let log = getLogger({ appName: key.linkedApplication.name }) - if (zapInfo) { - log("this payment is a zap") - } else { - log("this payment is NOT a zap", ctx) - - } - const invoice = await this.NewInvoice(key.user.user_id, { - amountSats: sats, - memo: zapInfo ? zapInfo.description : defaultLnurlPayMetadata - }, { expiry: defaultInvoiceExpiry, linkedApplication: key.linkedApplication, zapInfo }) - return { - pr: invoice.invoice, - routes: [] - } - } - - async HandleLnurlAddress(addressName: string): Promise { - const linkedUser = await this.storage.applicationStorage.FindNostrAppUser(addressName) - if (!linkedUser) { - throw new Error("this address is not linked to any user") - } - return this.GetLnurlPayInfoFromUser(linkedUser.user.user_id, linkedUser.application) - } - - async OpenChannel(userId: string, req: Types.OpenChannelRequest): Promise { throw new Error("WIP") } - - mapOperations(operations: UserOperationInfo[], type: Types.UserOperationType, inbound: boolean): Types.UserOperations { - if (operations.length === 0) { - return { - fromIndex: 0, - toIndex: 0, - operations: [] - } - } - return { - toIndex: operations[0].serial_id, - fromIndex: operations[operations.length - 1].serial_id, - operations: operations.map((o: UserOperationInfo): Types.UserOperation => { - let identifier = ""; - if (o.invoice) { - identifier = o.invoice - } else if (o.address) { - identifier = o.address; - } else if (o.user_address) { - identifier = o.user_address.address; - } else if (type === Types.UserOperationType.INCOMING_USER_TO_USER && o.from_user) { - identifier = o.from_user.user_id - } else if (type === Types.UserOperationType.OUTGOING_INVOICE && o.to_user) { - identifier = o.to_user.user_id - } - return { - inbound, - type, - amount: o.paid_amount, - paidAtUnix: o.paid_at_unix, - identifier, - operationId: `${type}-${o.serial_id}`, - network_fee: o.chain_fees || o.routing_fees || 0, - service_fee: o.service_fee || o.service_fees || 0, - confirmed: typeof o.confs === 'number' ? o.confs > 0 : true, - tx_hash: o.tx_hash || "", - internal: !!o.internal - } - }) - } - } - - async GetUserOperations(userId: string, req: Types.GetUserOperationsRequest): Promise { - const user = await this.storage.userStorage.GetUser(userId) - if (user.locked) { - throw new Error("user is banned, cannot retrieve operations") - } - const [outgoingInvoices, outgoingTransactions, incomingInvoices, incomingTransactions, incomingUserToUser, outgoingUserToUser] = await Promise.all([ - this.storage.paymentStorage.GetUserInvoicePayments(userId, req.latestOutgoingInvoice, req.max_size), - this.storage.paymentStorage.GetUserTransactionPayments(userId, req.latestOutgoingTx, req.max_size), - this.storage.paymentStorage.GetUserInvoicesFlaggedAsPaid(userId, req.latestIncomingInvoice, req.max_size), - this.storage.paymentStorage.GetUserReceivingTransactions(userId, req.latestIncomingTx, req.max_size), - this.storage.paymentStorage.GetUserToUserReceivedPayments(userId, req.latestIncomingUserToUserPayment, req.max_size), - this.storage.paymentStorage.GetUserToUserSentPayments(userId, req.latestOutgoingUserToUserPayment, req.max_size) - ]) - return { - latestIncomingInvoiceOperations: this.mapOperations(incomingInvoices, Types.UserOperationType.INCOMING_INVOICE, true), - latestIncomingTxOperations: this.mapOperations(incomingTransactions, Types.UserOperationType.INCOMING_TX, true), - latestOutgoingInvoiceOperations: this.mapOperations(outgoingInvoices, Types.UserOperationType.OUTGOING_INVOICE, false), - latestOutgoingTxOperations: this.mapOperations(outgoingTransactions, Types.UserOperationType.OUTGOING_TX, false), - latestIncomingUserToUserPayemnts: this.mapOperations(incomingUserToUser, Types.UserOperationType.INCOMING_USER_TO_USER, true), - latestOutgoingUserToUserPayemnts: this.mapOperations(outgoingUserToUser, Types.UserOperationType.OUTGOING_USER_TO_USER, false) - } - } - - async SendUserToUserPayment(fromUserId: string, toUserId: string, amount: number, linkedApplication: Application): Promise<{ amount: number, fees: number }> { - const payment = await this.storage.StartTransaction(async tx => { - const fromUser = await this.storage.userStorage.GetUser(fromUserId, tx) - const toUser = await this.storage.userStorage.GetUser(toUserId, tx) - if (fromUser.locked || toUser.locked) { - throw new Error("one of the users is banned, cannot send payment") - } - if (fromUser.balance_sats < amount) { - throw new Error("not enough balance to send payment") - } - const isAppUserPayment = fromUser.user_id !== linkedApplication.owner.user_id - let fee = this.getServiceFee(Types.UserOperationType.OUTGOING_USER_TO_USER, amount, isAppUserPayment) - const toDecrement = amount + fee - const paymentEntry = await this.storage.paymentStorage.AddPendingUserToUserPayment(fromUserId, toUserId, amount, fee, linkedApplication, tx) - await this.storage.userStorage.DecrementUserBalance(fromUser.user_id, toDecrement, `${toUserId}:${paymentEntry.serial_id}`, tx) - await this.storage.userStorage.IncrementUserBalance(toUser.user_id, amount, `${fromUserId}:${paymentEntry.serial_id}`, tx) - await this.storage.paymentStorage.SetPendingUserToUserPaymentAsPaid(paymentEntry.serial_id, tx) - if (isAppUserPayment && fee > 0) { - await this.storage.userStorage.IncrementUserBalance(linkedApplication.owner.user_id, fee, 'fees', tx) - } - return paymentEntry - }) - const fromUser = await this.storage.userStorage.GetUser(fromUserId) - const toUser = await this.storage.userStorage.GetUser(toUserId) - this.storage.eventsLog.LogEvent({ type: 'u2u_sender', userId: fromUserId, appId: linkedApplication.app_id, appUserId: "", balance: fromUser.balance_sats, data: toUserId, amount: payment.paid_amount + payment.service_fees }) - this.storage.eventsLog.LogEvent({ type: 'u2u_receiver', userId: toUserId, appId: linkedApplication.app_id, appUserId: "", balance: toUser.balance_sats, data: fromUserId, amount: amount }) - return { amount: payment.paid_amount, fees: payment.service_fees } - } - - async CheckNewlyConfirmedTxs(height: number) { - const pending = await this.storage.paymentStorage.GetPendingTransactions() - let lowestHeight = height - const map: Record = {} - - const checkTx = (t: PendingTx) => { - if (t.tx.broadcast_height < lowestHeight) { lowestHeight = t.tx.broadcast_height } - map[t.tx.tx_hash] = t - } - pending.incoming.forEach(t => checkTx({ type: "incoming", tx: t })) - pending.outgoing.forEach(t => checkTx({ type: "outgoing", tx: t })) - const { transactions } = await this.lnd.GetTransactions(lowestHeight) - const newlyConfirmedTxs = transactions.map(tx => { - const { txHash, numConfirmations: confs, amount: amt } = tx - const t = map[txHash] - if (!t || confs === 0) { - return - } - if (confs > 2 || (amt <= confInTwo && confs > 1) || (amt <= confInOne && confs > 0)) { - return { ...t, confs } - } - }) - return newlyConfirmedTxs.filter(t => t !== undefined) as (PendingTx & { confs: number })[] - } - - async GetLndBalance() { - return this.lnd.GetBalance() - } - - encodeLnurl(base: string) { - if (!base || typeof base !== 'string') { - throw new Error("provided string for lnurl encode is not a string or is an empty string") - } - let words = bech32.toWords(Buffer.from(base, 'utf8')); - return bech32.encode('lnurl', words, 1023); - } -} - +import { bech32 } from 'bech32' +import crypto from 'crypto' +import Storage from '../storage/index.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' +import { MainSettings } from './settings.js' +import { InboundOptionals, defaultInvoiceExpiry } from '../storage/paymentStorage.js' +import LND from '../lnd/lnd.js' +import { Application } from '../storage/entity/Application.js' +import { getLogger } from '../helpers/logger.js' +import { UserReceivingAddress } from '../storage/entity/UserReceivingAddress.js' +import { AddressPaidCb, InvoicePaidCb, PaidInvoice } from '../lnd/settings.js' +import { UserReceivingInvoice, ZapInfo } from '../storage/entity/UserReceivingInvoice.js' +import { SendCoinsResponse } from '../../../proto/lnd/lightning.js' +import { Event, verifiedSymbol, verifySignature } from '../nostr/tools/event.js' +import { AddressReceivingTransaction } from '../storage/entity/AddressReceivingTransaction.js' +import { UserTransactionPayment } from '../storage/entity/UserTransactionPayment.js' +import { Watchdog } from './watchdog.js' +import { LiquidityProvider } from '../lnd/liquidityProvider.js' +interface UserOperationInfo { + serial_id: number + paid_amount: number + paid_at_unix: number + invoice?: string + address?: string + from_user?: { user_id: string } + to_user?: { user_id: string } + service_fee?: number + service_fees?: number + routing_fees?: number + chain_fees?: number + confs?: number + tx_hash?: string; + user_address?: { + address: string + }; + internal?: boolean; +} +export type PendingTx = { type: 'incoming', tx: AddressReceivingTransaction } | { type: 'outgoing', tx: UserTransactionPayment } +const defaultLnurlPayMetadata = `[["text/plain", "lnurl pay to Lightning.pub"]]` +const confInOne = 1000 * 1000 +const confInTwo = 100 * 1000 * 1000 +export default class { + storage: Storage + settings: MainSettings + lnd: LND + addressPaidCb: AddressPaidCb + invoicePaidCb: InvoicePaidCb + log = getLogger({ component: "PaymentManager" }) + watchDog: Watchdog + constructor(storage: Storage, lnd: LND, settings: MainSettings, addressPaidCb: AddressPaidCb, invoicePaidCb: InvoicePaidCb) { + this.storage = storage + this.settings = settings + this.lnd = lnd + this.watchDog = new Watchdog(settings.watchDogSettings, lnd, storage) + this.addressPaidCb = addressPaidCb + this.invoicePaidCb = invoicePaidCb + } + Stop() { + this.watchDog.Stop() + } + + getServiceFee(action: Types.UserOperationType, amount: number, appUser: boolean): number { + switch (action) { + case Types.UserOperationType.INCOMING_TX: + return Math.ceil(this.settings.incomingTxFee * amount) + case Types.UserOperationType.OUTGOING_TX: + return Math.ceil(this.settings.outgoingTxFee * amount) + case Types.UserOperationType.INCOMING_INVOICE: + if (appUser) { + return Math.ceil(this.settings.incomingAppUserInvoiceFee * amount) + } + return Math.ceil(this.settings.incomingAppInvoiceFee * amount) + case Types.UserOperationType.OUTGOING_INVOICE: + if (appUser) { + return Math.ceil(this.settings.outgoingAppUserInvoiceFee * amount) + } + return Math.ceil(this.settings.outgoingAppInvoiceFee * amount) + case Types.UserOperationType.OUTGOING_USER_TO_USER || Types.UserOperationType.INCOMING_USER_TO_USER: + if (appUser) { + return Math.ceil(this.settings.userToUserFee * amount) + } + return Math.ceil(this.settings.appToUserFee * amount) + default: + throw new Error("Unknown service action type") + } + } + + async SetMockInvoiceAsPaid(req: Types.SetMockInvoiceAsPaidRequest) { + if (!this.settings.lndSettings.mockLnd) { + throw new Error("mock disabled, cannot set invoice as paid") + } + await this.lnd.SetMockInvoiceAsPaid(req.invoice, req.amount) + } + + async SetMockUserBalance(userId: string, balance: number) { + if (!this.settings.lndSettings.mockLnd) { + throw new Error("mock disabled, cannot set invoice as paid") + } + getLogger({})("setting mock balance...") + await this.storage.userStorage.UpdateUser(userId, { balance_sats: balance }) + } + + async NewAddress(ctx: Types.UserContext, req: Types.NewAddressRequest): Promise { + const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) + const user = await this.storage.userStorage.GetUser(ctx.user_id) + if (user.locked) { + throw new Error("user is banned, cannot generate address") + } + const existingAddress = await this.storage.paymentStorage.GetExistingUserAddress(ctx.user_id, app) + if (existingAddress) { + return { address: existingAddress.address } + } + const res = await this.lnd.NewAddress(req.addressType) + const userAddress = await this.storage.paymentStorage.AddUserAddress(user, res.address, { linkedApplication: app }) + this.storage.eventsLog.LogEvent({ type: 'new_address', userId: user.user_id, appUserId: "", appId: app.app_id, balance: user.balance_sats, data: res.address, amount: 0 }) + return { address: userAddress.address } + } + + async NewInvoice(userId: string, req: Types.NewInvoiceRequest, options: InboundOptionals = { expiry: defaultInvoiceExpiry }): Promise { + const user = await this.storage.userStorage.GetUser(userId) + if (user.locked) { + throw new Error("user is banned, cannot generate invoice") + } + const res = await this.lnd.NewInvoice(req.amountSats, req.memo, options.expiry) + const userInvoice = await this.storage.paymentStorage.AddUserInvoice(user, res.payRequest, options) + const appId = options.linkedApplication ? options.linkedApplication.app_id : "" + this.storage.eventsLog.LogEvent({ type: 'new_invoice', userId: user.user_id, appUserId: "", appId, balance: user.balance_sats, data: userInvoice.invoice, amount: req.amountSats }) + return { + invoice: userInvoice.invoice + } + } + + GetMaxPayableInvoice(balance: number, appUser: boolean): number { + let maxWithinServiceFee = 0 + if (appUser) { + maxWithinServiceFee = Math.max(0, Math.floor(balance * (1 - this.settings.outgoingAppUserInvoiceFee))) + } else { + maxWithinServiceFee = Math.max(0, Math.floor(balance * (1 - this.settings.outgoingAppInvoiceFee))) + } + return this.lnd.GetMaxWithinLimit(maxWithinServiceFee) + } + async DecodeInvoice(req: Types.DecodeInvoiceRequest): Promise { + const decoded = await this.lnd.DecodeInvoice(req.invoice) + return { + amount: Number(decoded.numSatoshis) + } + } + + async PayInvoice(userId: string, req: Types.PayInvoiceRequest, linkedApplication: Application): Promise { + this.log("paying invoice", req.invoice, "for user", userId, "with amount", req.amount) + await this.watchDog.PaymentRequested() + const maybeBanned = await this.storage.userStorage.GetUser(userId) + if (maybeBanned.locked) { + throw new Error("user is banned, cannot send payment") + } + const decoded = await this.lnd.DecodeInvoice(req.invoice) + if (decoded.numSatoshis !== 0 && req.amount !== 0) { + throw new Error("invoice has value, do not provide amount the the request") + } + if (decoded.numSatoshis === 0 && req.amount === 0) { + throw new Error("invoice has no value, an amount must be provided in the request") + } + const payAmount = req.amount !== 0 ? req.amount : Number(decoded.numSatoshis) + const isAppUserPayment = userId !== linkedApplication.owner.user_id + const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_INVOICE, payAmount, isAppUserPayment) + const internalInvoice = await this.storage.paymentStorage.GetInvoiceOwner(req.invoice) + let paymentInfo = { preimage: "", amtPaid: 0, networkFee: 0, serialId: 0 } + if (internalInvoice) { + paymentInfo = await this.PayInternalInvoice(userId, internalInvoice, { payAmount, serviceFee }, linkedApplication) + } else { + paymentInfo = await this.PayExternalInvoice(userId, req.invoice, { payAmount, serviceFee, amountForLnd: req.amount }, linkedApplication) + } + if (isAppUserPayment && serviceFee > 0) { + await this.storage.userStorage.IncrementUserBalance(linkedApplication.owner.user_id, serviceFee, "fees") + } + const user = await this.storage.userStorage.GetUser(userId) + this.storage.eventsLog.LogEvent({ type: 'invoice_payment', userId, appId: linkedApplication.app_id, appUserId: "", balance: user.balance_sats, data: req.invoice, amount: payAmount }) + return { + preimage: paymentInfo.preimage, + amount_paid: paymentInfo.amtPaid, + operation_id: `${Types.UserOperationType.OUTGOING_INVOICE}-${paymentInfo.serialId}`, + network_fee: paymentInfo.networkFee, + service_fee: serviceFee + } + } + + async PayExternalInvoice(userId: string, invoice: string, amounts: { payAmount: number, serviceFee: number, amountForLnd: number }, linkedApplication: Application) { + if (this.settings.disableExternalPayments) { + throw new Error("something went wrong sending payment, please try again later") + } + const { amountForLnd, payAmount, serviceFee } = amounts + const totalAmountToDecrement = payAmount + serviceFee + this.log("paying external invoice", invoice) + const routingFeeLimit = this.lnd.GetFeeLimitAmount(payAmount) + await this.storage.userStorage.DecrementUserBalance(userId, totalAmountToDecrement + routingFeeLimit, invoice) + const pendingPayment = await this.storage.paymentStorage.AddPendingExternalPayment(userId, invoice, payAmount, linkedApplication) + try { + const payment = await this.lnd.PayInvoice(invoice, amountForLnd, routingFeeLimit) + + if (routingFeeLimit - payment.feeSat > 0) { + this.log("refund routing fee", routingFeeLimit, payment.feeSat, "sats") + await this.storage.userStorage.IncrementUserBalance(userId, routingFeeLimit - payment.feeSat, "routing_fee_refund:" + invoice) + } + await this.storage.paymentStorage.UpdateExternalPayment(pendingPayment.serial_id, payment.feeSat, serviceFee, true) + + return { preimage: payment.paymentPreimage, amtPaid: payment.valueSat, networkFee: payment.feeSat, serialId: pendingPayment.serial_id } + + } catch (err) { + await this.storage.userStorage.IncrementUserBalance(userId, totalAmountToDecrement + routingFeeLimit, "payment_refund:" + invoice) + await this.storage.paymentStorage.UpdateExternalPayment(pendingPayment.serial_id, 0, 0, false) + throw err + } + } + + async PayInternalInvoice(userId: string, internalInvoice: UserReceivingInvoice, amounts: { payAmount: number, serviceFee: number }, linkedApplication: Application) { + this.log("paying internal invoice", internalInvoice.invoice) + if (internalInvoice.paid_at_unix > 0) { + throw new Error("this invoice was already paid") + } + const { payAmount, serviceFee } = amounts + const totalAmountToDecrement = payAmount + serviceFee + await this.storage.userStorage.DecrementUserBalance(userId, totalAmountToDecrement, internalInvoice.invoice) + this.invoicePaidCb(internalInvoice.invoice, payAmount, true) + const newPayment = await this.storage.paymentStorage.AddInternalPayment(userId, internalInvoice.invoice, payAmount, serviceFee, linkedApplication) + return { preimage: "", amtPaid: payAmount, networkFee: 0, serialId: newPayment.serial_id } + } + + + async PayAddress(ctx: Types.UserContext, req: Types.PayAddressRequest): Promise { + throw new Error("address payment currently disabled, use Lightning instead") + await this.watchDog.PaymentRequested() + this.log("paying address", req.address, "for user", ctx.user_id, "with amount", req.amoutSats) + const maybeBanned = await this.storage.userStorage.GetUser(ctx.user_id) + if (maybeBanned.locked) { + throw new Error("user is banned, cannot send chain tx") + } + const { blockHeight } = await this.lnd.GetInfo() + const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) + const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_TX, req.amoutSats, false) + const isAppUserPayment = ctx.user_id !== app.owner.user_id + const internalAddress = await this.storage.paymentStorage.GetAddressOwner(req.address) + let txId = "" + let chainFees = 0 + if (!internalAddress) { + this.log("paying external address") + const estimate = await this.lnd.EstimateChainFees(req.address, req.amoutSats, 1) + const vBytes = Math.ceil(Number(estimate.feeSat / estimate.satPerVbyte)) + chainFees = vBytes * req.satsPerVByte + const total = req.amoutSats + chainFees + // WARNING, before re-enabling this, make sure to add the tx_hash to the DecrementUserBalance "reason"!! + this.storage.userStorage.DecrementUserBalance(ctx.user_id, total + serviceFee, req.address) + try { + const payment = await this.lnd.PayAddress(req.address, req.amoutSats, req.satsPerVByte) + txId = payment.txid + } catch (err) { + // WARNING, before re-enabling this, make sure to add the tx_hash to the IncrementUserBalance "reason"!! + await this.storage.userStorage.IncrementUserBalance(ctx.user_id, total + serviceFee, req.address) + throw err + } + } else { + this.log("paying internal address") + txId = crypto.randomBytes(32).toString("hex") + const addressData = `${req.address}:${txId}` + await this.storage.userStorage.DecrementUserBalance(ctx.user_id, req.amoutSats + serviceFee, addressData) + this.addressPaidCb({ hash: txId, index: 0 }, req.address, req.amoutSats, true) + } + + if (isAppUserPayment && serviceFee > 0) { + await this.storage.userStorage.IncrementUserBalance(app.owner.user_id, serviceFee, 'fees') + } + + const newTx = await this.storage.paymentStorage.AddUserTransactionPayment(ctx.user_id, req.address, txId, 0, req.amoutSats, chainFees, serviceFee, !!internalAddress, blockHeight, app) + const user = await this.storage.userStorage.GetUser(ctx.user_id) + const txData = `${newTx.address}:${newTx.tx_hash}` + this.storage.eventsLog.LogEvent({ type: 'address_payment', userId: ctx.user_id, appId: app.app_id, appUserId: "", balance: user.balance_sats, data: txData, amount: req.amoutSats }) + return { + txId: txId, + operation_id: `${Types.UserOperationType.OUTGOING_TX}-${newTx.serial_id}`, + network_fee: chainFees, + service_fee: serviceFee + } + } + + balanceCheckUrl(k1: string): string { + return `${this.settings.serviceUrl}/api/guest/lnurl_withdraw/info?k1=${k1}` + } + + isDefaultServiceUrl(): boolean { + if ( + this.settings.serviceUrl.includes("localhost") + || + this.settings.serviceUrl.includes("127.0.0.1") + ) { + return true + } + return false; + } + + async GetLnurlWithdrawLink(ctx: Types.UserContext): Promise { + if (this.isDefaultServiceUrl()) { + throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") + } + const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) + const key = await this.storage.paymentStorage.AddUserEphemeralKey(ctx.user_id, 'balanceCheck', app) + return { + lnurl: this.encodeLnurl(this.balanceCheckUrl(key.key)), + k1: key.key + } + } + + async GetLnurlWithdrawInfo(balanceCheckK1: string): Promise { + throw new Error("LNURL withdraw currenlty not supported for non application users") + /*const key = await this.storage.paymentStorage.UseUserEphemeralKey(balanceCheckK1, 'balanceCheck') + const maxWithdrawable = this.GetMaxPayableInvoice(key.user.balance_sats) + const callbackK1 = await this.storage.paymentStorage.AddUserEphemeralKey(key.user.user_id, 'withdraw') + const newBalanceCheckK1 = await this.storage.paymentStorage.AddUserEphemeralKey(key.user.user_id, 'balanceCheck') + const payInfoK1 = await this.storage.paymentStorage.AddUserEphemeralKey(key.user.user_id, 'pay') + return { + tag: "withdrawRequest", + callback: `${this.settings.serviceUrl}/api/guest/lnurl_withdraw/handle`, + defaultDescription: "lnurl withdraw from lightning.pub", + k1: callbackK1.key, + maxWithdrawable: maxWithdrawable * 1000, + minWithdrawable: 10000, + balanceCheck: this.balanceCheckUrl(newBalanceCheckK1.key), + payLink: `${this.settings.serviceUrl}/api/guest/lnurl_pay/info?k1=${payInfoK1.key}`, + }*/ + } + + async HandleLnurlWithdraw(k1: string, invoice: string): Promise { + const key = await this.storage.paymentStorage.UseUserEphemeralKey(k1, 'withdraw') + if (!key.linkedApplication) { + throw new Error("found lnurl key entry with no linked application") + } + try { + await this.PayInvoice(key.user.user_id, { invoice: invoice, amount: 0 }, key.linkedApplication) + } catch (err: any) { + console.error("error sending payment for lnurl withdraw to ", key.user.user_id, err) + throw new Error("failed to pay invoice") + } + } + + lnurlPayUrl(k1: string): string { + return `${this.settings.serviceUrl}/api/guest/lnurl_pay/info?k1=${k1}` + } + + async GetLnurlPayLink(ctx: Types.UserContext): Promise { + if (this.isDefaultServiceUrl()) { + throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") + } + getLogger({})("getting lnurl pay link") + const app = await this.storage.applicationStorage.GetApplication(ctx.app_id) + const key = await this.storage.paymentStorage.AddUserEphemeralKey(ctx.user_id, 'pay', app) + const lnurl = this.encodeLnurl(this.lnurlPayUrl(key.key)) + getLogger({})("got lnurl pay link: ", lnurl) + return { + lnurl, + k1: key.key + } + } + + async GetLnurlPayInfoFromUser(userId: string, linkedApplication: Application, baseUrl?: string): Promise { + if (this.isDefaultServiceUrl()) { + throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") + } + const payK1 = await this.storage.paymentStorage.AddUserEphemeralKey(userId, 'pay', linkedApplication) + const url = baseUrl ? baseUrl : `${this.settings.serviceUrl}/api/guest/lnurl_pay/handle` + const { remote } = await this.lnd.ChannelBalance() + return { + tag: 'payRequest', + callback: `${url}?k1=${payK1.key}`, + maxSendable: remote * 1000, + minSendable: 10000, + metadata: defaultLnurlPayMetadata, + allowsNostr: !!linkedApplication.nostr_public_key, + nostrPubkey: linkedApplication.nostr_public_key || "" + } + } + + async GetLnurlPayInfo(payInfoK1: string): Promise { + if (this.isDefaultServiceUrl()) { + throw new Error("Lnurl not enabled. Make sure to set SERVICE_URL env variable") + } + const key = await this.storage.paymentStorage.UseUserEphemeralKey(payInfoK1, 'pay', true) + if (!key.linkedApplication) { + throw new Error("invalid lnurl request") + } + const { remote } = await this.lnd.ChannelBalance() + return { + tag: 'payRequest', + callback: `${this.settings.serviceUrl}/api/guest/lnurl_pay/handle?k1=${payInfoK1}`, + maxSendable: remote * 1000, + minSendable: 10000, + metadata: defaultLnurlPayMetadata, + allowsNostr: !!key.linkedApplication.nostr_public_key, + nostrPubkey: key.linkedApplication.nostr_public_key || "" + } + } + + parseTags(tag: string, tags: string[][], opts: { multiples?: boolean, required?: boolean } = {}): string[] { + const { multiples, required } = opts + const found = tags.filter(t => t && t.length >= 2 && t[0] === tag) + if (found.length === 0) { + if (required) { + throw new Error(`missing tag for "${tag}"`) + } + return [] + } + if (found.length === 1) { + const elements = found[0] + elements.shift() + if (elements.length === 0) { + throw new Error(`invalid content for "${tag}" tag`) + } + if (!multiples && elements.length !== 1) { + throw new Error(`too many contents for "${tag}" tag`) + + } + return elements + } + throw new Error(`too many entries for "${tag}" tag`) + } + + validateZapEvent(event: string, amt: number): ZapInfo { + const nostrEvent = JSON.parse(event) as Event + delete nostrEvent[verifiedSymbol] + const verified = verifySignature(nostrEvent) + if (!verified) { + throw new Error("nostr event not valid") + } + const p = this.parseTags("p", nostrEvent.tags, { required: true }) + const e = this.parseTags("e", nostrEvent.tags) + const relays = this.parseTags("relays", nostrEvent.tags, { required: true, multiples: true }) + const amount = this.parseTags("amount", nostrEvent.tags) + if (+amount !== amt) { + throw new Error("amount mismatch") + } + return { pub: p[0], eventId: e.length > 0 ? e[0] : "", relays, description: event } + } + + async HandleLnurlPay(ctx: Types.HandleLnurlPay_Query): Promise { + if (!ctx.k1 || !ctx.amount) { + throw new Error("invalid lnurl pay to handle") + } + const amountMillis = +ctx.amount + if (isNaN(amountMillis)) { + throw new Error("invalid amount in lnurl pay to handle") + } + let zapInfo: ZapInfo | undefined + if (ctx.nostr) { + zapInfo = this.validateZapEvent(ctx.nostr, amountMillis) + } + const key = await this.storage.paymentStorage.UseUserEphemeralKey(ctx.k1, 'pay', true) + const sats = amountMillis / 1000 + if (!Number.isInteger(sats)) { + throw new Error("millisats amount must be integer sats amount") + } + if (!key.linkedApplication) { + throw new Error("cannot handle lnurl for non application user") + } + let log = getLogger({ appName: key.linkedApplication.name }) + if (zapInfo) { + log("this payment is a zap") + } else { + log("this payment is NOT a zap", ctx) + + } + const invoice = await this.NewInvoice(key.user.user_id, { + amountSats: sats, + memo: zapInfo ? zapInfo.description : defaultLnurlPayMetadata + }, { expiry: defaultInvoiceExpiry, linkedApplication: key.linkedApplication, zapInfo }) + return { + pr: invoice.invoice, + routes: [] + } + } + + async HandleLnurlAddress(addressName: string): Promise { + const linkedUser = await this.storage.applicationStorage.FindNostrAppUser(addressName) + if (!linkedUser) { + throw new Error("this address is not linked to any user") + } + return this.GetLnurlPayInfoFromUser(linkedUser.user.user_id, linkedUser.application) + } + + async OpenChannel(userId: string, req: Types.OpenChannelRequest): Promise { throw new Error("WIP") } + + mapOperations(operations: UserOperationInfo[], type: Types.UserOperationType, inbound: boolean): Types.UserOperations { + if (operations.length === 0) { + return { + fromIndex: 0, + toIndex: 0, + operations: [] + } + } + return { + toIndex: operations[0].serial_id, + fromIndex: operations[operations.length - 1].serial_id, + operations: operations.map((o: UserOperationInfo): Types.UserOperation => { + let identifier = ""; + if (o.invoice) { + identifier = o.invoice + } else if (o.address) { + identifier = o.address; + } else if (o.user_address) { + identifier = o.user_address.address; + } else if (type === Types.UserOperationType.INCOMING_USER_TO_USER && o.from_user) { + identifier = o.from_user.user_id + } else if (type === Types.UserOperationType.OUTGOING_INVOICE && o.to_user) { + identifier = o.to_user.user_id + } + return { + inbound, + type, + amount: o.paid_amount, + paidAtUnix: o.paid_at_unix, + identifier, + operationId: `${type}-${o.serial_id}`, + network_fee: o.chain_fees || o.routing_fees || 0, + service_fee: o.service_fee || o.service_fees || 0, + confirmed: typeof o.confs === 'number' ? o.confs > 0 : true, + tx_hash: o.tx_hash || "", + internal: !!o.internal + } + }) + } + } + + async GetUserOperations(userId: string, req: Types.GetUserOperationsRequest): Promise { + const user = await this.storage.userStorage.GetUser(userId) + if (user.locked) { + throw new Error("user is banned, cannot retrieve operations") + } + const [outgoingInvoices, outgoingTransactions, incomingInvoices, incomingTransactions, incomingUserToUser, outgoingUserToUser] = await Promise.all([ + this.storage.paymentStorage.GetUserInvoicePayments(userId, req.latestOutgoingInvoice, req.max_size), + this.storage.paymentStorage.GetUserTransactionPayments(userId, req.latestOutgoingTx, req.max_size), + this.storage.paymentStorage.GetUserInvoicesFlaggedAsPaid(userId, req.latestIncomingInvoice, req.max_size), + this.storage.paymentStorage.GetUserReceivingTransactions(userId, req.latestIncomingTx, req.max_size), + this.storage.paymentStorage.GetUserToUserReceivedPayments(userId, req.latestIncomingUserToUserPayment, req.max_size), + this.storage.paymentStorage.GetUserToUserSentPayments(userId, req.latestOutgoingUserToUserPayment, req.max_size) + ]) + return { + latestIncomingInvoiceOperations: this.mapOperations(incomingInvoices, Types.UserOperationType.INCOMING_INVOICE, true), + latestIncomingTxOperations: this.mapOperations(incomingTransactions, Types.UserOperationType.INCOMING_TX, true), + latestOutgoingInvoiceOperations: this.mapOperations(outgoingInvoices, Types.UserOperationType.OUTGOING_INVOICE, false), + latestOutgoingTxOperations: this.mapOperations(outgoingTransactions, Types.UserOperationType.OUTGOING_TX, false), + latestIncomingUserToUserPayemnts: this.mapOperations(incomingUserToUser, Types.UserOperationType.INCOMING_USER_TO_USER, true), + latestOutgoingUserToUserPayemnts: this.mapOperations(outgoingUserToUser, Types.UserOperationType.OUTGOING_USER_TO_USER, false) + } + } + + async SendUserToUserPayment(fromUserId: string, toUserId: string, amount: number, linkedApplication: Application): Promise<{ amount: number, fees: number }> { + const payment = await this.storage.StartTransaction(async tx => { + const fromUser = await this.storage.userStorage.GetUser(fromUserId, tx) + const toUser = await this.storage.userStorage.GetUser(toUserId, tx) + if (fromUser.locked || toUser.locked) { + throw new Error("one of the users is banned, cannot send payment") + } + if (fromUser.balance_sats < amount) { + throw new Error("not enough balance to send payment") + } + const isAppUserPayment = fromUser.user_id !== linkedApplication.owner.user_id + let fee = this.getServiceFee(Types.UserOperationType.OUTGOING_USER_TO_USER, amount, isAppUserPayment) + const toDecrement = amount + fee + const paymentEntry = await this.storage.paymentStorage.AddPendingUserToUserPayment(fromUserId, toUserId, amount, fee, linkedApplication, tx) + await this.storage.userStorage.DecrementUserBalance(fromUser.user_id, toDecrement, `${toUserId}:${paymentEntry.serial_id}`, tx) + await this.storage.userStorage.IncrementUserBalance(toUser.user_id, amount, `${fromUserId}:${paymentEntry.serial_id}`, tx) + await this.storage.paymentStorage.SetPendingUserToUserPaymentAsPaid(paymentEntry.serial_id, tx) + if (isAppUserPayment && fee > 0) { + await this.storage.userStorage.IncrementUserBalance(linkedApplication.owner.user_id, fee, 'fees', tx) + } + return paymentEntry + }) + const fromUser = await this.storage.userStorage.GetUser(fromUserId) + const toUser = await this.storage.userStorage.GetUser(toUserId) + this.storage.eventsLog.LogEvent({ type: 'u2u_sender', userId: fromUserId, appId: linkedApplication.app_id, appUserId: "", balance: fromUser.balance_sats, data: toUserId, amount: payment.paid_amount + payment.service_fees }) + this.storage.eventsLog.LogEvent({ type: 'u2u_receiver', userId: toUserId, appId: linkedApplication.app_id, appUserId: "", balance: toUser.balance_sats, data: fromUserId, amount: amount }) + return { amount: payment.paid_amount, fees: payment.service_fees } + } + + async CheckNewlyConfirmedTxs(height: number) { + const pending = await this.storage.paymentStorage.GetPendingTransactions() + let lowestHeight = height + const map: Record = {} + + const checkTx = (t: PendingTx) => { + if (t.tx.broadcast_height < lowestHeight) { lowestHeight = t.tx.broadcast_height } + map[t.tx.tx_hash] = t + } + pending.incoming.forEach(t => checkTx({ type: "incoming", tx: t })) + pending.outgoing.forEach(t => checkTx({ type: "outgoing", tx: t })) + const { transactions } = await this.lnd.GetTransactions(lowestHeight) + const newlyConfirmedTxs = transactions.map(tx => { + const { txHash, numConfirmations: confs, amount: amt } = tx + const t = map[txHash] + if (!t || confs === 0) { + return + } + if (confs > 2 || (amt <= confInTwo && confs > 1) || (amt <= confInOne && confs > 0)) { + return { ...t, confs } + } + }) + return newlyConfirmedTxs.filter(t => t !== undefined) as (PendingTx & { confs: number })[] + } + + async GetLndBalance() { + return this.lnd.GetBalance() + } + + encodeLnurl(base: string) { + if (!base || typeof base !== 'string') { + throw new Error("provided string for lnurl encode is not a string or is an empty string") + } + let words = bech32.toWords(Buffer.from(base, 'utf8')); + return bech32.encode('lnurl', words, 1023); + } +} + diff --git a/src/services/main/productManager.ts b/src/services/main/productManager.ts index 9cfe2169..38bacfc4 100644 --- a/src/services/main/productManager.ts +++ b/src/services/main/productManager.ts @@ -1,39 +1,39 @@ -import Storage from '../storage/index.js' -import * as Types from '../../../proto/autogenerated/ts/types.js' - - -import { MainSettings } from './settings.js' -import PaymentManager from './paymentManager.js' -import { defaultInvoiceExpiry } from '../storage/paymentStorage.js' - -export default class { - storage: Storage - settings: MainSettings - paymentManager: PaymentManager - - constructor(storage: Storage, paymentManager: PaymentManager, settings: MainSettings) { - this.storage = storage - this.settings = settings - this.paymentManager = paymentManager - } - - async AddProduct(userId: string, req: Types.AddProductRequest): Promise { - const user = await this.storage.userStorage.GetUser(userId) - const newProduct = await this.storage.productStorage.AddProduct(req.name, req.price_sats, user) - return { - id: newProduct.product_id, - name: newProduct.name, - price_sats: newProduct.price_sats, - } - } - - async NewProductInvoice(id: string): Promise { - const product = await this.storage.productStorage.GetProduct(id) - const productInvoice = await this.paymentManager.NewInvoice(product.owner.user_id, { - amountSats: product.price_sats, memo: product.name - }, { product, expiry: defaultInvoiceExpiry }) - return { - invoice: productInvoice.invoice - } - } +import Storage from '../storage/index.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' + + +import { MainSettings } from './settings.js' +import PaymentManager from './paymentManager.js' +import { defaultInvoiceExpiry } from '../storage/paymentStorage.js' + +export default class { + storage: Storage + settings: MainSettings + paymentManager: PaymentManager + + constructor(storage: Storage, paymentManager: PaymentManager, settings: MainSettings) { + this.storage = storage + this.settings = settings + this.paymentManager = paymentManager + } + + async AddProduct(userId: string, req: Types.AddProductRequest): Promise { + const user = await this.storage.userStorage.GetUser(userId) + const newProduct = await this.storage.productStorage.AddProduct(req.name, req.price_sats, user) + return { + id: newProduct.product_id, + name: newProduct.name, + price_sats: newProduct.price_sats, + } + } + + async NewProductInvoice(id: string): Promise { + const product = await this.storage.productStorage.GetProduct(id) + const productInvoice = await this.paymentManager.NewInvoice(product.owner.user_id, { + amountSats: product.price_sats, memo: product.name + }, { product, expiry: defaultInvoiceExpiry }) + return { + invoice: productInvoice.invoice + } + } } \ No newline at end of file diff --git a/src/services/main/sanityChecker.ts b/src/services/main/sanityChecker.ts index bdad7154..7b4c2477 100644 --- a/src/services/main/sanityChecker.ts +++ b/src/services/main/sanityChecker.ts @@ -1,268 +1,268 @@ -import Storage from '../storage/index.js' -import LND from "../lnd/lnd.js" -import { LoggedEvent } from '../storage/eventsLog.js' -import { Invoice, Payment } from '../../../proto/lnd/lightning'; -import { getLogger } from '../helpers/logger.js'; -const LN_INVOICE_REGEX = /^(lightning:)?(lnbc|lntb)[0-9a-zA-Z]+$/; -const BITCOIN_ADDRESS_REGEX = /^(bitcoin:)?([13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[a-zA-HJ-NP-Z0-9]{39,59})$/; -type UniqueDecrementReasons = 'ban' -type UniqueIncrementReasons = 'fees' | 'routing_fee_refund' | 'payment_refund' -type CommonReasons = 'invoice' | 'address' | 'u2u' -type Reason = UniqueDecrementReasons | UniqueIncrementReasons | CommonReasons -const incrementTwiceAllowed = ['fees', 'ban'] -export default class SanityChecker { - storage: Storage - lnd: LND - - events: LoggedEvent[] = [] - invoices: Invoice[] = [] - payments: Payment[] = [] - incrementSources: Record = {} - decrementSources: Record = {} - decrementEvents: Record = {} - log = getLogger({ component: "SanityChecker" }) - users: Record = {} - constructor(storage: Storage, lnd: LND) { - this.storage = storage - this.lnd = lnd - } - - parseDataField(data: string): { type: Reason, data: string, txHash?: string, serialId?: number } { - const parts = data.split(":") - if (parts.length === 1) { - const [fullData] = parts - if (fullData === 'fees' || fullData === 'ban') { - return { type: fullData, data: fullData } - } else if (LN_INVOICE_REGEX.test(fullData)) { - return { type: 'invoice', data: fullData } - } else if (BITCOIN_ADDRESS_REGEX.test(fullData)) { - return { type: 'address', data: fullData } - } else { - return { type: 'u2u', data: fullData } - } - } else if (parts.length === 2) { - const [prefix, data] = parts - if (prefix === 'routing_fee_refund' || prefix === 'payment_refund') { - return { type: prefix, data } - } else if (BITCOIN_ADDRESS_REGEX.test(prefix)) { - return { type: 'address', data: prefix, txHash: data } - } else { - return { type: 'u2u', data: prefix, serialId: +data } - } - } - throw new Error("unknown data format") - } - - async verifyDecrementEvent(e: LoggedEvent) { - if (this.decrementSources[e.data]) { - throw new Error("entry decremented more that once " + e.data) - } - this.decrementSources[e.data] = !incrementTwiceAllowed.includes(e.data) - this.users[e.userId] = this.checkUserEntry(e, this.users[e.userId]) - const parsed = this.parseDataField(e.data) - switch (parsed.type) { - case 'ban': - return - case 'address': - return this.validateUserTransactionPayment({ address: parsed.data, txHash: parsed.txHash, userId: e.userId }) - case 'invoice': - return this.validateUserInvoicePayment({ invoice: parsed.data, userId: e.userId, amt: e.amount }) - case 'u2u': - return this.validateUser2UserPayment({ fromUser: e.userId, toUser: parsed.data, serialId: parsed.serialId }) - default: - throw new Error("unknown decrement type " + parsed.type) - } - } - - async validateUserTransactionPayment({ address, txHash, userId }: { userId: string, address: string, txHash?: string }) { - if (!txHash) { - throw new Error("no tx hash provided to payment for address " + address) - } - const entry = await this.storage.paymentStorage.GetUserTransactionPaymentOwner(address, txHash) - if (!entry) { - throw new Error("no payment found for tx hash " + txHash) - } - if (entry.user.user_id !== userId) { - throw new Error("payment user id mismatch for tx hash " + txHash) - } - if (entry.paid_at_unix <= 0) { - throw new Error("payment not paid for tx hash " + txHash) - } - } - - async validateUserInvoicePayment({ invoice, userId, amt }: { userId: string, invoice: string, amt: number }) { - const entry = await this.storage.paymentStorage.GetPaymentOwner(invoice) - if (!entry) { - throw new Error("no payment found for invoice " + invoice) - } - if (entry.user.user_id !== userId) { - throw new Error("payment user id mismatch for invoice " + invoice) - } - if (entry.paid_at_unix === 0) { - throw new Error("payment never settled for invoice " + invoice) // TODO: check if this is correct - } - if (entry.paid_at_unix === -1) { - this.decrementEvents[invoice] = { userId, refund: amt, failure: true } - } else { - const refund = amt - (entry.paid_amount + entry.routing_fees + entry.service_fees) - this.decrementEvents[invoice] = { userId, refund, failure: false } - } - if (!entry.internal) { - const lndEntry = this.payments.find(i => i.paymentRequest === invoice) - if (!lndEntry) { - throw new Error("payment not found in lnd for invoice " + invoice) - } - } - } - - async validateUser2UserPayment({ fromUser, toUser, serialId }: { fromUser: string, toUser: string, serialId?: number }) { - if (!serialId) { - throw new Error("no serial id provided to u2u payment") - } - const entry = await this.storage.paymentStorage.GetUser2UserPayment(serialId) - if (!entry) { - throw new Error("no payment u2u found for serial id " + serialId) - } - if (entry.from_user.user_id !== fromUser || entry.to_user.user_id !== toUser) { - throw new Error("u2u payment user id mismatch for serial id " + serialId) - } - if (entry.paid_at_unix <= 0) { - throw new Error("payment not paid for serial id " + serialId) - } - } - - async verifyIncrementEvent(e: LoggedEvent) { - if (this.incrementSources[e.data]) { - throw new Error("entry incremented more that once " + e.data) - } - this.incrementSources[e.data] = !incrementTwiceAllowed.includes(e.data) - this.users[e.userId] = this.checkUserEntry(e, this.users[e.userId]) - const parsed = this.parseDataField(e.data) - switch (parsed.type) { - case 'fees': - return - case 'address': - return this.validateAddressReceivingTransaction({ address: parsed.data, txHash: parsed.txHash, userId: e.userId }) - case 'invoice': - return this.validateReceivingInvoice({ invoice: parsed.data, userId: e.userId }) - case 'u2u': - return this.validateUser2UserPayment({ fromUser: parsed.data, toUser: e.userId, serialId: parsed.serialId }) - case 'routing_fee_refund': - return this.validateRoutingFeeRefund({ amt: e.amount, invoice: parsed.data, userId: e.userId }) - case 'payment_refund': - return this.validatePaymentRefund({ amt: e.amount, invoice: parsed.data, userId: e.userId }) - default: - throw new Error("unknown increment type " + parsed.type) - } - } - - async validateAddressReceivingTransaction({ userId, address, txHash }: { userId: string, address: string, txHash?: string }) { - if (!txHash) { - throw new Error("no tx hash provided to address " + address) - } - const entry = await this.storage.paymentStorage.GetAddressReceivingTransactionOwner(address, txHash) - if (!entry) { - throw new Error("no tx found for tx hash " + txHash) - } - if (entry.user_address.user.user_id !== userId) { - throw new Error("tx user id mismatch for tx hash " + txHash) - } - if (entry.paid_at_unix <= 0) { - throw new Error("tx not paid for tx hash " + txHash) - } - } - - async validateReceivingInvoice({ userId, invoice }: { userId: string, invoice: string }) { - const entry = await this.storage.paymentStorage.GetInvoiceOwner(invoice) - if (!entry) { - throw new Error("no invoice found for invoice " + invoice) - } - if (entry.user.user_id !== userId) { - throw new Error("invoice user id mismatch for invoice " + invoice) - } - if (entry.paid_at_unix <= 0) { - throw new Error("invoice not paid for invoice " + invoice) - } - if (!entry.internal) { - const entry = this.invoices.find(i => i.paymentRequest === invoice) - if (!entry) { - throw new Error("invoice not found in lnd " + invoice) - } - } - } - - async validateRoutingFeeRefund({ amt, invoice, userId }: { userId: string, invoice: string, amt: number }) { - const entry = this.decrementEvents[invoice] - if (!entry) { - throw new Error("no decrement event found for invoice routing fee refound " + invoice) - } - if (entry.userId !== userId) { - throw new Error("user id mismatch for routing fee refund " + invoice) - } - if (entry.failure) { - throw new Error("payment failled, should not refund routing fees " + invoice) - } - if (entry.refund !== amt) { - throw new Error("refund amount mismatch for routing fee refund " + invoice) - } - } - - async validatePaymentRefund({ amt, invoice, userId }: { userId: string, invoice: string, amt: number }) { - const entry = this.decrementEvents[invoice] - if (!entry) { - throw new Error("no decrement event found for invoice payment refund " + invoice) - } - if (entry.userId !== userId) { - throw new Error("user id mismatch for payment refund " + invoice) - } - if (!entry.failure) { - throw new Error("payment did not fail, should not refund payment " + invoice) - } - if (entry.refund !== amt) { - throw new Error("refund amount mismatch for payment refund " + invoice) - } - } - - async VerifyEventsLog() { - this.events = await this.storage.eventsLog.GetAllLogs() - this.invoices = (await this.lnd.GetAllPaidInvoices(1000)).invoices - this.payments = (await this.lnd.GetAllPayments(1000)).payments - this.incrementSources = {} - this.decrementSources = {} - this.users = {} - this.users = {} - this.decrementEvents = {} - for (let i = 0; i < this.events.length; i++) { - const e = this.events[i] - if (e.type === 'balance_decrement') { - await this.verifyDecrementEvent(e) - } else if (e.type === 'balance_increment') { - await this.verifyIncrementEvent(e) - } else { - await this.storage.paymentStorage.VerifyDbEvent(e) - } - } - await Promise.all(Object.entries(this.users).map(async ([userId, u]) => { - const user = await this.storage.userStorage.GetUser(userId) - if (user.balance_sats !== u.updatedBalance) { - throw new Error("sanity check on balance failed, expected: " + u.updatedBalance + " found: " + user.balance_sats) - } - })) - } - - checkUserEntry(e: LoggedEvent, u: { ts: number, updatedBalance: number } | undefined) { - const newEntry = { ts: e.timestampMs, updatedBalance: e.balance + e.amount * (e.type === 'balance_decrement' ? -1 : 1) } - if (!u) { - this.log(e.userId, "balance starts at", e.balance, "sats and moves by", e.amount * (e.type === 'balance_decrement' ? -1 : 1), "sats, resulting in", newEntry.updatedBalance, "sats") - return newEntry - } - if (e.timestampMs < u.ts) { - throw new Error("entry out of order " + e.timestampMs + " " + u.ts) - } - if (e.balance !== u.updatedBalance) { - throw new Error("inconsistent balance update got: " + e.balance + " expected " + u.updatedBalance) - } - this.log(e.userId, "balance updates from", e.balance, "sats and moves by", e.amount * (e.type === 'balance_decrement' ? -1 : 1), "sats, resulting in", newEntry.updatedBalance, "sats") - return newEntry - } +import Storage from '../storage/index.js' +import LND from "../lnd/lnd.js" +import { LoggedEvent } from '../storage/eventsLog.js' +import { Invoice, Payment } from '../../../proto/lnd/lightning'; +import { getLogger } from '../helpers/logger.js'; +const LN_INVOICE_REGEX = /^(lightning:)?(lnbc|lntb)[0-9a-zA-Z]+$/; +const BITCOIN_ADDRESS_REGEX = /^(bitcoin:)?([13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[a-zA-HJ-NP-Z0-9]{39,59})$/; +type UniqueDecrementReasons = 'ban' +type UniqueIncrementReasons = 'fees' | 'routing_fee_refund' | 'payment_refund' +type CommonReasons = 'invoice' | 'address' | 'u2u' +type Reason = UniqueDecrementReasons | UniqueIncrementReasons | CommonReasons +const incrementTwiceAllowed = ['fees', 'ban'] +export default class SanityChecker { + storage: Storage + lnd: LND + + events: LoggedEvent[] = [] + invoices: Invoice[] = [] + payments: Payment[] = [] + incrementSources: Record = {} + decrementSources: Record = {} + decrementEvents: Record = {} + log = getLogger({ component: "SanityChecker" }) + users: Record = {} + constructor(storage: Storage, lnd: LND) { + this.storage = storage + this.lnd = lnd + } + + parseDataField(data: string): { type: Reason, data: string, txHash?: string, serialId?: number } { + const parts = data.split(":") + if (parts.length === 1) { + const [fullData] = parts + if (fullData === 'fees' || fullData === 'ban') { + return { type: fullData, data: fullData } + } else if (LN_INVOICE_REGEX.test(fullData)) { + return { type: 'invoice', data: fullData } + } else if (BITCOIN_ADDRESS_REGEX.test(fullData)) { + return { type: 'address', data: fullData } + } else { + return { type: 'u2u', data: fullData } + } + } else if (parts.length === 2) { + const [prefix, data] = parts + if (prefix === 'routing_fee_refund' || prefix === 'payment_refund') { + return { type: prefix, data } + } else if (BITCOIN_ADDRESS_REGEX.test(prefix)) { + return { type: 'address', data: prefix, txHash: data } + } else { + return { type: 'u2u', data: prefix, serialId: +data } + } + } + throw new Error("unknown data format") + } + + async verifyDecrementEvent(e: LoggedEvent) { + if (this.decrementSources[e.data]) { + throw new Error("entry decremented more that once " + e.data) + } + this.decrementSources[e.data] = !incrementTwiceAllowed.includes(e.data) + this.users[e.userId] = this.checkUserEntry(e, this.users[e.userId]) + const parsed = this.parseDataField(e.data) + switch (parsed.type) { + case 'ban': + return + case 'address': + return this.validateUserTransactionPayment({ address: parsed.data, txHash: parsed.txHash, userId: e.userId }) + case 'invoice': + return this.validateUserInvoicePayment({ invoice: parsed.data, userId: e.userId, amt: e.amount }) + case 'u2u': + return this.validateUser2UserPayment({ fromUser: e.userId, toUser: parsed.data, serialId: parsed.serialId }) + default: + throw new Error("unknown decrement type " + parsed.type) + } + } + + async validateUserTransactionPayment({ address, txHash, userId }: { userId: string, address: string, txHash?: string }) { + if (!txHash) { + throw new Error("no tx hash provided to payment for address " + address) + } + const entry = await this.storage.paymentStorage.GetUserTransactionPaymentOwner(address, txHash) + if (!entry) { + throw new Error("no payment found for tx hash " + txHash) + } + if (entry.user.user_id !== userId) { + throw new Error("payment user id mismatch for tx hash " + txHash) + } + if (entry.paid_at_unix <= 0) { + throw new Error("payment not paid for tx hash " + txHash) + } + } + + async validateUserInvoicePayment({ invoice, userId, amt }: { userId: string, invoice: string, amt: number }) { + const entry = await this.storage.paymentStorage.GetPaymentOwner(invoice) + if (!entry) { + throw new Error("no payment found for invoice " + invoice) + } + if (entry.user.user_id !== userId) { + throw new Error("payment user id mismatch for invoice " + invoice) + } + if (entry.paid_at_unix === 0) { + throw new Error("payment never settled for invoice " + invoice) // TODO: check if this is correct + } + if (entry.paid_at_unix === -1) { + this.decrementEvents[invoice] = { userId, refund: amt, failure: true } + } else { + const refund = amt - (entry.paid_amount + entry.routing_fees + entry.service_fees) + this.decrementEvents[invoice] = { userId, refund, failure: false } + } + if (!entry.internal) { + const lndEntry = this.payments.find(i => i.paymentRequest === invoice) + if (!lndEntry) { + throw new Error("payment not found in lnd for invoice " + invoice) + } + } + } + + async validateUser2UserPayment({ fromUser, toUser, serialId }: { fromUser: string, toUser: string, serialId?: number }) { + if (!serialId) { + throw new Error("no serial id provided to u2u payment") + } + const entry = await this.storage.paymentStorage.GetUser2UserPayment(serialId) + if (!entry) { + throw new Error("no payment u2u found for serial id " + serialId) + } + if (entry.from_user.user_id !== fromUser || entry.to_user.user_id !== toUser) { + throw new Error("u2u payment user id mismatch for serial id " + serialId) + } + if (entry.paid_at_unix <= 0) { + throw new Error("payment not paid for serial id " + serialId) + } + } + + async verifyIncrementEvent(e: LoggedEvent) { + if (this.incrementSources[e.data]) { + throw new Error("entry incremented more that once " + e.data) + } + this.incrementSources[e.data] = !incrementTwiceAllowed.includes(e.data) + this.users[e.userId] = this.checkUserEntry(e, this.users[e.userId]) + const parsed = this.parseDataField(e.data) + switch (parsed.type) { + case 'fees': + return + case 'address': + return this.validateAddressReceivingTransaction({ address: parsed.data, txHash: parsed.txHash, userId: e.userId }) + case 'invoice': + return this.validateReceivingInvoice({ invoice: parsed.data, userId: e.userId }) + case 'u2u': + return this.validateUser2UserPayment({ fromUser: parsed.data, toUser: e.userId, serialId: parsed.serialId }) + case 'routing_fee_refund': + return this.validateRoutingFeeRefund({ amt: e.amount, invoice: parsed.data, userId: e.userId }) + case 'payment_refund': + return this.validatePaymentRefund({ amt: e.amount, invoice: parsed.data, userId: e.userId }) + default: + throw new Error("unknown increment type " + parsed.type) + } + } + + async validateAddressReceivingTransaction({ userId, address, txHash }: { userId: string, address: string, txHash?: string }) { + if (!txHash) { + throw new Error("no tx hash provided to address " + address) + } + const entry = await this.storage.paymentStorage.GetAddressReceivingTransactionOwner(address, txHash) + if (!entry) { + throw new Error("no tx found for tx hash " + txHash) + } + if (entry.user_address.user.user_id !== userId) { + throw new Error("tx user id mismatch for tx hash " + txHash) + } + if (entry.paid_at_unix <= 0) { + throw new Error("tx not paid for tx hash " + txHash) + } + } + + async validateReceivingInvoice({ userId, invoice }: { userId: string, invoice: string }) { + const entry = await this.storage.paymentStorage.GetInvoiceOwner(invoice) + if (!entry) { + throw new Error("no invoice found for invoice " + invoice) + } + if (entry.user.user_id !== userId) { + throw new Error("invoice user id mismatch for invoice " + invoice) + } + if (entry.paid_at_unix <= 0) { + throw new Error("invoice not paid for invoice " + invoice) + } + if (!entry.internal) { + const entry = this.invoices.find(i => i.paymentRequest === invoice) + if (!entry) { + throw new Error("invoice not found in lnd " + invoice) + } + } + } + + async validateRoutingFeeRefund({ amt, invoice, userId }: { userId: string, invoice: string, amt: number }) { + const entry = this.decrementEvents[invoice] + if (!entry) { + throw new Error("no decrement event found for invoice routing fee refound " + invoice) + } + if (entry.userId !== userId) { + throw new Error("user id mismatch for routing fee refund " + invoice) + } + if (entry.failure) { + throw new Error("payment failled, should not refund routing fees " + invoice) + } + if (entry.refund !== amt) { + throw new Error("refund amount mismatch for routing fee refund " + invoice) + } + } + + async validatePaymentRefund({ amt, invoice, userId }: { userId: string, invoice: string, amt: number }) { + const entry = this.decrementEvents[invoice] + if (!entry) { + throw new Error("no decrement event found for invoice payment refund " + invoice) + } + if (entry.userId !== userId) { + throw new Error("user id mismatch for payment refund " + invoice) + } + if (!entry.failure) { + throw new Error("payment did not fail, should not refund payment " + invoice) + } + if (entry.refund !== amt) { + throw new Error("refund amount mismatch for payment refund " + invoice) + } + } + + async VerifyEventsLog() { + this.events = await this.storage.eventsLog.GetAllLogs() + this.invoices = (await this.lnd.GetAllPaidInvoices(1000)).invoices + this.payments = (await this.lnd.GetAllPayments(1000)).payments + this.incrementSources = {} + this.decrementSources = {} + this.users = {} + this.users = {} + this.decrementEvents = {} + for (let i = 0; i < this.events.length; i++) { + const e = this.events[i] + if (e.type === 'balance_decrement') { + await this.verifyDecrementEvent(e) + } else if (e.type === 'balance_increment') { + await this.verifyIncrementEvent(e) + } else { + await this.storage.paymentStorage.VerifyDbEvent(e) + } + } + await Promise.all(Object.entries(this.users).map(async ([userId, u]) => { + const user = await this.storage.userStorage.GetUser(userId) + if (user.balance_sats !== u.updatedBalance) { + throw new Error("sanity check on balance failed, expected: " + u.updatedBalance + " found: " + user.balance_sats) + } + })) + } + + checkUserEntry(e: LoggedEvent, u: { ts: number, updatedBalance: number } | undefined) { + const newEntry = { ts: e.timestampMs, updatedBalance: e.balance + e.amount * (e.type === 'balance_decrement' ? -1 : 1) } + if (!u) { + this.log(e.userId, "balance starts at", e.balance, "sats and moves by", e.amount * (e.type === 'balance_decrement' ? -1 : 1), "sats, resulting in", newEntry.updatedBalance, "sats") + return newEntry + } + if (e.timestampMs < u.ts) { + throw new Error("entry out of order " + e.timestampMs + " " + u.ts) + } + if (e.balance !== u.updatedBalance) { + throw new Error("inconsistent balance update got: " + e.balance + " expected " + u.updatedBalance) + } + this.log(e.userId, "balance updates from", e.balance, "sats and moves by", e.amount * (e.type === 'balance_decrement' ? -1 : 1), "sats, resulting in", newEntry.updatedBalance, "sats") + return newEntry + } } \ No newline at end of file diff --git a/src/services/main/settings.ts b/src/services/main/settings.ts index d692c54f..368e9206 100644 --- a/src/services/main/settings.ts +++ b/src/services/main/settings.ts @@ -1,106 +1,106 @@ -import { LoadStorageSettingsFromEnv, StorageSettings } from '../storage/index.js' -import { LndSettings, NodeSettings } from '../lnd/settings.js' -import { LoadWatchdogSettingsFromEnv, WatchdogSettings } from './watchdog.js' -import { LoadLndSettingsFromEnv } from '../lnd/index.js' -import { EnvCanBeInteger, EnvMustBeInteger, EnvMustBeNonEmptyString } from '../helpers/envParser.js' -import { getLogger } from '../helpers/logger.js' -import fs from 'fs' -import crypto from 'crypto'; -export type MainSettings = { - storageSettings: StorageSettings, - lndSettings: LndSettings, - watchDogSettings: WatchdogSettings, - jwtSecret: string - incomingTxFee: number - outgoingTxFee: number - incomingAppInvoiceFee: number - incomingAppUserInvoiceFee: number - outgoingAppInvoiceFee: number - outgoingAppUserInvoiceFee: number - userToUserFee: number - appToUserFee: number - serviceUrl: string - servicePort: number - recordPerformance: boolean - skipSanityCheck: boolean - disableExternalPayments: boolean -} -export type BitcoinCoreSettings = { - port: number - user: string - pass: string -} -export type TestSettings = MainSettings & { lndSettings: { otherNode: NodeSettings, thirdNode: NodeSettings, fourthNode: NodeSettings }, bitcoinCoreSettings: BitcoinCoreSettings } -export const LoadMainSettingsFromEnv = (): MainSettings => { - return { - watchDogSettings: LoadWatchdogSettingsFromEnv(), - lndSettings: LoadLndSettingsFromEnv(), - storageSettings: LoadStorageSettingsFromEnv(), - jwtSecret: loadJwtSecret(), - incomingTxFee: EnvCanBeInteger("INCOMING_CHAIN_FEE_ROOT_BPS", 0) / 10000, - outgoingTxFee: EnvCanBeInteger("OUTGOING_CHAIN_FEE_ROOT_BPS", 60) / 10000, - incomingAppInvoiceFee: EnvCanBeInteger("INCOMING_INVOICE_FEE_ROOT_BPS", 0) / 10000, - outgoingAppInvoiceFee: EnvCanBeInteger("OUTGOING_INVOICE_FEE_ROOT_BPS", 60) / 10000, - incomingAppUserInvoiceFee: EnvCanBeInteger("INCOMING_INVOICE_FEE_USER_BPS", 0) / 10000, - outgoingAppUserInvoiceFee: EnvCanBeInteger("OUTGOING_INVOICE_FEE_USER_BPS", 0) / 10000, - userToUserFee: EnvCanBeInteger("TX_FEE_INTERNAL_USER_BPS", 0) / 10000, - appToUserFee: EnvCanBeInteger("TX_FEE_INTERNAL_ROOT_BPS", 0) / 10000, - serviceUrl: process.env.SERVICE_URL || `http://localhost:${EnvCanBeInteger("PORT", 1776)}`, - servicePort: EnvCanBeInteger("PORT", 1776), - recordPerformance: process.env.RECORD_PERFORMANCE === 'true' || false, - skipSanityCheck: process.env.SKIP_SANITY_CHECK === 'true' || false, - disableExternalPayments: process.env.DISABLE_EXTERNAL_PAYMENTS === 'true' || false, - } -} - -export const LoadTestSettingsFromEnv = (): TestSettings => { - const eventLogPath = `logs/eventLogV2Test${Date.now()}.csv` - const settings = LoadMainSettingsFromEnv() - return { - ...settings, - storageSettings: { dbSettings: { ...settings.storageSettings.dbSettings, databaseFile: ":memory:", metricsDatabaseFile: ":memory:" }, eventLogPath }, - lndSettings: { - ...settings.lndSettings, - otherNode: { - lndAddr: EnvMustBeNonEmptyString("LND_OTHER_ADDR"), - lndCertPath: EnvMustBeNonEmptyString("LND_OTHER_CERT_PATH"), - lndMacaroonPath: EnvMustBeNonEmptyString("LND_OTHER_MACAROON_PATH") - }, - thirdNode: { - lndAddr: EnvMustBeNonEmptyString("LND_THIRD_ADDR"), - lndCertPath: EnvMustBeNonEmptyString("LND_THIRD_CERT_PATH"), - lndMacaroonPath: EnvMustBeNonEmptyString("LND_THIRD_MACAROON_PATH") - }, - fourthNode: { - lndAddr: EnvMustBeNonEmptyString("LND_FOURTH_ADDR"), - lndCertPath: EnvMustBeNonEmptyString("LND_FOURTH_CERT_PATH"), - lndMacaroonPath: EnvMustBeNonEmptyString("LND_FOURTH_MACAROON_PATH") - }, - liquidityProviderPub: "" - }, - skipSanityCheck: true, - bitcoinCoreSettings: { - port: EnvMustBeInteger("BITCOIN_CORE_PORT"), - user: EnvMustBeNonEmptyString("BITCOIN_CORE_USER"), - pass: EnvMustBeNonEmptyString("BITCOIN_CORE_PASS") - }, - } -} - -export const loadJwtSecret = (): string => { - const secret = process.env["JWT_SECRET"] - const log = getLogger({}) - if (secret) { - return secret - } - log("JWT_SECRET not set in env, checking .jwt_secret file") - try { - const fileContent = fs.readFileSync(".jwt_secret", "utf-8") - return fileContent.trim() - } catch (e) { - log(".jwt_secret file not found, generating random secret") - const secret = crypto.randomBytes(32).toString('hex') - fs.writeFileSync(".jwt_secret", secret) - return secret - } +import { LoadStorageSettingsFromEnv, StorageSettings } from '../storage/index.js' +import { LndSettings, NodeSettings } from '../lnd/settings.js' +import { LoadWatchdogSettingsFromEnv, WatchdogSettings } from './watchdog.js' +import { LoadLndSettingsFromEnv } from '../lnd/index.js' +import { EnvCanBeInteger, EnvMustBeInteger, EnvMustBeNonEmptyString } from '../helpers/envParser.js' +import { getLogger } from '../helpers/logger.js' +import fs from 'fs' +import crypto from 'crypto'; +export type MainSettings = { + storageSettings: StorageSettings, + lndSettings: LndSettings, + watchDogSettings: WatchdogSettings, + jwtSecret: string + incomingTxFee: number + outgoingTxFee: number + incomingAppInvoiceFee: number + incomingAppUserInvoiceFee: number + outgoingAppInvoiceFee: number + outgoingAppUserInvoiceFee: number + userToUserFee: number + appToUserFee: number + serviceUrl: string + servicePort: number + recordPerformance: boolean + skipSanityCheck: boolean + disableExternalPayments: boolean +} +export type BitcoinCoreSettings = { + port: number + user: string + pass: string +} +export type TestSettings = MainSettings & { lndSettings: { otherNode: NodeSettings, thirdNode: NodeSettings, fourthNode: NodeSettings }, bitcoinCoreSettings: BitcoinCoreSettings } +export const LoadMainSettingsFromEnv = (): MainSettings => { + return { + watchDogSettings: LoadWatchdogSettingsFromEnv(), + lndSettings: LoadLndSettingsFromEnv(), + storageSettings: LoadStorageSettingsFromEnv(), + jwtSecret: loadJwtSecret(), + incomingTxFee: EnvCanBeInteger("INCOMING_CHAIN_FEE_ROOT_BPS", 0) / 10000, + outgoingTxFee: EnvCanBeInteger("OUTGOING_CHAIN_FEE_ROOT_BPS", 60) / 10000, + incomingAppInvoiceFee: EnvCanBeInteger("INCOMING_INVOICE_FEE_ROOT_BPS", 0) / 10000, + outgoingAppInvoiceFee: EnvCanBeInteger("OUTGOING_INVOICE_FEE_ROOT_BPS", 60) / 10000, + incomingAppUserInvoiceFee: EnvCanBeInteger("INCOMING_INVOICE_FEE_USER_BPS", 0) / 10000, + outgoingAppUserInvoiceFee: EnvCanBeInteger("OUTGOING_INVOICE_FEE_USER_BPS", 0) / 10000, + userToUserFee: EnvCanBeInteger("TX_FEE_INTERNAL_USER_BPS", 0) / 10000, + appToUserFee: EnvCanBeInteger("TX_FEE_INTERNAL_ROOT_BPS", 0) / 10000, + serviceUrl: process.env.SERVICE_URL || `http://localhost:${EnvCanBeInteger("PORT", 1776)}`, + servicePort: EnvCanBeInteger("PORT", 1776), + recordPerformance: process.env.RECORD_PERFORMANCE === 'true' || false, + skipSanityCheck: process.env.SKIP_SANITY_CHECK === 'true' || false, + disableExternalPayments: process.env.DISABLE_EXTERNAL_PAYMENTS === 'true' || false, + } +} + +export const LoadTestSettingsFromEnv = (): TestSettings => { + const eventLogPath = `logs/eventLogV2Test${Date.now()}.csv` + const settings = LoadMainSettingsFromEnv() + return { + ...settings, + storageSettings: { dbSettings: { ...settings.storageSettings.dbSettings, databaseFile: ":memory:", metricsDatabaseFile: ":memory:" }, eventLogPath }, + lndSettings: { + ...settings.lndSettings, + otherNode: { + lndAddr: EnvMustBeNonEmptyString("LND_OTHER_ADDR"), + lndCertPath: EnvMustBeNonEmptyString("LND_OTHER_CERT_PATH"), + lndMacaroonPath: EnvMustBeNonEmptyString("LND_OTHER_MACAROON_PATH") + }, + thirdNode: { + lndAddr: EnvMustBeNonEmptyString("LND_THIRD_ADDR"), + lndCertPath: EnvMustBeNonEmptyString("LND_THIRD_CERT_PATH"), + lndMacaroonPath: EnvMustBeNonEmptyString("LND_THIRD_MACAROON_PATH") + }, + fourthNode: { + lndAddr: EnvMustBeNonEmptyString("LND_FOURTH_ADDR"), + lndCertPath: EnvMustBeNonEmptyString("LND_FOURTH_CERT_PATH"), + lndMacaroonPath: EnvMustBeNonEmptyString("LND_FOURTH_MACAROON_PATH") + }, + liquidityProviderPub: "" + }, + skipSanityCheck: true, + bitcoinCoreSettings: { + port: EnvMustBeInteger("BITCOIN_CORE_PORT"), + user: EnvMustBeNonEmptyString("BITCOIN_CORE_USER"), + pass: EnvMustBeNonEmptyString("BITCOIN_CORE_PASS") + }, + } +} + +export const loadJwtSecret = (): string => { + const secret = process.env["JWT_SECRET"] + const log = getLogger({}) + if (secret) { + return secret + } + log("JWT_SECRET not set in env, checking .jwt_secret file") + try { + const fileContent = fs.readFileSync(".jwt_secret", "utf-8") + return fileContent.trim() + } catch (e) { + log(".jwt_secret file not found, generating random secret") + const secret = crypto.randomBytes(32).toString('hex') + fs.writeFileSync(".jwt_secret", secret) + return secret + } } \ No newline at end of file diff --git a/src/services/main/watchdog.ts b/src/services/main/watchdog.ts index 257e2614..7d38940f 100644 --- a/src/services/main/watchdog.ts +++ b/src/services/main/watchdog.ts @@ -1,179 +1,179 @@ -import { EnvCanBeInteger } from "../helpers/envParser.js"; -import FunctionQueue from "../helpers/functionQueue.js"; -import { getLogger } from "../helpers/logger.js"; -import LND from "../lnd/lnd.js"; -import { ChannelBalance } from "../lnd/settings.js"; -import Storage from '../storage/index.js' -export type WatchdogSettings = { - maxDiffSats: number -} -export const LoadWatchdogSettingsFromEnv = (test = false): WatchdogSettings => { - return { - maxDiffSats: EnvCanBeInteger("WATCHDOG_MAX_DIFF_SATS") - } -} -export class Watchdog { - queue: FunctionQueue - initialLndBalance: number; - initialUsersBalance: number; - startedAtUnix: number; - latestIndexOffset: number; - accumulatedHtlcFees: number; - lnd: LND; - settings: WatchdogSettings; - storage: Storage; - latestCheckStart = 0 - log = getLogger({ component: "watchdog" }) - ready = false - interval: NodeJS.Timer; - constructor(settings: WatchdogSettings, lnd: LND, storage: Storage) { - this.lnd = lnd; - this.settings = settings; - this.storage = storage; - this.queue = new FunctionQueue("watchdog_queue", () => this.StartCheck()) - } - - Stop() { - if (this.interval) { - clearInterval(this.interval) - } - } - - Start = async () => { - this.startedAtUnix = Math.floor(Date.now() / 1000) - const totalUsersBalance = await this.storage.paymentStorage.GetTotalUsersBalance() - this.initialLndBalance = await this.getTotalLndBalance(totalUsersBalance) - this.initialUsersBalance = totalUsersBalance - const fwEvents = await this.lnd.GetForwardingHistory(0, this.startedAtUnix) - this.latestIndexOffset = fwEvents.lastOffsetIndex - this.accumulatedHtlcFees = 0 - - this.interval = setInterval(() => { - if (this.latestCheckStart + (1000 * 60) < Date.now()) { - this.log("No balance check was made in the last minute, checking now") - this.PaymentRequested() - } - }, 1000 * 60) - - this.ready = true - } - - updateAccumulatedHtlcFees = async () => { - const fwEvents = await this.lnd.GetForwardingHistory(this.latestIndexOffset, this.startedAtUnix) - this.latestIndexOffset = fwEvents.lastOffsetIndex - fwEvents.forwardingEvents.forEach((event) => { - this.accumulatedHtlcFees += Number(event.fee) - }) - - } - - - - getTotalLndBalance = async (usersTotal: number) => { - const walletBalance = await this.lnd.GetWalletBalance() - this.log(Number(walletBalance.confirmedBalance), "sats in chain wallet") - const channelsBalance = await this.lnd.GetChannelBalance() - getLogger({ component: "debugLndBalancev3" })({ w: walletBalance, c: channelsBalance, u: usersTotal, f: this.accumulatedHtlcFees }) - const totalLightningBalanceMsats = (channelsBalance.localBalance?.msat || 0n) + (channelsBalance.unsettledLocalBalance?.msat || 0n) - const totalLightningBalance = Math.ceil(Number(totalLightningBalanceMsats) / 1000) - return Number(walletBalance.confirmedBalance) + totalLightningBalance - } - - checkBalanceUpdate = (deltaLnd: number, deltaUsers: number) => { - this.log("LND balance update:", deltaLnd, "sats since app startup") - this.log("Users balance update:", deltaUsers, "sats since app startup") - - const result = this.checkDeltas(deltaLnd, deltaUsers) - switch (result.type) { - case 'mismatch': - if (deltaLnd < 0) { - this.log("WARNING! LND balance decreased while users balance increased creating a difference of", result.absoluteDiff, "sats") - if (result.absoluteDiff > this.settings.maxDiffSats) { - this.log("Difference is too big for an update, locking outgoing operations") - return true - } - } else { - this.log("LND balance increased while users balance decreased creating a difference of", result.absoluteDiff, "sats, could be caused by data loss, or liquidity injection") - return false - } - break - case 'negative': - if (Math.abs(deltaLnd) > Math.abs(deltaUsers)) { - this.log("WARNING! LND balance decreased more than users balance with a difference of", result.absoluteDiff, "sats") - if (result.absoluteDiff > this.settings.maxDiffSats) { - this.log("Difference is too big for an update, locking outgoing operations") - return true - } - } else if (deltaLnd === deltaUsers) { - this.log("LND and users balance went both DOWN consistently") - return false - } else { - this.log("LND balance decreased less than users balance with a difference of", result.absoluteDiff, "sats, could be caused by data loss, or liquidity injection") - return false - } - break - case 'positive': - if (deltaLnd < deltaUsers) { - this.log("WARNING! LND balance increased less than users balance with a difference of", result.absoluteDiff, "sats") - if (result.absoluteDiff > this.settings.maxDiffSats) { - this.log("Difference is too big for an update, locking outgoing operations") - return true - } - } else if (deltaLnd === deltaUsers) { - this.log("LND and users balance went both UP consistently") - return false - } else { - this.log("LND balance increased more than users balance with a difference of", result.absoluteDiff, "sats, could be caused by data loss, or liquidity injection") - return false - } - } - return false - } - - StartCheck = async () => { - this.latestCheckStart = Date.now() - await this.updateAccumulatedHtlcFees() - const totalUsersBalance = await this.storage.paymentStorage.GetTotalUsersBalance() - const totalLndBalance = await this.getTotalLndBalance(totalUsersBalance) - const deltaLnd = totalLndBalance - (this.initialLndBalance + this.accumulatedHtlcFees) - const deltaUsers = totalUsersBalance - this.initialUsersBalance - const deny = this.checkBalanceUpdate(deltaLnd, deltaUsers) - if (deny) { - this.log("Balance mismatch detected in absolute update, locking outgoing operations") - this.lnd.LockOutgoingOperations() - return - } - this.lnd.UnlockOutgoingOperations() - } - - PaymentRequested = async () => { - this.log("Payment requested, checking balance") - if (!this.ready) { - throw new Error("Watchdog not ready") - } - return new Promise((res, rej) => { - this.queue.Run({ res, rej }) - }) - } - - checkDeltas = (deltaLnd: number, deltaUsers: number): DeltaCheckResult => { - if (deltaLnd < 0) { - if (deltaUsers < 0) { - const diff = Math.abs(deltaLnd - deltaUsers) - return { type: 'negative', absoluteDiff: diff, relativeDiff: diff / Math.max(deltaLnd, deltaUsers) } - } else { - const diff = Math.abs(deltaLnd) + deltaUsers - return { type: 'mismatch', absoluteDiff: diff } - } - } else { - if (deltaUsers < 0) { - const diff = deltaLnd + Math.abs(deltaUsers) - return { type: 'mismatch', absoluteDiff: diff } - } else { - const diff = Math.abs(deltaLnd - deltaUsers) - return { type: 'positive', absoluteDiff: diff, relativeDiff: diff / Math.max(deltaLnd, deltaUsers) } - } - } - } -} +import { EnvCanBeInteger } from "../helpers/envParser.js"; +import FunctionQueue from "../helpers/functionQueue.js"; +import { getLogger } from "../helpers/logger.js"; +import LND from "../lnd/lnd.js"; +import { ChannelBalance } from "../lnd/settings.js"; +import Storage from '../storage/index.js' +export type WatchdogSettings = { + maxDiffSats: number +} +export const LoadWatchdogSettingsFromEnv = (test = false): WatchdogSettings => { + return { + maxDiffSats: EnvCanBeInteger("WATCHDOG_MAX_DIFF_SATS") + } +} +export class Watchdog { + queue: FunctionQueue + initialLndBalance: number; + initialUsersBalance: number; + startedAtUnix: number; + latestIndexOffset: number; + accumulatedHtlcFees: number; + lnd: LND; + settings: WatchdogSettings; + storage: Storage; + latestCheckStart = 0 + log = getLogger({ component: "watchdog" }) + ready = false + interval: NodeJS.Timer; + constructor(settings: WatchdogSettings, lnd: LND, storage: Storage) { + this.lnd = lnd; + this.settings = settings; + this.storage = storage; + this.queue = new FunctionQueue("watchdog_queue", () => this.StartCheck()) + } + + Stop() { + if (this.interval) { + clearInterval(this.interval) + } + } + + Start = async () => { + this.startedAtUnix = Math.floor(Date.now() / 1000) + const totalUsersBalance = await this.storage.paymentStorage.GetTotalUsersBalance() + this.initialLndBalance = await this.getTotalLndBalance(totalUsersBalance) + this.initialUsersBalance = totalUsersBalance + const fwEvents = await this.lnd.GetForwardingHistory(0, this.startedAtUnix) + this.latestIndexOffset = fwEvents.lastOffsetIndex + this.accumulatedHtlcFees = 0 + + this.interval = setInterval(() => { + if (this.latestCheckStart + (1000 * 60) < Date.now()) { + this.log("No balance check was made in the last minute, checking now") + this.PaymentRequested() + } + }, 1000 * 60) + + this.ready = true + } + + updateAccumulatedHtlcFees = async () => { + const fwEvents = await this.lnd.GetForwardingHistory(this.latestIndexOffset, this.startedAtUnix) + this.latestIndexOffset = fwEvents.lastOffsetIndex + fwEvents.forwardingEvents.forEach((event) => { + this.accumulatedHtlcFees += Number(event.fee) + }) + + } + + + + getTotalLndBalance = async (usersTotal: number) => { + const walletBalance = await this.lnd.GetWalletBalance() + this.log(Number(walletBalance.confirmedBalance), "sats in chain wallet") + const channelsBalance = await this.lnd.GetChannelBalance() + getLogger({ component: "debugLndBalancev3" })({ w: walletBalance, c: channelsBalance, u: usersTotal, f: this.accumulatedHtlcFees }) + const totalLightningBalanceMsats = (channelsBalance.localBalance?.msat || 0n) + (channelsBalance.unsettledLocalBalance?.msat || 0n) + const totalLightningBalance = Math.ceil(Number(totalLightningBalanceMsats) / 1000) + return Number(walletBalance.confirmedBalance) + totalLightningBalance + } + + checkBalanceUpdate = (deltaLnd: number, deltaUsers: number) => { + this.log("LND balance update:", deltaLnd, "sats since app startup") + this.log("Users balance update:", deltaUsers, "sats since app startup") + + const result = this.checkDeltas(deltaLnd, deltaUsers) + switch (result.type) { + case 'mismatch': + if (deltaLnd < 0) { + this.log("WARNING! LND balance decreased while users balance increased creating a difference of", result.absoluteDiff, "sats") + if (result.absoluteDiff > this.settings.maxDiffSats) { + this.log("Difference is too big for an update, locking outgoing operations") + return true + } + } else { + this.log("LND balance increased while users balance decreased creating a difference of", result.absoluteDiff, "sats, could be caused by data loss, or liquidity injection") + return false + } + break + case 'negative': + if (Math.abs(deltaLnd) > Math.abs(deltaUsers)) { + this.log("WARNING! LND balance decreased more than users balance with a difference of", result.absoluteDiff, "sats") + if (result.absoluteDiff > this.settings.maxDiffSats) { + this.log("Difference is too big for an update, locking outgoing operations") + return true + } + } else if (deltaLnd === deltaUsers) { + this.log("LND and users balance went both DOWN consistently") + return false + } else { + this.log("LND balance decreased less than users balance with a difference of", result.absoluteDiff, "sats, could be caused by data loss, or liquidity injection") + return false + } + break + case 'positive': + if (deltaLnd < deltaUsers) { + this.log("WARNING! LND balance increased less than users balance with a difference of", result.absoluteDiff, "sats") + if (result.absoluteDiff > this.settings.maxDiffSats) { + this.log("Difference is too big for an update, locking outgoing operations") + return true + } + } else if (deltaLnd === deltaUsers) { + this.log("LND and users balance went both UP consistently") + return false + } else { + this.log("LND balance increased more than users balance with a difference of", result.absoluteDiff, "sats, could be caused by data loss, or liquidity injection") + return false + } + } + return false + } + + StartCheck = async () => { + this.latestCheckStart = Date.now() + await this.updateAccumulatedHtlcFees() + const totalUsersBalance = await this.storage.paymentStorage.GetTotalUsersBalance() + const totalLndBalance = await this.getTotalLndBalance(totalUsersBalance) + const deltaLnd = totalLndBalance - (this.initialLndBalance + this.accumulatedHtlcFees) + const deltaUsers = totalUsersBalance - this.initialUsersBalance + const deny = this.checkBalanceUpdate(deltaLnd, deltaUsers) + if (deny) { + this.log("Balance mismatch detected in absolute update, locking outgoing operations") + this.lnd.LockOutgoingOperations() + return + } + this.lnd.UnlockOutgoingOperations() + } + + PaymentRequested = async () => { + this.log("Payment requested, checking balance") + if (!this.ready) { + throw new Error("Watchdog not ready") + } + return new Promise((res, rej) => { + this.queue.Run({ res, rej }) + }) + } + + checkDeltas = (deltaLnd: number, deltaUsers: number): DeltaCheckResult => { + if (deltaLnd < 0) { + if (deltaUsers < 0) { + const diff = Math.abs(deltaLnd - deltaUsers) + return { type: 'negative', absoluteDiff: diff, relativeDiff: diff / Math.max(deltaLnd, deltaUsers) } + } else { + const diff = Math.abs(deltaLnd) + deltaUsers + return { type: 'mismatch', absoluteDiff: diff } + } + } else { + if (deltaUsers < 0) { + const diff = deltaLnd + Math.abs(deltaUsers) + return { type: 'mismatch', absoluteDiff: diff } + } else { + const diff = Math.abs(deltaLnd - deltaUsers) + return { type: 'positive', absoluteDiff: diff, relativeDiff: diff / Math.max(deltaLnd, deltaUsers) } + } + } + } +} type DeltaCheckResult = { type: 'negative' | 'positive', absoluteDiff: number, relativeDiff: number } | { type: 'mismatch', absoluteDiff: number } \ No newline at end of file diff --git a/src/services/metrics/htlcTracker.ts b/src/services/metrics/htlcTracker.ts index 0bd99fe9..420aa2e5 100644 --- a/src/services/metrics/htlcTracker.ts +++ b/src/services/metrics/htlcTracker.ts @@ -1,132 +1,132 @@ -import Storage from '../storage/index.js' -import { ForwardEvent, HtlcEvent, HtlcEvent_EventType } from "../../../proto/lnd/router.js"; -import { getLogger } from "../helpers/logger.js"; -type EventInfo = { - eventType: HtlcEvent_EventType - outgoingHtlcId: number - incomingHtlcId: number - outgoingChannelId: number - incomingChannelId: number -} -export default class HtlcTracker { - storage: Storage - pendingSendHtlcs: Map = new Map() - pendingReceiveHtlcs: Map = new Map() - pendingForwardHtlcs: Map = new Map() - constructor(storage: Storage) { - this.storage = storage - } - log = getLogger({ component: 'htlcTracker' }) - onHtlcEvent = async (htlc: HtlcEvent) => { - getLogger({ component: 'debugHtlcs' })(htlc) - const htlcEvent = htlc.event - if (htlcEvent.oneofKind === 'subscribedEvent') { - this.log("htlc subscribed") - return - } - const outgoingHtlcId = Number(htlc.outgoingHtlcId) - const incomingHtlcId = Number(htlc.incomingHtlcId) - const outgoingChannelId = Number(htlc.outgoingChannelId) - const incomingChannelId = Number(htlc.incomingChannelId) - const info: EventInfo = { eventType: htlc.eventType, outgoingChannelId, incomingChannelId, outgoingHtlcId, incomingHtlcId } - switch (htlcEvent.oneofKind) { - case 'forwardEvent': - return this.handleForward(htlcEvent.forwardEvent, info) - case 'forwardFailEvent': - return this.handleFailure(info) - case 'linkFailEvent': - return this.handleFailure(info) - case 'finalHtlcEvent': - if (!htlcEvent.finalHtlcEvent.settled) { - return this.handleFailure(info) - } else { - return this.handleSuccess(info) - } - case 'settleEvent': - return this.handleSuccess(info) - default: - this.log("unknown htlc event type") - } - } - - handleForward = (fwe: ForwardEvent, { eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => { - this.log("new forward event, currently tracked htlcs: (s,r,f)", this.pendingSendHtlcs.size, this.pendingReceiveHtlcs.size, this.pendingForwardHtlcs.size) - const { info } = fwe - const incomingAmtMsat = info ? Number(info.incomingAmtMsat) : 0 - const outgoingAmtMsat = info ? Number(info.outgoingAmtMsat) : 0 - if (eventType === HtlcEvent_EventType.SEND) { - this.pendingSendHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat) - } else if (eventType === HtlcEvent_EventType.RECEIVE) { - this.pendingReceiveHtlcs.set(incomingHtlcId, incomingAmtMsat - outgoingAmtMsat) - } else if (eventType === HtlcEvent_EventType.FORWARD) { - this.pendingForwardHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat) - } else { - this.log("unknown htlc event type for forward event") - } - } - - handleFailure = ({ eventType, outgoingHtlcId, incomingHtlcId, incomingChannelId, outgoingChannelId }: EventInfo) => { - if (eventType === HtlcEvent_EventType.SEND && this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) { - return this.incrementSendFailures(outgoingChannelId) - } - if (eventType === HtlcEvent_EventType.RECEIVE && this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) { - return this.incrementReceiveFailures(incomingChannelId) - } - if (eventType === HtlcEvent_EventType.FORWARD) { - const amt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) - if (amt !== null) { - return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, amt) - } - } - if (eventType === HtlcEvent_EventType.UNKNOWN) { - const fwdAmt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) - if (fwdAmt !== null) { - return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, fwdAmt) - } - if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) { - return this.incrementSendFailures(outgoingChannelId) - } - if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) { - return this.incrementReceiveFailures(incomingChannelId) - } - } - this.log("unknown htlc event type for failure event", eventType) - } - - handleSuccess = ({ eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => { - if (eventType === HtlcEvent_EventType.SEND) { - this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) - } else if (eventType === HtlcEvent_EventType.RECEIVE) { - this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) - } else if (eventType === HtlcEvent_EventType.FORWARD) { - this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) - } else if (eventType === HtlcEvent_EventType.UNKNOWN) { - if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) return - if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) return - if (this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) !== null) return - } else { - this.log("unknown htlc event type for success event", eventType) - } - } - - deleteMapEntry = (key: number, map: Map) => { - if (!map.has(key)) { - return null - } - const v = map.get(key) - map.delete(key) - return v || null - } - - incrementSendFailures = async (outgoingChannelId: number) => { - await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { send_errors: 1 }) - } - incrementReceiveFailures = async (incomingChannelId: number) => { - await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { receive_errors: 1 }) - } - incrementForwardFailures = async (incomingChannelId: number, outgoingChannelId: number, amt: number) => { - await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { forward_errors_as_input: 1, missed_forward_fee_as_input: amt }) - await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { forward_errors_as_output: 1, missed_forward_fee_as_output: amt }) - } -} - +import Storage from '../storage/index.js' +import { ForwardEvent, HtlcEvent, HtlcEvent_EventType } from "../../../proto/lnd/router.js"; +import { getLogger } from "../helpers/logger.js"; +type EventInfo = { + eventType: HtlcEvent_EventType + outgoingHtlcId: number + incomingHtlcId: number + outgoingChannelId: number + incomingChannelId: number +} +export default class HtlcTracker { + storage: Storage + pendingSendHtlcs: Map = new Map() + pendingReceiveHtlcs: Map = new Map() + pendingForwardHtlcs: Map = new Map() + constructor(storage: Storage) { + this.storage = storage + } + log = getLogger({ component: 'htlcTracker' }) + onHtlcEvent = async (htlc: HtlcEvent) => { + getLogger({ component: 'debugHtlcs' })(htlc) + const htlcEvent = htlc.event + if (htlcEvent.oneofKind === 'subscribedEvent') { + this.log("htlc subscribed") + return + } + const outgoingHtlcId = Number(htlc.outgoingHtlcId) + const incomingHtlcId = Number(htlc.incomingHtlcId) + const outgoingChannelId = Number(htlc.outgoingChannelId) + const incomingChannelId = Number(htlc.incomingChannelId) + const info: EventInfo = { eventType: htlc.eventType, outgoingChannelId, incomingChannelId, outgoingHtlcId, incomingHtlcId } + switch (htlcEvent.oneofKind) { + case 'forwardEvent': + return this.handleForward(htlcEvent.forwardEvent, info) + case 'forwardFailEvent': + return this.handleFailure(info) + case 'linkFailEvent': + return this.handleFailure(info) + case 'finalHtlcEvent': + if (!htlcEvent.finalHtlcEvent.settled) { + return this.handleFailure(info) + } else { + return this.handleSuccess(info) + } + case 'settleEvent': + return this.handleSuccess(info) + default: + this.log("unknown htlc event type") + } + } + + handleForward = (fwe: ForwardEvent, { eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => { + this.log("new forward event, currently tracked htlcs: (s,r,f)", this.pendingSendHtlcs.size, this.pendingReceiveHtlcs.size, this.pendingForwardHtlcs.size) + const { info } = fwe + const incomingAmtMsat = info ? Number(info.incomingAmtMsat) : 0 + const outgoingAmtMsat = info ? Number(info.outgoingAmtMsat) : 0 + if (eventType === HtlcEvent_EventType.SEND) { + this.pendingSendHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat) + } else if (eventType === HtlcEvent_EventType.RECEIVE) { + this.pendingReceiveHtlcs.set(incomingHtlcId, incomingAmtMsat - outgoingAmtMsat) + } else if (eventType === HtlcEvent_EventType.FORWARD) { + this.pendingForwardHtlcs.set(outgoingHtlcId, outgoingAmtMsat - incomingAmtMsat) + } else { + this.log("unknown htlc event type for forward event") + } + } + + handleFailure = ({ eventType, outgoingHtlcId, incomingHtlcId, incomingChannelId, outgoingChannelId }: EventInfo) => { + if (eventType === HtlcEvent_EventType.SEND && this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) { + return this.incrementSendFailures(outgoingChannelId) + } + if (eventType === HtlcEvent_EventType.RECEIVE && this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) { + return this.incrementReceiveFailures(incomingChannelId) + } + if (eventType === HtlcEvent_EventType.FORWARD) { + const amt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) + if (amt !== null) { + return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, amt) + } + } + if (eventType === HtlcEvent_EventType.UNKNOWN) { + const fwdAmt = this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) + if (fwdAmt !== null) { + return this.incrementForwardFailures(incomingChannelId, outgoingChannelId, fwdAmt) + } + if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) { + return this.incrementSendFailures(outgoingChannelId) + } + if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) { + return this.incrementReceiveFailures(incomingChannelId) + } + } + this.log("unknown htlc event type for failure event", eventType) + } + + handleSuccess = ({ eventType, outgoingHtlcId, incomingHtlcId }: EventInfo) => { + if (eventType === HtlcEvent_EventType.SEND) { + this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) + } else if (eventType === HtlcEvent_EventType.RECEIVE) { + this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) + } else if (eventType === HtlcEvent_EventType.FORWARD) { + this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) + } else if (eventType === HtlcEvent_EventType.UNKNOWN) { + if (this.deleteMapEntry(outgoingHtlcId, this.pendingSendHtlcs) !== null) return + if (this.deleteMapEntry(incomingHtlcId, this.pendingReceiveHtlcs) !== null) return + if (this.deleteMapEntry(outgoingHtlcId, this.pendingForwardHtlcs) !== null) return + } else { + this.log("unknown htlc event type for success event", eventType) + } + } + + deleteMapEntry = (key: number, map: Map) => { + if (!map.has(key)) { + return null + } + const v = map.get(key) + map.delete(key) + return v || null + } + + incrementSendFailures = async (outgoingChannelId: number) => { + await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { send_errors: 1 }) + } + incrementReceiveFailures = async (incomingChannelId: number) => { + await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { receive_errors: 1 }) + } + incrementForwardFailures = async (incomingChannelId: number, outgoingChannelId: number, amt: number) => { + await this.storage.metricsStorage.IncrementChannelRouting(incomingChannelId.toString(), { forward_errors_as_input: 1, missed_forward_fee_as_input: amt }) + await this.storage.metricsStorage.IncrementChannelRouting(outgoingChannelId.toString(), { forward_errors_as_output: 1, missed_forward_fee_as_output: amt }) + } +} + diff --git a/src/services/metrics/index.ts b/src/services/metrics/index.ts index 56d0d4d7..8e55d9ef 100644 --- a/src/services/metrics/index.ts +++ b/src/services/metrics/index.ts @@ -1,262 +1,262 @@ -import Storage from '../storage/index.js' -import * as Types from '../../../proto/autogenerated/ts/types.js' -import { Application } from '../storage/entity/Application.js' -import { HtlcEvent, HtlcEvent_EventType } from '../../../proto/lnd/router.js' -import { BalanceInfo } from '../lnd/settings.js' -import { BalanceEvent } from '../storage/entity/BalanceEvent.js' -import { ChannelBalanceEvent } from '../storage/entity/ChannelsBalanceEvent.js' -import LND from '../lnd/lnd.js' -import HtlcTracker from './htlcTracker.js' -const maxEvents = 100_000 -export default class Handler { - storage: Storage - lnd: LND - htlcTracker: HtlcTracker - metrics: Types.UsageMetric[] = [] - constructor(storage: Storage, lnd: LND) { - this.storage = storage - this.lnd = lnd - this.htlcTracker = new HtlcTracker(this.storage) - } - - async HtlcCb(htlc: HtlcEvent) { - await this.htlcTracker.onHtlcEvent(htlc) - } - - async NewBlockCb(height: number, balanceInfo: BalanceInfo) { - const balanceEvent: Partial = { - block_height: height, - confirmed_chain_balance: balanceInfo.confirmedBalance, - unconfirmed_chain_balance: balanceInfo.unconfirmedBalance, - total_chain_balance: balanceInfo.totalBalance, - } - const channelsEvents: Partial[] = balanceInfo.channelsBalance.map(c => ({ - channel_id: c.channelId, - local_balance_sats: c.localBalanceSats, - remote_balance_sats: c.remoteBalanceSats, - })) - await this.storage.metricsStorage.SaveBalanceEvents(balanceEvent, channelsEvents) - } - - async FetchLatestForwardingEvents() { - const latestIndex = await this.storage.metricsStorage.GetLatestForwardingIndexOffset() - const res = await this.lnd.GetForwardingHistory(latestIndex) - const forwards = res.forwardingEvents.map(e => ({ fee: Number(e.fee), chanIdIn: e.chanIdIn, chanIdOut: e.chanIdOut, timestampNs: e.timestampNs.toString(), offset: res.lastOffsetIndex })) - await Promise.all(forwards.map(async f => { - await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdIn, { forward_fee_as_input: f.fee, latest_index_offset: f.offset }) - await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdOut, { forward_fee_as_output: f.fee, latest_index_offset: f.offset }) - })) - } - - AddMetrics(newMetrics: (Types.RequestMetric & { app_id?: string })[]) { - const parsed: Types.UsageMetric[] = newMetrics.map(m => ({ - rpc_name: m.rpcName, - batch: m.batch, - nostr: m.nostr, - batch_size: m.batchSize, - parsed_in_nano: Number(m.parse - m.start), - auth_in_nano: Number(m.guard - m.parse), - validate_in_nano: Number(m.validate - m.guard), - handle_in_nano: Number(m.handle - m.validate), - success: !m.error, - app_id: m.app_id ? m.app_id : "", - processed_at_ms: m.startMs - })) - const len = this.metrics.push(...parsed) - if (len > maxEvents) { - this.metrics.splice(0, len - maxEvents) - } - } - async GetUsageMetrics(): Promise { - return { - metrics: this.metrics - } - } - async GetAppsMetrics(req: Types.AppsMetricsRequest): Promise { - const dbApps = await this.storage.applicationStorage.GetApplications() - const apps = await Promise.all(dbApps.map(app => this.GetAppMetrics(req, app))) - const unlinked = await this.GetAppMetrics(req, null) - apps.push(unlinked) - return { - apps - } - } - - async GetAppMetrics(req: Types.AppsMetricsRequest, app: Application | null): Promise { - const totalFees = await this.storage.paymentStorage.GetTotalFeesPaidInApp(app) - const { receivingInvoices, receivingTransactions, outgoingInvoices, outgoingTransactions, receivingAddresses, userToUser } = await this.storage.paymentStorage.GetAppOperations(app, { from: req.from_unix, to: req.to_unix }) - let totalReceived = 0 - let totalSpent = 0 - let unpaidInvoices = 0 - let feesInRange = 0 - const operations: Types.UserOperation[] = [] - receivingInvoices.forEach(i => { - if (i.paid_at_unix > 0) { - totalReceived += i.paid_amount - feesInRange += i.service_fee - if (req.include_operations) operations.push({ type: Types.UserOperationType.INCOMING_INVOICE, amount: i.paid_amount, inbound: true, paidAtUnix: i.paid_at_unix, confirmed: true, service_fee: i.service_fee, network_fee: 0, identifier: "", operationId: "", tx_hash: "", internal: i.internal }) - } else { - unpaidInvoices++ - } - }) - receivingTransactions.forEach(txs => { - txs.forEach(tx => { - if (req.include_operations) operations.push({ type: Types.UserOperationType.INCOMING_TX, amount: tx.paid_amount, inbound: true, paidAtUnix: tx.paid_at_unix, confirmed: tx.confs > 1, service_fee: tx.service_fee, network_fee: 0, identifier: "", operationId: "", tx_hash: tx.tx_hash, internal: tx.internal }) - if (tx.confs > 1) { - feesInRange += tx.service_fee - totalReceived += tx.paid_amount - } - }) - }) - outgoingInvoices.forEach(i => { - if (req.include_operations) operations.push({ type: Types.UserOperationType.OUTGOING_INVOICE, amount: i.paid_amount, inbound: false, paidAtUnix: i.paid_at_unix, confirmed: true, service_fee: i.service_fees, network_fee: i.routing_fees, identifier: "", operationId: "", tx_hash: "", internal: i.internal }) - totalSpent += i.paid_amount - feesInRange += i.service_fees - }) - outgoingTransactions.forEach(tx => { - if (req.include_operations) operations.push({ type: Types.UserOperationType.OUTGOING_TX, amount: tx.paid_amount, inbound: false, paidAtUnix: tx.paid_at_unix, confirmed: tx.confs > 1, service_fee: tx.service_fees, network_fee: tx.chain_fees, identifier: "", operationId: "", tx_hash: tx.tx_hash, internal: tx.internal }) - totalSpent += tx.paid_amount - feesInRange += tx.service_fees - }) - - userToUser.forEach(op => { - if (req.include_operations) operations.push({ type: Types.UserOperationType.INCOMING_USER_TO_USER, amount: op.paid_amount, inbound: true, paidAtUnix: op.paid_at_unix, confirmed: true, service_fee: op.service_fees, network_fee: 0, identifier: "", operationId: "", tx_hash: "", internal: true }) - feesInRange += op.service_fees - }) - - const users = await this.storage.applicationStorage.GetApplicationUsers(app, { from: req.from_unix, to: req.to_unix }) - - let totalUserWithBalance = 0 - let totalUserWithNoBalance = 0 - let totalUsersWithNegativeBalance = 0 - let totalAlwaysBeenInactive = 0 - let balanceSum = 0 - let minBalance = Number.MAX_SAFE_INTEGER - let maxBalance = 0 - await Promise.all(users.map(async u => { - if (u.user.balance_sats < 0) { - totalUsersWithNegativeBalance++ - } else if (u.user.balance_sats === 0) { - const wasActive = await this.storage.paymentStorage.UserHasOutgoingOperation(u.user.user_id) - totalUserWithNoBalance++ - if (!wasActive) { - totalAlwaysBeenInactive++ - } - } else { - balanceSum += u.user.balance_sats - totalUserWithBalance++ - if (u.user.balance_sats < minBalance) { - minBalance = u.user.balance_sats - } - if (u.user.balance_sats > maxBalance) { - maxBalance = u.user.balance_sats - } - } - })) - return { - app: { - name: app ? app.name : "unlinked to app", - id: app ? app.app_id : "unlinked", - npub: app ? (app.nostr_public_key || "") : "", - balance: app ? app.owner.balance_sats : 0, - }, - users: { - total: users.length, - always_been_inactive: totalAlwaysBeenInactive, - balance_avg: Math.round(balanceSum / totalUserWithBalance), - balance_median: Math.round((maxBalance + minBalance) / 2), - no_balance: totalUserWithNoBalance, - negative_balance: totalUsersWithNegativeBalance, - }, - - received: totalReceived, - spent: totalSpent, - available: balanceSum, - fees: feesInRange, - total_fees: totalFees, - invoices: receivingInvoices.length, - - operations - } - } - - async GetChannelsInfo() { - const { channels } = await this.lnd.ListChannels() - let totalActive = 0 - let totalInactive = 0 - channels.forEach(c => { - if (c.active) { - totalActive++ - } else { - totalInactive++ - } - }) - return { - totalActive, totalInactive, openChannels: channels - } - } - async GetPendingChannelsInfo() { - const { pendingForceClosingChannels, pendingOpenChannels } = await this.lnd.ListPendingChannels() - return { totalPendingClose: pendingForceClosingChannels.length, totalPendingOpen: pendingOpenChannels.length } - - } - - - async GetLndMetrics(req: Types.LndMetricsRequest): Promise { - const { openChannels, totalActive, totalInactive } = await this.GetChannelsInfo() - const { totalPendingOpen, totalPendingClose } = await this.GetPendingChannelsInfo() - const { channels: closedChannels } = await this.lnd.ListClosedChannels() - const rawRouting = await this.storage.metricsStorage.GetChannelRouting({ from: req.from_unix, to: req.to_unix }) - const routingMap: Record = {} - rawRouting.forEach(r => { - if (!routingMap[r.channel_id]) { - routingMap[r.channel_id] = { - channel_id: r.channel_id, - send_errors: 0, - receive_errors: 0, - forward_errors_as_input: 0, - forward_errors_as_output: 0, - missed_forward_fee_as_input: 0, - missed_forward_fee_as_output: 0, - forward_fee_as_input: 0, - forward_fee_as_output: 0, - events_number: 0 - } - } - routingMap[r.channel_id].send_errors += r.send_errors - routingMap[r.channel_id].receive_errors += r.receive_errors - routingMap[r.channel_id].forward_errors_as_input += r.forward_errors_as_input - routingMap[r.channel_id].forward_errors_as_output += r.forward_errors_as_output - routingMap[r.channel_id].missed_forward_fee_as_input += r.missed_forward_fee_as_input - routingMap[r.channel_id].missed_forward_fee_as_output += r.missed_forward_fee_as_output - routingMap[r.channel_id].forward_fee_as_input += r.forward_fee_as_input - routingMap[r.channel_id].forward_fee_as_output += r.forward_fee_as_output - routingMap[r.channel_id].events_number++ - }) - const { channelsBalanceEvents, chainBalanceEvents } = await this.storage.metricsStorage.GetBalanceEvents({ from: req.from_unix, to: req.to_unix }) - return { - nodes: [{ - chain_balance_events: chainBalanceEvents.map(e => ({ - block_height: e.block_height, - confirmed_balance: e.confirmed_chain_balance, - unconfirmed_balance: e.unconfirmed_chain_balance, - total_balance: e.total_chain_balance - })), - channels_balance_events: channelsBalanceEvents.map(e => ({ - block_height: e.balance_event.block_height, - channel_id: e.channel_id, - local_balance_sats: e.local_balance_sats, - remote_balance_sats: e.remote_balance_sats - })), - closing_channels: totalPendingClose, - pending_channels: totalPendingOpen, - offline_channels: totalInactive, - online_channels: totalActive, - closed_channels: closedChannels.map(c => ({ capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight })), - open_channels: openChannels.map(c => ({ active: c.active, capacity: Number(c.capacity), channel_id: c.chanId, lifetime: Number(c.lifetime), local_balance: Number(c.localBalance), remote_balance: Number(c.remoteBalance) })), - channel_routing: Object.values(routingMap) - }], - - } - } +import Storage from '../storage/index.js' +import * as Types from '../../../proto/autogenerated/ts/types.js' +import { Application } from '../storage/entity/Application.js' +import { HtlcEvent, HtlcEvent_EventType } from '../../../proto/lnd/router.js' +import { BalanceInfo } from '../lnd/settings.js' +import { BalanceEvent } from '../storage/entity/BalanceEvent.js' +import { ChannelBalanceEvent } from '../storage/entity/ChannelsBalanceEvent.js' +import LND from '../lnd/lnd.js' +import HtlcTracker from './htlcTracker.js' +const maxEvents = 100_000 +export default class Handler { + storage: Storage + lnd: LND + htlcTracker: HtlcTracker + metrics: Types.UsageMetric[] = [] + constructor(storage: Storage, lnd: LND) { + this.storage = storage + this.lnd = lnd + this.htlcTracker = new HtlcTracker(this.storage) + } + + async HtlcCb(htlc: HtlcEvent) { + await this.htlcTracker.onHtlcEvent(htlc) + } + + async NewBlockCb(height: number, balanceInfo: BalanceInfo) { + const balanceEvent: Partial = { + block_height: height, + confirmed_chain_balance: balanceInfo.confirmedBalance, + unconfirmed_chain_balance: balanceInfo.unconfirmedBalance, + total_chain_balance: balanceInfo.totalBalance, + } + const channelsEvents: Partial[] = balanceInfo.channelsBalance.map(c => ({ + channel_id: c.channelId, + local_balance_sats: c.localBalanceSats, + remote_balance_sats: c.remoteBalanceSats, + })) + await this.storage.metricsStorage.SaveBalanceEvents(balanceEvent, channelsEvents) + } + + async FetchLatestForwardingEvents() { + const latestIndex = await this.storage.metricsStorage.GetLatestForwardingIndexOffset() + const res = await this.lnd.GetForwardingHistory(latestIndex) + const forwards = res.forwardingEvents.map(e => ({ fee: Number(e.fee), chanIdIn: e.chanIdIn, chanIdOut: e.chanIdOut, timestampNs: e.timestampNs.toString(), offset: res.lastOffsetIndex })) + await Promise.all(forwards.map(async f => { + await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdIn, { forward_fee_as_input: f.fee, latest_index_offset: f.offset }) + await this.storage.metricsStorage.IncrementChannelRouting(f.chanIdOut, { forward_fee_as_output: f.fee, latest_index_offset: f.offset }) + })) + } + + AddMetrics(newMetrics: (Types.RequestMetric & { app_id?: string })[]) { + const parsed: Types.UsageMetric[] = newMetrics.map(m => ({ + rpc_name: m.rpcName, + batch: m.batch, + nostr: m.nostr, + batch_size: m.batchSize, + parsed_in_nano: Number(m.parse - m.start), + auth_in_nano: Number(m.guard - m.parse), + validate_in_nano: Number(m.validate - m.guard), + handle_in_nano: Number(m.handle - m.validate), + success: !m.error, + app_id: m.app_id ? m.app_id : "", + processed_at_ms: m.startMs + })) + const len = this.metrics.push(...parsed) + if (len > maxEvents) { + this.metrics.splice(0, len - maxEvents) + } + } + async GetUsageMetrics(): Promise { + return { + metrics: this.metrics + } + } + async GetAppsMetrics(req: Types.AppsMetricsRequest): Promise { + const dbApps = await this.storage.applicationStorage.GetApplications() + const apps = await Promise.all(dbApps.map(app => this.GetAppMetrics(req, app))) + const unlinked = await this.GetAppMetrics(req, null) + apps.push(unlinked) + return { + apps + } + } + + async GetAppMetrics(req: Types.AppsMetricsRequest, app: Application | null): Promise { + const totalFees = await this.storage.paymentStorage.GetTotalFeesPaidInApp(app) + const { receivingInvoices, receivingTransactions, outgoingInvoices, outgoingTransactions, receivingAddresses, userToUser } = await this.storage.paymentStorage.GetAppOperations(app, { from: req.from_unix, to: req.to_unix }) + let totalReceived = 0 + let totalSpent = 0 + let unpaidInvoices = 0 + let feesInRange = 0 + const operations: Types.UserOperation[] = [] + receivingInvoices.forEach(i => { + if (i.paid_at_unix > 0) { + totalReceived += i.paid_amount + feesInRange += i.service_fee + if (req.include_operations) operations.push({ type: Types.UserOperationType.INCOMING_INVOICE, amount: i.paid_amount, inbound: true, paidAtUnix: i.paid_at_unix, confirmed: true, service_fee: i.service_fee, network_fee: 0, identifier: "", operationId: "", tx_hash: "", internal: i.internal }) + } else { + unpaidInvoices++ + } + }) + receivingTransactions.forEach(txs => { + txs.forEach(tx => { + if (req.include_operations) operations.push({ type: Types.UserOperationType.INCOMING_TX, amount: tx.paid_amount, inbound: true, paidAtUnix: tx.paid_at_unix, confirmed: tx.confs > 1, service_fee: tx.service_fee, network_fee: 0, identifier: "", operationId: "", tx_hash: tx.tx_hash, internal: tx.internal }) + if (tx.confs > 1) { + feesInRange += tx.service_fee + totalReceived += tx.paid_amount + } + }) + }) + outgoingInvoices.forEach(i => { + if (req.include_operations) operations.push({ type: Types.UserOperationType.OUTGOING_INVOICE, amount: i.paid_amount, inbound: false, paidAtUnix: i.paid_at_unix, confirmed: true, service_fee: i.service_fees, network_fee: i.routing_fees, identifier: "", operationId: "", tx_hash: "", internal: i.internal }) + totalSpent += i.paid_amount + feesInRange += i.service_fees + }) + outgoingTransactions.forEach(tx => { + if (req.include_operations) operations.push({ type: Types.UserOperationType.OUTGOING_TX, amount: tx.paid_amount, inbound: false, paidAtUnix: tx.paid_at_unix, confirmed: tx.confs > 1, service_fee: tx.service_fees, network_fee: tx.chain_fees, identifier: "", operationId: "", tx_hash: tx.tx_hash, internal: tx.internal }) + totalSpent += tx.paid_amount + feesInRange += tx.service_fees + }) + + userToUser.forEach(op => { + if (req.include_operations) operations.push({ type: Types.UserOperationType.INCOMING_USER_TO_USER, amount: op.paid_amount, inbound: true, paidAtUnix: op.paid_at_unix, confirmed: true, service_fee: op.service_fees, network_fee: 0, identifier: "", operationId: "", tx_hash: "", internal: true }) + feesInRange += op.service_fees + }) + + const users = await this.storage.applicationStorage.GetApplicationUsers(app, { from: req.from_unix, to: req.to_unix }) + + let totalUserWithBalance = 0 + let totalUserWithNoBalance = 0 + let totalUsersWithNegativeBalance = 0 + let totalAlwaysBeenInactive = 0 + let balanceSum = 0 + let minBalance = Number.MAX_SAFE_INTEGER + let maxBalance = 0 + await Promise.all(users.map(async u => { + if (u.user.balance_sats < 0) { + totalUsersWithNegativeBalance++ + } else if (u.user.balance_sats === 0) { + const wasActive = await this.storage.paymentStorage.UserHasOutgoingOperation(u.user.user_id) + totalUserWithNoBalance++ + if (!wasActive) { + totalAlwaysBeenInactive++ + } + } else { + balanceSum += u.user.balance_sats + totalUserWithBalance++ + if (u.user.balance_sats < minBalance) { + minBalance = u.user.balance_sats + } + if (u.user.balance_sats > maxBalance) { + maxBalance = u.user.balance_sats + } + } + })) + return { + app: { + name: app ? app.name : "unlinked to app", + id: app ? app.app_id : "unlinked", + npub: app ? (app.nostr_public_key || "") : "", + balance: app ? app.owner.balance_sats : 0, + }, + users: { + total: users.length, + always_been_inactive: totalAlwaysBeenInactive, + balance_avg: Math.round(balanceSum / totalUserWithBalance), + balance_median: Math.round((maxBalance + minBalance) / 2), + no_balance: totalUserWithNoBalance, + negative_balance: totalUsersWithNegativeBalance, + }, + + received: totalReceived, + spent: totalSpent, + available: balanceSum, + fees: feesInRange, + total_fees: totalFees, + invoices: receivingInvoices.length, + + operations + } + } + + async GetChannelsInfo() { + const { channels } = await this.lnd.ListChannels() + let totalActive = 0 + let totalInactive = 0 + channels.forEach(c => { + if (c.active) { + totalActive++ + } else { + totalInactive++ + } + }) + return { + totalActive, totalInactive, openChannels: channels + } + } + async GetPendingChannelsInfo() { + const { pendingForceClosingChannels, pendingOpenChannels } = await this.lnd.ListPendingChannels() + return { totalPendingClose: pendingForceClosingChannels.length, totalPendingOpen: pendingOpenChannels.length } + + } + + + async GetLndMetrics(req: Types.LndMetricsRequest): Promise { + const { openChannels, totalActive, totalInactive } = await this.GetChannelsInfo() + const { totalPendingOpen, totalPendingClose } = await this.GetPendingChannelsInfo() + const { channels: closedChannels } = await this.lnd.ListClosedChannels() + const rawRouting = await this.storage.metricsStorage.GetChannelRouting({ from: req.from_unix, to: req.to_unix }) + const routingMap: Record = {} + rawRouting.forEach(r => { + if (!routingMap[r.channel_id]) { + routingMap[r.channel_id] = { + channel_id: r.channel_id, + send_errors: 0, + receive_errors: 0, + forward_errors_as_input: 0, + forward_errors_as_output: 0, + missed_forward_fee_as_input: 0, + missed_forward_fee_as_output: 0, + forward_fee_as_input: 0, + forward_fee_as_output: 0, + events_number: 0 + } + } + routingMap[r.channel_id].send_errors += r.send_errors + routingMap[r.channel_id].receive_errors += r.receive_errors + routingMap[r.channel_id].forward_errors_as_input += r.forward_errors_as_input + routingMap[r.channel_id].forward_errors_as_output += r.forward_errors_as_output + routingMap[r.channel_id].missed_forward_fee_as_input += r.missed_forward_fee_as_input + routingMap[r.channel_id].missed_forward_fee_as_output += r.missed_forward_fee_as_output + routingMap[r.channel_id].forward_fee_as_input += r.forward_fee_as_input + routingMap[r.channel_id].forward_fee_as_output += r.forward_fee_as_output + routingMap[r.channel_id].events_number++ + }) + const { channelsBalanceEvents, chainBalanceEvents } = await this.storage.metricsStorage.GetBalanceEvents({ from: req.from_unix, to: req.to_unix }) + return { + nodes: [{ + chain_balance_events: chainBalanceEvents.map(e => ({ + block_height: e.block_height, + confirmed_balance: e.confirmed_chain_balance, + unconfirmed_balance: e.unconfirmed_chain_balance, + total_balance: e.total_chain_balance + })), + channels_balance_events: channelsBalanceEvents.map(e => ({ + block_height: e.balance_event.block_height, + channel_id: e.channel_id, + local_balance_sats: e.local_balance_sats, + remote_balance_sats: e.remote_balance_sats + })), + closing_channels: totalPendingClose, + pending_channels: totalPendingOpen, + offline_channels: totalInactive, + online_channels: totalActive, + closed_channels: closedChannels.map(c => ({ capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight })), + open_channels: openChannels.map(c => ({ active: c.active, capacity: Number(c.capacity), channel_id: c.chanId, lifetime: Number(c.lifetime), local_balance: Number(c.localBalance), remote_balance: Number(c.remoteBalance) })), + channel_routing: Object.values(routingMap) + }], + + } + } } \ No newline at end of file diff --git a/src/services/nostr/handler.ts b/src/services/nostr/handler.ts index 398026c5..084963ff 100644 --- a/src/services/nostr/handler.ts +++ b/src/services/nostr/handler.ts @@ -1,226 +1,226 @@ -//import { SimplePool, Sub, Event, UnsignedEvent, getEventHash, signEvent } from 'nostr-tools' -import { SimplePool, Sub, Event, UnsignedEvent, getEventHash, finishEvent, relayInit } from './tools/index.js' -import { encryptData, decryptData, getSharedSecret, decodePayload, encodePayload } from './nip44.js' -import { ERROR, getLogger } from '../helpers/logger.js' -import { encodeNprofile } from '../../custom-nip19.js' -const handledEvents: string[] = [] // TODO: - big memory leak here, add TTL -type AppInfo = { appId: string, publicKey: string, privateKey: string, name: string } -type ClientInfo = { clientId: string, publicKey: string, privateKey: string, name: string } -export type SendData = { type: "content", content: string, pub: string } | { type: "event", event: UnsignedEvent } -export type SendInitiator = { type: 'app', appId: string } | { type: 'client', clientId: string } -export type NostrSend = (initiator: SendInitiator, data: SendData, relays?: string[] | undefined) => void - -export type NostrSettings = { - apps: AppInfo[] - relays: string[] - clients: ClientInfo[] -} -export type NostrEvent = { - id: string - pub: string - content: string - appId: string - startAtNano: string - startAtMs: number -} - -type SettingsRequest = { - type: 'settings' - settings: NostrSettings -} - -type SendRequest = { - type: 'send' - initiator: SendInitiator - data: SendData - relays?: string[] -} -type ReadyResponse = { - type: 'ready' -} -type EventResponse = { - type: 'event' - event: NostrEvent -} - -export type ChildProcessRequest = SettingsRequest | SendRequest -export type ChildProcessResponse = ReadyResponse | EventResponse -const send = (message: ChildProcessResponse) => { - if (process.send) { - process.send(message) - } -} -let subProcessHandler: Handler | undefined -process.on("message", (message: ChildProcessRequest) => { - switch (message.type) { - case 'settings': - initSubprocessHandler(message.settings) - break - case 'send': - sendToNostr(message.initiator, message.data, message.relays) - break - default: - getLogger({ component: "nostrMiddleware" })(ERROR, "unknown nostr request", message) - break - } -}) -const initSubprocessHandler = (settings: NostrSettings) => { - if (subProcessHandler) { - getLogger({ component: "nostrMiddleware" })(ERROR, "nostr settings ignored since handler already exists") - return - } - subProcessHandler = new Handler(settings, event => { - send({ - type: 'event', - event: event - }) - }) -} -const sendToNostr: NostrSend = (initiator, data, relays) => { - if (!subProcessHandler) { - getLogger({ component: "nostrMiddleware" })(ERROR, "nostr was not initialized") - return - } - subProcessHandler.Send(initiator, data, relays) -} -send({ type: 'ready' }) - -export default class Handler { - pool = new SimplePool() - settings: NostrSettings - subs: Sub[] = [] - apps: Record = {} - eventCallback: (event: NostrEvent) => void - log = getLogger({ component: "nostrMiddleware" }) - constructor(settings: NostrSettings, eventCallback: (event: NostrEvent) => void) { - this.settings = settings - this.log( - { - ...settings, - apps: settings.apps.map(app => { - const { privateKey, ...rest } = app; - return { - ...rest, - nprofile: encodeNprofile({ pubkey: rest.publicKey, relays: settings.relays }) - } - }) - } - ) - this.eventCallback = eventCallback - this.settings.apps.forEach(app => { - this.apps[app.publicKey] = app - }) - this.Connect() - } - - async Connect() { - const log = getLogger({}) - log("conneting to relay...", this.settings.relays[0]) - const relay = relayInit(this.settings.relays[0]) // TODO: create multiple conns for multiple relays - try { - await relay.connect() - } catch (err) { - log("failed to connect to relay, will try again in 2 seconds") - setTimeout(() => { - this.Connect() - }, 2000) - return - } - log("connected, subbing...") - relay.on('disconnect', () => { - log("relay disconnected, will try to reconnect") - relay.close() - this.Connect() - }) - const sub = relay.sub([ - { - since: Math.ceil(Date.now() / 1000), - kinds: [21000], - '#p': Object.keys(this.apps), - } - ]) - sub.on('eose', () => { - log("up to date with nostr events") - }) - sub.on('event', async (e) => { - if (e.kind !== 21000 || !e.pubkey) { - return - } - const pubTags = e.tags.find(tags => tags && tags.length > 1 && tags[0] === 'p') - if (!pubTags) { - return - } - const app = this.apps[pubTags[1]] - if (app) { - await this.processEvent(e, app) - return - } - }) - } - - async processEvent(e: Event<21000>, app: AppInfo) { - const eventId = e.id - if (handledEvents.includes(eventId)) { - this.log("event already handled") - return - } - handledEvents.push(eventId) - const startAtMs = Date.now() - const startAtNano = process.hrtime.bigint().toString() - const decoded = decodePayload(e.content) - const content = await decryptData(decoded, getSharedSecret(app.privateKey, e.pubkey)) - this.eventCallback({ id: eventId, content, pub: e.pubkey, appId: app.appId, startAtNano, startAtMs }) - } - - async Send(initiator: SendInitiator, data: SendData, relays?: string[]) { - const keys = this.GetSendKeys(initiator) - let toSign: UnsignedEvent - if (data.type === 'content') { - const decoded = await encryptData(data.content, getSharedSecret(keys.privateKey, data.pub)) - const content = encodePayload(decoded) - toSign = { - content, - created_at: Math.floor(Date.now() / 1000), - kind: 21000, - pubkey: keys.publicKey, - tags: [['p', data.pub]], - } - } else { - toSign = data.event - } - - const signed = finishEvent(toSign, keys.privateKey) - let sent = false - const log = getLogger({ appName: keys.name }) - await Promise.all(this.pool.publish(relays || this.settings.relays, signed).map(async p => { - try { - await p - sent = true - } catch (e: any) { - log(e) - } - })) - if (!sent) { - log("failed to send event") - } - } - - GetSendKeys(initiator: SendInitiator) { - if (initiator.type === 'app') { - const { appId } = initiator - const found = this.settings.apps.find((info: AppInfo) => info.appId === appId) - if (!found) { - throw new Error("unkown app") - } - return found - } else if (initiator.type === 'client') { - const { clientId } = initiator - const found = this.settings.clients.find((info: ClientInfo) => info.clientId === clientId) - if (!found) { - throw new Error("unkown client") - } - return found - } - throw new Error("unkown initiator type") - } +//import { SimplePool, Sub, Event, UnsignedEvent, getEventHash, signEvent } from 'nostr-tools' +import { SimplePool, Sub, Event, UnsignedEvent, getEventHash, finishEvent, relayInit } from './tools/index.js' +import { encryptData, decryptData, getSharedSecret, decodePayload, encodePayload } from './nip44.js' +import { ERROR, getLogger } from '../helpers/logger.js' +import { encodeNprofile } from '../../custom-nip19.js' +const handledEvents: string[] = [] // TODO: - big memory leak here, add TTL +type AppInfo = { appId: string, publicKey: string, privateKey: string, name: string } +type ClientInfo = { clientId: string, publicKey: string, privateKey: string, name: string } +export type SendData = { type: "content", content: string, pub: string } | { type: "event", event: UnsignedEvent } +export type SendInitiator = { type: 'app', appId: string } | { type: 'client', clientId: string } +export type NostrSend = (initiator: SendInitiator, data: SendData, relays?: string[] | undefined) => void + +export type NostrSettings = { + apps: AppInfo[] + relays: string[] + clients: ClientInfo[] +} +export type NostrEvent = { + id: string + pub: string + content: string + appId: string + startAtNano: string + startAtMs: number +} + +type SettingsRequest = { + type: 'settings' + settings: NostrSettings +} + +type SendRequest = { + type: 'send' + initiator: SendInitiator + data: SendData + relays?: string[] +} +type ReadyResponse = { + type: 'ready' +} +type EventResponse = { + type: 'event' + event: NostrEvent +} + +export type ChildProcessRequest = SettingsRequest | SendRequest +export type ChildProcessResponse = ReadyResponse | EventResponse +const send = (message: ChildProcessResponse) => { + if (process.send) { + process.send(message) + } +} +let subProcessHandler: Handler | undefined +process.on("message", (message: ChildProcessRequest) => { + switch (message.type) { + case 'settings': + initSubprocessHandler(message.settings) + break + case 'send': + sendToNostr(message.initiator, message.data, message.relays) + break + default: + getLogger({ component: "nostrMiddleware" })(ERROR, "unknown nostr request", message) + break + } +}) +const initSubprocessHandler = (settings: NostrSettings) => { + if (subProcessHandler) { + getLogger({ component: "nostrMiddleware" })(ERROR, "nostr settings ignored since handler already exists") + return + } + subProcessHandler = new Handler(settings, event => { + send({ + type: 'event', + event: event + }) + }) +} +const sendToNostr: NostrSend = (initiator, data, relays) => { + if (!subProcessHandler) { + getLogger({ component: "nostrMiddleware" })(ERROR, "nostr was not initialized") + return + } + subProcessHandler.Send(initiator, data, relays) +} +send({ type: 'ready' }) + +export default class Handler { + pool = new SimplePool() + settings: NostrSettings + subs: Sub[] = [] + apps: Record = {} + eventCallback: (event: NostrEvent) => void + log = getLogger({ component: "nostrMiddleware" }) + constructor(settings: NostrSettings, eventCallback: (event: NostrEvent) => void) { + this.settings = settings + this.log( + { + ...settings, + apps: settings.apps.map(app => { + const { privateKey, ...rest } = app; + return { + ...rest, + nprofile: encodeNprofile({ pubkey: rest.publicKey, relays: settings.relays }) + } + }) + } + ) + this.eventCallback = eventCallback + this.settings.apps.forEach(app => { + this.apps[app.publicKey] = app + }) + this.Connect() + } + + async Connect() { + const log = getLogger({}) + log("conneting to relay...", this.settings.relays[0]) + const relay = relayInit(this.settings.relays[0]) // TODO: create multiple conns for multiple relays + try { + await relay.connect() + } catch (err) { + log("failed to connect to relay, will try again in 2 seconds") + setTimeout(() => { + this.Connect() + }, 2000) + return + } + log("connected, subbing...") + relay.on('disconnect', () => { + log("relay disconnected, will try to reconnect") + relay.close() + this.Connect() + }) + const sub = relay.sub([ + { + since: Math.ceil(Date.now() / 1000), + kinds: [21000], + '#p': Object.keys(this.apps), + } + ]) + sub.on('eose', () => { + log("up to date with nostr events") + }) + sub.on('event', async (e) => { + if (e.kind !== 21000 || !e.pubkey) { + return + } + const pubTags = e.tags.find(tags => tags && tags.length > 1 && tags[0] === 'p') + if (!pubTags) { + return + } + const app = this.apps[pubTags[1]] + if (app) { + await this.processEvent(e, app) + return + } + }) + } + + async processEvent(e: Event<21000>, app: AppInfo) { + const eventId = e.id + if (handledEvents.includes(eventId)) { + this.log("event already handled") + return + } + handledEvents.push(eventId) + const startAtMs = Date.now() + const startAtNano = process.hrtime.bigint().toString() + const decoded = decodePayload(e.content) + const content = await decryptData(decoded, getSharedSecret(app.privateKey, e.pubkey)) + this.eventCallback({ id: eventId, content, pub: e.pubkey, appId: app.appId, startAtNano, startAtMs }) + } + + async Send(initiator: SendInitiator, data: SendData, relays?: string[]) { + const keys = this.GetSendKeys(initiator) + let toSign: UnsignedEvent + if (data.type === 'content') { + const decoded = await encryptData(data.content, getSharedSecret(keys.privateKey, data.pub)) + const content = encodePayload(decoded) + toSign = { + content, + created_at: Math.floor(Date.now() / 1000), + kind: 21000, + pubkey: keys.publicKey, + tags: [['p', data.pub]], + } + } else { + toSign = data.event + } + + const signed = finishEvent(toSign, keys.privateKey) + let sent = false + const log = getLogger({ appName: keys.name }) + await Promise.all(this.pool.publish(relays || this.settings.relays, signed).map(async p => { + try { + await p + sent = true + } catch (e: any) { + log(e) + } + })) + if (!sent) { + log("failed to send event") + } + } + + GetSendKeys(initiator: SendInitiator) { + if (initiator.type === 'app') { + const { appId } = initiator + const found = this.settings.apps.find((info: AppInfo) => info.appId === appId) + if (!found) { + throw new Error("unkown app") + } + return found + } else if (initiator.type === 'client') { + const { clientId } = initiator + const found = this.settings.clients.find((info: ClientInfo) => info.clientId === clientId) + if (!found) { + throw new Error("unkown client") + } + return found + } + throw new Error("unkown initiator type") + } } \ No newline at end of file diff --git a/src/services/nostr/index.ts b/src/services/nostr/index.ts index 948d7b2f..f7cf3a38 100644 --- a/src/services/nostr/index.ts +++ b/src/services/nostr/index.ts @@ -1,47 +1,47 @@ -import { ChildProcess, fork } from 'child_process' -import { EnvMustBeNonEmptyString } from "../helpers/envParser.js" -import { NostrSettings, NostrEvent, ChildProcessRequest, ChildProcessResponse, SendData, SendInitiator } from "./handler.js" -type EventCallback = (event: NostrEvent) => void - -const getEnvOrDefault = (name: string, defaultValue: string): string => { - return process.env[name] || defaultValue; -} - -export const LoadNosrtSettingsFromEnv = (test = false) => { - const relaysEnv = getEnvOrDefault("NOSTR_RELAYS", "wss://strfry.shock.network"); - return { - relays: relaysEnv.split(' ') - } -} - -export default class NostrSubprocess { - settings: NostrSettings - childProcess: ChildProcess - constructor(settings: NostrSettings, eventCallback: EventCallback) { - this.childProcess = fork("./build/src/services/nostr/handler") - this.childProcess.on("error", console.error) - this.childProcess.on("message", (message: ChildProcessResponse) => { - switch (message.type) { - case 'ready': - this.sendToChildProcess({ type: 'settings', settings: settings }) - break; - case 'event': - eventCallback(message.event) - break - default: - console.error("unknown nostr event response", message) - break; - } - }) - } - sendToChildProcess(message: ChildProcessRequest) { - this.childProcess.send(message) - } - - Send(initiator: SendInitiator, data: SendData, relays?: string[]) { - this.sendToChildProcess({ type: 'send', data, initiator, relays }) - } - Stop() { - this.childProcess.kill() - } -} +import { ChildProcess, fork } from 'child_process' +import { EnvMustBeNonEmptyString } from "../helpers/envParser.js" +import { NostrSettings, NostrEvent, ChildProcessRequest, ChildProcessResponse, SendData, SendInitiator } from "./handler.js" +type EventCallback = (event: NostrEvent) => void + +const getEnvOrDefault = (name: string, defaultValue: string): string => { + return process.env[name] || defaultValue; +} + +export const LoadNosrtSettingsFromEnv = (test = false) => { + const relaysEnv = getEnvOrDefault("NOSTR_RELAYS", "wss://strfry.shock.network"); + return { + relays: relaysEnv.split(' ') + } +} + +export default class NostrSubprocess { + settings: NostrSettings + childProcess: ChildProcess + constructor(settings: NostrSettings, eventCallback: EventCallback) { + this.childProcess = fork("./build/src/services/nostr/handler") + this.childProcess.on("error", console.error) + this.childProcess.on("message", (message: ChildProcessResponse) => { + switch (message.type) { + case 'ready': + this.sendToChildProcess({ type: 'settings', settings: settings }) + break; + case 'event': + eventCallback(message.event) + break + default: + console.error("unknown nostr event response", message) + break; + } + }) + } + sendToChildProcess(message: ChildProcessRequest) { + this.childProcess.send(message) + } + + Send(initiator: SendInitiator, data: SendData, relays?: string[]) { + this.sendToChildProcess({ type: 'send', data, initiator, relays }) + } + Stop() { + this.childProcess.kill() + } +} diff --git a/src/services/nostr/nip44.ts b/src/services/nostr/nip44.ts index 80eea903..7741f3a7 100644 --- a/src/services/nostr/nip44.ts +++ b/src/services/nostr/nip44.ts @@ -1,55 +1,55 @@ -import { base64 } from "@scure/base"; -import { randomBytes } from "@noble/hashes/utils"; -import { streamXOR as xchacha20 } from "@stablelib/xchacha20"; -import { secp256k1 } from "@noble/curves/secp256k1"; -import { sha256 } from "@noble/hashes/sha256"; -type EncryptedData = { - ciphertext: Uint8Array; - nonce: Uint8Array; -} -export const getSharedSecret = (privateKey: string, publicKey: string) => { - const key = secp256k1.getSharedSecret(privateKey, "02" + publicKey); - return sha256(key.slice(1, 33)); -} - -export const encryptData = (content: string, sharedSecret: Uint8Array) => { - const nonce = randomBytes(24); - const plaintext = new TextEncoder().encode(content); - const ciphertext = xchacha20(sharedSecret, nonce, plaintext, plaintext); - return { - ciphertext: Uint8Array.from(ciphertext), - nonce: nonce, - } as EncryptedData; -} - -export const decryptData = (payload: EncryptedData, sharedSecret: Uint8Array) => { - const dst = xchacha20(sharedSecret, payload.nonce, payload.ciphertext, payload.ciphertext); - const decoded = new TextDecoder().decode(dst); - return decoded; -} -const xchacha20EncryptionVersion = 1 -export const decodePayload = (p: string) => { - if (p.startsWith("{") && p.endsWith("}")) { - const pj = JSON.parse(p) as { v: number; nonce: string; ciphertext: string }; - if (pj.v !== xchacha20EncryptionVersion) { - throw new Error("Encryption version unsupported") - } - return { - nonce: base64.decode(pj.nonce), - ciphertext: base64.decode(pj.ciphertext), - } as EncryptedData; - } else { - const buf = base64.decode(p); - if (buf[0] !== xchacha20EncryptionVersion) { - throw new Error("Encryption version unsupported") - } - return { - nonce: buf.subarray(1, 25), - ciphertext: buf.subarray(25), - } as EncryptedData; - } -} - -export const encodePayload = (p: EncryptedData) => { - return base64.encode(new Uint8Array([xchacha20EncryptionVersion, ...p.nonce, ...p.ciphertext])); +import { base64 } from "@scure/base"; +import { randomBytes } from "@noble/hashes/utils"; +import { streamXOR as xchacha20 } from "@stablelib/xchacha20"; +import { secp256k1 } from "@noble/curves/secp256k1"; +import { sha256 } from "@noble/hashes/sha256"; +type EncryptedData = { + ciphertext: Uint8Array; + nonce: Uint8Array; +} +export const getSharedSecret = (privateKey: string, publicKey: string) => { + const key = secp256k1.getSharedSecret(privateKey, "02" + publicKey); + return sha256(key.slice(1, 33)); +} + +export const encryptData = (content: string, sharedSecret: Uint8Array) => { + const nonce = randomBytes(24); + const plaintext = new TextEncoder().encode(content); + const ciphertext = xchacha20(sharedSecret, nonce, plaintext, plaintext); + return { + ciphertext: Uint8Array.from(ciphertext), + nonce: nonce, + } as EncryptedData; +} + +export const decryptData = (payload: EncryptedData, sharedSecret: Uint8Array) => { + const dst = xchacha20(sharedSecret, payload.nonce, payload.ciphertext, payload.ciphertext); + const decoded = new TextDecoder().decode(dst); + return decoded; +} +const xchacha20EncryptionVersion = 1 +export const decodePayload = (p: string) => { + if (p.startsWith("{") && p.endsWith("}")) { + const pj = JSON.parse(p) as { v: number; nonce: string; ciphertext: string }; + if (pj.v !== xchacha20EncryptionVersion) { + throw new Error("Encryption version unsupported") + } + return { + nonce: base64.decode(pj.nonce), + ciphertext: base64.decode(pj.ciphertext), + } as EncryptedData; + } else { + const buf = base64.decode(p); + if (buf[0] !== xchacha20EncryptionVersion) { + throw new Error("Encryption version unsupported") + } + return { + nonce: buf.subarray(1, 25), + ciphertext: buf.subarray(25), + } as EncryptedData; + } +} + +export const encodePayload = (p: EncryptedData) => { + return base64.encode(new Uint8Array([xchacha20EncryptionVersion, ...p.nonce, ...p.ciphertext])); } \ No newline at end of file diff --git a/src/services/nostr/tools/event.ts b/src/services/nostr/tools/event.ts index 57908e2c..654c3f25 100644 --- a/src/services/nostr/tools/event.ts +++ b/src/services/nostr/tools/event.ts @@ -1,144 +1,144 @@ -import { schnorr } from '@noble/curves/secp256k1' -import { sha256 } from '@noble/hashes/sha256' -import { bytesToHex } from '@noble/hashes/utils' - -import { getPublicKey } from './keys.js' -import { utf8Encoder } from './utils.js' - -/** Designates a verified event signature. */ -export const verifiedSymbol = Symbol('verified') - -/** @deprecated Use numbers instead. */ -/* eslint-disable no-unused-vars */ -export enum Kind { - Metadata = 0, - Text = 1, - RecommendRelay = 2, - Contacts = 3, - EncryptedDirectMessage = 4, - EventDeletion = 5, - Repost = 6, - Reaction = 7, - BadgeAward = 8, - ChannelCreation = 40, - ChannelMetadata = 41, - ChannelMessage = 42, - ChannelHideMessage = 43, - ChannelMuteUser = 44, - Blank = 255, - Report = 1984, - ZapRequest = 9734, - Zap = 9735, - RelayList = 10002, - ClientAuth = 22242, - HttpAuth = 27235, - ProfileBadge = 30008, - BadgeDefinition = 30009, - Article = 30023, - FileMetadata = 1063, -} - -export interface Event { - kind: K - tags: string[][] - content: string - created_at: number - pubkey: string - id: string - sig: string - [verifiedSymbol]?: boolean -} - -export type EventTemplate = Pick, 'kind' | 'tags' | 'content' | 'created_at'> -export type UnsignedEvent = Pick< - Event, - 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey' -> - -/** An event whose signature has been verified. */ -export interface VerifiedEvent extends Event { - [verifiedSymbol]: true -} - -export function getBlankEvent(): EventTemplate -export function getBlankEvent(kind: K): EventTemplate -export function getBlankEvent(kind: K | Kind.Blank = Kind.Blank) { - return { - kind, - content: '', - tags: [], - created_at: 0, - } -} - -export function finishEvent(t: EventTemplate, privateKey: string): VerifiedEvent { - const event = t as VerifiedEvent - event.pubkey = getPublicKey(privateKey) - event.id = getEventHash(event) - event.sig = getSignature(event, privateKey) - event[verifiedSymbol] = true - return event -} - -export function serializeEvent(evt: UnsignedEvent): string { - if (!validateEvent(evt)) throw new Error("can't serialize event with wrong or missing properties") - - return JSON.stringify([0, evt.pubkey, evt.created_at, evt.kind, evt.tags, evt.content]) -} - -export function getEventHash(event: UnsignedEvent): string { - let eventHash = sha256(utf8Encoder.encode(serializeEvent(event))) - return bytesToHex(eventHash) -} - -const isRecord = (obj: unknown): obj is Record => obj instanceof Object - -export function validateEvent(event: T): event is T & UnsignedEvent { - if (!isRecord(event)) return false - if (typeof event.kind !== 'number') return false - if (typeof event.content !== 'string') return false - if (typeof event.created_at !== 'number') return false - if (typeof event.pubkey !== 'string') return false - if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false - - if (!Array.isArray(event.tags)) return false - for (let i = 0; i < event.tags.length; i++) { - let tag = event.tags[i] - if (!Array.isArray(tag)) return false - for (let j = 0; j < tag.length; j++) { - if (typeof tag[j] === 'object') return false - } - } - - return true -} - -/** Verify the event's signature. This function mutates the event with a `verified` symbol, making it idempotent. */ -export function verifySignature(event: Event): event is VerifiedEvent { - //@ts-ignore - if (typeof event[verifiedSymbol] === 'boolean') return event[verifiedSymbol] - - const hash = getEventHash(event) - if (hash !== event.id) { - return (event[verifiedSymbol] = false) - } - - try { - return (event[verifiedSymbol] = schnorr.verify(event.sig, hash, event.pubkey)) - } catch (err) { - return (event[verifiedSymbol] = false) - } -} - -/** @deprecated Use `getSignature` instead. */ -export function signEvent(event: UnsignedEvent, key: string): string { - console.warn( - 'nostr-tools: `signEvent` is deprecated and will be removed or changed in the future. Please use `getSignature` instead.', - ) - return getSignature(event, key) -} - -/** Calculate the signature for an event. */ -export function getSignature(event: UnsignedEvent, key: string): string { - return bytesToHex(schnorr.sign(getEventHash(event), key)) +import { schnorr } from '@noble/curves/secp256k1' +import { sha256 } from '@noble/hashes/sha256' +import { bytesToHex } from '@noble/hashes/utils' + +import { getPublicKey } from './keys.js' +import { utf8Encoder } from './utils.js' + +/** Designates a verified event signature. */ +export const verifiedSymbol = Symbol('verified') + +/** @deprecated Use numbers instead. */ +/* eslint-disable no-unused-vars */ +export enum Kind { + Metadata = 0, + Text = 1, + RecommendRelay = 2, + Contacts = 3, + EncryptedDirectMessage = 4, + EventDeletion = 5, + Repost = 6, + Reaction = 7, + BadgeAward = 8, + ChannelCreation = 40, + ChannelMetadata = 41, + ChannelMessage = 42, + ChannelHideMessage = 43, + ChannelMuteUser = 44, + Blank = 255, + Report = 1984, + ZapRequest = 9734, + Zap = 9735, + RelayList = 10002, + ClientAuth = 22242, + HttpAuth = 27235, + ProfileBadge = 30008, + BadgeDefinition = 30009, + Article = 30023, + FileMetadata = 1063, +} + +export interface Event { + kind: K + tags: string[][] + content: string + created_at: number + pubkey: string + id: string + sig: string + [verifiedSymbol]?: boolean +} + +export type EventTemplate = Pick, 'kind' | 'tags' | 'content' | 'created_at'> +export type UnsignedEvent = Pick< + Event, + 'kind' | 'tags' | 'content' | 'created_at' | 'pubkey' +> + +/** An event whose signature has been verified. */ +export interface VerifiedEvent extends Event { + [verifiedSymbol]: true +} + +export function getBlankEvent(): EventTemplate +export function getBlankEvent(kind: K): EventTemplate +export function getBlankEvent(kind: K | Kind.Blank = Kind.Blank) { + return { + kind, + content: '', + tags: [], + created_at: 0, + } +} + +export function finishEvent(t: EventTemplate, privateKey: string): VerifiedEvent { + const event = t as VerifiedEvent + event.pubkey = getPublicKey(privateKey) + event.id = getEventHash(event) + event.sig = getSignature(event, privateKey) + event[verifiedSymbol] = true + return event +} + +export function serializeEvent(evt: UnsignedEvent): string { + if (!validateEvent(evt)) throw new Error("can't serialize event with wrong or missing properties") + + return JSON.stringify([0, evt.pubkey, evt.created_at, evt.kind, evt.tags, evt.content]) +} + +export function getEventHash(event: UnsignedEvent): string { + let eventHash = sha256(utf8Encoder.encode(serializeEvent(event))) + return bytesToHex(eventHash) +} + +const isRecord = (obj: unknown): obj is Record => obj instanceof Object + +export function validateEvent(event: T): event is T & UnsignedEvent { + if (!isRecord(event)) return false + if (typeof event.kind !== 'number') return false + if (typeof event.content !== 'string') return false + if (typeof event.created_at !== 'number') return false + if (typeof event.pubkey !== 'string') return false + if (!event.pubkey.match(/^[a-f0-9]{64}$/)) return false + + if (!Array.isArray(event.tags)) return false + for (let i = 0; i < event.tags.length; i++) { + let tag = event.tags[i] + if (!Array.isArray(tag)) return false + for (let j = 0; j < tag.length; j++) { + if (typeof tag[j] === 'object') return false + } + } + + return true +} + +/** Verify the event's signature. This function mutates the event with a `verified` symbol, making it idempotent. */ +export function verifySignature(event: Event): event is VerifiedEvent { + //@ts-ignore + if (typeof event[verifiedSymbol] === 'boolean') return event[verifiedSymbol] + + const hash = getEventHash(event) + if (hash !== event.id) { + return (event[verifiedSymbol] = false) + } + + try { + return (event[verifiedSymbol] = schnorr.verify(event.sig, hash, event.pubkey)) + } catch (err) { + return (event[verifiedSymbol] = false) + } +} + +/** @deprecated Use `getSignature` instead. */ +export function signEvent(event: UnsignedEvent, key: string): string { + console.warn( + 'nostr-tools: `signEvent` is deprecated and will be removed or changed in the future. Please use `getSignature` instead.', + ) + return getSignature(event, key) +} + +/** Calculate the signature for an event. */ +export function getSignature(event: UnsignedEvent, key: string): string { + return bytesToHex(schnorr.sign(getEventHash(event), key)) } \ No newline at end of file diff --git a/src/services/nostr/tools/fakejson.ts b/src/services/nostr/tools/fakejson.ts index 7e710ed0..3f207bae 100644 --- a/src/services/nostr/tools/fakejson.ts +++ b/src/services/nostr/tools/fakejson.ts @@ -1,41 +1,41 @@ -export function getHex64(json: string, field: string): string { - let len = field.length + 3 - let idx = json.indexOf(`"${field}":`) + len - let s = json.slice(idx).indexOf(`"`) + idx + 1 - return json.slice(s, s + 64) -} - -export function getInt(json: string, field: string): number { - let len = field.length - let idx = json.indexOf(`"${field}":`) + len + 3 - let sliced = json.slice(idx) - let end = Math.min(sliced.indexOf(','), sliced.indexOf('}')) - return parseInt(sliced.slice(0, end), 10) -} - -export function getSubscriptionId(json: string): string | null { - let idx = json.slice(0, 22).indexOf(`"EVENT"`) - if (idx === -1) return null - - let pstart = json.slice(idx + 7 + 1).indexOf(`"`) - if (pstart === -1) return null - let start = idx + 7 + 1 + pstart - - let pend = json.slice(start + 1, 80).indexOf(`"`) - if (pend === -1) return null - let end = start + 1 + pend - - return json.slice(start + 1, end) -} - -export function matchEventId(json: string, id: string): boolean { - return id === getHex64(json, 'id') -} - -export function matchEventPubkey(json: string, pubkey: string): boolean { - return pubkey === getHex64(json, 'pubkey') -} - -export function matchEventKind(json: string, kind: number): boolean { - return kind === getInt(json, 'kind') +export function getHex64(json: string, field: string): string { + let len = field.length + 3 + let idx = json.indexOf(`"${field}":`) + len + let s = json.slice(idx).indexOf(`"`) + idx + 1 + return json.slice(s, s + 64) +} + +export function getInt(json: string, field: string): number { + let len = field.length + let idx = json.indexOf(`"${field}":`) + len + 3 + let sliced = json.slice(idx) + let end = Math.min(sliced.indexOf(','), sliced.indexOf('}')) + return parseInt(sliced.slice(0, end), 10) +} + +export function getSubscriptionId(json: string): string | null { + let idx = json.slice(0, 22).indexOf(`"EVENT"`) + if (idx === -1) return null + + let pstart = json.slice(idx + 7 + 1).indexOf(`"`) + if (pstart === -1) return null + let start = idx + 7 + 1 + pstart + + let pend = json.slice(start + 1, 80).indexOf(`"`) + if (pend === -1) return null + let end = start + 1 + pend + + return json.slice(start + 1, end) +} + +export function matchEventId(json: string, id: string): boolean { + return id === getHex64(json, 'id') +} + +export function matchEventPubkey(json: string, pubkey: string): boolean { + return pubkey === getHex64(json, 'pubkey') +} + +export function matchEventKind(json: string, kind: number): boolean { + return kind === getInt(json, 'kind') } \ No newline at end of file diff --git a/src/services/nostr/tools/filter.ts b/src/services/nostr/tools/filter.ts index f93c37e6..2caeccb5 100644 --- a/src/services/nostr/tools/filter.ts +++ b/src/services/nostr/tools/filter.ts @@ -1,72 +1,72 @@ -import { Event } from './event.js' - -export type Filter = { - ids?: string[] - kinds?: K[] - authors?: string[] - since?: number - until?: number - limit?: number - search?: string - [key: `#${string}`]: string[] | undefined -} - -export function matchFilter(filter: Filter, event: Event): boolean { - if (filter.ids && filter.ids.indexOf(event.id) === -1) { - if (!filter.ids.some(prefix => event.id.startsWith(prefix))) { - return false - } - } - if (filter.kinds && filter.kinds.indexOf(event.kind) === -1) return false - if (filter.authors && filter.authors.indexOf(event.pubkey) === -1) { - if (!filter.authors.some(prefix => event.pubkey.startsWith(prefix))) { - return false - } - } - - for (let f in filter) { - if (f[0] === '#') { - let tagName = f.slice(1) - let values = filter[`#${tagName}`] - if (values && !event.tags.find(([t, v]) => t === f.slice(1) && values!.indexOf(v) !== -1)) return false - } - } - - if (filter.since && event.created_at < filter.since) return false - if (filter.until && event.created_at > filter.until) return false - - return true -} - -export function matchFilters(filters: Filter[], event: Event): boolean { - for (let i = 0; i < filters.length; i++) { - if (matchFilter(filters[i], event)) return true - } - return false -} - -export function mergeFilters(...filters: Filter[]): Filter { - let result: Filter = {} - for (let i = 0; i < filters.length; i++) { - let filter = filters[i] - Object.entries(filter).forEach(([property, values]) => { - if (property === 'kinds' || property === 'ids' || property === 'authors' || property[0] === '#') { - // @ts-ignore - result[property] = result[property] || [] - // @ts-ignore - for (let v = 0; v < values.length; v++) { - // @ts-ignore - let value = values[v] - // @ts-ignore - if (!result[property].includes(value)) result[property].push(value) - } - } - }) - - if (filter.limit && (!result.limit || filter.limit > result.limit)) result.limit = filter.limit - if (filter.until && (!result.until || filter.until > result.until)) result.until = filter.until - if (filter.since && (!result.since || filter.since < result.since)) result.since = filter.since - } - - return result +import { Event } from './event.js' + +export type Filter = { + ids?: string[] + kinds?: K[] + authors?: string[] + since?: number + until?: number + limit?: number + search?: string + [key: `#${string}`]: string[] | undefined +} + +export function matchFilter(filter: Filter, event: Event): boolean { + if (filter.ids && filter.ids.indexOf(event.id) === -1) { + if (!filter.ids.some(prefix => event.id.startsWith(prefix))) { + return false + } + } + if (filter.kinds && filter.kinds.indexOf(event.kind) === -1) return false + if (filter.authors && filter.authors.indexOf(event.pubkey) === -1) { + if (!filter.authors.some(prefix => event.pubkey.startsWith(prefix))) { + return false + } + } + + for (let f in filter) { + if (f[0] === '#') { + let tagName = f.slice(1) + let values = filter[`#${tagName}`] + if (values && !event.tags.find(([t, v]) => t === f.slice(1) && values!.indexOf(v) !== -1)) return false + } + } + + if (filter.since && event.created_at < filter.since) return false + if (filter.until && event.created_at > filter.until) return false + + return true +} + +export function matchFilters(filters: Filter[], event: Event): boolean { + for (let i = 0; i < filters.length; i++) { + if (matchFilter(filters[i], event)) return true + } + return false +} + +export function mergeFilters(...filters: Filter[]): Filter { + let result: Filter = {} + for (let i = 0; i < filters.length; i++) { + let filter = filters[i] + Object.entries(filter).forEach(([property, values]) => { + if (property === 'kinds' || property === 'ids' || property === 'authors' || property[0] === '#') { + // @ts-ignore + result[property] = result[property] || [] + // @ts-ignore + for (let v = 0; v < values.length; v++) { + // @ts-ignore + let value = values[v] + // @ts-ignore + if (!result[property].includes(value)) result[property].push(value) + } + } + }) + + if (filter.limit && (!result.limit || filter.limit > result.limit)) result.limit = filter.limit + if (filter.until && (!result.until || filter.until > result.until)) result.until = filter.until + if (filter.since && (!result.since || filter.since < result.since)) result.since = filter.since + } + + return result } \ No newline at end of file diff --git a/src/services/nostr/tools/index.ts b/src/services/nostr/tools/index.ts index 3e7e0518..a3a62b47 100644 --- a/src/services/nostr/tools/index.ts +++ b/src/services/nostr/tools/index.ts @@ -1,7 +1,7 @@ -export * from './event.js' -export * from './fakejson.js' -export * from './filter.js' -export * from './keys.js' -export * from './pool.js' -export * from './relay.js' -export * from './utils.js' +export * from './event.js' +export * from './fakejson.js' +export * from './filter.js' +export * from './keys.js' +export * from './pool.js' +export * from './relay.js' +export * from './utils.js' diff --git a/src/services/nostr/tools/keys.ts b/src/services/nostr/tools/keys.ts index 18b3aff3..d6853142 100644 --- a/src/services/nostr/tools/keys.ts +++ b/src/services/nostr/tools/keys.ts @@ -1,10 +1,10 @@ -import { schnorr } from '@noble/curves/secp256k1' -import { bytesToHex } from '@noble/hashes/utils' - -export function generatePrivateKey(): string { - return bytesToHex(schnorr.utils.randomPrivateKey()) -} - -export function getPublicKey(privateKey: string): string { - return bytesToHex(schnorr.getPublicKey(privateKey)) +import { schnorr } from '@noble/curves/secp256k1' +import { bytesToHex } from '@noble/hashes/utils' + +export function generatePrivateKey(): string { + return bytesToHex(schnorr.utils.randomPrivateKey()) +} + +export function getPublicKey(privateKey: string): string { + return bytesToHex(schnorr.getPublicKey(privateKey)) } \ No newline at end of file diff --git a/src/services/nostr/tools/pool.ts b/src/services/nostr/tools/pool.ts index efdd177a..20fb3392 100644 --- a/src/services/nostr/tools/pool.ts +++ b/src/services/nostr/tools/pool.ts @@ -1,249 +1,249 @@ -import { relayInit, eventsGenerator, type Relay, type Sub, type SubscriptionOptions } from './relay.js' -import { normalizeURL } from './utils.js' - -import type { Event } from './event.js' -import { matchFilters, type Filter } from './filter.js' - -type BatchedRequest = { - filters: Filter[] - relays: string[] - resolve: (events: Event[]) => void - events: Event[] -} - -export class SimplePool { - private _conn: { [url: string]: Relay } - private _seenOn: { [id: string]: Set } = {} // a map of all events we've seen in each relay - private batchedByKey: { [batchKey: string]: BatchedRequest[] } = {} - - private eoseSubTimeout: number - private getTimeout: number - private seenOnEnabled: boolean = true - private batchInterval: number = 100 - - constructor( - options: { - eoseSubTimeout?: number - getTimeout?: number - seenOnEnabled?: boolean - batchInterval?: number - } = {}, - ) { - this._conn = {} - this.eoseSubTimeout = options.eoseSubTimeout || 3400 - this.getTimeout = options.getTimeout || 3400 - this.seenOnEnabled = options.seenOnEnabled !== false - this.batchInterval = options.batchInterval || 100 - } - - close(relays: string[]): void { - relays.forEach(url => { - let relay = this._conn[normalizeURL(url)] - if (relay) relay.close() - }) - } - - async ensureRelay(url: string): Promise { - const nm = normalizeURL(url) - - if (!this._conn[nm]) { - this._conn[nm] = relayInit(nm, { - getTimeout: this.getTimeout * 0.9, - listTimeout: this.getTimeout * 0.9, - }) - } - - const relay = this._conn[nm] - await relay.connect() - return relay - } - - sub(relays: string[], filters: Filter[], opts?: SubscriptionOptions): Sub { - let _knownIds: Set = new Set() - let modifiedOpts = { ...(opts || {}) } - modifiedOpts.alreadyHaveEvent = (id, url) => { - if (opts?.alreadyHaveEvent?.(id, url)) { - return true - } - if (this.seenOnEnabled) { - let set = this._seenOn[id] || new Set() - set.add(url) - this._seenOn[id] = set - } - return _knownIds.has(id) - } - - let subs: Sub[] = [] - let eventListeners: Set = new Set() - let eoseListeners: Set<() => void> = new Set() - let eosesMissing = relays.length - - let eoseSent = false - let eoseTimeout = setTimeout( - () => { - eoseSent = true - for (let cb of eoseListeners.values()) cb() - }, - opts?.eoseSubTimeout || this.eoseSubTimeout, - ) - - relays - .filter((r, i, a) => a.indexOf(r) === i) - .forEach(async relay => { - let r - try { - r = await this.ensureRelay(relay) - } catch (err) { - handleEose() - return - } - if (!r) return - let s = r.sub(filters, modifiedOpts) - s.on('event', event => { - _knownIds.add(event.id as string) - for (let cb of eventListeners.values()) cb(event) - }) - s.on('eose', () => { - if (eoseSent) return - handleEose() - }) - subs.push(s) - - function handleEose() { - eosesMissing-- - if (eosesMissing === 0) { - clearTimeout(eoseTimeout) - for (let cb of eoseListeners.values()) cb() - } - } - }) - - let greaterSub: Sub = { - sub(filters, opts) { - subs.forEach(sub => sub.sub(filters, opts)) - return greaterSub as any - }, - unsub() { - subs.forEach(sub => sub.unsub()) - }, - on(type, cb) { - if (type === 'event') { - eventListeners.add(cb) - } else if (type === 'eose') { - eoseListeners.add(cb as () => void | Promise) - } - }, - off(type, cb) { - if (type === 'event') { - eventListeners.delete(cb) - } else if (type === 'eose') eoseListeners.delete(cb as () => void | Promise) - }, - get events() { - return eventsGenerator(greaterSub) - }, - } - - return greaterSub - } - - get( - relays: string[], - filter: Filter, - opts?: SubscriptionOptions, - ): Promise | null> { - return new Promise(resolve => { - let sub = this.sub(relays, [filter], opts) - let timeout = setTimeout(() => { - sub.unsub() - resolve(null) - }, this.getTimeout) - sub.on('event', event => { - resolve(event) - clearTimeout(timeout) - sub.unsub() - }) - }) - } - - list( - relays: string[], - filters: Filter[], - opts?: SubscriptionOptions, - ): Promise[]> { - return new Promise(resolve => { - let events: Event[] = [] - let sub = this.sub(relays, filters, opts) - - sub.on('event', event => { - events.push(event) - }) - - // we can rely on an eose being emitted here because pool.sub() will fake one - sub.on('eose', () => { - sub.unsub() - resolve(events) - }) - }) - } - - batchedList( - batchKey: string, - relays: string[], - filters: Filter[], - ): Promise[]> { - return new Promise(resolve => { - if (!this.batchedByKey[batchKey]) { - this.batchedByKey[batchKey] = [ - { - filters, - relays, - resolve, - events: [], - }, - ] - - setTimeout(() => { - Object.keys(this.batchedByKey).forEach(async batchKey => { - const batchedRequests = this.batchedByKey[batchKey] - - const filters = [] as Filter[] - const relays = [] as string[] - batchedRequests.forEach(br => { - filters.push(...br.filters) - relays.push(...br.relays) - }) - - const sub = this.sub(relays, filters) - sub.on('event', event => { - batchedRequests.forEach(br => matchFilters(br.filters, event) && br.events.push(event)) - }) - sub.on('eose', () => { - sub.unsub() - batchedRequests.forEach(br => br.resolve(br.events)) - }) - - delete this.batchedByKey[batchKey] - }) - }, this.batchInterval) - } else { - this.batchedByKey[batchKey].push({ - filters, - relays, - resolve, - events: [], - }) - } - }) - } - - publish(relays: string[], event: Event): Promise[] { - return relays.map(async relay => { - let r = await this.ensureRelay(relay) - return r.publish(event) - }) - } - - seenOn(id: string): string[] { - return Array.from(this._seenOn[id]?.values?.() || []) - } +import { relayInit, eventsGenerator, type Relay, type Sub, type SubscriptionOptions } from './relay.js' +import { normalizeURL } from './utils.js' + +import type { Event } from './event.js' +import { matchFilters, type Filter } from './filter.js' + +type BatchedRequest = { + filters: Filter[] + relays: string[] + resolve: (events: Event[]) => void + events: Event[] +} + +export class SimplePool { + private _conn: { [url: string]: Relay } + private _seenOn: { [id: string]: Set } = {} // a map of all events we've seen in each relay + private batchedByKey: { [batchKey: string]: BatchedRequest[] } = {} + + private eoseSubTimeout: number + private getTimeout: number + private seenOnEnabled: boolean = true + private batchInterval: number = 100 + + constructor( + options: { + eoseSubTimeout?: number + getTimeout?: number + seenOnEnabled?: boolean + batchInterval?: number + } = {}, + ) { + this._conn = {} + this.eoseSubTimeout = options.eoseSubTimeout || 3400 + this.getTimeout = options.getTimeout || 3400 + this.seenOnEnabled = options.seenOnEnabled !== false + this.batchInterval = options.batchInterval || 100 + } + + close(relays: string[]): void { + relays.forEach(url => { + let relay = this._conn[normalizeURL(url)] + if (relay) relay.close() + }) + } + + async ensureRelay(url: string): Promise { + const nm = normalizeURL(url) + + if (!this._conn[nm]) { + this._conn[nm] = relayInit(nm, { + getTimeout: this.getTimeout * 0.9, + listTimeout: this.getTimeout * 0.9, + }) + } + + const relay = this._conn[nm] + await relay.connect() + return relay + } + + sub(relays: string[], filters: Filter[], opts?: SubscriptionOptions): Sub { + let _knownIds: Set = new Set() + let modifiedOpts = { ...(opts || {}) } + modifiedOpts.alreadyHaveEvent = (id, url) => { + if (opts?.alreadyHaveEvent?.(id, url)) { + return true + } + if (this.seenOnEnabled) { + let set = this._seenOn[id] || new Set() + set.add(url) + this._seenOn[id] = set + } + return _knownIds.has(id) + } + + let subs: Sub[] = [] + let eventListeners: Set = new Set() + let eoseListeners: Set<() => void> = new Set() + let eosesMissing = relays.length + + let eoseSent = false + let eoseTimeout = setTimeout( + () => { + eoseSent = true + for (let cb of eoseListeners.values()) cb() + }, + opts?.eoseSubTimeout || this.eoseSubTimeout, + ) + + relays + .filter((r, i, a) => a.indexOf(r) === i) + .forEach(async relay => { + let r + try { + r = await this.ensureRelay(relay) + } catch (err) { + handleEose() + return + } + if (!r) return + let s = r.sub(filters, modifiedOpts) + s.on('event', event => { + _knownIds.add(event.id as string) + for (let cb of eventListeners.values()) cb(event) + }) + s.on('eose', () => { + if (eoseSent) return + handleEose() + }) + subs.push(s) + + function handleEose() { + eosesMissing-- + if (eosesMissing === 0) { + clearTimeout(eoseTimeout) + for (let cb of eoseListeners.values()) cb() + } + } + }) + + let greaterSub: Sub = { + sub(filters, opts) { + subs.forEach(sub => sub.sub(filters, opts)) + return greaterSub as any + }, + unsub() { + subs.forEach(sub => sub.unsub()) + }, + on(type, cb) { + if (type === 'event') { + eventListeners.add(cb) + } else if (type === 'eose') { + eoseListeners.add(cb as () => void | Promise) + } + }, + off(type, cb) { + if (type === 'event') { + eventListeners.delete(cb) + } else if (type === 'eose') eoseListeners.delete(cb as () => void | Promise) + }, + get events() { + return eventsGenerator(greaterSub) + }, + } + + return greaterSub + } + + get( + relays: string[], + filter: Filter, + opts?: SubscriptionOptions, + ): Promise | null> { + return new Promise(resolve => { + let sub = this.sub(relays, [filter], opts) + let timeout = setTimeout(() => { + sub.unsub() + resolve(null) + }, this.getTimeout) + sub.on('event', event => { + resolve(event) + clearTimeout(timeout) + sub.unsub() + }) + }) + } + + list( + relays: string[], + filters: Filter[], + opts?: SubscriptionOptions, + ): Promise[]> { + return new Promise(resolve => { + let events: Event[] = [] + let sub = this.sub(relays, filters, opts) + + sub.on('event', event => { + events.push(event) + }) + + // we can rely on an eose being emitted here because pool.sub() will fake one + sub.on('eose', () => { + sub.unsub() + resolve(events) + }) + }) + } + + batchedList( + batchKey: string, + relays: string[], + filters: Filter[], + ): Promise[]> { + return new Promise(resolve => { + if (!this.batchedByKey[batchKey]) { + this.batchedByKey[batchKey] = [ + { + filters, + relays, + resolve, + events: [], + }, + ] + + setTimeout(() => { + Object.keys(this.batchedByKey).forEach(async batchKey => { + const batchedRequests = this.batchedByKey[batchKey] + + const filters = [] as Filter[] + const relays = [] as string[] + batchedRequests.forEach(br => { + filters.push(...br.filters) + relays.push(...br.relays) + }) + + const sub = this.sub(relays, filters) + sub.on('event', event => { + batchedRequests.forEach(br => matchFilters(br.filters, event) && br.events.push(event)) + }) + sub.on('eose', () => { + sub.unsub() + batchedRequests.forEach(br => br.resolve(br.events)) + }) + + delete this.batchedByKey[batchKey] + }) + }, this.batchInterval) + } else { + this.batchedByKey[batchKey].push({ + filters, + relays, + resolve, + events: [], + }) + } + }) + } + + publish(relays: string[], event: Event): Promise[] { + return relays.map(async relay => { + let r = await this.ensureRelay(relay) + return r.publish(event) + }) + } + + seenOn(id: string): string[] { + return Array.from(this._seenOn[id]?.values?.() || []) + } } \ No newline at end of file diff --git a/src/services/nostr/tools/relay.ts b/src/services/nostr/tools/relay.ts index b4135c37..d14b6f4b 100644 --- a/src/services/nostr/tools/relay.ts +++ b/src/services/nostr/tools/relay.ts @@ -1,402 +1,402 @@ -/* global WebSocket */ -import "websocket-polyfill" -import { verifySignature, validateEvent, type Event } from './event.js' -import { matchFilters, type Filter } from './filter.js' -import { getHex64, getSubscriptionId } from './fakejson.js' -import { MessageQueue } from './utils.js' - -type RelayEvent = { - connect: () => void | Promise - disconnect: () => void | Promise - error: () => void | Promise - notice: (msg: string) => void | Promise - auth: (challenge: string) => void | Promise -} -export type CountPayload = { - count: number -} -export type SubEvent = { - event: (event: Event) => void | Promise - count: (payload: CountPayload) => void | Promise - eose: () => void | Promise -} -export type Relay = { - url: string - status: number - connect: () => Promise - close: () => void - sub: (filters: Filter[], opts?: SubscriptionOptions) => Sub - list: (filters: Filter[], opts?: SubscriptionOptions) => Promise[]> - get: (filter: Filter, opts?: SubscriptionOptions) => Promise | null> - count: (filters: Filter[], opts?: SubscriptionOptions) => Promise - publish: (event: Event) => Promise - auth: (event: Event) => Promise - off: (event: T, listener: U) => void - on: (event: T, listener: U) => void -} -export type Sub = { - sub: (filters: Filter[], opts: SubscriptionOptions) => Sub - unsub: () => void - on: , U extends SubEvent[T]>(event: T, listener: U) => void - off: , U extends SubEvent[T]>(event: T, listener: U) => void - events: AsyncGenerator, void, unknown> -} - -export type SubscriptionOptions = { - id?: string - verb?: 'REQ' | 'COUNT' - skipVerification?: boolean - alreadyHaveEvent?: null | ((id: string, relay: string) => boolean) - eoseSubTimeout?: number -} - -const newListeners = (): { [TK in keyof RelayEvent]: RelayEvent[TK][] } => ({ - connect: [], - disconnect: [], - error: [], - notice: [], - auth: [], -}) - -export function relayInit( - url: string, - options: { - getTimeout?: number - listTimeout?: number - countTimeout?: number - } = {}, -): Relay { - let { listTimeout = 3000, getTimeout = 3000, countTimeout = 3000 } = options - - var ws: WebSocket - var openSubs: { [id: string]: { filters: Filter[] } & SubscriptionOptions } = {} - var listeners = newListeners() - var subListeners: { - [subid: string]: { [TK in keyof SubEvent]: SubEvent[TK][] } - } = {} - var pubListeners: { - [eventid: string]: { - resolve: (_: unknown) => void - reject: (err: Error) => void - } - } = {} - - var connectionPromise: Promise | undefined - async function connectRelay(): Promise { - if (connectionPromise) return connectionPromise - connectionPromise = new Promise((resolve, reject) => { - try { - ws = new WebSocket(url) - } catch (err) { - reject(err) - } - - ws.onopen = () => { - listeners.connect.forEach(cb => cb()) - resolve() - } - ws.onerror = () => { - connectionPromise = undefined - listeners.error.forEach(cb => cb()) - reject() - } - ws.onclose = async () => { - connectionPromise = undefined - listeners.disconnect.forEach(cb => cb()) - } - - let incomingMessageQueue: MessageQueue = new MessageQueue() - let handleNextInterval: any - - ws.onmessage = e => { - incomingMessageQueue.enqueue(e.data) - if (!handleNextInterval) { - handleNextInterval = setInterval(handleNext, 0) - } - } - - function handleNext() { - if (incomingMessageQueue.size === 0) { - clearInterval(handleNextInterval) - handleNextInterval = null - return - } - - var json = incomingMessageQueue.dequeue() - if (!json) return - - let subid = getSubscriptionId(json) - if (subid) { - let so = openSubs[subid] - if (so && so.alreadyHaveEvent && so.alreadyHaveEvent(getHex64(json, 'id'), url)) { - return - } - } - - try { - let data = JSON.parse(json) - - // we won't do any checks against the data since all failures (i.e. invalid messages from relays) - // will naturally be caught by the encompassing try..catch block - - switch (data[0]) { - case 'EVENT': { - let id = data[1] - let event = data[2] - if ( - validateEvent(event) && - openSubs[id] && - (openSubs[id].skipVerification || verifySignature(event)) && - matchFilters(openSubs[id].filters, event) - ) { - openSubs[id] - ; (subListeners[id]?.event || []).forEach(cb => cb(event)) - } - return - } - case 'COUNT': - let id = data[1] - let payload = data[2] - if (openSubs[id]) { - ; (subListeners[id]?.count || []).forEach(cb => cb(payload)) - } - return - case 'EOSE': { - let id = data[1] - if (id in subListeners) { - subListeners[id].eose.forEach(cb => cb()) - subListeners[id].eose = [] // 'eose' only happens once per sub, so stop listeners here - } - return - } - case 'OK': { - let id: string = data[1] - let ok: boolean = data[2] - let reason: string = data[3] || '' - if (id in pubListeners) { - let { resolve, reject } = pubListeners[id] - if (ok) resolve(null) - else reject(new Error(reason)) - } - return - } - case 'NOTICE': - let notice = data[1] - listeners.notice.forEach(cb => cb(notice)) - return - case 'AUTH': { - let challenge = data[1] - listeners.auth?.forEach(cb => cb(challenge)) - return - } - } - } catch (err) { - return - } - } - }) - - return connectionPromise - } - - function connected() { - return ws?.readyState === 1 - } - - async function connect(): Promise { - if (connected()) return // ws already open - await connectRelay() - } - - async function trySend(params: [string, ...any]) { - let msg = JSON.stringify(params) - if (!connected()) { - await new Promise(resolve => setTimeout(resolve, 1000)) - if (!connected()) { - return - } - } - try { - ws.send(msg) - } catch (err) { - console.log(err) - } - } - - const sub = ( - filters: Filter[], - { - verb = 'REQ', - skipVerification = false, - alreadyHaveEvent = null, - id = Math.random().toString().slice(2), - }: SubscriptionOptions = {}, - ): Sub => { - let subid = id - - openSubs[subid] = { - id: subid, - filters, - skipVerification, - alreadyHaveEvent, - } - trySend([verb, subid, ...filters]) - - let subscription: Sub = { - sub: (newFilters, newOpts = {}) => - sub(newFilters || filters, { - skipVerification: newOpts.skipVerification || skipVerification, - alreadyHaveEvent: newOpts.alreadyHaveEvent || alreadyHaveEvent, - id: subid, - }), - unsub: () => { - delete openSubs[subid] - delete subListeners[subid] - trySend(['CLOSE', subid]) - }, - on: (type, cb) => { - subListeners[subid] = subListeners[subid] || { - event: [], - count: [], - eose: [], - } - //@ts-ignore - subListeners[subid][type].push(cb) - }, - off: (type, cb): void => { - let listeners = subListeners[subid] - //@ts-ignore - let idx = listeners[type].indexOf(cb) - if (idx >= 0) listeners[type].splice(idx, 1) - }, - get events() { - return eventsGenerator(subscription) - }, - } - - return subscription - } - - function _publishEvent(event: Event, type: string) { - return new Promise((resolve, reject) => { - if (!event.id) { - reject(new Error(`event ${event} has no id`)) - return - } - - let id = event.id - trySend([type, event]) - pubListeners[id] = { resolve, reject } - }) - } - - return { - url, - sub, - on: (type: T, cb: U): void => { - //@ts-ignore - listeners[type].push(cb) - if (type === 'connect' && ws?.readyState === 1) { - // i would love to know why we need this - ; (cb as () => void)() - } - }, - off: (type: T, cb: U): void => { - //@ts-ignore - let index = listeners[type].indexOf(cb) - if (index !== -1) listeners[type].splice(index, 1) - }, - list: (filters, opts?: SubscriptionOptions) => - new Promise(resolve => { - let s = sub(filters, opts) - let events: Event[] = [] - let timeout = setTimeout(() => { - s.unsub() - resolve(events) - }, listTimeout) - s.on('eose', () => { - s.unsub() - clearTimeout(timeout) - resolve(events) - }) - s.on('event', event => { - events.push(event) - }) - }), - get: (filter, opts?: SubscriptionOptions) => - new Promise(resolve => { - let s = sub([filter], opts) - let timeout = setTimeout(() => { - s.unsub() - resolve(null) - }, getTimeout) - s.on('event', event => { - s.unsub() - clearTimeout(timeout) - resolve(event) - }) - }), - count: (filters: Filter[]): Promise => - new Promise(resolve => { - let s = sub(filters, { ...sub, verb: 'COUNT' }) - let timeout = setTimeout(() => { - s.unsub() - resolve(null) - }, countTimeout) - s.on('count', (event: CountPayload) => { - s.unsub() - clearTimeout(timeout) - resolve(event) - }) - }), - async publish(event): Promise { - await _publishEvent(event, 'EVENT') - }, - async auth(event): Promise { - await _publishEvent(event, 'AUTH') - }, - connect, - close(): void { - listeners = newListeners() - subListeners = {} - pubListeners = {} - if (ws?.readyState === WebSocket.OPEN) { - ws.close() - } - }, - get status() { - return ws?.readyState ?? 3 - }, - } -} - -export async function* eventsGenerator(sub: Sub): AsyncGenerator, void, unknown> { - let nextResolve: ((event: Event) => void) | undefined - const eventQueue: Event[] = [] - - const pushToQueue = (event: Event) => { - if (nextResolve) { - nextResolve(event) - nextResolve = undefined - } else { - eventQueue.push(event) - } - } - - sub.on('event', pushToQueue) - - try { - while (true) { - if (eventQueue.length > 0) { - yield eventQueue.shift()! - } else { - const event = await new Promise>(resolve => { - nextResolve = resolve - }) - yield event - } - } - } finally { - sub.off('event', pushToQueue) - } +/* global WebSocket */ +import "websocket-polyfill" +import { verifySignature, validateEvent, type Event } from './event.js' +import { matchFilters, type Filter } from './filter.js' +import { getHex64, getSubscriptionId } from './fakejson.js' +import { MessageQueue } from './utils.js' + +type RelayEvent = { + connect: () => void | Promise + disconnect: () => void | Promise + error: () => void | Promise + notice: (msg: string) => void | Promise + auth: (challenge: string) => void | Promise +} +export type CountPayload = { + count: number +} +export type SubEvent = { + event: (event: Event) => void | Promise + count: (payload: CountPayload) => void | Promise + eose: () => void | Promise +} +export type Relay = { + url: string + status: number + connect: () => Promise + close: () => void + sub: (filters: Filter[], opts?: SubscriptionOptions) => Sub + list: (filters: Filter[], opts?: SubscriptionOptions) => Promise[]> + get: (filter: Filter, opts?: SubscriptionOptions) => Promise | null> + count: (filters: Filter[], opts?: SubscriptionOptions) => Promise + publish: (event: Event) => Promise + auth: (event: Event) => Promise + off: (event: T, listener: U) => void + on: (event: T, listener: U) => void +} +export type Sub = { + sub: (filters: Filter[], opts: SubscriptionOptions) => Sub + unsub: () => void + on: , U extends SubEvent[T]>(event: T, listener: U) => void + off: , U extends SubEvent[T]>(event: T, listener: U) => void + events: AsyncGenerator, void, unknown> +} + +export type SubscriptionOptions = { + id?: string + verb?: 'REQ' | 'COUNT' + skipVerification?: boolean + alreadyHaveEvent?: null | ((id: string, relay: string) => boolean) + eoseSubTimeout?: number +} + +const newListeners = (): { [TK in keyof RelayEvent]: RelayEvent[TK][] } => ({ + connect: [], + disconnect: [], + error: [], + notice: [], + auth: [], +}) + +export function relayInit( + url: string, + options: { + getTimeout?: number + listTimeout?: number + countTimeout?: number + } = {}, +): Relay { + let { listTimeout = 3000, getTimeout = 3000, countTimeout = 3000 } = options + + var ws: WebSocket + var openSubs: { [id: string]: { filters: Filter[] } & SubscriptionOptions } = {} + var listeners = newListeners() + var subListeners: { + [subid: string]: { [TK in keyof SubEvent]: SubEvent[TK][] } + } = {} + var pubListeners: { + [eventid: string]: { + resolve: (_: unknown) => void + reject: (err: Error) => void + } + } = {} + + var connectionPromise: Promise | undefined + async function connectRelay(): Promise { + if (connectionPromise) return connectionPromise + connectionPromise = new Promise((resolve, reject) => { + try { + ws = new WebSocket(url) + } catch (err) { + reject(err) + } + + ws.onopen = () => { + listeners.connect.forEach(cb => cb()) + resolve() + } + ws.onerror = () => { + connectionPromise = undefined + listeners.error.forEach(cb => cb()) + reject() + } + ws.onclose = async () => { + connectionPromise = undefined + listeners.disconnect.forEach(cb => cb()) + } + + let incomingMessageQueue: MessageQueue = new MessageQueue() + let handleNextInterval: any + + ws.onmessage = e => { + incomingMessageQueue.enqueue(e.data) + if (!handleNextInterval) { + handleNextInterval = setInterval(handleNext, 0) + } + } + + function handleNext() { + if (incomingMessageQueue.size === 0) { + clearInterval(handleNextInterval) + handleNextInterval = null + return + } + + var json = incomingMessageQueue.dequeue() + if (!json) return + + let subid = getSubscriptionId(json) + if (subid) { + let so = openSubs[subid] + if (so && so.alreadyHaveEvent && so.alreadyHaveEvent(getHex64(json, 'id'), url)) { + return + } + } + + try { + let data = JSON.parse(json) + + // we won't do any checks against the data since all failures (i.e. invalid messages from relays) + // will naturally be caught by the encompassing try..catch block + + switch (data[0]) { + case 'EVENT': { + let id = data[1] + let event = data[2] + if ( + validateEvent(event) && + openSubs[id] && + (openSubs[id].skipVerification || verifySignature(event)) && + matchFilters(openSubs[id].filters, event) + ) { + openSubs[id] + ; (subListeners[id]?.event || []).forEach(cb => cb(event)) + } + return + } + case 'COUNT': + let id = data[1] + let payload = data[2] + if (openSubs[id]) { + ; (subListeners[id]?.count || []).forEach(cb => cb(payload)) + } + return + case 'EOSE': { + let id = data[1] + if (id in subListeners) { + subListeners[id].eose.forEach(cb => cb()) + subListeners[id].eose = [] // 'eose' only happens once per sub, so stop listeners here + } + return + } + case 'OK': { + let id: string = data[1] + let ok: boolean = data[2] + let reason: string = data[3] || '' + if (id in pubListeners) { + let { resolve, reject } = pubListeners[id] + if (ok) resolve(null) + else reject(new Error(reason)) + } + return + } + case 'NOTICE': + let notice = data[1] + listeners.notice.forEach(cb => cb(notice)) + return + case 'AUTH': { + let challenge = data[1] + listeners.auth?.forEach(cb => cb(challenge)) + return + } + } + } catch (err) { + return + } + } + }) + + return connectionPromise + } + + function connected() { + return ws?.readyState === 1 + } + + async function connect(): Promise { + if (connected()) return // ws already open + await connectRelay() + } + + async function trySend(params: [string, ...any]) { + let msg = JSON.stringify(params) + if (!connected()) { + await new Promise(resolve => setTimeout(resolve, 1000)) + if (!connected()) { + return + } + } + try { + ws.send(msg) + } catch (err) { + console.log(err) + } + } + + const sub = ( + filters: Filter[], + { + verb = 'REQ', + skipVerification = false, + alreadyHaveEvent = null, + id = Math.random().toString().slice(2), + }: SubscriptionOptions = {}, + ): Sub => { + let subid = id + + openSubs[subid] = { + id: subid, + filters, + skipVerification, + alreadyHaveEvent, + } + trySend([verb, subid, ...filters]) + + let subscription: Sub = { + sub: (newFilters, newOpts = {}) => + sub(newFilters || filters, { + skipVerification: newOpts.skipVerification || skipVerification, + alreadyHaveEvent: newOpts.alreadyHaveEvent || alreadyHaveEvent, + id: subid, + }), + unsub: () => { + delete openSubs[subid] + delete subListeners[subid] + trySend(['CLOSE', subid]) + }, + on: (type, cb) => { + subListeners[subid] = subListeners[subid] || { + event: [], + count: [], + eose: [], + } + //@ts-ignore + subListeners[subid][type].push(cb) + }, + off: (type, cb): void => { + let listeners = subListeners[subid] + //@ts-ignore + let idx = listeners[type].indexOf(cb) + if (idx >= 0) listeners[type].splice(idx, 1) + }, + get events() { + return eventsGenerator(subscription) + }, + } + + return subscription + } + + function _publishEvent(event: Event, type: string) { + return new Promise((resolve, reject) => { + if (!event.id) { + reject(new Error(`event ${event} has no id`)) + return + } + + let id = event.id + trySend([type, event]) + pubListeners[id] = { resolve, reject } + }) + } + + return { + url, + sub, + on: (type: T, cb: U): void => { + //@ts-ignore + listeners[type].push(cb) + if (type === 'connect' && ws?.readyState === 1) { + // i would love to know why we need this + ; (cb as () => void)() + } + }, + off: (type: T, cb: U): void => { + //@ts-ignore + let index = listeners[type].indexOf(cb) + if (index !== -1) listeners[type].splice(index, 1) + }, + list: (filters, opts?: SubscriptionOptions) => + new Promise(resolve => { + let s = sub(filters, opts) + let events: Event[] = [] + let timeout = setTimeout(() => { + s.unsub() + resolve(events) + }, listTimeout) + s.on('eose', () => { + s.unsub() + clearTimeout(timeout) + resolve(events) + }) + s.on('event', event => { + events.push(event) + }) + }), + get: (filter, opts?: SubscriptionOptions) => + new Promise(resolve => { + let s = sub([filter], opts) + let timeout = setTimeout(() => { + s.unsub() + resolve(null) + }, getTimeout) + s.on('event', event => { + s.unsub() + clearTimeout(timeout) + resolve(event) + }) + }), + count: (filters: Filter[]): Promise => + new Promise(resolve => { + let s = sub(filters, { ...sub, verb: 'COUNT' }) + let timeout = setTimeout(() => { + s.unsub() + resolve(null) + }, countTimeout) + s.on('count', (event: CountPayload) => { + s.unsub() + clearTimeout(timeout) + resolve(event) + }) + }), + async publish(event): Promise { + await _publishEvent(event, 'EVENT') + }, + async auth(event): Promise { + await _publishEvent(event, 'AUTH') + }, + connect, + close(): void { + listeners = newListeners() + subListeners = {} + pubListeners = {} + if (ws?.readyState === WebSocket.OPEN) { + ws.close() + } + }, + get status() { + return ws?.readyState ?? 3 + }, + } +} + +export async function* eventsGenerator(sub: Sub): AsyncGenerator, void, unknown> { + let nextResolve: ((event: Event) => void) | undefined + const eventQueue: Event[] = [] + + const pushToQueue = (event: Event) => { + if (nextResolve) { + nextResolve(event) + nextResolve = undefined + } else { + eventQueue.push(event) + } + } + + sub.on('event', pushToQueue) + + try { + while (true) { + if (eventQueue.length > 0) { + yield eventQueue.shift()! + } else { + const event = await new Promise>(resolve => { + nextResolve = resolve + }) + yield event + } + } + } finally { + sub.off('event', pushToQueue) + } } \ No newline at end of file diff --git a/src/services/nostr/tools/utils.ts b/src/services/nostr/tools/utils.ts index e7d3d7e4..5a735aa9 100644 --- a/src/services/nostr/tools/utils.ts +++ b/src/services/nostr/tools/utils.ts @@ -1,169 +1,169 @@ -import type { Event } from './event.js' - -export const utf8Decoder = new TextDecoder('utf-8') -export const utf8Encoder = new TextEncoder() - -export function normalizeURL(url: string): string { - let p = new URL(url) - p.pathname = p.pathname.replace(/\/+/g, '/') - if (p.pathname.endsWith('/')) p.pathname = p.pathname.slice(0, -1) - if ((p.port === '80' && p.protocol === 'ws:') || (p.port === '443' && p.protocol === 'wss:')) p.port = '' - p.searchParams.sort() - p.hash = '' - return p.toString() -} - -// -// fast insert-into-sorted-array functions adapted from https://github.com/terrymorse58/fast-sorted-array -// -export function insertEventIntoDescendingList(sortedArray: Event[], event: Event) { - let start = 0 - let end = sortedArray.length - 1 - let midPoint - let position = start - - if (end < 0) { - position = 0 - } else if (event.created_at < sortedArray[end].created_at) { - position = end + 1 - } else if (event.created_at >= sortedArray[start].created_at) { - position = start - } else - while (true) { - if (end <= start + 1) { - position = end - break - } - midPoint = Math.floor(start + (end - start) / 2) - if (sortedArray[midPoint].created_at > event.created_at) { - start = midPoint - } else if (sortedArray[midPoint].created_at < event.created_at) { - end = midPoint - } else { - // aMidPoint === num - position = midPoint - break - } - } - - // insert when num is NOT already in (no duplicates) - if (sortedArray[position]?.id !== event.id) { - return [...sortedArray.slice(0, position), event, ...sortedArray.slice(position)] - } - - return sortedArray -} - -export function insertEventIntoAscendingList(sortedArray: Event[], event: Event) { - let start = 0 - let end = sortedArray.length - 1 - let midPoint - let position = start - - if (end < 0) { - position = 0 - } else if (event.created_at > sortedArray[end].created_at) { - position = end + 1 - } else if (event.created_at <= sortedArray[start].created_at) { - position = start - } else - while (true) { - if (end <= start + 1) { - position = end - break - } - midPoint = Math.floor(start + (end - start) / 2) - if (sortedArray[midPoint].created_at < event.created_at) { - start = midPoint - } else if (sortedArray[midPoint].created_at > event.created_at) { - end = midPoint - } else { - // aMidPoint === num - position = midPoint - break - } - } - - // insert when num is NOT already in (no duplicates) - if (sortedArray[position]?.id !== event.id) { - return [...sortedArray.slice(0, position), event, ...sortedArray.slice(position)] - } - - return sortedArray -} - -export class MessageNode { - private _value: string - private _next: MessageNode | null - - public get value(): string { - return this._value - } - public set value(message: string) { - this._value = message - } - public get next(): MessageNode | null { - return this._next - } - public set next(node: MessageNode | null) { - this._next = node - } - - constructor(message: string) { - this._value = message - this._next = null - } -} - -export class MessageQueue { - private _first: MessageNode | null - private _last: MessageNode | null - - public get first(): MessageNode | null { - return this._first - } - public set first(messageNode: MessageNode | null) { - this._first = messageNode - } - public get last(): MessageNode | null { - return this._last - } - public set last(messageNode: MessageNode | null) { - this._last = messageNode - } - private _size: number - public get size(): number { - return this._size - } - public set size(v: number) { - this._size = v - } - - constructor() { - this._first = null - this._last = null - this._size = 0 - } - enqueue(message: string): boolean { - const newNode = new MessageNode(message) - if (this._size === 0 || !this._last) { - this._first = newNode - this._last = newNode - } else { - this._last.next = newNode - this._last = newNode - } - this._size++ - return true - } - dequeue(): string | null { - if (this._size === 0 || !this._first) return null - - let prev = this._first - this._first = prev.next - prev.next = null - - this._size-- - return prev.value - } +import type { Event } from './event.js' + +export const utf8Decoder = new TextDecoder('utf-8') +export const utf8Encoder = new TextEncoder() + +export function normalizeURL(url: string): string { + let p = new URL(url) + p.pathname = p.pathname.replace(/\/+/g, '/') + if (p.pathname.endsWith('/')) p.pathname = p.pathname.slice(0, -1) + if ((p.port === '80' && p.protocol === 'ws:') || (p.port === '443' && p.protocol === 'wss:')) p.port = '' + p.searchParams.sort() + p.hash = '' + return p.toString() +} + +// +// fast insert-into-sorted-array functions adapted from https://github.com/terrymorse58/fast-sorted-array +// +export function insertEventIntoDescendingList(sortedArray: Event[], event: Event) { + let start = 0 + let end = sortedArray.length - 1 + let midPoint + let position = start + + if (end < 0) { + position = 0 + } else if (event.created_at < sortedArray[end].created_at) { + position = end + 1 + } else if (event.created_at >= sortedArray[start].created_at) { + position = start + } else + while (true) { + if (end <= start + 1) { + position = end + break + } + midPoint = Math.floor(start + (end - start) / 2) + if (sortedArray[midPoint].created_at > event.created_at) { + start = midPoint + } else if (sortedArray[midPoint].created_at < event.created_at) { + end = midPoint + } else { + // aMidPoint === num + position = midPoint + break + } + } + + // insert when num is NOT already in (no duplicates) + if (sortedArray[position]?.id !== event.id) { + return [...sortedArray.slice(0, position), event, ...sortedArray.slice(position)] + } + + return sortedArray +} + +export function insertEventIntoAscendingList(sortedArray: Event[], event: Event) { + let start = 0 + let end = sortedArray.length - 1 + let midPoint + let position = start + + if (end < 0) { + position = 0 + } else if (event.created_at > sortedArray[end].created_at) { + position = end + 1 + } else if (event.created_at <= sortedArray[start].created_at) { + position = start + } else + while (true) { + if (end <= start + 1) { + position = end + break + } + midPoint = Math.floor(start + (end - start) / 2) + if (sortedArray[midPoint].created_at < event.created_at) { + start = midPoint + } else if (sortedArray[midPoint].created_at > event.created_at) { + end = midPoint + } else { + // aMidPoint === num + position = midPoint + break + } + } + + // insert when num is NOT already in (no duplicates) + if (sortedArray[position]?.id !== event.id) { + return [...sortedArray.slice(0, position), event, ...sortedArray.slice(position)] + } + + return sortedArray +} + +export class MessageNode { + private _value: string + private _next: MessageNode | null + + public get value(): string { + return this._value + } + public set value(message: string) { + this._value = message + } + public get next(): MessageNode | null { + return this._next + } + public set next(node: MessageNode | null) { + this._next = node + } + + constructor(message: string) { + this._value = message + this._next = null + } +} + +export class MessageQueue { + private _first: MessageNode | null + private _last: MessageNode | null + + public get first(): MessageNode | null { + return this._first + } + public set first(messageNode: MessageNode | null) { + this._first = messageNode + } + public get last(): MessageNode | null { + return this._last + } + public set last(messageNode: MessageNode | null) { + this._last = messageNode + } + private _size: number + public get size(): number { + return this._size + } + public set size(v: number) { + this._size = v + } + + constructor() { + this._first = null + this._last = null + this._size = 0 + } + enqueue(message: string): boolean { + const newNode = new MessageNode(message) + if (this._size === 0 || !this._last) { + this._first = newNode + this._last = newNode + } else { + this._last.next = newNode + this._last = newNode + } + this._size++ + return true + } + dequeue(): string | null { + if (this._size === 0 || !this._first) return null + + let prev = this._first + this._first = prev.next + prev.next = null + + this._size-- + return prev.value + } } \ No newline at end of file diff --git a/src/services/serverMethods/index.ts b/src/services/serverMethods/index.ts index f51d9296..7e8a1363 100644 --- a/src/services/serverMethods/index.ts +++ b/src/services/serverMethods/index.ts @@ -1,219 +1,219 @@ -import * as Types from '../../../proto/autogenerated/ts/types.js' -import { getLogger } from '../helpers/logger.js' -import main from '../main/index.js' -import Main from '../main/index.js' -export default (mainHandler: Main): Types.ServerMethods => { - return { - GetUsageMetrics: async ({ ctx }) => { - return mainHandler.metricsManager.GetUsageMetrics() - }, - GetAppsMetrics: async ({ ctx, req }) => { - return mainHandler.metricsManager.GetAppsMetrics(req) - }, - GetLndMetrics: async ({ ctx, req }) => { - return mainHandler.metricsManager.GetLndMetrics(req) - }, - EncryptionExchange: async () => { }, - Health: async () => { await mainHandler.lnd.Health() }, - LndGetInfo: async ({ ctx }) => { - const info = await mainHandler.lnd.GetInfo() - return { alias: info.alias } - }, - BanUser: async ({ ctx, req }) => { - const err = Types.BanUserRequestValidate(req, { - user_id_CustomCheck: id => id !== '' - }) - if (err != null) throw new Error(err.message) - return mainHandler.appUserManager.BanUser(req.user_id) - }, - SetMockInvoiceAsPaid: async ({ ctx, req }) => { - const err = Types.SetMockInvoiceAsPaidRequestValidate(req, { - invoice_CustomCheck: invoice => invoice !== '', - }) - if (err != null) throw new Error(err.message) - await mainHandler.paymentManager.SetMockInvoiceAsPaid(req) - }, - UserHealth: async () => { }, - GetUserInfo: ({ ctx }) => mainHandler.appUserManager.GetUserInfo(ctx), - GetUserOperations: async ({ ctx, req }) => { - return mainHandler.paymentManager.GetUserOperations(ctx.user_id, req) - }, - OpenChannel: async ({ ctx, req }) => { - const err = Types.OpenChannelRequestValidate(req, { - fundingAmount_CustomCheck: amt => amt > 0, - pushAmount_CustomCheck: amt => amt > 0, - destination_CustomCheck: dest => dest !== "" - }) - if (err != null) throw new Error(err.message) - return mainHandler.paymentManager.OpenChannel(ctx.user_id, req) - }, - NewAddress: ({ ctx, req }) => mainHandler.paymentManager.NewAddress(ctx, req), - PayAddress: async ({ ctx, req }) => { - const err = Types.PayAddressRequestValidate(req, { - address_CustomCheck: addr => addr !== '', - amoutSats_CustomCheck: amt => amt > 0, - satsPerVByte_CustomCheck: spb => spb > 0 - }) - if (err != null) throw new Error(err.message) - return mainHandler.paymentManager.PayAddress(ctx, req) - }, - NewInvoice: ({ ctx, req }) => mainHandler.appUserManager.NewInvoice(ctx, req), - DecodeInvoice: async ({ ctx, req }) => { - return mainHandler.paymentManager.DecodeInvoice(req) - }, - PayInvoice: async ({ ctx, req }) => { - const err = Types.PayInvoiceRequestValidate(req, { - invoice_CustomCheck: invoice => invoice !== '' - }) - if (err != null) throw new Error(err.message) - return mainHandler.appUserManager.PayInvoice(ctx, req) - }, - GetLnurlWithdrawLink: ({ ctx }) => mainHandler.paymentManager.GetLnurlWithdrawLink(ctx), - GetLnurlWithdrawInfo: async ({ ctx, query }) => { - if (!query.k1) { - throw new Error("invalid lnurl withdraw to get info") - } - return mainHandler.paymentManager.GetLnurlWithdrawInfo(query.k1) - }, - HandleLnurlWithdraw: async ({ query }) => { - if (!query.k1 || !query.pr) { - throw new Error("invalid lnurl withdraw to handle") - } - return mainHandler.paymentManager.HandleLnurlWithdraw(query.k1, query.pr) - }, - GetLnurlPayLink: ({ ctx }) => mainHandler.paymentManager.GetLnurlPayLink(ctx), - GetLnurlPayInfo: async ({ ctx, query }) => { - if (!query.k1) { - throw new Error("invalid lnurl pay to get info") - } - return mainHandler.paymentManager.GetLnurlPayInfo(query.k1) - }, - HandleLnurlPay: async ({ ctx, query }) => { - return mainHandler.paymentManager.HandleLnurlPay(query) - }, - HandleLnurlAddress: async ({ ctx, params }) => { - if (!params.address_name) { - throw new Error("invalid address_name to lnurl address") - } - return mainHandler.paymentManager.HandleLnurlAddress(params.address_name) - }, - AddProduct: async ({ ctx, req }) => { - return mainHandler.productManager.AddProduct(ctx.user_id, req) - }, - NewProductInvoice: async ({ query }) => { - if (!query.id) { - throw new Error("product id must be non empty") - } - return mainHandler.productManager.NewProductInvoice(query.id) - }, - GetLNURLChannelLink: async ({ ctx }) => { - throw new Error("unimplemented") - }, - AddApp: async ({ ctx, req }) => { - const err = Types.AuthAppRequestValidate(req, { - name_CustomCheck: name => name !== '' - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.AddApp(req) - }, - AuthApp: async ({ ctx, req }) => { - const err = Types.AuthAppRequestValidate(req, { - name_CustomCheck: name => name !== '' - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.AuthApp(req) - }, - GetApp: async ({ ctx }) => { - return mainHandler.applicationManager.GetApp(ctx.app_id) - }, - AddAppUser: async ({ ctx, req }) => { - const err = Types.AddAppUserRequestValidate(req, { - identifier_CustomCheck: id => id !== '' - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.AddAppUser(ctx.app_id, req) - }, - AddAppInvoice: async ({ ctx, req }) => { - const err = Types.AddAppInvoiceRequestValidate(req, { - payer_identifier_CustomCheck: id => id !== '', - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.AddAppInvoice(ctx.app_id, req) - }, - AddAppUserInvoice: async ({ ctx, req }) => { - const err = Types.AddAppUserInvoiceRequestValidate(req, { - payer_identifier_CustomCheck: id => id !== '', - receiver_identifier_CustomCheck: id => id !== '', - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.AddAppUserInvoice(ctx.app_id, req) - }, - GetAppUser: async ({ ctx, req }) => { - const err = Types.GetAppUserRequestValidate(req, { - user_identifier_CustomCheck: id => id !== '', - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.GetAppUser(ctx.app_id, req) - }, - PayAppUserInvoice: async ({ ctx, req }) => { - const err = Types.PayAppUserInvoiceRequestValidate(req, { - user_identifier_CustomCheck: id => id !== '', - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.PayAppUserInvoice(ctx.app_id, req) - }, - SendAppUserToAppUserPayment: async ({ ctx, req }) => { - const err = Types.SendAppUserToAppUserPaymentRequestValidate(req, { - to_user_identifier_CustomCheck: id => id !== '', - from_user_identifier_CustomCheck: id => id !== '', - amount_CustomCheck: amount => amount > 0 - }) - if (err != null) throw new Error(err.message) - await mainHandler.applicationManager.SendAppUserToAppUserPayment(ctx.app_id, req) - }, - SendAppUserToAppPayment: async ({ ctx, req }) => { - const err = Types.SendAppUserToAppPaymentRequestValidate(req, { - from_user_identifier_CustomCheck: id => id !== '', - amount_CustomCheck: amount => amount > 0 - }) - if (err != null) throw new Error(err.message) - await mainHandler.applicationManager.SendAppUserToAppPayment(ctx.app_id, req) - }, - GetAppUserLNURLInfo: async ({ ctx, req }) => { - const err = Types.GetAppUserLNURLInfoRequestValidate(req, { - user_identifier_CustomCheck: id => id !== '' - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.GetAppUserLNURLInfo(ctx.app_id, req) - }, - SetMockAppUserBalance: async ({ ctx, req }) => { - const err = Types.SetMockAppUserBalanceRequestValidate(req, { - user_identifier_CustomCheck: id => id !== '' - }) - if (err != null) throw new Error(err.message) - await mainHandler.applicationManager.SetMockAppUserBalance(ctx.app_id, req) - }, - SetMockAppBalance: async ({ ctx, req }) => { - await mainHandler.applicationManager.SetMockAppBalance(ctx.app_id, req) - }, - GetLiveUserOperations: async ({ ctx, cb }) => { - }, - GetMigrationUpdate: async ({ ctx, cb }) => { - }, - RequestNPubLinkingToken: async ({ ctx, req }) => { - const err = Types.RequestNPubLinkingTokenRequestValidate(req, { - user_identifier_CustomCheck: userIdentifier => userIdentifier !== '', - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.RequestNPubLinkingToken(ctx.app_id, req) - }, - LinkNPubThroughToken: async ({ ctx, req }) => { - const err = Types.LinkNPubThroughTokenRequestValidate(req, { - nostr_pub_CustomCheck: nostrPub => nostrPub !== '', - token_CustomCheck: token => token !== '' - }) - if (err != null) throw new Error(err.message) - return mainHandler.applicationManager.LinkNpubThroughToken(ctx, req) - } - } +import * as Types from '../../../proto/autogenerated/ts/types.js' +import { getLogger } from '../helpers/logger.js' +import main from '../main/index.js' +import Main from '../main/index.js' +export default (mainHandler: Main): Types.ServerMethods => { + return { + GetUsageMetrics: async ({ ctx }) => { + return mainHandler.metricsManager.GetUsageMetrics() + }, + GetAppsMetrics: async ({ ctx, req }) => { + return mainHandler.metricsManager.GetAppsMetrics(req) + }, + GetLndMetrics: async ({ ctx, req }) => { + return mainHandler.metricsManager.GetLndMetrics(req) + }, + EncryptionExchange: async () => { }, + Health: async () => { await mainHandler.lnd.Health() }, + LndGetInfo: async ({ ctx }) => { + const info = await mainHandler.lnd.GetInfo() + return { alias: info.alias } + }, + BanUser: async ({ ctx, req }) => { + const err = Types.BanUserRequestValidate(req, { + user_id_CustomCheck: id => id !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.appUserManager.BanUser(req.user_id) + }, + SetMockInvoiceAsPaid: async ({ ctx, req }) => { + const err = Types.SetMockInvoiceAsPaidRequestValidate(req, { + invoice_CustomCheck: invoice => invoice !== '', + }) + if (err != null) throw new Error(err.message) + await mainHandler.paymentManager.SetMockInvoiceAsPaid(req) + }, + UserHealth: async () => { }, + GetUserInfo: ({ ctx }) => mainHandler.appUserManager.GetUserInfo(ctx), + GetUserOperations: async ({ ctx, req }) => { + return mainHandler.paymentManager.GetUserOperations(ctx.user_id, req) + }, + OpenChannel: async ({ ctx, req }) => { + const err = Types.OpenChannelRequestValidate(req, { + fundingAmount_CustomCheck: amt => amt > 0, + pushAmount_CustomCheck: amt => amt > 0, + destination_CustomCheck: dest => dest !== "" + }) + if (err != null) throw new Error(err.message) + return mainHandler.paymentManager.OpenChannel(ctx.user_id, req) + }, + NewAddress: ({ ctx, req }) => mainHandler.paymentManager.NewAddress(ctx, req), + PayAddress: async ({ ctx, req }) => { + const err = Types.PayAddressRequestValidate(req, { + address_CustomCheck: addr => addr !== '', + amoutSats_CustomCheck: amt => amt > 0, + satsPerVByte_CustomCheck: spb => spb > 0 + }) + if (err != null) throw new Error(err.message) + return mainHandler.paymentManager.PayAddress(ctx, req) + }, + NewInvoice: ({ ctx, req }) => mainHandler.appUserManager.NewInvoice(ctx, req), + DecodeInvoice: async ({ ctx, req }) => { + return mainHandler.paymentManager.DecodeInvoice(req) + }, + PayInvoice: async ({ ctx, req }) => { + const err = Types.PayInvoiceRequestValidate(req, { + invoice_CustomCheck: invoice => invoice !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.appUserManager.PayInvoice(ctx, req) + }, + GetLnurlWithdrawLink: ({ ctx }) => mainHandler.paymentManager.GetLnurlWithdrawLink(ctx), + GetLnurlWithdrawInfo: async ({ ctx, query }) => { + if (!query.k1) { + throw new Error("invalid lnurl withdraw to get info") + } + return mainHandler.paymentManager.GetLnurlWithdrawInfo(query.k1) + }, + HandleLnurlWithdraw: async ({ query }) => { + if (!query.k1 || !query.pr) { + throw new Error("invalid lnurl withdraw to handle") + } + return mainHandler.paymentManager.HandleLnurlWithdraw(query.k1, query.pr) + }, + GetLnurlPayLink: ({ ctx }) => mainHandler.paymentManager.GetLnurlPayLink(ctx), + GetLnurlPayInfo: async ({ ctx, query }) => { + if (!query.k1) { + throw new Error("invalid lnurl pay to get info") + } + return mainHandler.paymentManager.GetLnurlPayInfo(query.k1) + }, + HandleLnurlPay: async ({ ctx, query }) => { + return mainHandler.paymentManager.HandleLnurlPay(query) + }, + HandleLnurlAddress: async ({ ctx, params }) => { + if (!params.address_name) { + throw new Error("invalid address_name to lnurl address") + } + return mainHandler.paymentManager.HandleLnurlAddress(params.address_name) + }, + AddProduct: async ({ ctx, req }) => { + return mainHandler.productManager.AddProduct(ctx.user_id, req) + }, + NewProductInvoice: async ({ query }) => { + if (!query.id) { + throw new Error("product id must be non empty") + } + return mainHandler.productManager.NewProductInvoice(query.id) + }, + GetLNURLChannelLink: async ({ ctx }) => { + throw new Error("unimplemented") + }, + AddApp: async ({ ctx, req }) => { + const err = Types.AuthAppRequestValidate(req, { + name_CustomCheck: name => name !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.AddApp(req) + }, + AuthApp: async ({ ctx, req }) => { + const err = Types.AuthAppRequestValidate(req, { + name_CustomCheck: name => name !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.AuthApp(req) + }, + GetApp: async ({ ctx }) => { + return mainHandler.applicationManager.GetApp(ctx.app_id) + }, + AddAppUser: async ({ ctx, req }) => { + const err = Types.AddAppUserRequestValidate(req, { + identifier_CustomCheck: id => id !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.AddAppUser(ctx.app_id, req) + }, + AddAppInvoice: async ({ ctx, req }) => { + const err = Types.AddAppInvoiceRequestValidate(req, { + payer_identifier_CustomCheck: id => id !== '', + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.AddAppInvoice(ctx.app_id, req) + }, + AddAppUserInvoice: async ({ ctx, req }) => { + const err = Types.AddAppUserInvoiceRequestValidate(req, { + payer_identifier_CustomCheck: id => id !== '', + receiver_identifier_CustomCheck: id => id !== '', + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.AddAppUserInvoice(ctx.app_id, req) + }, + GetAppUser: async ({ ctx, req }) => { + const err = Types.GetAppUserRequestValidate(req, { + user_identifier_CustomCheck: id => id !== '', + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.GetAppUser(ctx.app_id, req) + }, + PayAppUserInvoice: async ({ ctx, req }) => { + const err = Types.PayAppUserInvoiceRequestValidate(req, { + user_identifier_CustomCheck: id => id !== '', + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.PayAppUserInvoice(ctx.app_id, req) + }, + SendAppUserToAppUserPayment: async ({ ctx, req }) => { + const err = Types.SendAppUserToAppUserPaymentRequestValidate(req, { + to_user_identifier_CustomCheck: id => id !== '', + from_user_identifier_CustomCheck: id => id !== '', + amount_CustomCheck: amount => amount > 0 + }) + if (err != null) throw new Error(err.message) + await mainHandler.applicationManager.SendAppUserToAppUserPayment(ctx.app_id, req) + }, + SendAppUserToAppPayment: async ({ ctx, req }) => { + const err = Types.SendAppUserToAppPaymentRequestValidate(req, { + from_user_identifier_CustomCheck: id => id !== '', + amount_CustomCheck: amount => amount > 0 + }) + if (err != null) throw new Error(err.message) + await mainHandler.applicationManager.SendAppUserToAppPayment(ctx.app_id, req) + }, + GetAppUserLNURLInfo: async ({ ctx, req }) => { + const err = Types.GetAppUserLNURLInfoRequestValidate(req, { + user_identifier_CustomCheck: id => id !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.GetAppUserLNURLInfo(ctx.app_id, req) + }, + SetMockAppUserBalance: async ({ ctx, req }) => { + const err = Types.SetMockAppUserBalanceRequestValidate(req, { + user_identifier_CustomCheck: id => id !== '' + }) + if (err != null) throw new Error(err.message) + await mainHandler.applicationManager.SetMockAppUserBalance(ctx.app_id, req) + }, + SetMockAppBalance: async ({ ctx, req }) => { + await mainHandler.applicationManager.SetMockAppBalance(ctx.app_id, req) + }, + GetLiveUserOperations: async ({ ctx, cb }) => { + }, + GetMigrationUpdate: async ({ ctx, cb }) => { + }, + RequestNPubLinkingToken: async ({ ctx, req }) => { + const err = Types.RequestNPubLinkingTokenRequestValidate(req, { + user_identifier_CustomCheck: userIdentifier => userIdentifier !== '', + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.RequestNPubLinkingToken(ctx.app_id, req) + }, + LinkNPubThroughToken: async ({ ctx, req }) => { + const err = Types.LinkNPubThroughTokenRequestValidate(req, { + nostr_pub_CustomCheck: nostrPub => nostrPub !== '', + token_CustomCheck: token => token !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.applicationManager.LinkNpubThroughToken(ctx, req) + } + } } \ No newline at end of file diff --git a/src/services/storage/applicationStorage.ts b/src/services/storage/applicationStorage.ts index 5e0d3f28..d025835c 100644 --- a/src/services/storage/applicationStorage.ts +++ b/src/services/storage/applicationStorage.ts @@ -1,172 +1,172 @@ -import crypto from 'crypto'; -import { Between, DataSource, EntityManager, FindOperator, IsNull, LessThanOrEqual, MoreThanOrEqual } from "typeorm" -import { generatePrivateKey, getPublicKey } from 'nostr-tools'; -import { Application } from "./entity/Application.js" -import UserStorage from './userStorage.js'; -import { ApplicationUser } from './entity/ApplicationUser.js'; -import { getLogger } from '../helpers/logger.js'; -import TransactionsQueue, { TX } from "./transactionsQueue.js"; -import { User } from './entity/User.js'; -export default class { - DB: DataSource | EntityManager - userStorage: UserStorage - txQueue: TransactionsQueue - constructor(DB: DataSource | EntityManager, userStorage: UserStorage, txQueue: TransactionsQueue) { - this.DB = DB - this.userStorage = userStorage - this.txQueue = txQueue - } - - async AddApplication(name: string, allowUserCreation: boolean): Promise { - return this.DB.transaction(async tx => { - const owner = await this.userStorage.AddUser(0, tx) - const repo = this.DB.getRepository(Application) - const newApplication = repo.create({ - app_id: crypto.randomBytes(32).toString('hex'), - name, - owner, - allow_user_creation: allowUserCreation - }) - return tx.getRepository(Application).save(newApplication) - }) - } - - async GetApplicationByName(name: string, entityManager = this.DB) { - const found = await entityManager.getRepository(Application).findOne({ - where: { - name - } - }) - if (!found) { - throw new Error(`application ${name} not found`) - } - return found - } - - async GetApplications(entityManager = this.DB): Promise { - return entityManager.getRepository(Application).find() - } - async GetApplication(appId: string, entityManager = this.DB): Promise { - if (!appId) { - throw new Error("invalid app id provided") - } - const found = await entityManager.getRepository(Application).findOne({ - where: { - app_id: appId - } - }) - if (!found) { - throw new Error(`application ${appId} not found`) - } - return found - } - - async UpdateApplication(app: Application, update: Partial, entityManager = this.DB) { - await entityManager.getRepository(Application).update(app.serial_id, update) - } - - async GenerateApplicationKeys(app: Application) { - const priv = generatePrivateKey() - const pub = getPublicKey(priv) - await this.UpdateApplication(app, { nostr_private_key: priv, nostr_public_key: pub }) - return { privateKey: priv, publicKey: pub, appId: app.app_id, name: app.name } - } - - async AddApplicationUser(application: Application, userIdentifier: string, balance: number, nostrPub?: string) { - return this.DB.transaction(async tx => { - const user = await this.userStorage.AddUser(balance, tx) - const repo = tx.getRepository(ApplicationUser) - const appUser = repo.create({ - user: user, - application, - identifier: userIdentifier, - nostr_public_key: nostrPub - }) - return repo.save(appUser) - }) - } - - async GetApplicationUserIfExists(application: Application, userIdentifier: string, entityManager = this.DB): Promise { - return entityManager.getRepository(ApplicationUser).findOne({ where: { identifier: userIdentifier, application: { serial_id: application.serial_id } } }) - } - - async GetOrCreateNostrAppUser(application: Application, nostrPub: string, entityManager = this.DB): Promise { - if (!nostrPub) { - throw new Error("no nostrPub provided") - } - const user = await entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } }) - if (user) { - //if (user.application.app_id !== application.app_id) { - // throw new Error("tried to access a user of application:" + user.application.app_id + "from application:" + application.app_id) - //} - return user - } - if (!application.allow_user_creation) { - throw new Error("user creation by client is not allowed in this app") - } - return this.AddApplicationUser(application, crypto.randomBytes(32).toString('hex'), 0, nostrPub) - } - - async FindNostrAppUser(nostrPub: string, entityManager = this.DB) { - return entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } }) - } - - async GetOrCreateApplicationUser(application: Application, userIdentifier: string, balance: number, entityManager = this.DB): Promise<{ user: ApplicationUser, created: boolean }> { - const user = await this.GetApplicationUserIfExists(application, userIdentifier, entityManager) - if (user) { - return { user, created: false } - } - return { user: await this.AddApplicationUser(application, userIdentifier, balance), created: true } - } - - async GetApplicationUser(application: Application, userIdentifier: string, entityManager = this.DB): Promise { - const found = await this.GetApplicationUserIfExists(application, userIdentifier, entityManager) - if (!found) { - getLogger({ appName: application.name })("user", userIdentifier, "not found", application.name) - throw new Error(`application user not found`) - } - - if (found.application.app_id !== application.app_id) { - throw new Error("requested user does not belong to requestor application") - } - return found - } - - async GetApplicationUsers(application: Application | null, { from, to }: { from?: number, to?: number }, entityManager = this.DB) { - const q = application ? { app_id: application.app_id } : IsNull() - let time: { created_at?: FindOperator } = {} - if (!!from && !!to) { - time.created_at = Between(new Date(from * 1000), new Date(to * 1000)) - } else if (!!from) { - time.created_at = MoreThanOrEqual(new Date(from * 1000)) - } else if (!!to) { - time.created_at = LessThanOrEqual(new Date(to * 1000)) - } - return entityManager.getRepository(ApplicationUser).find({ where: { application: q, ...time } }) - } - - async GetAppUserFromUser(application: Application, userId: string, entityManager = this.DB): Promise { - return entityManager.getRepository(ApplicationUser).findOne({ where: { user: { user_id: userId }, application: { app_id: application.app_id } } }) - } - - async GetAllAppUsersFromUser(userId: string, entityManager = this.DB): Promise { - return entityManager.getRepository(ApplicationUser).find({ where: { user: { user_id: userId } } }) - } - - async IsApplicationOwner(userId: string, entityManager = this.DB) { - return entityManager.getRepository(Application).findOne({ where: { owner: { user_id: userId } } }) - } - - - async AddNPubToApplicationUser(serialId: number, nPub: string, entityManager = this.DB) { - return entityManager.getRepository(ApplicationUser).update(serialId, { nostr_public_key: nPub }) - - } - - - async RemoveApplicationUserAndBaseUser(appUser: ApplicationUser, entityManager = this.DB) { - const baseUser = appUser.user; - await entityManager.getRepository(ApplicationUser).remove(appUser); - await entityManager.getRepository(User).remove(baseUser); - } +import crypto from 'crypto'; +import { Between, DataSource, EntityManager, FindOperator, IsNull, LessThanOrEqual, MoreThanOrEqual } from "typeorm" +import { generatePrivateKey, getPublicKey } from 'nostr-tools'; +import { Application } from "./entity/Application.js" +import UserStorage from './userStorage.js'; +import { ApplicationUser } from './entity/ApplicationUser.js'; +import { getLogger } from '../helpers/logger.js'; +import TransactionsQueue, { TX } from "./transactionsQueue.js"; +import { User } from './entity/User.js'; +export default class { + DB: DataSource | EntityManager + userStorage: UserStorage + txQueue: TransactionsQueue + constructor(DB: DataSource | EntityManager, userStorage: UserStorage, txQueue: TransactionsQueue) { + this.DB = DB + this.userStorage = userStorage + this.txQueue = txQueue + } + + async AddApplication(name: string, allowUserCreation: boolean): Promise { + return this.DB.transaction(async tx => { + const owner = await this.userStorage.AddUser(0, tx) + const repo = this.DB.getRepository(Application) + const newApplication = repo.create({ + app_id: crypto.randomBytes(32).toString('hex'), + name, + owner, + allow_user_creation: allowUserCreation + }) + return tx.getRepository(Application).save(newApplication) + }) + } + + async GetApplicationByName(name: string, entityManager = this.DB) { + const found = await entityManager.getRepository(Application).findOne({ + where: { + name + } + }) + if (!found) { + throw new Error(`application ${name} not found`) + } + return found + } + + async GetApplications(entityManager = this.DB): Promise { + return entityManager.getRepository(Application).find() + } + async GetApplication(appId: string, entityManager = this.DB): Promise { + if (!appId) { + throw new Error("invalid app id provided") + } + const found = await entityManager.getRepository(Application).findOne({ + where: { + app_id: appId + } + }) + if (!found) { + throw new Error(`application ${appId} not found`) + } + return found + } + + async UpdateApplication(app: Application, update: Partial, entityManager = this.DB) { + await entityManager.getRepository(Application).update(app.serial_id, update) + } + + async GenerateApplicationKeys(app: Application) { + const priv = generatePrivateKey() + const pub = getPublicKey(priv) + await this.UpdateApplication(app, { nostr_private_key: priv, nostr_public_key: pub }) + return { privateKey: priv, publicKey: pub, appId: app.app_id, name: app.name } + } + + async AddApplicationUser(application: Application, userIdentifier: string, balance: number, nostrPub?: string) { + return this.DB.transaction(async tx => { + const user = await this.userStorage.AddUser(balance, tx) + const repo = tx.getRepository(ApplicationUser) + const appUser = repo.create({ + user: user, + application, + identifier: userIdentifier, + nostr_public_key: nostrPub + }) + return repo.save(appUser) + }) + } + + async GetApplicationUserIfExists(application: Application, userIdentifier: string, entityManager = this.DB): Promise { + return entityManager.getRepository(ApplicationUser).findOne({ where: { identifier: userIdentifier, application: { serial_id: application.serial_id } } }) + } + + async GetOrCreateNostrAppUser(application: Application, nostrPub: string, entityManager = this.DB): Promise { + if (!nostrPub) { + throw new Error("no nostrPub provided") + } + const user = await entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } }) + if (user) { + //if (user.application.app_id !== application.app_id) { + // throw new Error("tried to access a user of application:" + user.application.app_id + "from application:" + application.app_id) + //} + return user + } + if (!application.allow_user_creation) { + throw new Error("user creation by client is not allowed in this app") + } + return this.AddApplicationUser(application, crypto.randomBytes(32).toString('hex'), 0, nostrPub) + } + + async FindNostrAppUser(nostrPub: string, entityManager = this.DB) { + return entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } }) + } + + async GetOrCreateApplicationUser(application: Application, userIdentifier: string, balance: number, entityManager = this.DB): Promise<{ user: ApplicationUser, created: boolean }> { + const user = await this.GetApplicationUserIfExists(application, userIdentifier, entityManager) + if (user) { + return { user, created: false } + } + return { user: await this.AddApplicationUser(application, userIdentifier, balance), created: true } + } + + async GetApplicationUser(application: Application, userIdentifier: string, entityManager = this.DB): Promise { + const found = await this.GetApplicationUserIfExists(application, userIdentifier, entityManager) + if (!found) { + getLogger({ appName: application.name })("user", userIdentifier, "not found", application.name) + throw new Error(`application user not found`) + } + + if (found.application.app_id !== application.app_id) { + throw new Error("requested user does not belong to requestor application") + } + return found + } + + async GetApplicationUsers(application: Application | null, { from, to }: { from?: number, to?: number }, entityManager = this.DB) { + const q = application ? { app_id: application.app_id } : IsNull() + let time: { created_at?: FindOperator } = {} + if (!!from && !!to) { + time.created_at = Between(new Date(from * 1000), new Date(to * 1000)) + } else if (!!from) { + time.created_at = MoreThanOrEqual(new Date(from * 1000)) + } else if (!!to) { + time.created_at = LessThanOrEqual(new Date(to * 1000)) + } + return entityManager.getRepository(ApplicationUser).find({ where: { application: q, ...time } }) + } + + async GetAppUserFromUser(application: Application, userId: string, entityManager = this.DB): Promise { + return entityManager.getRepository(ApplicationUser).findOne({ where: { user: { user_id: userId }, application: { app_id: application.app_id } } }) + } + + async GetAllAppUsersFromUser(userId: string, entityManager = this.DB): Promise { + return entityManager.getRepository(ApplicationUser).find({ where: { user: { user_id: userId } } }) + } + + async IsApplicationOwner(userId: string, entityManager = this.DB) { + return entityManager.getRepository(Application).findOne({ where: { owner: { user_id: userId } } }) + } + + + async AddNPubToApplicationUser(serialId: number, nPub: string, entityManager = this.DB) { + return entityManager.getRepository(ApplicationUser).update(serialId, { nostr_public_key: nPub }) + + } + + + async RemoveApplicationUserAndBaseUser(appUser: ApplicationUser, entityManager = this.DB) { + const baseUser = appUser.user; + await entityManager.getRepository(ApplicationUser).remove(appUser); + await entityManager.getRepository(User).remove(baseUser); + } } \ No newline at end of file diff --git a/src/services/storage/db.ts b/src/services/storage/db.ts index be18d448..6a8a7144 100644 --- a/src/services/storage/db.ts +++ b/src/services/storage/db.ts @@ -1,84 +1,84 @@ -import "reflect-metadata" -import { DataSource, Migration } from "typeorm" -import { AddressReceivingTransaction } from "./entity/AddressReceivingTransaction.js" -import { User } from "./entity/User.js" -import { UserReceivingAddress } from "./entity/UserReceivingAddress.js" -import { UserReceivingInvoice } from "./entity/UserReceivingInvoice.js" -import { UserInvoicePayment } from "./entity/UserInvoicePayment.js" -import { EnvMustBeNonEmptyString } from "../helpers/envParser.js" -import { UserTransactionPayment } from "./entity/UserTransactionPayment.js" -import { UserBasicAuth } from "./entity/UserBasicAuth.js" -import { UserEphemeralKey } from "./entity/UserEphemeralKey.js" -import { Product } from "./entity/Product.js" -import { UserToUserPayment } from "./entity/UserToUserPayment.js" -import { Application } from "./entity/Application.js" -import { ApplicationUser } from "./entity/ApplicationUser.js" -import { BalanceEvent } from "./entity/BalanceEvent.js" -import { ChannelBalanceEvent } from "./entity/ChannelsBalanceEvent.js" -import { getLogger } from "../helpers/logger.js" -import { ChannelRouting } from "./entity/ChannelRouting.js" - - -export type DbSettings = { - databaseFile: string - migrate: boolean - metricsDatabaseFile: string -} -export const LoadDbSettingsFromEnv = (): DbSettings => { - return { - databaseFile: process.env.DATABASE_FILE || "db.sqlite", - migrate: process.env.MIGRATE_DB === 'true' || false, - metricsDatabaseFile: process.env.METRICS_DATABASE_FILE || "metrics.sqlite" - } -} - -export const newMetricsDb = async (settings: DbSettings, metricsMigrations: Function[]): Promise<{ source: DataSource, executedMigrations: Migration[] }> => { - const source = await new DataSource({ - type: "sqlite", - database: settings.metricsDatabaseFile, - entities: [BalanceEvent, ChannelBalanceEvent, ChannelRouting], - migrations: metricsMigrations - }).initialize(); - const log = getLogger({}); - const pendingMigrations = await source.showMigrations() - if (pendingMigrations) { - log("Migrations found, migrating...") - const executedMigrations = await source.runMigrations({ transaction: 'all' }) - return { source, executedMigrations } - } - return { source, executedMigrations: [] } - -} - -export default async (settings: DbSettings, migrations: Function[]): Promise<{ source: DataSource, executedMigrations: Migration[] }> => { - const source = await new DataSource({ - type: "sqlite", - database: settings.databaseFile, - // logging: true, - entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, - UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment], - //synchronize: true, - migrations - }).initialize() - const log = getLogger({}) - const pendingMigrations = await source.showMigrations() - if (pendingMigrations) { - log("migrations found, migrating...") - const executedMigrations = await source.runMigrations({ transaction: 'all' }) - return { source, executedMigrations } - } - return { source, executedMigrations: [] } -} - -export const runFakeMigration = async (databaseFile: string, migrations: Function[]) => { - const source = await new DataSource({ - type: "sqlite", - database: databaseFile, - // logging: true, - entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, - UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment], - //synchronize: true, - migrations - }).initialize() - return source.runMigrations({ fake: true }) +import "reflect-metadata" +import { DataSource, Migration } from "typeorm" +import { AddressReceivingTransaction } from "./entity/AddressReceivingTransaction.js" +import { User } from "./entity/User.js" +import { UserReceivingAddress } from "./entity/UserReceivingAddress.js" +import { UserReceivingInvoice } from "./entity/UserReceivingInvoice.js" +import { UserInvoicePayment } from "./entity/UserInvoicePayment.js" +import { EnvMustBeNonEmptyString } from "../helpers/envParser.js" +import { UserTransactionPayment } from "./entity/UserTransactionPayment.js" +import { UserBasicAuth } from "./entity/UserBasicAuth.js" +import { UserEphemeralKey } from "./entity/UserEphemeralKey.js" +import { Product } from "./entity/Product.js" +import { UserToUserPayment } from "./entity/UserToUserPayment.js" +import { Application } from "./entity/Application.js" +import { ApplicationUser } from "./entity/ApplicationUser.js" +import { BalanceEvent } from "./entity/BalanceEvent.js" +import { ChannelBalanceEvent } from "./entity/ChannelsBalanceEvent.js" +import { getLogger } from "../helpers/logger.js" +import { ChannelRouting } from "./entity/ChannelRouting.js" + + +export type DbSettings = { + databaseFile: string + migrate: boolean + metricsDatabaseFile: string +} +export const LoadDbSettingsFromEnv = (): DbSettings => { + return { + databaseFile: process.env.DATABASE_FILE || "db.sqlite", + migrate: process.env.MIGRATE_DB === 'true' || false, + metricsDatabaseFile: process.env.METRICS_DATABASE_FILE || "metrics.sqlite" + } +} + +export const newMetricsDb = async (settings: DbSettings, metricsMigrations: Function[]): Promise<{ source: DataSource, executedMigrations: Migration[] }> => { + const source = await new DataSource({ + type: "sqlite", + database: settings.metricsDatabaseFile, + entities: [BalanceEvent, ChannelBalanceEvent, ChannelRouting], + migrations: metricsMigrations + }).initialize(); + const log = getLogger({}); + const pendingMigrations = await source.showMigrations() + if (pendingMigrations) { + log("Migrations found, migrating...") + const executedMigrations = await source.runMigrations({ transaction: 'all' }) + return { source, executedMigrations } + } + return { source, executedMigrations: [] } + +} + +export default async (settings: DbSettings, migrations: Function[]): Promise<{ source: DataSource, executedMigrations: Migration[] }> => { + const source = await new DataSource({ + type: "sqlite", + database: settings.databaseFile, + // logging: true, + entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, + UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment], + //synchronize: true, + migrations + }).initialize() + const log = getLogger({}) + const pendingMigrations = await source.showMigrations() + if (pendingMigrations) { + log("migrations found, migrating...") + const executedMigrations = await source.runMigrations({ transaction: 'all' }) + return { source, executedMigrations } + } + return { source, executedMigrations: [] } +} + +export const runFakeMigration = async (databaseFile: string, migrations: Function[]) => { + const source = await new DataSource({ + type: "sqlite", + database: databaseFile, + // logging: true, + entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, + UserBasicAuth, UserEphemeralKey, Product, UserToUserPayment, Application, ApplicationUser, UserToUserPayment], + //synchronize: true, + migrations + }).initialize() + return source.runMigrations({ fake: true }) } \ No newline at end of file diff --git a/src/services/storage/entity/AddressReceivingTransaction.ts b/src/services/storage/entity/AddressReceivingTransaction.ts index 14ad9936..05e5f741 100644 --- a/src/services/storage/entity/AddressReceivingTransaction.ts +++ b/src/services/storage/entity/AddressReceivingTransaction.ts @@ -1,45 +1,45 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" - -import { UserReceivingAddress } from "./UserReceivingAddress.js" - -@Entity() -@Index("address_receiving_transaction_unique", ["tx_hash", "output_index"], { unique: true }) -export class AddressReceivingTransaction { - - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => UserReceivingAddress, { eager: true }) - @JoinColumn() - user_address: UserReceivingAddress - - @Column() - tx_hash: string - - @Column() - output_index: number - - @Column() - paid_amount: number - - @Column() - service_fee: number - - @Column() - paid_at_unix: number - - @Column({ default: false }) - internal: boolean - - @Column({ default: 0 }) - confs: number - - @Column({ default: 0 }) - broadcast_height: number - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" + +import { UserReceivingAddress } from "./UserReceivingAddress.js" + +@Entity() +@Index("address_receiving_transaction_unique", ["tx_hash", "output_index"], { unique: true }) +export class AddressReceivingTransaction { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => UserReceivingAddress, { eager: true }) + @JoinColumn() + user_address: UserReceivingAddress + + @Column() + tx_hash: string + + @Column() + output_index: number + + @Column() + paid_amount: number + + @Column() + service_fee: number + + @Column() + paid_at_unix: number + + @Column({ default: false }) + internal: boolean + + @Column({ default: 0 }) + confs: number + + @Column({ default: 0 }) + broadcast_height: number + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/Application.ts b/src/services/storage/entity/Application.ts index f951b750..e4367c07 100644 --- a/src/services/storage/entity/Application.ts +++ b/src/services/storage/entity/Application.ts @@ -1,35 +1,35 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn, JoinColumn, ManyToOne } from "typeorm" -import { User } from "./User.js" - -@Entity() -export class Application { - - @PrimaryGeneratedColumn() - serial_id: number - - @Column() - @Index({ unique: true }) - app_id: string - - @Column({ unique: true }) - name: string - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - owner: User - - @Column({ default: false }) - allow_user_creation: boolean - - @Column({ nullable: true, unique: true }) - nostr_private_key?: string - - @Column({ nullable: true, unique: true }) - nostr_public_key?: string - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn, JoinColumn, ManyToOne } from "typeorm" +import { User } from "./User.js" + +@Entity() +export class Application { + + @PrimaryGeneratedColumn() + serial_id: number + + @Column() + @Index({ unique: true }) + app_id: string + + @Column({ unique: true }) + name: string + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + owner: User + + @Column({ default: false }) + allow_user_creation: boolean + + @Column({ nullable: true, unique: true }) + nostr_private_key?: string + + @Column({ nullable: true, unique: true }) + nostr_public_key?: string + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/ApplicationUser.ts b/src/services/storage/entity/ApplicationUser.ts index d2e9e64c..a885cb65 100644 --- a/src/services/storage/entity/ApplicationUser.ts +++ b/src/services/storage/entity/ApplicationUser.ts @@ -1,31 +1,31 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, JoinColumn, OneToOne, OneToMany, ManyToOne, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" -import { Application } from "./Application.js" - -@Entity() -export class ApplicationUser { - - @PrimaryGeneratedColumn() - serial_id: number - - @OneToOne(type => User, { eager: true }) - @JoinColumn() - user: User - - @ManyToOne(type => Application, { eager: true }) - @JoinColumn() - application: Application - - @Column() - @Index({ unique: true }) - identifier: string - - @Column({ nullable: true, unique: true }) - nostr_public_key?: string - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, JoinColumn, OneToOne, OneToMany, ManyToOne, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" +import { Application } from "./Application.js" + +@Entity() +export class ApplicationUser { + + @PrimaryGeneratedColumn() + serial_id: number + + @OneToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @ManyToOne(type => Application, { eager: true }) + @JoinColumn() + application: Application + + @Column() + @Index({ unique: true }) + identifier: string + + @Column({ nullable: true, unique: true }) + nostr_public_key?: string + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/BalanceEvent.ts b/src/services/storage/entity/BalanceEvent.ts index 9234c3bc..b6d657b2 100644 --- a/src/services/storage/entity/BalanceEvent.ts +++ b/src/services/storage/entity/BalanceEvent.ts @@ -1,25 +1,25 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn } from "typeorm" - -@Entity() -export class BalanceEvent { - @PrimaryGeneratedColumn() - serial_id: number - - @Column() - block_height: number - - @Column() - confirmed_chain_balance: number - - @Column() - unconfirmed_chain_balance: number - - @Column() - total_chain_balance: number - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn } from "typeorm" + +@Entity() +export class BalanceEvent { + @PrimaryGeneratedColumn() + serial_id: number + + @Column() + block_height: number + + @Column() + confirmed_chain_balance: number + + @Column() + unconfirmed_chain_balance: number + + @Column() + total_chain_balance: number + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/ChannelRouting.ts b/src/services/storage/entity/ChannelRouting.ts index bb97207c..b8cfe16d 100644 --- a/src/services/storage/entity/ChannelRouting.ts +++ b/src/services/storage/entity/ChannelRouting.ts @@ -1,46 +1,46 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn } from "typeorm" - -@Entity() -export class ChannelRouting { - @PrimaryGeneratedColumn() - serial_id: number - - @Column() - day_unix: number - - @Column() - channel_id: string - - @Column({ default: 0 }) - send_errors: number - - @Column({ default: 0 }) - receive_errors: number - - @Column({ default: 0 }) - forward_errors_as_input: number - - @Column({ default: 0 }) - forward_errors_as_output: number - - @Column({ default: 0 }) - missed_forward_fee_as_input: number - - @Column({ default: 0 }) - missed_forward_fee_as_output: number - - @Column({ default: 0 }) - forward_fee_as_input: number - - @Column({ default: 0 }) - forward_fee_as_output: number - - @Column({ default: 0 }) - latest_index_offset: number - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn } from "typeorm" + +@Entity() +export class ChannelRouting { + @PrimaryGeneratedColumn() + serial_id: number + + @Column() + day_unix: number + + @Column() + channel_id: string + + @Column({ default: 0 }) + send_errors: number + + @Column({ default: 0 }) + receive_errors: number + + @Column({ default: 0 }) + forward_errors_as_input: number + + @Column({ default: 0 }) + forward_errors_as_output: number + + @Column({ default: 0 }) + missed_forward_fee_as_input: number + + @Column({ default: 0 }) + missed_forward_fee_as_output: number + + @Column({ default: 0 }) + forward_fee_as_input: number + + @Column({ default: 0 }) + forward_fee_as_output: number + + @Column({ default: 0 }) + latest_index_offset: number + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/ChannelsBalanceEvent.ts b/src/services/storage/entity/ChannelsBalanceEvent.ts index 59ef0817..c40cfc2a 100644 --- a/src/services/storage/entity/ChannelsBalanceEvent.ts +++ b/src/services/storage/entity/ChannelsBalanceEvent.ts @@ -1,27 +1,27 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn, ManyToOne, JoinColumn } from "typeorm" -import { BalanceEvent } from "./BalanceEvent.js" - -@Entity() -export class ChannelBalanceEvent { - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => BalanceEvent, { eager: true }) - @JoinColumn() - balance_event: BalanceEvent - - @Column() - channel_id: string - - @Column() - local_balance_sats: number - - @Column() - remote_balance_sats: number - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn, ManyToOne, JoinColumn } from "typeorm" +import { BalanceEvent } from "./BalanceEvent.js" + +@Entity() +export class ChannelBalanceEvent { + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => BalanceEvent, { eager: true }) + @JoinColumn() + balance_event: BalanceEvent + + @Column() + channel_id: string + + @Column() + local_balance_sats: number + + @Column() + remote_balance_sats: number + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/Product.ts b/src/services/storage/entity/Product.ts index 792779c8..6aa83bdb 100644 --- a/src/services/storage/entity/Product.ts +++ b/src/services/storage/entity/Product.ts @@ -1,24 +1,24 @@ -import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" - -@Entity() -export class Product { - - @PrimaryGeneratedColumn('uuid') - product_id: string - - @ManyToOne(type => User, { eager: true }) - owner: User - - @Column() - name: string - - @Column() - price_sats: number - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" + +@Entity() +export class Product { + + @PrimaryGeneratedColumn('uuid') + product_id: string + + @ManyToOne(type => User, { eager: true }) + owner: User + + @Column() + name: string + + @Column() + price_sats: number + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/User.ts b/src/services/storage/entity/User.ts index cd1300e9..4e9fb501 100644 --- a/src/services/storage/entity/User.ts +++ b/src/services/storage/entity/User.ts @@ -1,23 +1,23 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn } from "typeorm" - -@Entity() -export class User { - @PrimaryGeneratedColumn() - serial_id: number - - @Column() - @Index({ unique: true }) - user_id: string - - @Column({ type: 'integer', default: 0 }) - balance_sats: number - - @Column({ default: false }) - locked: boolean - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn } from "typeorm" + +@Entity() +export class User { + @PrimaryGeneratedColumn() + serial_id: number + + @Column() + @Index({ unique: true }) + user_id: string + + @Column({ type: 'integer', default: 0 }) + balance_sats: number + + @Column({ default: false }) + locked: boolean + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/UserBasicAuth.ts b/src/services/storage/entity/UserBasicAuth.ts index ff1f57f3..c5568575 100644 --- a/src/services/storage/entity/UserBasicAuth.ts +++ b/src/services/storage/entity/UserBasicAuth.ts @@ -1,26 +1,26 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, JoinColumn, OneToOne, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" - -@Entity() -export class UserBasicAuth { - - @PrimaryGeneratedColumn() - serial_id: number - - @OneToOne(type => User, { eager: true }) - @JoinColumn() - user: User - - @Column() - @Index({ unique: true }) - name: string - - @Column() - secret_sha256: string - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, JoinColumn, OneToOne, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" + +@Entity() +export class UserBasicAuth { + + @PrimaryGeneratedColumn() + serial_id: number + + @OneToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @Column() + @Index({ unique: true }) + name: string + + @Column() + secret_sha256: string + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/UserEphemeralKey.ts b/src/services/storage/entity/UserEphemeralKey.ts index feffc458..d8f71fde 100644 --- a/src/services/storage/entity/UserEphemeralKey.ts +++ b/src/services/storage/entity/UserEphemeralKey.ts @@ -1,31 +1,31 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" -import { Application } from "./Application.js" -export type EphemeralKeyType = 'balanceCheck' | 'withdraw' | 'pay' -@Entity() -export class UserEphemeralKey { - - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - user: User - - @ManyToOne(type => Application, { eager: true }) - @JoinColumn() - linkedApplication: Application | null - - @Column() - @Index({ unique: true }) - key: string - - @Column() - type: EphemeralKeyType - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" +import { Application } from "./Application.js" +export type EphemeralKeyType = 'balanceCheck' | 'withdraw' | 'pay' +@Entity() +export class UserEphemeralKey { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @ManyToOne(type => Application, { eager: true }) + @JoinColumn() + linkedApplication: Application | null + + @Column() + @Index({ unique: true }) + key: string + + @Column() + type: EphemeralKeyType + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/UserInvoicePayment.ts b/src/services/storage/entity/UserInvoicePayment.ts index 6f259f5f..7ab53b4a 100644 --- a/src/services/storage/entity/UserInvoicePayment.ts +++ b/src/services/storage/entity/UserInvoicePayment.ts @@ -1,42 +1,42 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" -import { Application } from "./Application.js" - -@Entity() -export class UserInvoicePayment { - - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - user: User - - @Column() - @Index({ unique: true }) - invoice: string - - @Column() - paid_amount: number - - @Column() - routing_fees: number - - @Column() - service_fees: number - - @Column() - paid_at_unix: number - - @Column({ default: false }) - internal: boolean - - @ManyToOne(type => Application, { eager: true }) - linkedApplication: Application | null - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" +import { Application } from "./Application.js" + +@Entity() +export class UserInvoicePayment { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @Column() + @Index({ unique: true }) + invoice: string + + @Column() + paid_amount: number + + @Column() + routing_fees: number + + @Column() + service_fees: number + + @Column() + paid_at_unix: number + + @Column({ default: false }) + internal: boolean + + @ManyToOne(type => Application, { eager: true }) + linkedApplication: Application | null + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/UserReceivingAddress.ts b/src/services/storage/entity/UserReceivingAddress.ts index 314060e0..706d009e 100644 --- a/src/services/storage/entity/UserReceivingAddress.ts +++ b/src/services/storage/entity/UserReceivingAddress.ts @@ -1,30 +1,30 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" -import { Application } from "./Application.js" - -@Entity() -export class UserReceivingAddress { - - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - user: User - - @Column() - @Index({ unique: true }) - address: string - - @Column() - callbackUrl: string - - @ManyToOne(type => Application, { eager: true }) - linkedApplication: Application | null - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" +import { Application } from "./Application.js" + +@Entity() +export class UserReceivingAddress { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @Column() + @Index({ unique: true }) + address: string + + @Column() + callbackUrl: string + + @ManyToOne(type => Application, { eager: true }) + linkedApplication: Application | null + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/UserReceivingInvoice.ts b/src/services/storage/entity/UserReceivingInvoice.ts index f39498a2..fa7af39c 100644 --- a/src/services/storage/entity/UserReceivingInvoice.ts +++ b/src/services/storage/entity/UserReceivingInvoice.ts @@ -1,66 +1,66 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { Product } from "./Product.js" -import { User } from "./User.js" -import { Application } from "./Application.js" -export type ZapInfo = { - pub: string - eventId: string - relays: string[] - description: string -} -@Entity() -export class UserReceivingInvoice { - - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - user: User - - @Column() - @Index({ unique: true }) - invoice: string - - @Column() - expires_at_unix: number - - @Column({ default: 0 }) - paid_at_unix: number - - @Column({ default: false }) - internal: boolean - - @Column({ default: false }) - paidByLnd: boolean - - @Column({ default: "" }) - callbackUrl: string - - @Column({ default: 0 }) - paid_amount: number - - @Column({ default: 0 }) - service_fee: number - - @ManyToOne(type => Product, { eager: true }) - product: Product | null - - @ManyToOne(type => User, { eager: true }) - payer: User | null - - @ManyToOne(type => Application, { eager: true }) - linkedApplication: Application | null - - @Column({ - nullable: true, - type: 'simple-json' - }) - zap_info?: ZapInfo - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { Product } from "./Product.js" +import { User } from "./User.js" +import { Application } from "./Application.js" +export type ZapInfo = { + pub: string + eventId: string + relays: string[] + description: string +} +@Entity() +export class UserReceivingInvoice { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @Column() + @Index({ unique: true }) + invoice: string + + @Column() + expires_at_unix: number + + @Column({ default: 0 }) + paid_at_unix: number + + @Column({ default: false }) + internal: boolean + + @Column({ default: false }) + paidByLnd: boolean + + @Column({ default: "" }) + callbackUrl: string + + @Column({ default: 0 }) + paid_amount: number + + @Column({ default: 0 }) + service_fee: number + + @ManyToOne(type => Product, { eager: true }) + product: Product | null + + @ManyToOne(type => User, { eager: true }) + payer: User | null + + @ManyToOne(type => Application, { eager: true }) + linkedApplication: Application | null + + @Column({ + nullable: true, + type: 'simple-json' + }) + zap_info?: ZapInfo + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/UserToUserPayment.ts b/src/services/storage/entity/UserToUserPayment.ts index f851235a..56e25336 100644 --- a/src/services/storage/entity/UserToUserPayment.ts +++ b/src/services/storage/entity/UserToUserPayment.ts @@ -1,36 +1,36 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" -import { Application } from "./Application.js" - -@Entity() -export class UserToUserPayment { - - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - from_user: User - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - to_user: User - - @Column() - paid_amount: number - - @Column() - service_fees: number - - @Column() - paid_at_unix: number - - @ManyToOne(type => Application, { eager: true }) - linkedApplication: Application | null - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" +import { Application } from "./Application.js" + +@Entity() +export class UserToUserPayment { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + from_user: User + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + to_user: User + + @Column() + paid_amount: number + + @Column() + service_fees: number + + @Column() + paid_at_unix: number + + @ManyToOne(type => Application, { eager: true }) + linkedApplication: Application | null + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/entity/UserTransactionPayment.ts b/src/services/storage/entity/UserTransactionPayment.ts index 1f7ac890..3663e9eb 100644 --- a/src/services/storage/entity/UserTransactionPayment.ts +++ b/src/services/storage/entity/UserTransactionPayment.ts @@ -1,54 +1,54 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" -import { User } from "./User.js" -import { Application } from "./Application.js" - -@Entity() -@Index("user_transaction_unique", ["tx_hash", "output_index"], { unique: true }) -export class UserTransactionPayment { - - @PrimaryGeneratedColumn() - serial_id: number - - @ManyToOne(type => User, { eager: true }) - @JoinColumn() - user: User - - @Column() - address: string - - @Column() - tx_hash: string - - @Column() - output_index: number - - @Column() - paid_amount: number - - @Column() - chain_fees: number - - @Column() - service_fees: number - - @Column() - paid_at_unix: number - - @Column({ default: false }) - internal: boolean - - @Column({ default: 0 }) - confs: number - - @Column({ default: 0 }) - broadcast_height: number - - @ManyToOne(type => Application, { eager: true }) - linkedApplication: Application | null - - @CreateDateColumn() - created_at: Date - - @UpdateDateColumn() - updated_at: Date -} +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm" +import { User } from "./User.js" +import { Application } from "./Application.js" + +@Entity() +@Index("user_transaction_unique", ["tx_hash", "output_index"], { unique: true }) +export class UserTransactionPayment { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @Column() + address: string + + @Column() + tx_hash: string + + @Column() + output_index: number + + @Column() + paid_amount: number + + @Column() + chain_fees: number + + @Column() + service_fees: number + + @Column() + paid_at_unix: number + + @Column({ default: false }) + internal: boolean + + @Column({ default: 0 }) + confs: number + + @Column({ default: 0 }) + broadcast_height: number + + @ManyToOne(type => Application, { eager: true }) + linkedApplication: Application | null + + @CreateDateColumn() + created_at: Date + + @UpdateDateColumn() + updated_at: Date +} diff --git a/src/services/storage/eventsLog.ts b/src/services/storage/eventsLog.ts index 4df1ee0e..ca586993 100644 --- a/src/services/storage/eventsLog.ts +++ b/src/services/storage/eventsLog.ts @@ -1,125 +1,125 @@ -import fs from 'fs' -import { parse, stringify } from 'csv' -import { getLogger } from '../helpers/logger.js' -//const eventLogPath = "logs/eventLogV2.csv" -type LoggedEventType = 'new_invoice' | 'new_address' | 'address_paid' | 'invoice_paid' | 'invoice_payment' | 'address_payment' | 'u2u_receiver' | 'u2u_sender' | 'balance_increment' | 'balance_decrement' -export type LoggedEvent = { - timestampMs: number - userId: string - appUserId: string - appId: string - balance: number - type: LoggedEventType - data: string - amount: number -} -type TimeEntry = { - timestamp: number - amount: number - balance: number - userId: string -} -const columns = ["timestampMs", "userId", "appUserId", "appId", "balance", "type", "data", "amount"] -type StringerWrite = (chunk: any, cb: (error: Error | null | undefined) => void) => boolean -export default class EventsLogManager { - eventLogPath: string - log = getLogger({ component: "EventsLogManager" }) - stringerWrite: StringerWrite - constructor(eventLogPath: string) { - this.eventLogPath = eventLogPath - const exists = fs.existsSync(eventLogPath) - if (!exists) { - const stringer = stringify({ header: true, columns }) - stringer.pipe(fs.createWriteStream(eventLogPath, { flags: 'a' })) - this.stringerWrite = (chunk, cb) => stringer.write(chunk, cb) - } else { - const stringer = stringify({}) - stringer.pipe(fs.createWriteStream(eventLogPath, { flags: 'a' })) - this.stringerWrite = (chunk, cb) => stringer.write(chunk, cb) - } - } - - - - LogEvent = (e: Omit) => { - this.log(e.type, "->", e.userId, "->", e.appId, "->", e.appUserId, "->", e.balance, "->", e.data, "->", e.amount) - this.write([Date.now(), e.userId, e.appUserId, e.appId, e.balance, e.type, e.data, e.amount]) - } - - GetAllLogs = async (path?: string): Promise => { - const logs = await this.Read(path) - this.log("found", logs.length, "event logs") - return logs - } - - Read = async (path?: string): Promise => { - const filePath = path ? path : this.eventLogPath - const exists = fs.existsSync(filePath) - if (!exists) { - return [] - } - return new Promise((res, rej) => { - const result: LoggedEvent[] = [] - fs.createReadStream(filePath) - .pipe(parse({ delimiter: ",", from_line: 2 })) - .on('data', data => { result.push(this.parseEvent(data)) }) - .on('error', err => { rej(err) }) - .on('end', () => { res(result) }) - }) - } - - parseEvent = (args: string[]): LoggedEvent => { - const [timestampMs, userId, appUserId, appId, balance, type, data, amount] = args - return { timestampMs: +timestampMs, userId, appUserId, appId, balance: +balance, type: type as LoggedEventType, data, amount: +amount } - } - - write = async (args: (string | number)[]) => { - return new Promise((res, rej) => { - this.stringerWrite(args, err => { - if (err) { - rej(err) - } else { res() } - }) - }) - } - - ignoredKeys = ['fees', "bc1qkafgye62h2zhzlwtrga6jytz2p7af4lg8fwqt6", "6eb1d279f95377b8514aad3b79ff1cddbe9f5d3b95653b55719850df9df63821", "b11585413bfa7bf65a5f1263e3100e53b4c9afe6b5d8c94c6b85017dfcbf3d49"] - createTimeSeries = (events: LoggedEvent[]) => { - const dataAppIds: Record = {} - const order: { timestamp: number, data: string, type: 'inc' | 'dec' }[] = [] - const incrementEntries: Record = {} - const decrementEntries: Record = {} - events.forEach(e => { - if (this.ignoredKeys.includes(e.data)) { - return - } - if (e.type === 'balance_increment') { - if (incrementEntries[e.data]) { - throw new Error("increment duplicate! " + e.data) - } - incrementEntries[e.data] = { timestamp: e.timestampMs, balance: e.balance, amount: e.amount, userId: e.userId } - order.push({ timestamp: e.timestampMs, data: e.data, type: 'inc' }) - } else if (e.type === 'balance_decrement') { - if (decrementEntries[e.data]) { - throw new Error("decrement duplicate! " + e.data) - } - decrementEntries[e.data] = { timestamp: e.timestampMs, balance: e.balance, amount: e.amount, userId: e.userId } - order.push({ timestamp: e.timestampMs, data: e.data, type: 'dec' }) - } else if (e.appId) { - dataAppIds[e.data] = e.appId - } - }) - const full = order.map(o => { - const { type } = o - if (type === 'inc') { - const entry = incrementEntries[o.data] - return { timestamp: entry.timestamp, amount: entry.amount, balance: entry.balance, userId: entry.userId, appId: dataAppIds[o.data], internal: !!decrementEntries[o.data] } - } else { - const entry = decrementEntries[o.data] - return { timestamp: entry.timestamp, amount: -entry.amount, balance: entry.balance, userId: entry.userId, appId: dataAppIds[o.data], internal: !!incrementEntries[o.data] } - } - }) - full.sort((a, b) => a.timestamp - b.timestamp) - fs.writeFileSync("timeSeries.json", JSON.stringify(full, null, 2)) - } +import fs from 'fs' +import { parse, stringify } from 'csv' +import { getLogger } from '../helpers/logger.js' +//const eventLogPath = "logs/eventLogV2.csv" +type LoggedEventType = 'new_invoice' | 'new_address' | 'address_paid' | 'invoice_paid' | 'invoice_payment' | 'address_payment' | 'u2u_receiver' | 'u2u_sender' | 'balance_increment' | 'balance_decrement' +export type LoggedEvent = { + timestampMs: number + userId: string + appUserId: string + appId: string + balance: number + type: LoggedEventType + data: string + amount: number +} +type TimeEntry = { + timestamp: number + amount: number + balance: number + userId: string +} +const columns = ["timestampMs", "userId", "appUserId", "appId", "balance", "type", "data", "amount"] +type StringerWrite = (chunk: any, cb: (error: Error | null | undefined) => void) => boolean +export default class EventsLogManager { + eventLogPath: string + log = getLogger({ component: "EventsLogManager" }) + stringerWrite: StringerWrite + constructor(eventLogPath: string) { + this.eventLogPath = eventLogPath + const exists = fs.existsSync(eventLogPath) + if (!exists) { + const stringer = stringify({ header: true, columns }) + stringer.pipe(fs.createWriteStream(eventLogPath, { flags: 'a' })) + this.stringerWrite = (chunk, cb) => stringer.write(chunk, cb) + } else { + const stringer = stringify({}) + stringer.pipe(fs.createWriteStream(eventLogPath, { flags: 'a' })) + this.stringerWrite = (chunk, cb) => stringer.write(chunk, cb) + } + } + + + + LogEvent = (e: Omit) => { + this.log(e.type, "->", e.userId, "->", e.appId, "->", e.appUserId, "->", e.balance, "->", e.data, "->", e.amount) + this.write([Date.now(), e.userId, e.appUserId, e.appId, e.balance, e.type, e.data, e.amount]) + } + + GetAllLogs = async (path?: string): Promise => { + const logs = await this.Read(path) + this.log("found", logs.length, "event logs") + return logs + } + + Read = async (path?: string): Promise => { + const filePath = path ? path : this.eventLogPath + const exists = fs.existsSync(filePath) + if (!exists) { + return [] + } + return new Promise((res, rej) => { + const result: LoggedEvent[] = [] + fs.createReadStream(filePath) + .pipe(parse({ delimiter: ",", from_line: 2 })) + .on('data', data => { result.push(this.parseEvent(data)) }) + .on('error', err => { rej(err) }) + .on('end', () => { res(result) }) + }) + } + + parseEvent = (args: string[]): LoggedEvent => { + const [timestampMs, userId, appUserId, appId, balance, type, data, amount] = args + return { timestampMs: +timestampMs, userId, appUserId, appId, balance: +balance, type: type as LoggedEventType, data, amount: +amount } + } + + write = async (args: (string | number)[]) => { + return new Promise((res, rej) => { + this.stringerWrite(args, err => { + if (err) { + rej(err) + } else { res() } + }) + }) + } + + ignoredKeys = ['fees', "bc1qkafgye62h2zhzlwtrga6jytz2p7af4lg8fwqt6", "6eb1d279f95377b8514aad3b79ff1cddbe9f5d3b95653b55719850df9df63821", "b11585413bfa7bf65a5f1263e3100e53b4c9afe6b5d8c94c6b85017dfcbf3d49"] + createTimeSeries = (events: LoggedEvent[]) => { + const dataAppIds: Record = {} + const order: { timestamp: number, data: string, type: 'inc' | 'dec' }[] = [] + const incrementEntries: Record = {} + const decrementEntries: Record = {} + events.forEach(e => { + if (this.ignoredKeys.includes(e.data)) { + return + } + if (e.type === 'balance_increment') { + if (incrementEntries[e.data]) { + throw new Error("increment duplicate! " + e.data) + } + incrementEntries[e.data] = { timestamp: e.timestampMs, balance: e.balance, amount: e.amount, userId: e.userId } + order.push({ timestamp: e.timestampMs, data: e.data, type: 'inc' }) + } else if (e.type === 'balance_decrement') { + if (decrementEntries[e.data]) { + throw new Error("decrement duplicate! " + e.data) + } + decrementEntries[e.data] = { timestamp: e.timestampMs, balance: e.balance, amount: e.amount, userId: e.userId } + order.push({ timestamp: e.timestampMs, data: e.data, type: 'dec' }) + } else if (e.appId) { + dataAppIds[e.data] = e.appId + } + }) + const full = order.map(o => { + const { type } = o + if (type === 'inc') { + const entry = incrementEntries[o.data] + return { timestamp: entry.timestamp, amount: entry.amount, balance: entry.balance, userId: entry.userId, appId: dataAppIds[o.data], internal: !!decrementEntries[o.data] } + } else { + const entry = decrementEntries[o.data] + return { timestamp: entry.timestamp, amount: -entry.amount, balance: entry.balance, userId: entry.userId, appId: dataAppIds[o.data], internal: !!incrementEntries[o.data] } + } + }) + full.sort((a, b) => a.timestamp - b.timestamp) + fs.writeFileSync("timeSeries.json", JSON.stringify(full, null, 2)) + } } \ No newline at end of file diff --git a/src/services/storage/index.ts b/src/services/storage/index.ts index 1510dc9e..28837163 100644 --- a/src/services/storage/index.ts +++ b/src/services/storage/index.ts @@ -1,47 +1,47 @@ -import { DataSource, EntityManager } from "typeorm" -import NewDB, { DbSettings, LoadDbSettingsFromEnv } from "./db.js" -import ProductStorage from './productStorage.js' -import ApplicationStorage from './applicationStorage.js' -import UserStorage from "./userStorage.js"; -import PaymentStorage from "./paymentStorage.js"; -import MetricsStorage from "./metricsStorage.js"; -import TransactionsQueue, { TX } from "./transactionsQueue.js"; -import EventsLogManager from "./eventsLog.js"; -export type StorageSettings = { - dbSettings: DbSettings - eventLogPath: string -} -export const LoadStorageSettingsFromEnv = (): StorageSettings => { - return { dbSettings: LoadDbSettingsFromEnv(), eventLogPath: "logs/eventLogV2.csv" } -} -export default class { - DB: DataSource | EntityManager - settings: StorageSettings - txQueue: TransactionsQueue - productStorage: ProductStorage - applicationStorage: ApplicationStorage - userStorage: UserStorage - paymentStorage: PaymentStorage - metricsStorage: MetricsStorage - eventsLog: EventsLogManager - constructor(settings: StorageSettings) { - this.settings = settings - this.eventsLog = new EventsLogManager(settings.eventLogPath) - } - async Connect(migrations: Function[], metricsMigrations: Function[]) { - const { source, executedMigrations } = await NewDB(this.settings.dbSettings, migrations) - this.DB = source - this.txQueue = new TransactionsQueue("main", this.DB) - this.userStorage = new UserStorage(this.DB, this.txQueue, this.eventsLog) - this.productStorage = new ProductStorage(this.DB, this.txQueue) - this.applicationStorage = new ApplicationStorage(this.DB, this.userStorage, this.txQueue) - this.paymentStorage = new PaymentStorage(this.DB, this.userStorage, this.txQueue) - this.metricsStorage = new MetricsStorage(this.settings) - const executedMetricsMigrations = await this.metricsStorage.Connect(metricsMigrations) - return { executedMigrations, executedMetricsMigrations }; - } - - StartTransaction(exec: TX, description?: string) { - return this.txQueue.PushToQueue({ exec, dbTx: true, description }) - } +import { DataSource, EntityManager } from "typeorm" +import NewDB, { DbSettings, LoadDbSettingsFromEnv } from "./db.js" +import ProductStorage from './productStorage.js' +import ApplicationStorage from './applicationStorage.js' +import UserStorage from "./userStorage.js"; +import PaymentStorage from "./paymentStorage.js"; +import MetricsStorage from "./metricsStorage.js"; +import TransactionsQueue, { TX } from "./transactionsQueue.js"; +import EventsLogManager from "./eventsLog.js"; +export type StorageSettings = { + dbSettings: DbSettings + eventLogPath: string +} +export const LoadStorageSettingsFromEnv = (): StorageSettings => { + return { dbSettings: LoadDbSettingsFromEnv(), eventLogPath: "logs/eventLogV2.csv" } +} +export default class { + DB: DataSource | EntityManager + settings: StorageSettings + txQueue: TransactionsQueue + productStorage: ProductStorage + applicationStorage: ApplicationStorage + userStorage: UserStorage + paymentStorage: PaymentStorage + metricsStorage: MetricsStorage + eventsLog: EventsLogManager + constructor(settings: StorageSettings) { + this.settings = settings + this.eventsLog = new EventsLogManager(settings.eventLogPath) + } + async Connect(migrations: Function[], metricsMigrations: Function[]) { + const { source, executedMigrations } = await NewDB(this.settings.dbSettings, migrations) + this.DB = source + this.txQueue = new TransactionsQueue("main", this.DB) + this.userStorage = new UserStorage(this.DB, this.txQueue, this.eventsLog) + this.productStorage = new ProductStorage(this.DB, this.txQueue) + this.applicationStorage = new ApplicationStorage(this.DB, this.userStorage, this.txQueue) + this.paymentStorage = new PaymentStorage(this.DB, this.userStorage, this.txQueue) + this.metricsStorage = new MetricsStorage(this.settings) + const executedMetricsMigrations = await this.metricsStorage.Connect(metricsMigrations) + return { executedMigrations, executedMetricsMigrations }; + } + + StartTransaction(exec: TX, description?: string) { + return this.txQueue.PushToQueue({ exec, dbTx: true, description }) + } } \ No newline at end of file diff --git a/src/services/storage/metricsStorage.ts b/src/services/storage/metricsStorage.ts index 8cc5332c..df82c88b 100644 --- a/src/services/storage/metricsStorage.ts +++ b/src/services/storage/metricsStorage.ts @@ -1,114 +1,114 @@ -import { Between, DataSource, EntityManager, FindOperator, LessThanOrEqual, MoreThanOrEqual } from "typeorm" -import { BalanceEvent } from "./entity/BalanceEvent.js" -import { ChannelBalanceEvent } from "./entity/ChannelsBalanceEvent.js" -import TransactionsQueue, { TX } from "./transactionsQueue.js"; -import { StorageSettings } from "./index.js"; -import { newMetricsDb } from "./db.js"; -import { ChannelRouting } from "./entity/ChannelRouting.js"; -export default class { - - DB: DataSource | EntityManager - settings: StorageSettings - txQueue: TransactionsQueue - constructor(settings: StorageSettings) { - this.settings = settings; - } - async Connect(metricsMigrations: Function[]) { - const { source, executedMigrations } = await newMetricsDb(this.settings.dbSettings, metricsMigrations) - this.DB = source; - this.txQueue = new TransactionsQueue("metrics", this.DB) - return executedMigrations; - } - - async SaveBalanceEvents(balanceEvent: Partial, channelBalanceEvents: Partial[]) { - const blanceEventEntry = this.DB.getRepository(BalanceEvent).create(balanceEvent) - const balanceEntry = await this.txQueue.PushToQueue({ exec: async db => db.getRepository(BalanceEvent).save(blanceEventEntry), dbTx: false }) - - const channelsEntry = this.DB.getRepository(ChannelBalanceEvent).create(channelBalanceEvents.map(e => ({ ...e, balance_event: balanceEntry }))) - const channelsEntries = await this.txQueue.PushToQueue({ exec: async db => db.getRepository(ChannelBalanceEvent).save(channelsEntry), dbTx: false }) - return { balanceEntry, channelsEntries } - } - - async GetBalanceEvents({ from, to }: { from?: number, to?: number }, entityManager = this.DB) { - const q = getTimeQuery({ from, to }) - - const [chainBalanceEvents, channelsBalanceEvents] = await Promise.all([ - entityManager.getRepository(BalanceEvent).find(q), - entityManager.getRepository(ChannelBalanceEvent).find(q), - ]) - return { chainBalanceEvents, channelsBalanceEvents } - } - - async initChannelRoutingEvent(dayUnix: number, channelId: string) { - const existing = await this.DB.getRepository(ChannelRouting).findOne({ where: { day_unix: dayUnix, channel_id: channelId } }) - if (!existing) { - const entry = this.DB.getRepository(ChannelRouting).create({ day_unix: dayUnix, channel_id: channelId }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(ChannelRouting).save(entry), dbTx: false }) - } - return existing - } - - GetChannelRouting({ from, to }: { from?: number, to?: number }, entityManager = this.DB) { - const q = getTimeQuery({ from, to }) - return entityManager.getRepository(ChannelRouting).find(q) - } - - async GetLatestForwardingIndexOffset() { - const latestIndex = await this.DB.getRepository(ChannelRouting).findOne({ order: { latest_index_offset: "DESC" } }) - if (latestIndex) { - return latestIndex.latest_index_offset - } - return 0 - } - - async IncrementChannelRouting(channelId: string, event: Partial) { - const dayUnix = getTodayUnix() - const existing = await this.initChannelRoutingEvent(dayUnix, channelId) - const repo = this.DB.getRepository(ChannelRouting) - if (event.send_errors) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "send_errors", event.send_errors) - } - if (event.receive_errors) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "receive_errors", event.receive_errors) - } - if (event.forward_errors_as_input) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_errors_as_input", event.forward_errors_as_input) - } - if (event.forward_errors_as_output) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_errors_as_output", event.forward_errors_as_output) - } - if (event.missed_forward_fee_as_input) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "missed_forward_fee_as_input", event.missed_forward_fee_as_input) - } - if (event.missed_forward_fee_as_output) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "missed_forward_fee_as_output", event.missed_forward_fee_as_output) - } - if (event.forward_fee_as_input) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_fee_as_input", event.forward_fee_as_input) - } - if (event.forward_fee_as_output) { - await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_fee_as_output", event.forward_fee_as_output) - } - if (event.latest_index_offset) { - await repo.update(existing.serial_id, { latest_index_offset: event.latest_index_offset }) - } - } - - -} - -const getTimeQuery = ({ from, to }: { from?: number, to?: number }) => { - if (!!from && !!to) { - return { where: { created_at: Between(new Date(from * 1000), new Date(to * 1000)) } } - } else if (!!from) { - return { where: { created_at: MoreThanOrEqual(new Date(from * 1000)) } } - } else if (!!to) { - return { where: { created_at: LessThanOrEqual(new Date(to * 1000)) } } - } - return {} -} - -const getTodayUnix = () => { - const now = new Date() - return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime() / 1000 +import { Between, DataSource, EntityManager, FindOperator, LessThanOrEqual, MoreThanOrEqual } from "typeorm" +import { BalanceEvent } from "./entity/BalanceEvent.js" +import { ChannelBalanceEvent } from "./entity/ChannelsBalanceEvent.js" +import TransactionsQueue, { TX } from "./transactionsQueue.js"; +import { StorageSettings } from "./index.js"; +import { newMetricsDb } from "./db.js"; +import { ChannelRouting } from "./entity/ChannelRouting.js"; +export default class { + + DB: DataSource | EntityManager + settings: StorageSettings + txQueue: TransactionsQueue + constructor(settings: StorageSettings) { + this.settings = settings; + } + async Connect(metricsMigrations: Function[]) { + const { source, executedMigrations } = await newMetricsDb(this.settings.dbSettings, metricsMigrations) + this.DB = source; + this.txQueue = new TransactionsQueue("metrics", this.DB) + return executedMigrations; + } + + async SaveBalanceEvents(balanceEvent: Partial, channelBalanceEvents: Partial[]) { + const blanceEventEntry = this.DB.getRepository(BalanceEvent).create(balanceEvent) + const balanceEntry = await this.txQueue.PushToQueue({ exec: async db => db.getRepository(BalanceEvent).save(blanceEventEntry), dbTx: false }) + + const channelsEntry = this.DB.getRepository(ChannelBalanceEvent).create(channelBalanceEvents.map(e => ({ ...e, balance_event: balanceEntry }))) + const channelsEntries = await this.txQueue.PushToQueue({ exec: async db => db.getRepository(ChannelBalanceEvent).save(channelsEntry), dbTx: false }) + return { balanceEntry, channelsEntries } + } + + async GetBalanceEvents({ from, to }: { from?: number, to?: number }, entityManager = this.DB) { + const q = getTimeQuery({ from, to }) + + const [chainBalanceEvents, channelsBalanceEvents] = await Promise.all([ + entityManager.getRepository(BalanceEvent).find(q), + entityManager.getRepository(ChannelBalanceEvent).find(q), + ]) + return { chainBalanceEvents, channelsBalanceEvents } + } + + async initChannelRoutingEvent(dayUnix: number, channelId: string) { + const existing = await this.DB.getRepository(ChannelRouting).findOne({ where: { day_unix: dayUnix, channel_id: channelId } }) + if (!existing) { + const entry = this.DB.getRepository(ChannelRouting).create({ day_unix: dayUnix, channel_id: channelId }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(ChannelRouting).save(entry), dbTx: false }) + } + return existing + } + + GetChannelRouting({ from, to }: { from?: number, to?: number }, entityManager = this.DB) { + const q = getTimeQuery({ from, to }) + return entityManager.getRepository(ChannelRouting).find(q) + } + + async GetLatestForwardingIndexOffset() { + const latestIndex = await this.DB.getRepository(ChannelRouting).findOne({ order: { latest_index_offset: "DESC" } }) + if (latestIndex) { + return latestIndex.latest_index_offset + } + return 0 + } + + async IncrementChannelRouting(channelId: string, event: Partial) { + const dayUnix = getTodayUnix() + const existing = await this.initChannelRoutingEvent(dayUnix, channelId) + const repo = this.DB.getRepository(ChannelRouting) + if (event.send_errors) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "send_errors", event.send_errors) + } + if (event.receive_errors) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "receive_errors", event.receive_errors) + } + if (event.forward_errors_as_input) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_errors_as_input", event.forward_errors_as_input) + } + if (event.forward_errors_as_output) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_errors_as_output", event.forward_errors_as_output) + } + if (event.missed_forward_fee_as_input) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "missed_forward_fee_as_input", event.missed_forward_fee_as_input) + } + if (event.missed_forward_fee_as_output) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "missed_forward_fee_as_output", event.missed_forward_fee_as_output) + } + if (event.forward_fee_as_input) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_fee_as_input", event.forward_fee_as_input) + } + if (event.forward_fee_as_output) { + await repo.increment({ day_unix: dayUnix, channel_id: channelId }, "forward_fee_as_output", event.forward_fee_as_output) + } + if (event.latest_index_offset) { + await repo.update(existing.serial_id, { latest_index_offset: event.latest_index_offset }) + } + } + + +} + +const getTimeQuery = ({ from, to }: { from?: number, to?: number }) => { + if (!!from && !!to) { + return { where: { created_at: Between(new Date(from * 1000), new Date(to * 1000)) } } + } else if (!!from) { + return { where: { created_at: MoreThanOrEqual(new Date(from * 1000)) } } + } else if (!!to) { + return { where: { created_at: LessThanOrEqual(new Date(to * 1000)) } } + } + return {} +} + +const getTodayUnix = () => { + const now = new Date() + return new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime() / 1000 } \ No newline at end of file diff --git a/src/services/storage/migrations/1703170309875-initial.ts b/src/services/storage/migrations/1703170309875-initial.ts index de9c1595..61ce3697 100644 --- a/src/services/storage/migrations/1703170309875-initial.ts +++ b/src/services/storage/migrations/1703170309875-initial.ts @@ -1,180 +1,180 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class Initial1703170309875 implements MigrationInterface { - name = 'Initial1703170309875' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE "user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" varchar NOT NULL, "balance_sats" integer NOT NULL DEFAULT (0), "locked" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_758b8ce7c18b9d347461b30228" ON "user" ("user_id") `); - await queryRunner.query(`CREATE TABLE "product" ("product_id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "price_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer)`); - await queryRunner.query(`CREATE TABLE "application" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "app_id" varchar NOT NULL, "name" varchar NOT NULL, "allow_user_creation" boolean NOT NULL DEFAULT (0), "nostr_private_key" varchar, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "UQ_608bb41e7e1ef5f6d7abb07e394" UNIQUE ("name"), CONSTRAINT "UQ_f190e1a83a524035b84c1fe0696" UNIQUE ("nostr_private_key"), CONSTRAINT "UQ_87c12c4528183bf7a211221cc3c" UNIQUE ("nostr_public_key"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e04964210949f10bb25dc6e747" ON "application" ("app_id") `); - await queryRunner.query(`CREATE TABLE "user_receiving_invoice" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "expires_at_unix" integer NOT NULL, "paid_at_unix" integer NOT NULL DEFAULT (0), "internal" boolean NOT NULL DEFAULT (0), "paidByLnd" boolean NOT NULL DEFAULT (0), "callbackUrl" varchar NOT NULL DEFAULT (''), "paid_amount" integer NOT NULL DEFAULT (0), "service_fee" integer NOT NULL DEFAULT (0), "zap_info" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "productProductId" varchar, "payerSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a131e6b58f084f1340538681b5" ON "user_receiving_invoice" ("invoice") `); - await queryRunner.query(`CREATE TABLE "user_receiving_address" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "callbackUrl" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ecf415a7a0b2fa64aa03c5b067" ON "user_receiving_address" ("address") `); - await queryRunner.query(`CREATE TABLE "address_receiving_transaction" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "service_fee" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userAddressSerialId" integer)`); - await queryRunner.query(`CREATE UNIQUE INDEX "address_receiving_transaction_unique" ON "address_receiving_transaction" ("tx_hash", "output_index") `); - await queryRunner.query(`CREATE TABLE "application_user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "identifier" varchar NOT NULL, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "applicationSerialId" integer, CONSTRAINT "UQ_3175dc397c8285d1e532554dea5" UNIQUE ("nostr_public_key"), CONSTRAINT "REL_0796a381bcc624f52e9a155712" UNIQUE ("userSerialId"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a0dbb25a73306b037dec82251" ON "application_user" ("identifier") `); - await queryRunner.query(`CREATE TABLE "user_basic_auth" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "secret_sha256" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, CONSTRAINT "REL_4474a3cab08c387040d4c66f33" UNIQUE ("userSerialId"))`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_361b01c8e10453b2f979246535" ON "user_basic_auth" ("name") `); - await queryRunner.query(`CREATE TABLE "user_ephemeral_key" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "type" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b9628a8315cdc6afed037563d9" ON "user_ephemeral_key" ("key") `); - await queryRunner.query(`CREATE TABLE "user_invoice_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "paid_amount" integer NOT NULL, "routing_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a609a4d3d8d9b07b90692a3c45" ON "user_invoice_payment" ("invoice") `); - await queryRunner.query(`CREATE TABLE "user_to_user_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "paid_amount" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "fromUserSerialId" integer, "toUserSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`CREATE TABLE "user_transaction_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "chain_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "something" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`CREATE UNIQUE INDEX "user_transaction_unique" ON "user_transaction_payment" ("tx_hash", "output_index") `); - await queryRunner.query(`CREATE TABLE "temporary_product" ("product_id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "price_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "FK_9e072a061430561c76a631f506c" FOREIGN KEY ("ownerSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_product"("product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId") SELECT "product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId" FROM "product"`); - await queryRunner.query(`DROP TABLE "product"`); - await queryRunner.query(`ALTER TABLE "temporary_product" RENAME TO "product"`); - await queryRunner.query(`DROP INDEX "IDX_e04964210949f10bb25dc6e747"`); - await queryRunner.query(`CREATE TABLE "temporary_application" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "app_id" varchar NOT NULL, "name" varchar NOT NULL, "allow_user_creation" boolean NOT NULL DEFAULT (0), "nostr_private_key" varchar, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "UQ_608bb41e7e1ef5f6d7abb07e394" UNIQUE ("name"), CONSTRAINT "UQ_f190e1a83a524035b84c1fe0696" UNIQUE ("nostr_private_key"), CONSTRAINT "UQ_87c12c4528183bf7a211221cc3c" UNIQUE ("nostr_public_key"), CONSTRAINT "FK_cf04162e14c4641072b08f263c5" FOREIGN KEY ("ownerSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_application"("serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId") SELECT "serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId" FROM "application"`); - await queryRunner.query(`DROP TABLE "application"`); - await queryRunner.query(`ALTER TABLE "temporary_application" RENAME TO "application"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e04964210949f10bb25dc6e747" ON "application" ("app_id") `); - await queryRunner.query(`DROP INDEX "IDX_a131e6b58f084f1340538681b5"`); - await queryRunner.query(`CREATE TABLE "temporary_user_receiving_invoice" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "expires_at_unix" integer NOT NULL, "paid_at_unix" integer NOT NULL DEFAULT (0), "internal" boolean NOT NULL DEFAULT (0), "paidByLnd" boolean NOT NULL DEFAULT (0), "callbackUrl" varchar NOT NULL DEFAULT (''), "paid_amount" integer NOT NULL DEFAULT (0), "service_fee" integer NOT NULL DEFAULT (0), "zap_info" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "productProductId" varchar, "payerSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_2c0dfb3483f3e5e7e3cdd5dc71f" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_5263bde2a519db9ea608b702ec8" FOREIGN KEY ("productProductId") REFERENCES "product" ("product_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_d4bb1e4c60e8a869f1f43ca2e31" FOREIGN KEY ("payerSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_714a8b7d4f89f8a802ca181b789" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_user_receiving_invoice"("serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId" FROM "user_receiving_invoice"`); - await queryRunner.query(`DROP TABLE "user_receiving_invoice"`); - await queryRunner.query(`ALTER TABLE "temporary_user_receiving_invoice" RENAME TO "user_receiving_invoice"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a131e6b58f084f1340538681b5" ON "user_receiving_invoice" ("invoice") `); - await queryRunner.query(`DROP INDEX "IDX_ecf415a7a0b2fa64aa03c5b067"`); - await queryRunner.query(`CREATE TABLE "temporary_user_receiving_address" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "callbackUrl" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_823e78a588858598aa91766c7ff" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_58480f93d00174952e00a0c0a5d" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_user_receiving_address"("serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_receiving_address"`); - await queryRunner.query(`DROP TABLE "user_receiving_address"`); - await queryRunner.query(`ALTER TABLE "temporary_user_receiving_address" RENAME TO "user_receiving_address"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ecf415a7a0b2fa64aa03c5b067" ON "user_receiving_address" ("address") `); - await queryRunner.query(`DROP INDEX "address_receiving_transaction_unique"`); - await queryRunner.query(`CREATE TABLE "temporary_address_receiving_transaction" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "service_fee" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userAddressSerialId" integer, CONSTRAINT "FK_fa29dc074c2e067beca4aefeaad" FOREIGN KEY ("userAddressSerialId") REFERENCES "user_receiving_address" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_address_receiving_transaction"("serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId") SELECT "serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId" FROM "address_receiving_transaction"`); - await queryRunner.query(`DROP TABLE "address_receiving_transaction"`); - await queryRunner.query(`ALTER TABLE "temporary_address_receiving_transaction" RENAME TO "address_receiving_transaction"`); - await queryRunner.query(`CREATE UNIQUE INDEX "address_receiving_transaction_unique" ON "address_receiving_transaction" ("tx_hash", "output_index") `); - await queryRunner.query(`DROP INDEX "IDX_0a0dbb25a73306b037dec82251"`); - await queryRunner.query(`CREATE TABLE "temporary_application_user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "identifier" varchar NOT NULL, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "applicationSerialId" integer, CONSTRAINT "UQ_3175dc397c8285d1e532554dea5" UNIQUE ("nostr_public_key"), CONSTRAINT "REL_0796a381bcc624f52e9a155712" UNIQUE ("userSerialId"), CONSTRAINT "FK_0796a381bcc624f52e9a155712b" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_1b3bdb6f660cd99533a1e673ef1" FOREIGN KEY ("applicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_application_user"("serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId") SELECT "serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId" FROM "application_user"`); - await queryRunner.query(`DROP TABLE "application_user"`); - await queryRunner.query(`ALTER TABLE "temporary_application_user" RENAME TO "application_user"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a0dbb25a73306b037dec82251" ON "application_user" ("identifier") `); - await queryRunner.query(`DROP INDEX "IDX_361b01c8e10453b2f979246535"`); - await queryRunner.query(`CREATE TABLE "temporary_user_basic_auth" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "secret_sha256" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, CONSTRAINT "REL_4474a3cab08c387040d4c66f33" UNIQUE ("userSerialId"), CONSTRAINT "FK_4474a3cab08c387040d4c66f337" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_user_basic_auth"("serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId") SELECT "serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId" FROM "user_basic_auth"`); - await queryRunner.query(`DROP TABLE "user_basic_auth"`); - await queryRunner.query(`ALTER TABLE "temporary_user_basic_auth" RENAME TO "user_basic_auth"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_361b01c8e10453b2f979246535" ON "user_basic_auth" ("name") `); - await queryRunner.query(`DROP INDEX "IDX_b9628a8315cdc6afed037563d9"`); - await queryRunner.query(`CREATE TABLE "temporary_user_ephemeral_key" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "type" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_13af336122427a543067b13c453" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_9dff387698d432ff8b931ea954d" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_user_ephemeral_key"("serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_ephemeral_key"`); - await queryRunner.query(`DROP TABLE "user_ephemeral_key"`); - await queryRunner.query(`ALTER TABLE "temporary_user_ephemeral_key" RENAME TO "user_ephemeral_key"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b9628a8315cdc6afed037563d9" ON "user_ephemeral_key" ("key") `); - await queryRunner.query(`DROP INDEX "IDX_a609a4d3d8d9b07b90692a3c45"`); - await queryRunner.query(`CREATE TABLE "temporary_user_invoice_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "paid_amount" integer NOT NULL, "routing_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_ef2aa6761ab681bbbd5f94e0fcb" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_6bcac90887eea1dc61d37db2994" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_user_invoice_payment"("serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_invoice_payment"`); - await queryRunner.query(`DROP TABLE "user_invoice_payment"`); - await queryRunner.query(`ALTER TABLE "temporary_user_invoice_payment" RENAME TO "user_invoice_payment"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a609a4d3d8d9b07b90692a3c45" ON "user_invoice_payment" ("invoice") `); - await queryRunner.query(`CREATE TABLE "temporary_user_to_user_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "paid_amount" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "fromUserSerialId" integer, "toUserSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_239687f55807600edd2c515628a" FOREIGN KEY ("fromUserSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_d88c97ca05db8d408682a5944d2" FOREIGN KEY ("toUserSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_f08d33ed4949525faed9218ad25" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_user_to_user_payment"("serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId") SELECT "serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId" FROM "user_to_user_payment"`); - await queryRunner.query(`DROP TABLE "user_to_user_payment"`); - await queryRunner.query(`ALTER TABLE "temporary_user_to_user_payment" RENAME TO "user_to_user_payment"`); - await queryRunner.query(`DROP INDEX "user_transaction_unique"`); - await queryRunner.query(`CREATE TABLE "temporary_user_transaction_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "chain_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "something" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_6f24c901b4103f7146eb615a5db" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_75abdd29270979e901da0dba7b9" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_user_transaction_payment"("serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_transaction_payment"`); - await queryRunner.query(`DROP TABLE "user_transaction_payment"`); - await queryRunner.query(`ALTER TABLE "temporary_user_transaction_payment" RENAME TO "user_transaction_payment"`); - await queryRunner.query(`CREATE UNIQUE INDEX "user_transaction_unique" ON "user_transaction_payment" ("tx_hash", "output_index") `); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`DROP INDEX "user_transaction_unique"`); - await queryRunner.query(`ALTER TABLE "user_transaction_payment" RENAME TO "temporary_user_transaction_payment"`); - await queryRunner.query(`CREATE TABLE "user_transaction_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "chain_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "something" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`INSERT INTO "user_transaction_payment"("serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_transaction_payment"`); - await queryRunner.query(`DROP TABLE "temporary_user_transaction_payment"`); - await queryRunner.query(`CREATE UNIQUE INDEX "user_transaction_unique" ON "user_transaction_payment" ("tx_hash", "output_index") `); - await queryRunner.query(`ALTER TABLE "user_to_user_payment" RENAME TO "temporary_user_to_user_payment"`); - await queryRunner.query(`CREATE TABLE "user_to_user_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "paid_amount" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "fromUserSerialId" integer, "toUserSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`INSERT INTO "user_to_user_payment"("serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId") SELECT "serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId" FROM "temporary_user_to_user_payment"`); - await queryRunner.query(`DROP TABLE "temporary_user_to_user_payment"`); - await queryRunner.query(`DROP INDEX "IDX_a609a4d3d8d9b07b90692a3c45"`); - await queryRunner.query(`ALTER TABLE "user_invoice_payment" RENAME TO "temporary_user_invoice_payment"`); - await queryRunner.query(`CREATE TABLE "user_invoice_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "paid_amount" integer NOT NULL, "routing_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`INSERT INTO "user_invoice_payment"("serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_invoice_payment"`); - await queryRunner.query(`DROP TABLE "temporary_user_invoice_payment"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a609a4d3d8d9b07b90692a3c45" ON "user_invoice_payment" ("invoice") `); - await queryRunner.query(`DROP INDEX "IDX_b9628a8315cdc6afed037563d9"`); - await queryRunner.query(`ALTER TABLE "user_ephemeral_key" RENAME TO "temporary_user_ephemeral_key"`); - await queryRunner.query(`CREATE TABLE "user_ephemeral_key" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "type" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`INSERT INTO "user_ephemeral_key"("serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_ephemeral_key"`); - await queryRunner.query(`DROP TABLE "temporary_user_ephemeral_key"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b9628a8315cdc6afed037563d9" ON "user_ephemeral_key" ("key") `); - await queryRunner.query(`DROP INDEX "IDX_361b01c8e10453b2f979246535"`); - await queryRunner.query(`ALTER TABLE "user_basic_auth" RENAME TO "temporary_user_basic_auth"`); - await queryRunner.query(`CREATE TABLE "user_basic_auth" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "secret_sha256" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, CONSTRAINT "REL_4474a3cab08c387040d4c66f33" UNIQUE ("userSerialId"))`); - await queryRunner.query(`INSERT INTO "user_basic_auth"("serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId") SELECT "serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId" FROM "temporary_user_basic_auth"`); - await queryRunner.query(`DROP TABLE "temporary_user_basic_auth"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_361b01c8e10453b2f979246535" ON "user_basic_auth" ("name") `); - await queryRunner.query(`DROP INDEX "IDX_0a0dbb25a73306b037dec82251"`); - await queryRunner.query(`ALTER TABLE "application_user" RENAME TO "temporary_application_user"`); - await queryRunner.query(`CREATE TABLE "application_user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "identifier" varchar NOT NULL, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "applicationSerialId" integer, CONSTRAINT "UQ_3175dc397c8285d1e532554dea5" UNIQUE ("nostr_public_key"), CONSTRAINT "REL_0796a381bcc624f52e9a155712" UNIQUE ("userSerialId"))`); - await queryRunner.query(`INSERT INTO "application_user"("serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId") SELECT "serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId" FROM "temporary_application_user"`); - await queryRunner.query(`DROP TABLE "temporary_application_user"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a0dbb25a73306b037dec82251" ON "application_user" ("identifier") `); - await queryRunner.query(`DROP INDEX "address_receiving_transaction_unique"`); - await queryRunner.query(`ALTER TABLE "address_receiving_transaction" RENAME TO "temporary_address_receiving_transaction"`); - await queryRunner.query(`CREATE TABLE "address_receiving_transaction" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "service_fee" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userAddressSerialId" integer)`); - await queryRunner.query(`INSERT INTO "address_receiving_transaction"("serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId") SELECT "serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId" FROM "temporary_address_receiving_transaction"`); - await queryRunner.query(`DROP TABLE "temporary_address_receiving_transaction"`); - await queryRunner.query(`CREATE UNIQUE INDEX "address_receiving_transaction_unique" ON "address_receiving_transaction" ("tx_hash", "output_index") `); - await queryRunner.query(`DROP INDEX "IDX_ecf415a7a0b2fa64aa03c5b067"`); - await queryRunner.query(`ALTER TABLE "user_receiving_address" RENAME TO "temporary_user_receiving_address"`); - await queryRunner.query(`CREATE TABLE "user_receiving_address" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "callbackUrl" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`INSERT INTO "user_receiving_address"("serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_receiving_address"`); - await queryRunner.query(`DROP TABLE "temporary_user_receiving_address"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ecf415a7a0b2fa64aa03c5b067" ON "user_receiving_address" ("address") `); - await queryRunner.query(`DROP INDEX "IDX_a131e6b58f084f1340538681b5"`); - await queryRunner.query(`ALTER TABLE "user_receiving_invoice" RENAME TO "temporary_user_receiving_invoice"`); - await queryRunner.query(`CREATE TABLE "user_receiving_invoice" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "expires_at_unix" integer NOT NULL, "paid_at_unix" integer NOT NULL DEFAULT (0), "internal" boolean NOT NULL DEFAULT (0), "paidByLnd" boolean NOT NULL DEFAULT (0), "callbackUrl" varchar NOT NULL DEFAULT (''), "paid_amount" integer NOT NULL DEFAULT (0), "service_fee" integer NOT NULL DEFAULT (0), "zap_info" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "productProductId" varchar, "payerSerialId" integer, "linkedApplicationSerialId" integer)`); - await queryRunner.query(`INSERT INTO "user_receiving_invoice"("serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId" FROM "temporary_user_receiving_invoice"`); - await queryRunner.query(`DROP TABLE "temporary_user_receiving_invoice"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a131e6b58f084f1340538681b5" ON "user_receiving_invoice" ("invoice") `); - await queryRunner.query(`DROP INDEX "IDX_e04964210949f10bb25dc6e747"`); - await queryRunner.query(`ALTER TABLE "application" RENAME TO "temporary_application"`); - await queryRunner.query(`CREATE TABLE "application" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "app_id" varchar NOT NULL, "name" varchar NOT NULL, "allow_user_creation" boolean NOT NULL DEFAULT (0), "nostr_private_key" varchar, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "UQ_608bb41e7e1ef5f6d7abb07e394" UNIQUE ("name"), CONSTRAINT "UQ_f190e1a83a524035b84c1fe0696" UNIQUE ("nostr_private_key"), CONSTRAINT "UQ_87c12c4528183bf7a211221cc3c" UNIQUE ("nostr_public_key"))`); - await queryRunner.query(`INSERT INTO "application"("serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId") SELECT "serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId" FROM "temporary_application"`); - await queryRunner.query(`DROP TABLE "temporary_application"`); - await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e04964210949f10bb25dc6e747" ON "application" ("app_id") `); - await queryRunner.query(`ALTER TABLE "product" RENAME TO "temporary_product"`); - await queryRunner.query(`CREATE TABLE "product" ("product_id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "price_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer)`); - await queryRunner.query(`INSERT INTO "product"("product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId") SELECT "product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId" FROM "temporary_product"`); - await queryRunner.query(`DROP TABLE "temporary_product"`); - await queryRunner.query(`DROP INDEX "user_transaction_unique"`); - await queryRunner.query(`DROP TABLE "user_transaction_payment"`); - await queryRunner.query(`DROP TABLE "user_to_user_payment"`); - await queryRunner.query(`DROP INDEX "IDX_a609a4d3d8d9b07b90692a3c45"`); - await queryRunner.query(`DROP TABLE "user_invoice_payment"`); - await queryRunner.query(`DROP INDEX "IDX_b9628a8315cdc6afed037563d9"`); - await queryRunner.query(`DROP TABLE "user_ephemeral_key"`); - await queryRunner.query(`DROP INDEX "IDX_361b01c8e10453b2f979246535"`); - await queryRunner.query(`DROP TABLE "user_basic_auth"`); - await queryRunner.query(`DROP INDEX "IDX_0a0dbb25a73306b037dec82251"`); - await queryRunner.query(`DROP TABLE "application_user"`); - await queryRunner.query(`DROP INDEX "address_receiving_transaction_unique"`); - await queryRunner.query(`DROP TABLE "address_receiving_transaction"`); - await queryRunner.query(`DROP INDEX "IDX_ecf415a7a0b2fa64aa03c5b067"`); - await queryRunner.query(`DROP TABLE "user_receiving_address"`); - await queryRunner.query(`DROP INDEX "IDX_a131e6b58f084f1340538681b5"`); - await queryRunner.query(`DROP TABLE "user_receiving_invoice"`); - await queryRunner.query(`DROP INDEX "IDX_e04964210949f10bb25dc6e747"`); - await queryRunner.query(`DROP TABLE "application"`); - await queryRunner.query(`DROP TABLE "product"`); - await queryRunner.query(`DROP INDEX "IDX_758b8ce7c18b9d347461b30228"`); - await queryRunner.query(`DROP TABLE "user"`); - } - -} +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class Initial1703170309875 implements MigrationInterface { + name = 'Initial1703170309875' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE "user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" varchar NOT NULL, "balance_sats" integer NOT NULL DEFAULT (0), "locked" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_758b8ce7c18b9d347461b30228" ON "user" ("user_id") `); + await queryRunner.query(`CREATE TABLE "product" ("product_id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "price_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer)`); + await queryRunner.query(`CREATE TABLE "application" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "app_id" varchar NOT NULL, "name" varchar NOT NULL, "allow_user_creation" boolean NOT NULL DEFAULT (0), "nostr_private_key" varchar, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "UQ_608bb41e7e1ef5f6d7abb07e394" UNIQUE ("name"), CONSTRAINT "UQ_f190e1a83a524035b84c1fe0696" UNIQUE ("nostr_private_key"), CONSTRAINT "UQ_87c12c4528183bf7a211221cc3c" UNIQUE ("nostr_public_key"))`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e04964210949f10bb25dc6e747" ON "application" ("app_id") `); + await queryRunner.query(`CREATE TABLE "user_receiving_invoice" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "expires_at_unix" integer NOT NULL, "paid_at_unix" integer NOT NULL DEFAULT (0), "internal" boolean NOT NULL DEFAULT (0), "paidByLnd" boolean NOT NULL DEFAULT (0), "callbackUrl" varchar NOT NULL DEFAULT (''), "paid_amount" integer NOT NULL DEFAULT (0), "service_fee" integer NOT NULL DEFAULT (0), "zap_info" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "productProductId" varchar, "payerSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a131e6b58f084f1340538681b5" ON "user_receiving_invoice" ("invoice") `); + await queryRunner.query(`CREATE TABLE "user_receiving_address" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "callbackUrl" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ecf415a7a0b2fa64aa03c5b067" ON "user_receiving_address" ("address") `); + await queryRunner.query(`CREATE TABLE "address_receiving_transaction" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "service_fee" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userAddressSerialId" integer)`); + await queryRunner.query(`CREATE UNIQUE INDEX "address_receiving_transaction_unique" ON "address_receiving_transaction" ("tx_hash", "output_index") `); + await queryRunner.query(`CREATE TABLE "application_user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "identifier" varchar NOT NULL, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "applicationSerialId" integer, CONSTRAINT "UQ_3175dc397c8285d1e532554dea5" UNIQUE ("nostr_public_key"), CONSTRAINT "REL_0796a381bcc624f52e9a155712" UNIQUE ("userSerialId"))`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a0dbb25a73306b037dec82251" ON "application_user" ("identifier") `); + await queryRunner.query(`CREATE TABLE "user_basic_auth" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "secret_sha256" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, CONSTRAINT "REL_4474a3cab08c387040d4c66f33" UNIQUE ("userSerialId"))`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_361b01c8e10453b2f979246535" ON "user_basic_auth" ("name") `); + await queryRunner.query(`CREATE TABLE "user_ephemeral_key" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "type" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b9628a8315cdc6afed037563d9" ON "user_ephemeral_key" ("key") `); + await queryRunner.query(`CREATE TABLE "user_invoice_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "paid_amount" integer NOT NULL, "routing_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a609a4d3d8d9b07b90692a3c45" ON "user_invoice_payment" ("invoice") `); + await queryRunner.query(`CREATE TABLE "user_to_user_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "paid_amount" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "fromUserSerialId" integer, "toUserSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`CREATE TABLE "user_transaction_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "chain_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "something" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`CREATE UNIQUE INDEX "user_transaction_unique" ON "user_transaction_payment" ("tx_hash", "output_index") `); + await queryRunner.query(`CREATE TABLE "temporary_product" ("product_id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "price_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "FK_9e072a061430561c76a631f506c" FOREIGN KEY ("ownerSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_product"("product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId") SELECT "product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId" FROM "product"`); + await queryRunner.query(`DROP TABLE "product"`); + await queryRunner.query(`ALTER TABLE "temporary_product" RENAME TO "product"`); + await queryRunner.query(`DROP INDEX "IDX_e04964210949f10bb25dc6e747"`); + await queryRunner.query(`CREATE TABLE "temporary_application" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "app_id" varchar NOT NULL, "name" varchar NOT NULL, "allow_user_creation" boolean NOT NULL DEFAULT (0), "nostr_private_key" varchar, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "UQ_608bb41e7e1ef5f6d7abb07e394" UNIQUE ("name"), CONSTRAINT "UQ_f190e1a83a524035b84c1fe0696" UNIQUE ("nostr_private_key"), CONSTRAINT "UQ_87c12c4528183bf7a211221cc3c" UNIQUE ("nostr_public_key"), CONSTRAINT "FK_cf04162e14c4641072b08f263c5" FOREIGN KEY ("ownerSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_application"("serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId") SELECT "serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId" FROM "application"`); + await queryRunner.query(`DROP TABLE "application"`); + await queryRunner.query(`ALTER TABLE "temporary_application" RENAME TO "application"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e04964210949f10bb25dc6e747" ON "application" ("app_id") `); + await queryRunner.query(`DROP INDEX "IDX_a131e6b58f084f1340538681b5"`); + await queryRunner.query(`CREATE TABLE "temporary_user_receiving_invoice" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "expires_at_unix" integer NOT NULL, "paid_at_unix" integer NOT NULL DEFAULT (0), "internal" boolean NOT NULL DEFAULT (0), "paidByLnd" boolean NOT NULL DEFAULT (0), "callbackUrl" varchar NOT NULL DEFAULT (''), "paid_amount" integer NOT NULL DEFAULT (0), "service_fee" integer NOT NULL DEFAULT (0), "zap_info" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "productProductId" varchar, "payerSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_2c0dfb3483f3e5e7e3cdd5dc71f" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_5263bde2a519db9ea608b702ec8" FOREIGN KEY ("productProductId") REFERENCES "product" ("product_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_d4bb1e4c60e8a869f1f43ca2e31" FOREIGN KEY ("payerSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_714a8b7d4f89f8a802ca181b789" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_user_receiving_invoice"("serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId" FROM "user_receiving_invoice"`); + await queryRunner.query(`DROP TABLE "user_receiving_invoice"`); + await queryRunner.query(`ALTER TABLE "temporary_user_receiving_invoice" RENAME TO "user_receiving_invoice"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a131e6b58f084f1340538681b5" ON "user_receiving_invoice" ("invoice") `); + await queryRunner.query(`DROP INDEX "IDX_ecf415a7a0b2fa64aa03c5b067"`); + await queryRunner.query(`CREATE TABLE "temporary_user_receiving_address" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "callbackUrl" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_823e78a588858598aa91766c7ff" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_58480f93d00174952e00a0c0a5d" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_user_receiving_address"("serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_receiving_address"`); + await queryRunner.query(`DROP TABLE "user_receiving_address"`); + await queryRunner.query(`ALTER TABLE "temporary_user_receiving_address" RENAME TO "user_receiving_address"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ecf415a7a0b2fa64aa03c5b067" ON "user_receiving_address" ("address") `); + await queryRunner.query(`DROP INDEX "address_receiving_transaction_unique"`); + await queryRunner.query(`CREATE TABLE "temporary_address_receiving_transaction" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "service_fee" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userAddressSerialId" integer, CONSTRAINT "FK_fa29dc074c2e067beca4aefeaad" FOREIGN KEY ("userAddressSerialId") REFERENCES "user_receiving_address" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_address_receiving_transaction"("serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId") SELECT "serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId" FROM "address_receiving_transaction"`); + await queryRunner.query(`DROP TABLE "address_receiving_transaction"`); + await queryRunner.query(`ALTER TABLE "temporary_address_receiving_transaction" RENAME TO "address_receiving_transaction"`); + await queryRunner.query(`CREATE UNIQUE INDEX "address_receiving_transaction_unique" ON "address_receiving_transaction" ("tx_hash", "output_index") `); + await queryRunner.query(`DROP INDEX "IDX_0a0dbb25a73306b037dec82251"`); + await queryRunner.query(`CREATE TABLE "temporary_application_user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "identifier" varchar NOT NULL, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "applicationSerialId" integer, CONSTRAINT "UQ_3175dc397c8285d1e532554dea5" UNIQUE ("nostr_public_key"), CONSTRAINT "REL_0796a381bcc624f52e9a155712" UNIQUE ("userSerialId"), CONSTRAINT "FK_0796a381bcc624f52e9a155712b" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_1b3bdb6f660cd99533a1e673ef1" FOREIGN KEY ("applicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_application_user"("serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId") SELECT "serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId" FROM "application_user"`); + await queryRunner.query(`DROP TABLE "application_user"`); + await queryRunner.query(`ALTER TABLE "temporary_application_user" RENAME TO "application_user"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a0dbb25a73306b037dec82251" ON "application_user" ("identifier") `); + await queryRunner.query(`DROP INDEX "IDX_361b01c8e10453b2f979246535"`); + await queryRunner.query(`CREATE TABLE "temporary_user_basic_auth" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "secret_sha256" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, CONSTRAINT "REL_4474a3cab08c387040d4c66f33" UNIQUE ("userSerialId"), CONSTRAINT "FK_4474a3cab08c387040d4c66f337" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_user_basic_auth"("serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId") SELECT "serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId" FROM "user_basic_auth"`); + await queryRunner.query(`DROP TABLE "user_basic_auth"`); + await queryRunner.query(`ALTER TABLE "temporary_user_basic_auth" RENAME TO "user_basic_auth"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_361b01c8e10453b2f979246535" ON "user_basic_auth" ("name") `); + await queryRunner.query(`DROP INDEX "IDX_b9628a8315cdc6afed037563d9"`); + await queryRunner.query(`CREATE TABLE "temporary_user_ephemeral_key" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "type" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_13af336122427a543067b13c453" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_9dff387698d432ff8b931ea954d" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_user_ephemeral_key"("serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_ephemeral_key"`); + await queryRunner.query(`DROP TABLE "user_ephemeral_key"`); + await queryRunner.query(`ALTER TABLE "temporary_user_ephemeral_key" RENAME TO "user_ephemeral_key"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b9628a8315cdc6afed037563d9" ON "user_ephemeral_key" ("key") `); + await queryRunner.query(`DROP INDEX "IDX_a609a4d3d8d9b07b90692a3c45"`); + await queryRunner.query(`CREATE TABLE "temporary_user_invoice_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "paid_amount" integer NOT NULL, "routing_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_ef2aa6761ab681bbbd5f94e0fcb" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_6bcac90887eea1dc61d37db2994" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_user_invoice_payment"("serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_invoice_payment"`); + await queryRunner.query(`DROP TABLE "user_invoice_payment"`); + await queryRunner.query(`ALTER TABLE "temporary_user_invoice_payment" RENAME TO "user_invoice_payment"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a609a4d3d8d9b07b90692a3c45" ON "user_invoice_payment" ("invoice") `); + await queryRunner.query(`CREATE TABLE "temporary_user_to_user_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "paid_amount" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "fromUserSerialId" integer, "toUserSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_239687f55807600edd2c515628a" FOREIGN KEY ("fromUserSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_d88c97ca05db8d408682a5944d2" FOREIGN KEY ("toUserSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_f08d33ed4949525faed9218ad25" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_user_to_user_payment"("serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId") SELECT "serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId" FROM "user_to_user_payment"`); + await queryRunner.query(`DROP TABLE "user_to_user_payment"`); + await queryRunner.query(`ALTER TABLE "temporary_user_to_user_payment" RENAME TO "user_to_user_payment"`); + await queryRunner.query(`DROP INDEX "user_transaction_unique"`); + await queryRunner.query(`CREATE TABLE "temporary_user_transaction_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "chain_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "something" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer, CONSTRAINT "FK_6f24c901b4103f7146eb615a5db" FOREIGN KEY ("userSerialId") REFERENCES "user" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT "FK_75abdd29270979e901da0dba7b9" FOREIGN KEY ("linkedApplicationSerialId") REFERENCES "application" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_user_transaction_payment"("serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "user_transaction_payment"`); + await queryRunner.query(`DROP TABLE "user_transaction_payment"`); + await queryRunner.query(`ALTER TABLE "temporary_user_transaction_payment" RENAME TO "user_transaction_payment"`); + await queryRunner.query(`CREATE UNIQUE INDEX "user_transaction_unique" ON "user_transaction_payment" ("tx_hash", "output_index") `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX "user_transaction_unique"`); + await queryRunner.query(`ALTER TABLE "user_transaction_payment" RENAME TO "temporary_user_transaction_payment"`); + await queryRunner.query(`CREATE TABLE "user_transaction_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "chain_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "something" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`INSERT INTO "user_transaction_payment"("serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "tx_hash", "output_index", "paid_amount", "chain_fees", "service_fees", "paid_at_unix", "internal", "confs", "broadcast_height", "something", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_transaction_payment"`); + await queryRunner.query(`DROP TABLE "temporary_user_transaction_payment"`); + await queryRunner.query(`CREATE UNIQUE INDEX "user_transaction_unique" ON "user_transaction_payment" ("tx_hash", "output_index") `); + await queryRunner.query(`ALTER TABLE "user_to_user_payment" RENAME TO "temporary_user_to_user_payment"`); + await queryRunner.query(`CREATE TABLE "user_to_user_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "paid_amount" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "fromUserSerialId" integer, "toUserSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`INSERT INTO "user_to_user_payment"("serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId") SELECT "serial_id", "paid_amount", "service_fees", "paid_at_unix", "created_at", "updated_at", "fromUserSerialId", "toUserSerialId", "linkedApplicationSerialId" FROM "temporary_user_to_user_payment"`); + await queryRunner.query(`DROP TABLE "temporary_user_to_user_payment"`); + await queryRunner.query(`DROP INDEX "IDX_a609a4d3d8d9b07b90692a3c45"`); + await queryRunner.query(`ALTER TABLE "user_invoice_payment" RENAME TO "temporary_user_invoice_payment"`); + await queryRunner.query(`CREATE TABLE "user_invoice_payment" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "paid_amount" integer NOT NULL, "routing_fees" integer NOT NULL, "service_fees" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`INSERT INTO "user_invoice_payment"("serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "paid_amount", "routing_fees", "service_fees", "paid_at_unix", "internal", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_invoice_payment"`); + await queryRunner.query(`DROP TABLE "temporary_user_invoice_payment"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a609a4d3d8d9b07b90692a3c45" ON "user_invoice_payment" ("invoice") `); + await queryRunner.query(`DROP INDEX "IDX_b9628a8315cdc6afed037563d9"`); + await queryRunner.query(`ALTER TABLE "user_ephemeral_key" RENAME TO "temporary_user_ephemeral_key"`); + await queryRunner.query(`CREATE TABLE "user_ephemeral_key" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "key" varchar NOT NULL, "type" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`INSERT INTO "user_ephemeral_key"("serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "key", "type", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_ephemeral_key"`); + await queryRunner.query(`DROP TABLE "temporary_user_ephemeral_key"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_b9628a8315cdc6afed037563d9" ON "user_ephemeral_key" ("key") `); + await queryRunner.query(`DROP INDEX "IDX_361b01c8e10453b2f979246535"`); + await queryRunner.query(`ALTER TABLE "user_basic_auth" RENAME TO "temporary_user_basic_auth"`); + await queryRunner.query(`CREATE TABLE "user_basic_auth" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "secret_sha256" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, CONSTRAINT "REL_4474a3cab08c387040d4c66f33" UNIQUE ("userSerialId"))`); + await queryRunner.query(`INSERT INTO "user_basic_auth"("serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId") SELECT "serial_id", "name", "secret_sha256", "created_at", "updated_at", "userSerialId" FROM "temporary_user_basic_auth"`); + await queryRunner.query(`DROP TABLE "temporary_user_basic_auth"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_361b01c8e10453b2f979246535" ON "user_basic_auth" ("name") `); + await queryRunner.query(`DROP INDEX "IDX_0a0dbb25a73306b037dec82251"`); + await queryRunner.query(`ALTER TABLE "application_user" RENAME TO "temporary_application_user"`); + await queryRunner.query(`CREATE TABLE "application_user" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "identifier" varchar NOT NULL, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "applicationSerialId" integer, CONSTRAINT "UQ_3175dc397c8285d1e532554dea5" UNIQUE ("nostr_public_key"), CONSTRAINT "REL_0796a381bcc624f52e9a155712" UNIQUE ("userSerialId"))`); + await queryRunner.query(`INSERT INTO "application_user"("serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId") SELECT "serial_id", "identifier", "nostr_public_key", "created_at", "updated_at", "userSerialId", "applicationSerialId" FROM "temporary_application_user"`); + await queryRunner.query(`DROP TABLE "temporary_application_user"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_0a0dbb25a73306b037dec82251" ON "application_user" ("identifier") `); + await queryRunner.query(`DROP INDEX "address_receiving_transaction_unique"`); + await queryRunner.query(`ALTER TABLE "address_receiving_transaction" RENAME TO "temporary_address_receiving_transaction"`); + await queryRunner.query(`CREATE TABLE "address_receiving_transaction" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "tx_hash" varchar NOT NULL, "output_index" integer NOT NULL, "paid_amount" integer NOT NULL, "service_fee" integer NOT NULL, "paid_at_unix" integer NOT NULL, "internal" boolean NOT NULL DEFAULT (0), "confs" integer NOT NULL DEFAULT (0), "broadcast_height" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userAddressSerialId" integer)`); + await queryRunner.query(`INSERT INTO "address_receiving_transaction"("serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId") SELECT "serial_id", "tx_hash", "output_index", "paid_amount", "service_fee", "paid_at_unix", "internal", "confs", "broadcast_height", "created_at", "updated_at", "userAddressSerialId" FROM "temporary_address_receiving_transaction"`); + await queryRunner.query(`DROP TABLE "temporary_address_receiving_transaction"`); + await queryRunner.query(`CREATE UNIQUE INDEX "address_receiving_transaction_unique" ON "address_receiving_transaction" ("tx_hash", "output_index") `); + await queryRunner.query(`DROP INDEX "IDX_ecf415a7a0b2fa64aa03c5b067"`); + await queryRunner.query(`ALTER TABLE "user_receiving_address" RENAME TO "temporary_user_receiving_address"`); + await queryRunner.query(`CREATE TABLE "user_receiving_address" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar NOT NULL, "callbackUrl" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`INSERT INTO "user_receiving_address"("serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId") SELECT "serial_id", "address", "callbackUrl", "created_at", "updated_at", "userSerialId", "linkedApplicationSerialId" FROM "temporary_user_receiving_address"`); + await queryRunner.query(`DROP TABLE "temporary_user_receiving_address"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_ecf415a7a0b2fa64aa03c5b067" ON "user_receiving_address" ("address") `); + await queryRunner.query(`DROP INDEX "IDX_a131e6b58f084f1340538681b5"`); + await queryRunner.query(`ALTER TABLE "user_receiving_invoice" RENAME TO "temporary_user_receiving_invoice"`); + await queryRunner.query(`CREATE TABLE "user_receiving_invoice" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "invoice" varchar NOT NULL, "expires_at_unix" integer NOT NULL, "paid_at_unix" integer NOT NULL DEFAULT (0), "internal" boolean NOT NULL DEFAULT (0), "paidByLnd" boolean NOT NULL DEFAULT (0), "callbackUrl" varchar NOT NULL DEFAULT (''), "paid_amount" integer NOT NULL DEFAULT (0), "service_fee" integer NOT NULL DEFAULT (0), "zap_info" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "userSerialId" integer, "productProductId" varchar, "payerSerialId" integer, "linkedApplicationSerialId" integer)`); + await queryRunner.query(`INSERT INTO "user_receiving_invoice"("serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId") SELECT "serial_id", "invoice", "expires_at_unix", "paid_at_unix", "internal", "paidByLnd", "callbackUrl", "paid_amount", "service_fee", "zap_info", "created_at", "updated_at", "userSerialId", "productProductId", "payerSerialId", "linkedApplicationSerialId" FROM "temporary_user_receiving_invoice"`); + await queryRunner.query(`DROP TABLE "temporary_user_receiving_invoice"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_a131e6b58f084f1340538681b5" ON "user_receiving_invoice" ("invoice") `); + await queryRunner.query(`DROP INDEX "IDX_e04964210949f10bb25dc6e747"`); + await queryRunner.query(`ALTER TABLE "application" RENAME TO "temporary_application"`); + await queryRunner.query(`CREATE TABLE "application" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "app_id" varchar NOT NULL, "name" varchar NOT NULL, "allow_user_creation" boolean NOT NULL DEFAULT (0), "nostr_private_key" varchar, "nostr_public_key" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer, CONSTRAINT "UQ_608bb41e7e1ef5f6d7abb07e394" UNIQUE ("name"), CONSTRAINT "UQ_f190e1a83a524035b84c1fe0696" UNIQUE ("nostr_private_key"), CONSTRAINT "UQ_87c12c4528183bf7a211221cc3c" UNIQUE ("nostr_public_key"))`); + await queryRunner.query(`INSERT INTO "application"("serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId") SELECT "serial_id", "app_id", "name", "allow_user_creation", "nostr_private_key", "nostr_public_key", "created_at", "updated_at", "ownerSerialId" FROM "temporary_application"`); + await queryRunner.query(`DROP TABLE "temporary_application"`); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_e04964210949f10bb25dc6e747" ON "application" ("app_id") `); + await queryRunner.query(`ALTER TABLE "product" RENAME TO "temporary_product"`); + await queryRunner.query(`CREATE TABLE "product" ("product_id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "price_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "ownerSerialId" integer)`); + await queryRunner.query(`INSERT INTO "product"("product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId") SELECT "product_id", "name", "price_sats", "created_at", "updated_at", "ownerSerialId" FROM "temporary_product"`); + await queryRunner.query(`DROP TABLE "temporary_product"`); + await queryRunner.query(`DROP INDEX "user_transaction_unique"`); + await queryRunner.query(`DROP TABLE "user_transaction_payment"`); + await queryRunner.query(`DROP TABLE "user_to_user_payment"`); + await queryRunner.query(`DROP INDEX "IDX_a609a4d3d8d9b07b90692a3c45"`); + await queryRunner.query(`DROP TABLE "user_invoice_payment"`); + await queryRunner.query(`DROP INDEX "IDX_b9628a8315cdc6afed037563d9"`); + await queryRunner.query(`DROP TABLE "user_ephemeral_key"`); + await queryRunner.query(`DROP INDEX "IDX_361b01c8e10453b2f979246535"`); + await queryRunner.query(`DROP TABLE "user_basic_auth"`); + await queryRunner.query(`DROP INDEX "IDX_0a0dbb25a73306b037dec82251"`); + await queryRunner.query(`DROP TABLE "application_user"`); + await queryRunner.query(`DROP INDEX "address_receiving_transaction_unique"`); + await queryRunner.query(`DROP TABLE "address_receiving_transaction"`); + await queryRunner.query(`DROP INDEX "IDX_ecf415a7a0b2fa64aa03c5b067"`); + await queryRunner.query(`DROP TABLE "user_receiving_address"`); + await queryRunner.query(`DROP INDEX "IDX_a131e6b58f084f1340538681b5"`); + await queryRunner.query(`DROP TABLE "user_receiving_invoice"`); + await queryRunner.query(`DROP INDEX "IDX_e04964210949f10bb25dc6e747"`); + await queryRunner.query(`DROP TABLE "application"`); + await queryRunner.query(`DROP TABLE "product"`); + await queryRunner.query(`DROP INDEX "IDX_758b8ce7c18b9d347461b30228"`); + await queryRunner.query(`DROP TABLE "user"`); + } + +} diff --git a/src/services/storage/migrations/1703170330183-lnd_metrics.ts b/src/services/storage/migrations/1703170330183-lnd_metrics.ts index f0064bd4..5357e1a5 100644 --- a/src/services/storage/migrations/1703170330183-lnd_metrics.ts +++ b/src/services/storage/migrations/1703170330183-lnd_metrics.ts @@ -1,26 +1,26 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class LndMetrics1703170330183 implements MigrationInterface { - name = 'LndMetrics1703170330183' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE "balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "block_height" integer NOT NULL, "confirmed_chain_balance" integer NOT NULL, "unconfirmed_chain_balance" integer NOT NULL, "total_chain_balance" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); - await queryRunner.query(`CREATE TABLE "channel_balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "channel_id" varchar NOT NULL, "local_balance_sats" integer NOT NULL, "remote_balance_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "balanceEventSerialId" integer)`); - await queryRunner.query(`CREATE TABLE "routing_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "incoming_channel_id" integer NOT NULL, "incoming_htlc_id" integer NOT NULL, "outgoing_channel_id" integer NOT NULL, "outgoing_htlc_id" integer NOT NULL, "timestamp_ns" integer NOT NULL, "event_type" varchar NOT NULL, "incoming_amt_msat" integer, "outgoing_amt_msat" integer, "failure_string" varchar, "settled" boolean, "offchain" boolean, "forward_fail_event" boolean, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); - await queryRunner.query(`CREATE TABLE "temporary_channel_balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "channel_id" varchar NOT NULL, "local_balance_sats" integer NOT NULL, "remote_balance_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "balanceEventSerialId" integer, CONSTRAINT "FK_e203090b07e770fe2e21a32e7c1" FOREIGN KEY ("balanceEventSerialId") REFERENCES "balance_event" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); - await queryRunner.query(`INSERT INTO "temporary_channel_balance_event"("serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId") SELECT "serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId" FROM "channel_balance_event"`); - await queryRunner.query(`DROP TABLE "channel_balance_event"`); - await queryRunner.query(`ALTER TABLE "temporary_channel_balance_event" RENAME TO "channel_balance_event"`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "channel_balance_event" RENAME TO "temporary_channel_balance_event"`); - await queryRunner.query(`CREATE TABLE "channel_balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "channel_id" varchar NOT NULL, "local_balance_sats" integer NOT NULL, "remote_balance_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "balanceEventSerialId" integer)`); - await queryRunner.query(`INSERT INTO "channel_balance_event"("serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId") SELECT "serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId" FROM "temporary_channel_balance_event"`); - await queryRunner.query(`DROP TABLE "temporary_channel_balance_event"`); - await queryRunner.query(`DROP TABLE "routing_event"`); - await queryRunner.query(`DROP TABLE "channel_balance_event"`); - await queryRunner.query(`DROP TABLE "balance_event"`); - } - -} +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class LndMetrics1703170330183 implements MigrationInterface { + name = 'LndMetrics1703170330183' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE "balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "block_height" integer NOT NULL, "confirmed_chain_balance" integer NOT NULL, "unconfirmed_chain_balance" integer NOT NULL, "total_chain_balance" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); + await queryRunner.query(`CREATE TABLE "channel_balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "channel_id" varchar NOT NULL, "local_balance_sats" integer NOT NULL, "remote_balance_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "balanceEventSerialId" integer)`); + await queryRunner.query(`CREATE TABLE "routing_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "incoming_channel_id" integer NOT NULL, "incoming_htlc_id" integer NOT NULL, "outgoing_channel_id" integer NOT NULL, "outgoing_htlc_id" integer NOT NULL, "timestamp_ns" integer NOT NULL, "event_type" varchar NOT NULL, "incoming_amt_msat" integer, "outgoing_amt_msat" integer, "failure_string" varchar, "settled" boolean, "offchain" boolean, "forward_fail_event" boolean, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); + await queryRunner.query(`CREATE TABLE "temporary_channel_balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "channel_id" varchar NOT NULL, "local_balance_sats" integer NOT NULL, "remote_balance_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "balanceEventSerialId" integer, CONSTRAINT "FK_e203090b07e770fe2e21a32e7c1" FOREIGN KEY ("balanceEventSerialId") REFERENCES "balance_event" ("serial_id") ON DELETE NO ACTION ON UPDATE NO ACTION)`); + await queryRunner.query(`INSERT INTO "temporary_channel_balance_event"("serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId") SELECT "serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId" FROM "channel_balance_event"`); + await queryRunner.query(`DROP TABLE "channel_balance_event"`); + await queryRunner.query(`ALTER TABLE "temporary_channel_balance_event" RENAME TO "channel_balance_event"`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "channel_balance_event" RENAME TO "temporary_channel_balance_event"`); + await queryRunner.query(`CREATE TABLE "channel_balance_event" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "channel_id" varchar NOT NULL, "local_balance_sats" integer NOT NULL, "remote_balance_sats" integer NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')), "balanceEventSerialId" integer)`); + await queryRunner.query(`INSERT INTO "channel_balance_event"("serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId") SELECT "serial_id", "channel_id", "local_balance_sats", "remote_balance_sats", "created_at", "updated_at", "balanceEventSerialId" FROM "temporary_channel_balance_event"`); + await queryRunner.query(`DROP TABLE "temporary_channel_balance_event"`); + await queryRunner.query(`DROP TABLE "routing_event"`); + await queryRunner.query(`DROP TABLE "channel_balance_event"`); + await queryRunner.query(`DROP TABLE "balance_event"`); + } + +} diff --git a/src/services/storage/migrations/1709316653538-channel_routing.ts b/src/services/storage/migrations/1709316653538-channel_routing.ts index 7331dd92..42b9cd4e 100644 --- a/src/services/storage/migrations/1709316653538-channel_routing.ts +++ b/src/services/storage/migrations/1709316653538-channel_routing.ts @@ -1,14 +1,14 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class ChannelRouting1709316653538 implements MigrationInterface { - name = 'ChannelRouting1709316653538' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`CREATE TABLE "channel_routing" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "day_unix" integer NOT NULL, "channel_id" varchar NOT NULL, "send_errors" integer NOT NULL DEFAULT (0), "receive_errors" integer NOT NULL DEFAULT (0), "forward_errors_as_input" integer NOT NULL DEFAULT (0), "forward_errors_as_output" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_input" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_output" integer NOT NULL DEFAULT (0), "forward_fee_as_input" integer NOT NULL DEFAULT (0), "forward_fee_as_output" integer NOT NULL DEFAULT (0), "latest_index_offset" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`DROP TABLE "channel_routing"`); - } - -} +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class ChannelRouting1709316653538 implements MigrationInterface { + name = 'ChannelRouting1709316653538' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE "channel_routing" ("serial_id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "day_unix" integer NOT NULL, "channel_id" varchar NOT NULL, "send_errors" integer NOT NULL DEFAULT (0), "receive_errors" integer NOT NULL DEFAULT (0), "forward_errors_as_input" integer NOT NULL DEFAULT (0), "forward_errors_as_output" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_input" integer NOT NULL DEFAULT (0), "missed_forward_fee_as_output" integer NOT NULL DEFAULT (0), "forward_fee_as_input" integer NOT NULL DEFAULT (0), "forward_fee_as_output" integer NOT NULL DEFAULT (0), "latest_index_offset" integer NOT NULL DEFAULT (0), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "updated_at" datetime NOT NULL DEFAULT (datetime('now')))`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE "channel_routing"`); + } + +} diff --git a/src/services/storage/migrations/runner.ts b/src/services/storage/migrations/runner.ts index 3c81aa2f..3f9b5a71 100644 --- a/src/services/storage/migrations/runner.ts +++ b/src/services/storage/migrations/runner.ts @@ -1,29 +1,29 @@ -import { PubLogger } from '../../helpers/logger.js' -import { DbSettings, runFakeMigration } from '../db.js' -import Storage, { StorageSettings } from '../index.js' -import { Initial1703170309875 } from './1703170309875-initial.js' -import { LndMetrics1703170330183 } from './1703170330183-lnd_metrics.js' -import { ChannelRouting1709316653538 } from './1709316653538-channel_routing.js' -const allMigrations = [Initial1703170309875] -const allMetricsMigrations = [LndMetrics1703170330183, ChannelRouting1709316653538] -export const TypeOrmMigrationRunner = async (log: PubLogger, storageManager: Storage, settings: DbSettings, arg: string | undefined): Promise => { - if (arg === 'fake_initial_migration') { - runFakeMigration(settings.databaseFile, [Initial1703170309875]) - return true - } - await connectAndMigrate(log, storageManager, allMigrations, allMetricsMigrations) - return false -} - -const connectAndMigrate = async (log: PubLogger, storageManager: Storage, migrations: Function[], metricsMigrations: Function[]) => { - const { executedMigrations, executedMetricsMigrations } = await storageManager.Connect(migrations, metricsMigrations) - if (migrations.length > 0) { - log(executedMigrations.length, "of", migrations.length, "migrations were executed correctly") - log(executedMigrations) - log("-------------------") - - } if (metricsMigrations.length > 0) { - log(executedMetricsMigrations.length, "of", metricsMigrations.length, "metrics migrations were executed correctly") - log(executedMetricsMigrations) - } +import { PubLogger } from '../../helpers/logger.js' +import { DbSettings, runFakeMigration } from '../db.js' +import Storage, { StorageSettings } from '../index.js' +import { Initial1703170309875 } from './1703170309875-initial.js' +import { LndMetrics1703170330183 } from './1703170330183-lnd_metrics.js' +import { ChannelRouting1709316653538 } from './1709316653538-channel_routing.js' +const allMigrations = [Initial1703170309875] +const allMetricsMigrations = [LndMetrics1703170330183, ChannelRouting1709316653538] +export const TypeOrmMigrationRunner = async (log: PubLogger, storageManager: Storage, settings: DbSettings, arg: string | undefined): Promise => { + if (arg === 'fake_initial_migration') { + runFakeMigration(settings.databaseFile, [Initial1703170309875]) + return true + } + await connectAndMigrate(log, storageManager, allMigrations, allMetricsMigrations) + return false +} + +const connectAndMigrate = async (log: PubLogger, storageManager: Storage, migrations: Function[], metricsMigrations: Function[]) => { + const { executedMigrations, executedMetricsMigrations } = await storageManager.Connect(migrations, metricsMigrations) + if (migrations.length > 0) { + log(executedMigrations.length, "of", migrations.length, "migrations were executed correctly") + log(executedMigrations) + log("-------------------") + + } if (metricsMigrations.length > 0) { + log(executedMetricsMigrations.length, "of", metricsMigrations.length, "metrics migrations were executed correctly") + log(executedMetricsMigrations) + } } \ No newline at end of file diff --git a/src/services/storage/paymentStorage.ts b/src/services/storage/paymentStorage.ts index f2ce7992..23337255 100644 --- a/src/services/storage/paymentStorage.ts +++ b/src/services/storage/paymentStorage.ts @@ -1,417 +1,417 @@ -import crypto from 'crypto'; -import { Between, DataSource, EntityManager, FindOperator, IsNull, LessThanOrEqual, MoreThan, MoreThanOrEqual } from "typeorm" -import { User } from './entity/User.js'; -import { UserTransactionPayment } from './entity/UserTransactionPayment.js'; -import { EphemeralKeyType, UserEphemeralKey } from './entity/UserEphemeralKey.js'; -import { UserReceivingInvoice, ZapInfo } from './entity/UserReceivingInvoice.js'; -import { UserReceivingAddress } from './entity/UserReceivingAddress.js'; -import { Product } from './entity/Product.js'; -import UserStorage from './userStorage.js'; -import { AddressReceivingTransaction } from './entity/AddressReceivingTransaction.js'; -import { UserInvoicePayment } from './entity/UserInvoicePayment.js'; -import { UserToUserPayment } from './entity/UserToUserPayment.js'; -import { Application } from './entity/Application.js'; -import TransactionsQueue from "./transactionsQueue.js"; -import { LoggedEvent } from './eventsLog.js'; -export type InboundOptionals = { product?: Product, callbackUrl?: string, expiry: number, expectedPayer?: User, linkedApplication?: Application, zapInfo?: ZapInfo } -export const defaultInvoiceExpiry = 60 * 60 -export default class { - DB: DataSource | EntityManager - userStorage: UserStorage - txQueue: TransactionsQueue - constructor(DB: DataSource | EntityManager, userStorage: UserStorage, txQueue: TransactionsQueue) { - this.DB = DB - this.userStorage = userStorage - this.txQueue = txQueue - } - - async AddAddressReceivingTransaction(address: UserReceivingAddress, txHash: string, outputIndex: number, amount: number, serviceFee: number, internal: boolean, height: number, dbTx: EntityManager | DataSource) { - const newAddressTransaction = dbTx.getRepository(AddressReceivingTransaction).create({ - user_address: address, - tx_hash: txHash, - output_index: outputIndex, - paid_amount: amount, - service_fee: serviceFee, - paid_at_unix: Math.floor(Date.now() / 1000), - internal, - broadcast_height: height, - confs: internal ? 10 : 0 - }) - return dbTx.getRepository(AddressReceivingTransaction).save(newAddressTransaction) - } - - GetUserReceivingTransactions(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { - return entityManager.getRepository(AddressReceivingTransaction).find({ - where: { - user_address: { user: { user_id: userId } }, - serial_id: MoreThanOrEqual(fromIndex), - paid_at_unix: MoreThan(0), - }, - order: { - paid_at_unix: 'DESC' - }, - take - }) - } - - async GetExistingUserAddress(userId: string, linkedApplication: Application, entityManager = this.DB) { - return entityManager.getRepository(UserReceivingAddress).findOne({ where: { user: { user_id: userId }, linkedApplication: { app_id: linkedApplication.app_id } } }) - } - - async AddUserAddress(user: User, address: string, opts: { callbackUrl?: string, linkedApplication?: Application } = {}): Promise { - const newUserAddress = this.DB.getRepository(UserReceivingAddress).create({ - address, - callbackUrl: opts.callbackUrl || "", - linkedApplication: opts.linkedApplication, - user - }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserReceivingAddress).save(newUserAddress), dbTx: false, description: `add address for ${user.user_id} linked to ${opts.linkedApplication?.app_id}: ${address} ` }) - } - - async FlagInvoiceAsPaid(invoice: UserReceivingInvoice, amount: number, serviceFee: number, internal: boolean, dbTx: EntityManager | DataSource) { - const i: Partial = { paid_at_unix: Math.floor(Date.now() / 1000), paid_amount: amount, service_fee: serviceFee, internal } - if (!internal) { - i.paidByLnd = true - } - return dbTx.getRepository(UserReceivingInvoice).update(invoice.serial_id, i) - } - - GetUserInvoicesFlaggedAsPaid(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { - return entityManager.getRepository(UserReceivingInvoice).find({ - where: { - user: { - user_id: userId - }, - serial_id: MoreThanOrEqual(fromIndex), - paid_at_unix: MoreThan(0), - }, - order: { - paid_at_unix: 'DESC' - }, - take - }) - } - - async AddUserInvoice(user: User, invoice: string, options: InboundOptionals = { expiry: defaultInvoiceExpiry }): Promise { - const newUserInvoice = this.DB.getRepository(UserReceivingInvoice).create({ - invoice: invoice, - callbackUrl: options.callbackUrl, - user: user, - product: options.product, - expires_at_unix: Math.floor(Date.now() / 1000) + options.expiry, - payer: options.expectedPayer, - linkedApplication: options.linkedApplication, - zap_info: options.zapInfo - }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserReceivingInvoice).save(newUserInvoice), dbTx: false, description: `add invoice for ${user.user_id} linked to ${options.linkedApplication?.app_id}: ${invoice} ` }) - } - - async GetAddressOwner(address: string, entityManager = this.DB): Promise { - return entityManager.getRepository(UserReceivingAddress).findOne({ - where: { - address - } - }) - } - - async GetAddressReceivingTransactionOwner(address: string, txHash: string, entityManager = this.DB): Promise { - return entityManager.getRepository(AddressReceivingTransaction).findOne({ - where: { - user_address: { address }, - tx_hash: txHash - } - }) - } - async GetUserTransactionPaymentOwner(address: string, txHash: string, entityManager = this.DB): Promise { - return entityManager.getRepository(UserTransactionPayment).findOne({ - where: { - address, - tx_hash: txHash - } - }) - } - - async GetInvoiceOwner(paymentRequest: string, entityManager = this.DB): Promise { - return entityManager.getRepository(UserReceivingInvoice).findOne({ - where: { - invoice: paymentRequest - } - }) - } - async GetPaymentOwner(paymentRequest: string, entityManager = this.DB): Promise { - return entityManager.getRepository(UserInvoicePayment).findOne({ - where: { - invoice: paymentRequest - } - }) - } - async GetUser2UserPayment(serialId: number, entityManager = this.DB): Promise { - return entityManager.getRepository(UserToUserPayment).findOne({ - where: { - serial_id: serialId - } - }) - } - - async AddPendingExternalPayment(userId: string, invoice: string, amount: number, linkedApplication: Application): Promise { - const newPayment = this.DB.getRepository(UserInvoicePayment).create({ - user: await this.userStorage.GetUser(userId), - paid_amount: amount, - invoice, - routing_fees: 0, - service_fees: 0, - paid_at_unix: 0, - internal: false, - linkedApplication - }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserInvoicePayment).save(newPayment), dbTx: false, description: `add pending invoice payment for ${userId} linked to ${linkedApplication.app_id}: ${invoice}, amt: ${amount} ` }) - } - - async UpdateExternalPayment(invoicePaymentSerialId: number, routingFees: number, serviceFees: number, success: boolean) { - return this.DB.getRepository(UserInvoicePayment).update(invoicePaymentSerialId, { - routing_fees: routingFees, - service_fees: serviceFees, - paid_at_unix: success ? Math.floor(Date.now() / 1000) : -1 - }) - } - - async AddInternalPayment(userId: string, invoice: string, amount: number, serviceFees: number, linkedApplication: Application): Promise { - const newPayment = this.DB.getRepository(UserInvoicePayment).create({ - user: await this.userStorage.GetUser(userId), - paid_amount: amount, - invoice, - routing_fees: 0, - service_fees: serviceFees, - paid_at_unix: Math.floor(Date.now() / 1000), - internal: true, - linkedApplication - }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserInvoicePayment).save(newPayment), dbTx: false, description: `add internal invoice payment for ${userId} linked to ${linkedApplication.app_id}: ${invoice}, amt: ${amount} ` }) - } - - GetUserInvoicePayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { - return entityManager.getRepository(UserInvoicePayment).find({ - where: { - user: { - user_id: userId - }, - serial_id: MoreThanOrEqual(fromIndex), - paid_at_unix: MoreThan(0), - }, - order: { - paid_at_unix: 'DESC' - }, - take - }) - } - - async AddUserTransactionPayment(userId: string, address: string, txHash: string, txOutput: number, amount: number, chainFees: number, serviceFees: number, internal: boolean, height: number, linkedApplication: Application): Promise { - const newTx = this.DB.getRepository(UserTransactionPayment).create({ - user: await this.userStorage.GetUser(userId), - address, - paid_amount: amount, - chain_fees: chainFees, - output_index: txOutput, - tx_hash: txHash, - service_fees: serviceFees, - paid_at_unix: Math.floor(Date.now() / 1000), - internal, - broadcast_height: height, - confs: internal ? 10 : 0, - linkedApplication - }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserTransactionPayment).save(newTx), dbTx: false, description: `add tx payment for ${userId} linked to ${linkedApplication.app_id}: ${address}, amt: ${amount} ` }) - } - - GetUserTransactionPayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { - return entityManager.getRepository(UserTransactionPayment).find({ - where: { - user: { - user_id: userId - }, - serial_id: MoreThanOrEqual(fromIndex), - paid_at_unix: MoreThan(0), - }, - order: { - paid_at_unix: 'DESC' - }, - take - }) - } - - async GetPendingTransactions(entityManager = this.DB) { - const incoming = await entityManager.getRepository(AddressReceivingTransaction).find({ where: { confs: 0 } }) - const outgoing = await entityManager.getRepository(UserTransactionPayment).find({ where: { confs: 0 } }) - return { incoming, outgoing } - } - - async UpdateAddressReceivingTransaction(serialId: number, update: Partial, entityManager = this.DB) { - return entityManager.getRepository(AddressReceivingTransaction).update(serialId, update) - } - async UpdateUserTransactionPayment(serialId: number, update: Partial, entityManager = this.DB) { - await entityManager.getRepository(UserTransactionPayment).update(serialId, update) - } - - - async AddUserEphemeralKey(userId: string, keyType: EphemeralKeyType, linkedApplication: Application): Promise { - const found = await this.DB.getRepository(UserEphemeralKey).findOne({ where: { type: keyType, user: { user_id: userId }, linkedApplication: { app_id: linkedApplication.app_id } } }) - if (found) { - return found - } - const newKey = this.DB.getRepository(UserEphemeralKey).create({ - user: await this.userStorage.GetUser(userId), - key: crypto.randomBytes(31).toString('hex'), - type: keyType, - linkedApplication - }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserEphemeralKey).save(newKey), dbTx: false }) - } - - async UseUserEphemeralKey(key: string, keyType: EphemeralKeyType, persist = false, entityManager = this.DB): Promise { - const found = await entityManager.getRepository(UserEphemeralKey).findOne({ - where: { - key: key, - type: keyType - } - }) - if (!found) { - throw new Error("the provided ephemeral key is invalid") - } - if (!persist) { - await entityManager.getRepository(UserEphemeralKey).delete(found.serial_id) - } - return found - } - - async AddPendingUserToUserPayment(fromUserId: string, toUserId: string, amount: number, fee: number, linkedApplication: Application, dbTx: DataSource | EntityManager) { - const entry = dbTx.getRepository(UserToUserPayment).create({ - from_user: await this.userStorage.GetUser(fromUserId, dbTx), - to_user: await this.userStorage.GetUser(toUserId, dbTx), - paid_at_unix: 0, - paid_amount: amount, - service_fees: fee, - linkedApplication - }) - return dbTx.getRepository(UserToUserPayment).save(entry) - } - async SetPendingUserToUserPaymentAsPaid(serialId: number, dbTx: DataSource | EntityManager) { - dbTx.getRepository(UserToUserPayment).update(serialId, { paid_at_unix: Math.floor(Date.now() / 1000) }) - } - - GetUserToUserReceivedPayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB) { - return entityManager.getRepository(UserToUserPayment).find({ - where: { - to_user: { - user_id: userId - }, - serial_id: MoreThanOrEqual(fromIndex), - paid_at_unix: MoreThan(0), - }, - order: { - paid_at_unix: 'DESC' - }, - take - }) - } - - GetUserToUserSentPayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB) { - return entityManager.getRepository(UserToUserPayment).find({ - where: { - from_user: { - user_id: userId - }, - serial_id: MoreThanOrEqual(fromIndex), - paid_at_unix: MoreThan(0), - }, - order: { - paid_at_unix: 'DESC' - }, - take - }) - } - - async GetTotalFeesPaidInApp(app: Application | null, entityManager = this.DB) { - if (!app) { - return 0 - } - const entries = await Promise.all([ - entityManager.getRepository(UserReceivingInvoice).sum("service_fee", { linkedApplication: { app_id: app.app_id } }), - entityManager.getRepository(AddressReceivingTransaction).sum("service_fee", { user_address: { linkedApplication: { app_id: app.app_id } } }), - entityManager.getRepository(UserInvoicePayment).sum("service_fees", { linkedApplication: { app_id: app.app_id } }), - entityManager.getRepository(UserTransactionPayment).sum("service_fees", { linkedApplication: { app_id: app.app_id } }), - entityManager.getRepository(UserToUserPayment).sum("service_fees", { linkedApplication: { app_id: app.app_id } }) - ]) - let total = 0 - entries.forEach(e => { - if (e) { - total += e - } - }) - return total - } - - async GetAppOperations(application: Application | null, { from, to }: { from?: number, to?: number }, entityManager = this.DB) { - const q = application ? { app_id: application.app_id } : IsNull() - let time: { created_at?: FindOperator } = {} - if (!!from && !!to) { - time.created_at = Between(new Date(from * 1000), new Date(to * 1000)) - } else if (!!from) { - time.created_at = MoreThanOrEqual(new Date(from * 1000)) - } else if (!!to) { - time.created_at = LessThanOrEqual(new Date(to * 1000)) - } - - const [receivingInvoices, receivingAddresses, outgoingInvoices, outgoingTransactions, userToUser] = await Promise.all([ - entityManager.getRepository(UserReceivingInvoice).find({ where: { linkedApplication: q, ...time } }), - entityManager.getRepository(UserReceivingAddress).find({ where: { linkedApplication: q, ...time } }), - entityManager.getRepository(UserInvoicePayment).find({ where: { linkedApplication: q, ...time } }), - entityManager.getRepository(UserTransactionPayment).find({ where: { linkedApplication: q, ...time } }), - entityManager.getRepository(UserToUserPayment).find({ where: { linkedApplication: q, ...time } }) - ]) - const receivingTransactions = await Promise.all(receivingAddresses.map(addr => entityManager.getRepository(AddressReceivingTransaction).find({ where: { user_address: { serial_id: addr.serial_id }, ...time } }))) - return { - receivingInvoices, receivingAddresses, receivingTransactions, - outgoingInvoices, outgoingTransactions, - userToUser - } - } - - async UserHasOutgoingOperation(userId: string, entityManager = this.DB) { - const [i, tx, u2u] = await Promise.all([ - entityManager.getRepository(UserInvoicePayment).findOne({ where: { user: { user_id: userId } } }), - entityManager.getRepository(UserTransactionPayment).findOne({ where: { user: { user_id: userId } } }), - entityManager.getRepository(UserToUserPayment).findOne({ where: { from_user: { user_id: userId } } }), - ]) - return !!i || !!tx || !!u2u - } - - async VerifyDbEvent(e: LoggedEvent) { - switch (e.type) { - case "new_invoice": - return this.DB.getRepository(UserReceivingInvoice).findOneOrFail({ where: { invoice: e.data, user: { user_id: e.userId } } }) - case 'new_address': - return this.DB.getRepository(UserReceivingAddress).findOneOrFail({ where: { address: e.data, user: { user_id: e.userId } } }) - case 'invoice_paid': - return this.DB.getRepository(UserReceivingInvoice).findOneOrFail({ where: { invoice: e.data, user: { user_id: e.userId }, paid_at_unix: MoreThan(0) } }) - case 'invoice_payment': - return this.DB.getRepository(UserInvoicePayment).findOneOrFail({ where: { invoice: e.data, user: { user_id: e.userId } } }) - case 'address_paid': - const [receivingAddress, receivedHash] = e.data.split(":") - return this.DB.getRepository(AddressReceivingTransaction).findOneOrFail({ where: { user_address: { address: receivingAddress }, tx_hash: receivedHash, confs: MoreThan(0) } }) - case 'address_payment': - const [sentAddress, sentHash] = e.data.split(":") - return this.DB.getRepository(UserTransactionPayment).findOneOrFail({ where: { address: sentAddress, tx_hash: sentHash, user: { user_id: e.userId } } }) - case 'u2u_receiver': - return this.DB.getRepository(UserToUserPayment).findOneOrFail({ where: { from_user: { user_id: e.data }, to_user: { user_id: e.userId } } }) - case 'u2u_sender': - return this.DB.getRepository(UserToUserPayment).findOneOrFail({ where: { to_user: { user_id: e.data }, from_user: { user_id: e.userId } } }) - default: - break; - } - } - - async GetTotalUsersBalance(entityManager = this.DB) { - const total = await entityManager.getRepository(User).sum("balance_sats") - return total || 0 - } +import crypto from 'crypto'; +import { Between, DataSource, EntityManager, FindOperator, IsNull, LessThanOrEqual, MoreThan, MoreThanOrEqual } from "typeorm" +import { User } from './entity/User.js'; +import { UserTransactionPayment } from './entity/UserTransactionPayment.js'; +import { EphemeralKeyType, UserEphemeralKey } from './entity/UserEphemeralKey.js'; +import { UserReceivingInvoice, ZapInfo } from './entity/UserReceivingInvoice.js'; +import { UserReceivingAddress } from './entity/UserReceivingAddress.js'; +import { Product } from './entity/Product.js'; +import UserStorage from './userStorage.js'; +import { AddressReceivingTransaction } from './entity/AddressReceivingTransaction.js'; +import { UserInvoicePayment } from './entity/UserInvoicePayment.js'; +import { UserToUserPayment } from './entity/UserToUserPayment.js'; +import { Application } from './entity/Application.js'; +import TransactionsQueue from "./transactionsQueue.js"; +import { LoggedEvent } from './eventsLog.js'; +export type InboundOptionals = { product?: Product, callbackUrl?: string, expiry: number, expectedPayer?: User, linkedApplication?: Application, zapInfo?: ZapInfo } +export const defaultInvoiceExpiry = 60 * 60 +export default class { + DB: DataSource | EntityManager + userStorage: UserStorage + txQueue: TransactionsQueue + constructor(DB: DataSource | EntityManager, userStorage: UserStorage, txQueue: TransactionsQueue) { + this.DB = DB + this.userStorage = userStorage + this.txQueue = txQueue + } + + async AddAddressReceivingTransaction(address: UserReceivingAddress, txHash: string, outputIndex: number, amount: number, serviceFee: number, internal: boolean, height: number, dbTx: EntityManager | DataSource) { + const newAddressTransaction = dbTx.getRepository(AddressReceivingTransaction).create({ + user_address: address, + tx_hash: txHash, + output_index: outputIndex, + paid_amount: amount, + service_fee: serviceFee, + paid_at_unix: Math.floor(Date.now() / 1000), + internal, + broadcast_height: height, + confs: internal ? 10 : 0 + }) + return dbTx.getRepository(AddressReceivingTransaction).save(newAddressTransaction) + } + + GetUserReceivingTransactions(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { + return entityManager.getRepository(AddressReceivingTransaction).find({ + where: { + user_address: { user: { user_id: userId } }, + serial_id: MoreThanOrEqual(fromIndex), + paid_at_unix: MoreThan(0), + }, + order: { + paid_at_unix: 'DESC' + }, + take + }) + } + + async GetExistingUserAddress(userId: string, linkedApplication: Application, entityManager = this.DB) { + return entityManager.getRepository(UserReceivingAddress).findOne({ where: { user: { user_id: userId }, linkedApplication: { app_id: linkedApplication.app_id } } }) + } + + async AddUserAddress(user: User, address: string, opts: { callbackUrl?: string, linkedApplication?: Application } = {}): Promise { + const newUserAddress = this.DB.getRepository(UserReceivingAddress).create({ + address, + callbackUrl: opts.callbackUrl || "", + linkedApplication: opts.linkedApplication, + user + }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserReceivingAddress).save(newUserAddress), dbTx: false, description: `add address for ${user.user_id} linked to ${opts.linkedApplication?.app_id}: ${address} ` }) + } + + async FlagInvoiceAsPaid(invoice: UserReceivingInvoice, amount: number, serviceFee: number, internal: boolean, dbTx: EntityManager | DataSource) { + const i: Partial = { paid_at_unix: Math.floor(Date.now() / 1000), paid_amount: amount, service_fee: serviceFee, internal } + if (!internal) { + i.paidByLnd = true + } + return dbTx.getRepository(UserReceivingInvoice).update(invoice.serial_id, i) + } + + GetUserInvoicesFlaggedAsPaid(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { + return entityManager.getRepository(UserReceivingInvoice).find({ + where: { + user: { + user_id: userId + }, + serial_id: MoreThanOrEqual(fromIndex), + paid_at_unix: MoreThan(0), + }, + order: { + paid_at_unix: 'DESC' + }, + take + }) + } + + async AddUserInvoice(user: User, invoice: string, options: InboundOptionals = { expiry: defaultInvoiceExpiry }): Promise { + const newUserInvoice = this.DB.getRepository(UserReceivingInvoice).create({ + invoice: invoice, + callbackUrl: options.callbackUrl, + user: user, + product: options.product, + expires_at_unix: Math.floor(Date.now() / 1000) + options.expiry, + payer: options.expectedPayer, + linkedApplication: options.linkedApplication, + zap_info: options.zapInfo + }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserReceivingInvoice).save(newUserInvoice), dbTx: false, description: `add invoice for ${user.user_id} linked to ${options.linkedApplication?.app_id}: ${invoice} ` }) + } + + async GetAddressOwner(address: string, entityManager = this.DB): Promise { + return entityManager.getRepository(UserReceivingAddress).findOne({ + where: { + address + } + }) + } + + async GetAddressReceivingTransactionOwner(address: string, txHash: string, entityManager = this.DB): Promise { + return entityManager.getRepository(AddressReceivingTransaction).findOne({ + where: { + user_address: { address }, + tx_hash: txHash + } + }) + } + async GetUserTransactionPaymentOwner(address: string, txHash: string, entityManager = this.DB): Promise { + return entityManager.getRepository(UserTransactionPayment).findOne({ + where: { + address, + tx_hash: txHash + } + }) + } + + async GetInvoiceOwner(paymentRequest: string, entityManager = this.DB): Promise { + return entityManager.getRepository(UserReceivingInvoice).findOne({ + where: { + invoice: paymentRequest + } + }) + } + async GetPaymentOwner(paymentRequest: string, entityManager = this.DB): Promise { + return entityManager.getRepository(UserInvoicePayment).findOne({ + where: { + invoice: paymentRequest + } + }) + } + async GetUser2UserPayment(serialId: number, entityManager = this.DB): Promise { + return entityManager.getRepository(UserToUserPayment).findOne({ + where: { + serial_id: serialId + } + }) + } + + async AddPendingExternalPayment(userId: string, invoice: string, amount: number, linkedApplication: Application): Promise { + const newPayment = this.DB.getRepository(UserInvoicePayment).create({ + user: await this.userStorage.GetUser(userId), + paid_amount: amount, + invoice, + routing_fees: 0, + service_fees: 0, + paid_at_unix: 0, + internal: false, + linkedApplication + }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserInvoicePayment).save(newPayment), dbTx: false, description: `add pending invoice payment for ${userId} linked to ${linkedApplication.app_id}: ${invoice}, amt: ${amount} ` }) + } + + async UpdateExternalPayment(invoicePaymentSerialId: number, routingFees: number, serviceFees: number, success: boolean) { + return this.DB.getRepository(UserInvoicePayment).update(invoicePaymentSerialId, { + routing_fees: routingFees, + service_fees: serviceFees, + paid_at_unix: success ? Math.floor(Date.now() / 1000) : -1 + }) + } + + async AddInternalPayment(userId: string, invoice: string, amount: number, serviceFees: number, linkedApplication: Application): Promise { + const newPayment = this.DB.getRepository(UserInvoicePayment).create({ + user: await this.userStorage.GetUser(userId), + paid_amount: amount, + invoice, + routing_fees: 0, + service_fees: serviceFees, + paid_at_unix: Math.floor(Date.now() / 1000), + internal: true, + linkedApplication + }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserInvoicePayment).save(newPayment), dbTx: false, description: `add internal invoice payment for ${userId} linked to ${linkedApplication.app_id}: ${invoice}, amt: ${amount} ` }) + } + + GetUserInvoicePayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { + return entityManager.getRepository(UserInvoicePayment).find({ + where: { + user: { + user_id: userId + }, + serial_id: MoreThanOrEqual(fromIndex), + paid_at_unix: MoreThan(0), + }, + order: { + paid_at_unix: 'DESC' + }, + take + }) + } + + async AddUserTransactionPayment(userId: string, address: string, txHash: string, txOutput: number, amount: number, chainFees: number, serviceFees: number, internal: boolean, height: number, linkedApplication: Application): Promise { + const newTx = this.DB.getRepository(UserTransactionPayment).create({ + user: await this.userStorage.GetUser(userId), + address, + paid_amount: amount, + chain_fees: chainFees, + output_index: txOutput, + tx_hash: txHash, + service_fees: serviceFees, + paid_at_unix: Math.floor(Date.now() / 1000), + internal, + broadcast_height: height, + confs: internal ? 10 : 0, + linkedApplication + }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserTransactionPayment).save(newTx), dbTx: false, description: `add tx payment for ${userId} linked to ${linkedApplication.app_id}: ${address}, amt: ${amount} ` }) + } + + GetUserTransactionPayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB): Promise { + return entityManager.getRepository(UserTransactionPayment).find({ + where: { + user: { + user_id: userId + }, + serial_id: MoreThanOrEqual(fromIndex), + paid_at_unix: MoreThan(0), + }, + order: { + paid_at_unix: 'DESC' + }, + take + }) + } + + async GetPendingTransactions(entityManager = this.DB) { + const incoming = await entityManager.getRepository(AddressReceivingTransaction).find({ where: { confs: 0 } }) + const outgoing = await entityManager.getRepository(UserTransactionPayment).find({ where: { confs: 0 } }) + return { incoming, outgoing } + } + + async UpdateAddressReceivingTransaction(serialId: number, update: Partial, entityManager = this.DB) { + return entityManager.getRepository(AddressReceivingTransaction).update(serialId, update) + } + async UpdateUserTransactionPayment(serialId: number, update: Partial, entityManager = this.DB) { + await entityManager.getRepository(UserTransactionPayment).update(serialId, update) + } + + + async AddUserEphemeralKey(userId: string, keyType: EphemeralKeyType, linkedApplication: Application): Promise { + const found = await this.DB.getRepository(UserEphemeralKey).findOne({ where: { type: keyType, user: { user_id: userId }, linkedApplication: { app_id: linkedApplication.app_id } } }) + if (found) { + return found + } + const newKey = this.DB.getRepository(UserEphemeralKey).create({ + user: await this.userStorage.GetUser(userId), + key: crypto.randomBytes(31).toString('hex'), + type: keyType, + linkedApplication + }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(UserEphemeralKey).save(newKey), dbTx: false }) + } + + async UseUserEphemeralKey(key: string, keyType: EphemeralKeyType, persist = false, entityManager = this.DB): Promise { + const found = await entityManager.getRepository(UserEphemeralKey).findOne({ + where: { + key: key, + type: keyType + } + }) + if (!found) { + throw new Error("the provided ephemeral key is invalid") + } + if (!persist) { + await entityManager.getRepository(UserEphemeralKey).delete(found.serial_id) + } + return found + } + + async AddPendingUserToUserPayment(fromUserId: string, toUserId: string, amount: number, fee: number, linkedApplication: Application, dbTx: DataSource | EntityManager) { + const entry = dbTx.getRepository(UserToUserPayment).create({ + from_user: await this.userStorage.GetUser(fromUserId, dbTx), + to_user: await this.userStorage.GetUser(toUserId, dbTx), + paid_at_unix: 0, + paid_amount: amount, + service_fees: fee, + linkedApplication + }) + return dbTx.getRepository(UserToUserPayment).save(entry) + } + async SetPendingUserToUserPaymentAsPaid(serialId: number, dbTx: DataSource | EntityManager) { + dbTx.getRepository(UserToUserPayment).update(serialId, { paid_at_unix: Math.floor(Date.now() / 1000) }) + } + + GetUserToUserReceivedPayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB) { + return entityManager.getRepository(UserToUserPayment).find({ + where: { + to_user: { + user_id: userId + }, + serial_id: MoreThanOrEqual(fromIndex), + paid_at_unix: MoreThan(0), + }, + order: { + paid_at_unix: 'DESC' + }, + take + }) + } + + GetUserToUserSentPayments(userId: string, fromIndex: number, take = 50, entityManager = this.DB) { + return entityManager.getRepository(UserToUserPayment).find({ + where: { + from_user: { + user_id: userId + }, + serial_id: MoreThanOrEqual(fromIndex), + paid_at_unix: MoreThan(0), + }, + order: { + paid_at_unix: 'DESC' + }, + take + }) + } + + async GetTotalFeesPaidInApp(app: Application | null, entityManager = this.DB) { + if (!app) { + return 0 + } + const entries = await Promise.all([ + entityManager.getRepository(UserReceivingInvoice).sum("service_fee", { linkedApplication: { app_id: app.app_id } }), + entityManager.getRepository(AddressReceivingTransaction).sum("service_fee", { user_address: { linkedApplication: { app_id: app.app_id } } }), + entityManager.getRepository(UserInvoicePayment).sum("service_fees", { linkedApplication: { app_id: app.app_id } }), + entityManager.getRepository(UserTransactionPayment).sum("service_fees", { linkedApplication: { app_id: app.app_id } }), + entityManager.getRepository(UserToUserPayment).sum("service_fees", { linkedApplication: { app_id: app.app_id } }) + ]) + let total = 0 + entries.forEach(e => { + if (e) { + total += e + } + }) + return total + } + + async GetAppOperations(application: Application | null, { from, to }: { from?: number, to?: number }, entityManager = this.DB) { + const q = application ? { app_id: application.app_id } : IsNull() + let time: { created_at?: FindOperator } = {} + if (!!from && !!to) { + time.created_at = Between(new Date(from * 1000), new Date(to * 1000)) + } else if (!!from) { + time.created_at = MoreThanOrEqual(new Date(from * 1000)) + } else if (!!to) { + time.created_at = LessThanOrEqual(new Date(to * 1000)) + } + + const [receivingInvoices, receivingAddresses, outgoingInvoices, outgoingTransactions, userToUser] = await Promise.all([ + entityManager.getRepository(UserReceivingInvoice).find({ where: { linkedApplication: q, ...time } }), + entityManager.getRepository(UserReceivingAddress).find({ where: { linkedApplication: q, ...time } }), + entityManager.getRepository(UserInvoicePayment).find({ where: { linkedApplication: q, ...time } }), + entityManager.getRepository(UserTransactionPayment).find({ where: { linkedApplication: q, ...time } }), + entityManager.getRepository(UserToUserPayment).find({ where: { linkedApplication: q, ...time } }) + ]) + const receivingTransactions = await Promise.all(receivingAddresses.map(addr => entityManager.getRepository(AddressReceivingTransaction).find({ where: { user_address: { serial_id: addr.serial_id }, ...time } }))) + return { + receivingInvoices, receivingAddresses, receivingTransactions, + outgoingInvoices, outgoingTransactions, + userToUser + } + } + + async UserHasOutgoingOperation(userId: string, entityManager = this.DB) { + const [i, tx, u2u] = await Promise.all([ + entityManager.getRepository(UserInvoicePayment).findOne({ where: { user: { user_id: userId } } }), + entityManager.getRepository(UserTransactionPayment).findOne({ where: { user: { user_id: userId } } }), + entityManager.getRepository(UserToUserPayment).findOne({ where: { from_user: { user_id: userId } } }), + ]) + return !!i || !!tx || !!u2u + } + + async VerifyDbEvent(e: LoggedEvent) { + switch (e.type) { + case "new_invoice": + return this.DB.getRepository(UserReceivingInvoice).findOneOrFail({ where: { invoice: e.data, user: { user_id: e.userId } } }) + case 'new_address': + return this.DB.getRepository(UserReceivingAddress).findOneOrFail({ where: { address: e.data, user: { user_id: e.userId } } }) + case 'invoice_paid': + return this.DB.getRepository(UserReceivingInvoice).findOneOrFail({ where: { invoice: e.data, user: { user_id: e.userId }, paid_at_unix: MoreThan(0) } }) + case 'invoice_payment': + return this.DB.getRepository(UserInvoicePayment).findOneOrFail({ where: { invoice: e.data, user: { user_id: e.userId } } }) + case 'address_paid': + const [receivingAddress, receivedHash] = e.data.split(":") + return this.DB.getRepository(AddressReceivingTransaction).findOneOrFail({ where: { user_address: { address: receivingAddress }, tx_hash: receivedHash, confs: MoreThan(0) } }) + case 'address_payment': + const [sentAddress, sentHash] = e.data.split(":") + return this.DB.getRepository(UserTransactionPayment).findOneOrFail({ where: { address: sentAddress, tx_hash: sentHash, user: { user_id: e.userId } } }) + case 'u2u_receiver': + return this.DB.getRepository(UserToUserPayment).findOneOrFail({ where: { from_user: { user_id: e.data }, to_user: { user_id: e.userId } } }) + case 'u2u_sender': + return this.DB.getRepository(UserToUserPayment).findOneOrFail({ where: { to_user: { user_id: e.data }, from_user: { user_id: e.userId } } }) + default: + break; + } + } + + async GetTotalUsersBalance(entityManager = this.DB) { + const total = await entityManager.getRepository(User).sum("balance_sats") + return total || 0 + } } \ No newline at end of file diff --git a/src/services/storage/productStorage.ts b/src/services/storage/productStorage.ts index abc9f39f..10635afa 100644 --- a/src/services/storage/productStorage.ts +++ b/src/services/storage/productStorage.ts @@ -1,26 +1,26 @@ -import { DataSource, EntityManager } from "typeorm" -import { Product } from "./entity/Product.js" -import { User } from "./entity/User.js" -import TransactionsQueue, { TX } from "./transactionsQueue.js"; -export default class { - DB: DataSource | EntityManager - txQueue: TransactionsQueue - constructor(DB: DataSource | EntityManager, txQueue: TransactionsQueue) { - this.DB = DB - this.txQueue = txQueue - } - async AddProduct(name: string, priceSats: number, user: User): Promise { - const newProduct = this.DB.getRepository(Product).create({ - name: name, price_sats: priceSats, owner: user - }) - return this.txQueue.PushToQueue({ exec: async db => db.getRepository(Product).save(newProduct), dbTx: false }) - } - - async GetProduct(id: string, entityManager = this.DB): Promise { - const product = await entityManager.getRepository(Product).findOne({ where: { product_id: id } }) - if (!product) { - throw new Error("product not found") - } - return product - } +import { DataSource, EntityManager } from "typeorm" +import { Product } from "./entity/Product.js" +import { User } from "./entity/User.js" +import TransactionsQueue, { TX } from "./transactionsQueue.js"; +export default class { + DB: DataSource | EntityManager + txQueue: TransactionsQueue + constructor(DB: DataSource | EntityManager, txQueue: TransactionsQueue) { + this.DB = DB + this.txQueue = txQueue + } + async AddProduct(name: string, priceSats: number, user: User): Promise { + const newProduct = this.DB.getRepository(Product).create({ + name: name, price_sats: priceSats, owner: user + }) + return this.txQueue.PushToQueue({ exec: async db => db.getRepository(Product).save(newProduct), dbTx: false }) + } + + async GetProduct(id: string, entityManager = this.DB): Promise { + const product = await entityManager.getRepository(Product).findOne({ where: { product_id: id } }) + if (!product) { + throw new Error("product not found") + } + return product + } } \ No newline at end of file diff --git a/src/services/storage/transactionsQueue.ts b/src/services/storage/transactionsQueue.ts index 48e090e8..3dc36425 100644 --- a/src/services/storage/transactionsQueue.ts +++ b/src/services/storage/transactionsQueue.ts @@ -1,86 +1,86 @@ -import { DataSource, EntityManager, EntityTarget } from "typeorm" -import { PubLogger, getLogger } from "../helpers/logger.js" - -export type TX = (entityManager: EntityManager | DataSource) => Promise -export type TxOperation = { - exec: TX - dbTx: boolean - description?: string -} - -export default class { - DB: DataSource | EntityManager - pendingTx: boolean - transactionsQueue: { op: TxOperation, res: (v: any) => void, rej: (message: string) => void }[] = [] - log: PubLogger - constructor(name: string, DB: DataSource | EntityManager) { - this.DB = DB - this.log = getLogger({ component: name }) - } - - PushToQueue(op: TxOperation) { - if (!this.pendingTx) { - this.log("queue empty, starting transaction", this.transactionsQueue.length) - return this.execQueueItem(op) - } - this.log("queue not empty, possibly stuck") - return new Promise((res, rej) => { - this.transactionsQueue.push({ op, res, rej }) - }) - } - - async execNextInQueue() { - this.log("executing next in queue") - this.pendingTx = false - const next = this.transactionsQueue.pop() - if (!next) { - this.log("queue is clear") - return - } - try { - const res = await this.execQueueItem(next.op) - if (next.op.description) this.log("done", next.op.description) - next.res(res) - } catch (err: any) { - next.rej(err.message) - } - } - - execQueueItem(op: TxOperation) { - if (this.pendingTx) { - throw new Error("cannot start DB transaction") - } - this.pendingTx = true - this.log("starting", op.dbTx ? "db transaction" : "operation", op.description || "") - if (op.dbTx) { - return this.doTransaction(op.exec) - } - return this.doOperation(op.exec) - } - - async doOperation(exec: TX) { - try { - const res = await exec(this.DB) - this.execNextInQueue() - return res - } catch (err) { - this.execNextInQueue() - throw err - } - } - - - async doTransaction(exec: TX) { - try { - const res = await this.DB.transaction(async tx => { - return exec(tx) - }) - this.execNextInQueue() - return res - } catch (err: any) { - this.execNextInQueue() - this.log("transaction failed", err.message) - throw err - } - } +import { DataSource, EntityManager, EntityTarget } from "typeorm" +import { PubLogger, getLogger } from "../helpers/logger.js" + +export type TX = (entityManager: EntityManager | DataSource) => Promise +export type TxOperation = { + exec: TX + dbTx: boolean + description?: string +} + +export default class { + DB: DataSource | EntityManager + pendingTx: boolean + transactionsQueue: { op: TxOperation, res: (v: any) => void, rej: (message: string) => void }[] = [] + log: PubLogger + constructor(name: string, DB: DataSource | EntityManager) { + this.DB = DB + this.log = getLogger({ component: name }) + } + + PushToQueue(op: TxOperation) { + if (!this.pendingTx) { + this.log("queue empty, starting transaction", this.transactionsQueue.length) + return this.execQueueItem(op) + } + this.log("queue not empty, possibly stuck") + return new Promise((res, rej) => { + this.transactionsQueue.push({ op, res, rej }) + }) + } + + async execNextInQueue() { + this.log("executing next in queue") + this.pendingTx = false + const next = this.transactionsQueue.pop() + if (!next) { + this.log("queue is clear") + return + } + try { + const res = await this.execQueueItem(next.op) + if (next.op.description) this.log("done", next.op.description) + next.res(res) + } catch (err: any) { + next.rej(err.message) + } + } + + execQueueItem(op: TxOperation) { + if (this.pendingTx) { + throw new Error("cannot start DB transaction") + } + this.pendingTx = true + this.log("starting", op.dbTx ? "db transaction" : "operation", op.description || "") + if (op.dbTx) { + return this.doTransaction(op.exec) + } + return this.doOperation(op.exec) + } + + async doOperation(exec: TX) { + try { + const res = await exec(this.DB) + this.execNextInQueue() + return res + } catch (err) { + this.execNextInQueue() + throw err + } + } + + + async doTransaction(exec: TX) { + try { + const res = await this.DB.transaction(async tx => { + return exec(tx) + }) + this.execNextInQueue() + return res + } catch (err: any) { + this.execNextInQueue() + this.log("transaction failed", err.message) + throw err + } + } } \ No newline at end of file diff --git a/src/services/storage/userStorage.ts b/src/services/storage/userStorage.ts index 74f0296c..602d3084 100644 --- a/src/services/storage/userStorage.ts +++ b/src/services/storage/userStorage.ts @@ -1,137 +1,137 @@ -import crypto from 'crypto'; -import { DataSource, EntityManager } from "typeorm" -import { User } from './entity/User.js'; -import { UserBasicAuth } from './entity/UserBasicAuth.js'; -import { getLogger } from '../helpers/logger.js'; -import TransactionsQueue from "./transactionsQueue.js"; -import EventsLogManager from './eventsLog.js'; -export default class { - DB: DataSource | EntityManager - txQueue: TransactionsQueue - eventsLog: EventsLogManager - constructor(DB: DataSource | EntityManager, txQueue: TransactionsQueue, eventsLog: EventsLogManager) { - this.DB = DB - this.txQueue = txQueue - this.eventsLog = eventsLog - } - - async AddUser(balance: number, dbTx: DataSource | EntityManager): Promise { - if (balance && process.env.ALLOW_BALANCE_MIGRATION !== 'true') { - throw new Error("balance migration is not allowed") - } - getLogger({})("Adding user with balance", balance) - const newUser = dbTx.getRepository(User).create({ - user_id: crypto.randomBytes(32).toString('hex'), - balance_sats: balance - }) - return dbTx.getRepository(User).save(newUser) - } - - async AddBasicUser(name: string, secret: string): Promise { - return this.DB.transaction(async tx => { - const user = await this.AddUser(0, tx) - const newUserAuth = tx.getRepository(UserBasicAuth).create({ - user: user, - name: name, - secret_sha256: crypto.createHash('sha256').update(secret).digest('base64') - }) - return tx.getRepository(UserBasicAuth).save(newUserAuth) - }) - - } - FindUser(userId: string, entityManager = this.DB) { - return entityManager.getRepository(User).findOne({ - where: { - user_id: userId - } - }) - } - async GetUser(userId: string, entityManager = this.DB): Promise { - const user = await this.FindUser(userId, entityManager) - if (!user) { - throw new Error(`user ${userId} not found`) // TODO: fix logs doxing - } - return user - } - - async UnbanUser(userId: string, entityManager = this.DB) { - const res = await entityManager.getRepository(User).update({ - user_id: userId - }, { locked: false }) - if (!res.affected) { - throw new Error("unaffected user unlock for " + userId) // TODO: fix logs doxing - } - } - - async BanUser(userId: string, entityManager = this.DB) { - const user = await this.GetUser(userId, entityManager) - const res = await entityManager.getRepository(User).update({ - user_id: userId - }, { balance_sats: 0, locked: true }) - if (!res.affected) { - throw new Error("unaffected ban user for " + userId) // TODO: fix logs doxing - } - if (user.balance_sats > 0) { - this.eventsLog.LogEvent({ type: 'balance_decrement', userId, appId: "", appUserId: "", balance: user.balance_sats, data: 'ban', amount: user.balance_sats }) - } - return user - } - async IncrementUserBalance(userId: string, increment: number, reason: string, entityManager?: DataSource | EntityManager) { - if (entityManager) { - return this.IncrementUserBalanceInTx(userId, increment, reason, entityManager) - } - await this.txQueue.PushToQueue({ - dbTx: true, - description: `incrementing user ${userId} balance by ${increment}`, - exec: async tx => { - await this.IncrementUserBalanceInTx(userId, increment, reason, tx) - } - }) - } - async IncrementUserBalanceInTx(userId: string, increment: number, reason: string, dbTx: DataSource | EntityManager) { - const user = await this.GetUser(userId, dbTx) - const res = await dbTx.getRepository(User).increment({ - user_id: userId, - }, "balance_sats", increment) - if (!res.affected) { - getLogger({ userId: userId, component: "balanceUpdates" })("user unaffected by increment") - throw new Error("unaffected balance increment for " + userId) // TODO: fix logs doxing - } - getLogger({ userId: userId, component: "balanceUpdates" })("incremented balance from", user.balance_sats, "sats, by", increment, "sats") - this.eventsLog.LogEvent({ type: 'balance_increment', userId, appId: "", appUserId: "", balance: user.balance_sats, data: reason, amount: increment }) - } - async DecrementUserBalance(userId: string, decrement: number, reason: string, entityManager?: DataSource | EntityManager) { - if (entityManager) { - return this.DecrementUserBalanceInTx(userId, decrement, reason, entityManager) - } - await this.txQueue.PushToQueue({ - dbTx: true, - description: `decrementing user ${userId} balance by ${decrement}`, - exec: async tx => { - await this.DecrementUserBalanceInTx(userId, decrement, reason, tx) - } - }) - } - - async DecrementUserBalanceInTx(userId: string, decrement: number, reason: string, dbTx: DataSource | EntityManager) { - const user = await this.GetUser(userId, dbTx) - if (!user || user.balance_sats < decrement) { - getLogger({ userId: userId, component: "balanceUpdates" })("not enough balance to decrement") - throw new Error("not enough balance to decrement") - } - const res = await dbTx.getRepository(User).decrement({ - user_id: userId, - }, "balance_sats", decrement) - if (!res.affected) { - getLogger({ userId: userId, component: "balanceUpdates" })("user unaffected by decrement") - throw new Error("unaffected balance decrement for " + userId) // TODO: fix logs doxing - } - getLogger({ userId: userId, component: "balanceUpdates" })("decremented balance from", user.balance_sats, "sats, by", decrement, "sats") - this.eventsLog.LogEvent({ type: 'balance_decrement', userId, appId: "", appUserId: "", balance: user.balance_sats, data: reason, amount: decrement }) - } - - async UpdateUser(userId: string, update: Partial, entityManager = this.DB) { - const user = await this.GetUser(userId, entityManager) - await entityManager.getRepository(User).update(user.serial_id, update) - } +import crypto from 'crypto'; +import { DataSource, EntityManager } from "typeorm" +import { User } from './entity/User.js'; +import { UserBasicAuth } from './entity/UserBasicAuth.js'; +import { getLogger } from '../helpers/logger.js'; +import TransactionsQueue from "./transactionsQueue.js"; +import EventsLogManager from './eventsLog.js'; +export default class { + DB: DataSource | EntityManager + txQueue: TransactionsQueue + eventsLog: EventsLogManager + constructor(DB: DataSource | EntityManager, txQueue: TransactionsQueue, eventsLog: EventsLogManager) { + this.DB = DB + this.txQueue = txQueue + this.eventsLog = eventsLog + } + + async AddUser(balance: number, dbTx: DataSource | EntityManager): Promise { + if (balance && process.env.ALLOW_BALANCE_MIGRATION !== 'true') { + throw new Error("balance migration is not allowed") + } + getLogger({})("Adding user with balance", balance) + const newUser = dbTx.getRepository(User).create({ + user_id: crypto.randomBytes(32).toString('hex'), + balance_sats: balance + }) + return dbTx.getRepository(User).save(newUser) + } + + async AddBasicUser(name: string, secret: string): Promise { + return this.DB.transaction(async tx => { + const user = await this.AddUser(0, tx) + const newUserAuth = tx.getRepository(UserBasicAuth).create({ + user: user, + name: name, + secret_sha256: crypto.createHash('sha256').update(secret).digest('base64') + }) + return tx.getRepository(UserBasicAuth).save(newUserAuth) + }) + + } + FindUser(userId: string, entityManager = this.DB) { + return entityManager.getRepository(User).findOne({ + where: { + user_id: userId + } + }) + } + async GetUser(userId: string, entityManager = this.DB): Promise { + const user = await this.FindUser(userId, entityManager) + if (!user) { + throw new Error(`user ${userId} not found`) // TODO: fix logs doxing + } + return user + } + + async UnbanUser(userId: string, entityManager = this.DB) { + const res = await entityManager.getRepository(User).update({ + user_id: userId + }, { locked: false }) + if (!res.affected) { + throw new Error("unaffected user unlock for " + userId) // TODO: fix logs doxing + } + } + + async BanUser(userId: string, entityManager = this.DB) { + const user = await this.GetUser(userId, entityManager) + const res = await entityManager.getRepository(User).update({ + user_id: userId + }, { balance_sats: 0, locked: true }) + if (!res.affected) { + throw new Error("unaffected ban user for " + userId) // TODO: fix logs doxing + } + if (user.balance_sats > 0) { + this.eventsLog.LogEvent({ type: 'balance_decrement', userId, appId: "", appUserId: "", balance: user.balance_sats, data: 'ban', amount: user.balance_sats }) + } + return user + } + async IncrementUserBalance(userId: string, increment: number, reason: string, entityManager?: DataSource | EntityManager) { + if (entityManager) { + return this.IncrementUserBalanceInTx(userId, increment, reason, entityManager) + } + await this.txQueue.PushToQueue({ + dbTx: true, + description: `incrementing user ${userId} balance by ${increment}`, + exec: async tx => { + await this.IncrementUserBalanceInTx(userId, increment, reason, tx) + } + }) + } + async IncrementUserBalanceInTx(userId: string, increment: number, reason: string, dbTx: DataSource | EntityManager) { + const user = await this.GetUser(userId, dbTx) + const res = await dbTx.getRepository(User).increment({ + user_id: userId, + }, "balance_sats", increment) + if (!res.affected) { + getLogger({ userId: userId, component: "balanceUpdates" })("user unaffected by increment") + throw new Error("unaffected balance increment for " + userId) // TODO: fix logs doxing + } + getLogger({ userId: userId, component: "balanceUpdates" })("incremented balance from", user.balance_sats, "sats, by", increment, "sats") + this.eventsLog.LogEvent({ type: 'balance_increment', userId, appId: "", appUserId: "", balance: user.balance_sats, data: reason, amount: increment }) + } + async DecrementUserBalance(userId: string, decrement: number, reason: string, entityManager?: DataSource | EntityManager) { + if (entityManager) { + return this.DecrementUserBalanceInTx(userId, decrement, reason, entityManager) + } + await this.txQueue.PushToQueue({ + dbTx: true, + description: `decrementing user ${userId} balance by ${decrement}`, + exec: async tx => { + await this.DecrementUserBalanceInTx(userId, decrement, reason, tx) + } + }) + } + + async DecrementUserBalanceInTx(userId: string, decrement: number, reason: string, dbTx: DataSource | EntityManager) { + const user = await this.GetUser(userId, dbTx) + if (!user || user.balance_sats < decrement) { + getLogger({ userId: userId, component: "balanceUpdates" })("not enough balance to decrement") + throw new Error("not enough balance to decrement") + } + const res = await dbTx.getRepository(User).decrement({ + user_id: userId, + }, "balance_sats", decrement) + if (!res.affected) { + getLogger({ userId: userId, component: "balanceUpdates" })("user unaffected by decrement") + throw new Error("unaffected balance decrement for " + userId) // TODO: fix logs doxing + } + getLogger({ userId: userId, component: "balanceUpdates" })("decremented balance from", user.balance_sats, "sats, by", decrement, "sats") + this.eventsLog.LogEvent({ type: 'balance_decrement', userId, appId: "", appUserId: "", balance: user.balance_sats, data: reason, amount: decrement }) + } + + async UpdateUser(userId: string, update: Partial, entityManager = this.DB) { + const user = await this.GetUser(userId, entityManager) + await entityManager.getRepository(User).update(user.serial_id, update) + } } \ No newline at end of file diff --git a/src/tests/.env.test b/src/tests/.env.test index 1b2ad695..1c118bac 100644 --- a/src/tests/.env.test +++ b/src/tests/.env.test @@ -1,40 +1,40 @@ -LND_ADDRESS=127.0.0.1:10001 #alice -LND_CERT_PATH=alice-tls.cert #alice -LND_MACAROON_PATH=alice-admin.macaroon -DATABASE_FILE=db.sqlite -JWT_SECRET=bigsecrethere -ALLOW_BALANCE_MIGRATION=true -OUTBOUND_MAX_FEE_BPS=60 -OUTBOUND_MAX_FEE_EXTRA_SATS=100 -INCOMING_CHAIN_FEE_ROOT_BPS=0 -OUTGOING_CHAIN_FEE_ROOT_BPS=60 #this is applied only to withdrawls from application wallets -INCOMING_INVOICE_FEE_ROOT_BPS=0 -OUTGOING_INVOICE_FEE_ROOT_BPS=60 #this is applied only to withdrawals from application wallets -INCOMING_INVOICE_FEE_USER_BPS=0 #defined by app this is just default -OUTGOING_INVOICE_FEE_USER_BPS=60 #defined by app this is just default -TX_FEE_INTERNAL_ROOT_BPS=60 #this is applied only to withdrawls from application wallets -TX_FEE_INTERNAL_USER_BPS=60 #defined by app this is just default -NOSTR_RELAYS=wss://strfry.shock.network -SERVICE_URL=http://localhost:8080 -ADMIN_TOKEN=thisisadmin -PORT=8080 -METRICS_DATABASE_FILE=metrics.sqlite -WATCHDOG_MAX_DIFF_BPS=100 -WATCHDOG_MAX_DIFF_SATS=10000 - -# dave <--> alice <--> carol <--> bob -LND_OTHER_ADDR=127.0.0.1:10002 -LND_OTHER_CERT_PATH=bob-tls.cert -LND_OTHER_MACAROON_PATH=bob-admin.macaroon - -LND_THIRD_ADDR=127.0.0.1:10003 -LND_THIRD_CERT_PATH=carol-tls.cert -LND_THIRD_MACAROON_PATH=carol-admin.macaroon - -LND_FOURTH_ADDR=127.0.0.1:10004 -LND_FOURTH_CERT_PATH=dave-tls.cert -LND_FOURTH_MACAROON_PATH=dave-admin.macaroon - -BITCOIN_CORE_PORT=18443 -BITCOIN_CORE_USER=polaruser +LND_ADDRESS=127.0.0.1:10001 #alice +LND_CERT_PATH=alice-tls.cert #alice +LND_MACAROON_PATH=alice-admin.macaroon +DATABASE_FILE=db.sqlite +JWT_SECRET=bigsecrethere +ALLOW_BALANCE_MIGRATION=true +OUTBOUND_MAX_FEE_BPS=60 +OUTBOUND_MAX_FEE_EXTRA_SATS=100 +INCOMING_CHAIN_FEE_ROOT_BPS=0 +OUTGOING_CHAIN_FEE_ROOT_BPS=60 #this is applied only to withdrawls from application wallets +INCOMING_INVOICE_FEE_ROOT_BPS=0 +OUTGOING_INVOICE_FEE_ROOT_BPS=60 #this is applied only to withdrawals from application wallets +INCOMING_INVOICE_FEE_USER_BPS=0 #defined by app this is just default +OUTGOING_INVOICE_FEE_USER_BPS=60 #defined by app this is just default +TX_FEE_INTERNAL_ROOT_BPS=60 #this is applied only to withdrawls from application wallets +TX_FEE_INTERNAL_USER_BPS=60 #defined by app this is just default +NOSTR_RELAYS=wss://strfry.shock.network +SERVICE_URL=http://localhost:8080 +ADMIN_TOKEN=thisisadmin +PORT=8080 +METRICS_DATABASE_FILE=metrics.sqlite +WATCHDOG_MAX_DIFF_BPS=100 +WATCHDOG_MAX_DIFF_SATS=10000 + +# dave <--> alice <--> carol <--> bob +LND_OTHER_ADDR=127.0.0.1:10002 +LND_OTHER_CERT_PATH=bob-tls.cert +LND_OTHER_MACAROON_PATH=bob-admin.macaroon + +LND_THIRD_ADDR=127.0.0.1:10003 +LND_THIRD_CERT_PATH=carol-tls.cert +LND_THIRD_MACAROON_PATH=carol-admin.macaroon + +LND_FOURTH_ADDR=127.0.0.1:10004 +LND_FOURTH_CERT_PATH=dave-tls.cert +LND_FOURTH_MACAROON_PATH=dave-admin.macaroon + +BITCOIN_CORE_PORT=18443 +BITCOIN_CORE_USER=polaruser BITCOIN_CORE_PASS=polarpass \ No newline at end of file diff --git a/src/tests/DockerFile b/src/tests/DockerFile index 3290156d..1e99f084 100644 --- a/src/tests/DockerFile +++ b/src/tests/DockerFile @@ -1,17 +1,17 @@ -FROM node:10-alpine - -RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app - -WORKDIR /home/node/app - -COPY package*.json ./ - -USER node - -RUN npm install - -COPY env.example .env - -COPY --chown=node:node . . - +FROM node:10-alpine + +RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app + +WORKDIR /home/node/app + +COPY package*.json ./ + +USER node + +RUN npm install + +COPY env.example .env + +COPY --chown=node:node . . + CMD [ "npm", "test" ] \ No newline at end of file diff --git a/src/tests/bitcoinCore.ts b/src/tests/bitcoinCore.ts index a8940d59..58b5d490 100644 --- a/src/tests/bitcoinCore.ts +++ b/src/tests/bitcoinCore.ts @@ -1,39 +1,39 @@ -// @ts-ignore -import BitcoinCore from 'bitcoin-core'; -import { TestSettings } from '../services/main/settings'; -export class BitcoinCoreWrapper { - core: BitcoinCore - addr: { address: string } - constructor(settings: TestSettings) { - this.core = new BitcoinCore({ - //network: 'regtest', - host: '127.0.0.1', - port: `${settings.bitcoinCoreSettings.port}`, - username: settings.bitcoinCoreSettings.user, - password: settings.bitcoinCoreSettings.pass, - // use a long timeout due to the time it takes to mine a lot of blocks - timeout: 5 * 60 * 1000, - }) - } - InitAddress = async () => { - this.addr = await this.core.getNewAddress() - } - Init = async () => { - const wallet = await this.core.createWallet(''); - console.log({ wallet }) - await this.InitAddress() - console.log({ addr: this.addr }) - await this.Mine(101) - const info = await this.core.getWalletInfo(); - console.log({ info }) - } - - Mine = async (blocks: number) => { - await this.core.generateToAddress(blocks, this.addr) - } - - SendToAddress = async (address: string, amount: number) => { - const tx = await this.core.sendToAddress(address, amount) - console.log({ tx }) - } +// @ts-ignore +import BitcoinCore from 'bitcoin-core'; +import { TestSettings } from '../services/main/settings'; +export class BitcoinCoreWrapper { + core: BitcoinCore + addr: { address: string } + constructor(settings: TestSettings) { + this.core = new BitcoinCore({ + //network: 'regtest', + host: '127.0.0.1', + port: `${settings.bitcoinCoreSettings.port}`, + username: settings.bitcoinCoreSettings.user, + password: settings.bitcoinCoreSettings.pass, + // use a long timeout due to the time it takes to mine a lot of blocks + timeout: 5 * 60 * 1000, + }) + } + InitAddress = async () => { + this.addr = await this.core.getNewAddress() + } + Init = async () => { + const wallet = await this.core.createWallet(''); + console.log({ wallet }) + await this.InitAddress() + console.log({ addr: this.addr }) + await this.Mine(101) + const info = await this.core.getWalletInfo(); + console.log({ info }) + } + + Mine = async (blocks: number) => { + await this.core.generateToAddress(blocks, this.addr) + } + + SendToAddress = async (address: string, amount: number) => { + const tx = await this.core.sendToAddress(address, amount) + console.log({ tx }) + } } \ No newline at end of file diff --git a/src/tests/docker-compose.yml b/src/tests/docker-compose.yml index c43fef91..c6f2c38f 100644 --- a/src/tests/docker-compose.yml +++ b/src/tests/docker-compose.yml @@ -1,108 +1,108 @@ -version: '3.3' -services: - backend1: - environment: - USERID: ${USERID:-1000} - GROUPID: ${GROUPID:-1000} - stop_grace_period: 5m - image: polarlightning/bitcoind:26.0 - container_name: polar-n2-backend1 - hostname: backend1 - command: >- - bitcoind -server=1 -regtest=1 -rpcauth=polaruser:5e5e98c21f5c814568f8b55d83b23c1c$$066b03f92df30b11de8e4b1b1cd5b1b4281aa25205bd57df9be82caf97a05526 -debug=1 -zmqpubrawblock=tcp://0.0.0.0:28334 -zmqpubrawtx=tcp://0.0.0.0:28335 -zmqpubhashblock=tcp://0.0.0.0:28336 -txindex=1 -dnsseed=0 -upnp=0 -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0 -rpcport=18443 -rest -listen=1 -listenonion=0 -fallbackfee=0.0002 -blockfilterindex=1 -peerblockfilters=1 - volumes: - - ./volumes/bitcoind/backend1:/home/bitcoin/.bitcoin - expose: - - '18443' - - '18444' - - '28334' - - '28335' - ports: - - '18443:18443' - - '19444:18444' - - '28334:28334' - - '29335:28335' - alice: - environment: - USERID: ${USERID:-1000} - GROUPID: ${GROUPID:-1000} - stop_grace_period: 2m - image: polarlightning/lnd:0.17.3-beta - container_name: polar-n2-alice - hostname: alice - command: >- - lnd --noseedbackup --trickledelay=5000 --alias=alice --externalip=alice --tlsextradomain=alice --tlsextradomain=polar-n2-alice --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 - restart: always - volumes: - - ./volumes/lnd/alice:/home/lnd/.lnd - expose: - - '8080' - - '10009' - - '9735' - ports: - # - '8081:8080' - - '10001:10009' - - '9735:9735' - bob: - environment: - USERID: ${USERID:-1000} - GROUPID: ${GROUPID:-1000} - stop_grace_period: 2m - image: polarlightning/lnd:0.17.3-beta - container_name: polar-n2-bob - hostname: bob - command: >- - lnd --noseedbackup --trickledelay=5000 --alias=bob --externalip=bob --tlsextradomain=bob --tlsextradomain=polar-n2-bob --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 - restart: always - volumes: - - ./volumes/lnd/bob:/home/lnd/.lnd - expose: - - '8080' - - '10009' - - '9735' - ports: - # - '8082:8080' - - '10002:10009' - - '9736:9735' - carol: - environment: - USERID: ${USERID:-1000} - GROUPID: ${GROUPID:-1000} - stop_grace_period: 2m - image: polarlightning/lnd:0.17.3-beta - container_name: polar-n2-carol - hostname: carol - command: >- - lnd --noseedbackup --trickledelay=5000 --alias=carol --externalip=carol --tlsextradomain=carol --tlsextradomain=polar-n2-carol --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 - restart: always - volumes: - - ./volumes/lnd/carol:/home/lnd/.lnd - expose: - - '8080' - - '10009' - - '9735' - ports: - # - '8083:8080' - - '10003:10009' - - '9737:9735' - dave: - environment: - USERID: ${USERID:-1000} - GROUPID: ${GROUPID:-1000} - stop_grace_period: 2m - image: polarlightning/lnd:0.17.3-beta - container_name: polar-n2-dave - hostname: dave - command: >- - lnd --noseedbackup --trickledelay=5000 --alias=dave --externalip=dave --tlsextradomain=dave --tlsextradomain=polar-n2-dave --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 - restart: always - volumes: - - ./volumes/lnd/dave:/home/lnd/.lnd - expose: - - '8080' - - '10009' - - '9735' - ports: - # - '8084:8080' - - '10004:10009' - - '9738:9735' +version: '3.3' +services: + backend1: + environment: + USERID: ${USERID:-1000} + GROUPID: ${GROUPID:-1000} + stop_grace_period: 5m + image: polarlightning/bitcoind:26.0 + container_name: polar-n2-backend1 + hostname: backend1 + command: >- + bitcoind -server=1 -regtest=1 -rpcauth=polaruser:5e5e98c21f5c814568f8b55d83b23c1c$$066b03f92df30b11de8e4b1b1cd5b1b4281aa25205bd57df9be82caf97a05526 -debug=1 -zmqpubrawblock=tcp://0.0.0.0:28334 -zmqpubrawtx=tcp://0.0.0.0:28335 -zmqpubhashblock=tcp://0.0.0.0:28336 -txindex=1 -dnsseed=0 -upnp=0 -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0 -rpcport=18443 -rest -listen=1 -listenonion=0 -fallbackfee=0.0002 -blockfilterindex=1 -peerblockfilters=1 + volumes: + - ./volumes/bitcoind/backend1:/home/bitcoin/.bitcoin + expose: + - '18443' + - '18444' + - '28334' + - '28335' + ports: + - '18443:18443' + - '19444:18444' + - '28334:28334' + - '29335:28335' + alice: + environment: + USERID: ${USERID:-1000} + GROUPID: ${GROUPID:-1000} + stop_grace_period: 2m + image: polarlightning/lnd:0.17.3-beta + container_name: polar-n2-alice + hostname: alice + command: >- + lnd --noseedbackup --trickledelay=5000 --alias=alice --externalip=alice --tlsextradomain=alice --tlsextradomain=polar-n2-alice --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 + restart: always + volumes: + - ./volumes/lnd/alice:/home/lnd/.lnd + expose: + - '8080' + - '10009' + - '9735' + ports: + # - '8081:8080' + - '10001:10009' + - '9735:9735' + bob: + environment: + USERID: ${USERID:-1000} + GROUPID: ${GROUPID:-1000} + stop_grace_period: 2m + image: polarlightning/lnd:0.17.3-beta + container_name: polar-n2-bob + hostname: bob + command: >- + lnd --noseedbackup --trickledelay=5000 --alias=bob --externalip=bob --tlsextradomain=bob --tlsextradomain=polar-n2-bob --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 + restart: always + volumes: + - ./volumes/lnd/bob:/home/lnd/.lnd + expose: + - '8080' + - '10009' + - '9735' + ports: + # - '8082:8080' + - '10002:10009' + - '9736:9735' + carol: + environment: + USERID: ${USERID:-1000} + GROUPID: ${GROUPID:-1000} + stop_grace_period: 2m + image: polarlightning/lnd:0.17.3-beta + container_name: polar-n2-carol + hostname: carol + command: >- + lnd --noseedbackup --trickledelay=5000 --alias=carol --externalip=carol --tlsextradomain=carol --tlsextradomain=polar-n2-carol --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 + restart: always + volumes: + - ./volumes/lnd/carol:/home/lnd/.lnd + expose: + - '8080' + - '10009' + - '9735' + ports: + # - '8083:8080' + - '10003:10009' + - '9737:9735' + dave: + environment: + USERID: ${USERID:-1000} + GROUPID: ${GROUPID:-1000} + stop_grace_period: 2m + image: polarlightning/lnd:0.17.3-beta + container_name: polar-n2-dave + hostname: dave + command: >- + lnd --noseedbackup --trickledelay=5000 --alias=dave --externalip=dave --tlsextradomain=dave --tlsextradomain=polar-n2-dave --tlsextradomain=host.docker.internal --listen=0.0.0.0:9735 --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:8080 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=polar-n2-backend1 --bitcoind.rpcuser=polaruser --bitcoind.rpcpass=polarpass --bitcoind.zmqpubrawblock=tcp://polar-n2-backend1:28334 --bitcoind.zmqpubrawtx=tcp://polar-n2-backend1:28335 + restart: always + volumes: + - ./volumes/lnd/dave:/home/lnd/.lnd + expose: + - '8080' + - '10009' + - '9735' + ports: + # - '8084:8080' + - '10004:10009' + - '9738:9735' diff --git a/src/tests/externalPayment.spec.ts b/src/tests/externalPayment.spec.ts index 551cdd57..45642767 100644 --- a/src/tests/externalPayment.spec.ts +++ b/src/tests/externalPayment.spec.ts @@ -1,47 +1,47 @@ -import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' -import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' -export const ignore = false -export const dev = false -export default async (T: TestBase) => { - await safelySetUserBalance(T, T.user1, 2000) - await testSuccessfulExternalPayment(T) - await testFailedExternalPayment(T) - await runSanityCheck(T) -} - - -const testSuccessfulExternalPayment = async (T: TestBase) => { - T.d("starting testSuccessfulExternalPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const invoice = await T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry) - expect(invoice.payRequest).to.startWith("lnbcrt5u") - T.d("generated 500 sats invoice for external node") - - const pay = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application) - expect(pay.amount_paid).to.be.equal(500) - T.d("paid 500 sats invoice from user1") - const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) - const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) - expect(u1.balance_sats).to.be.equal(1496) - T.d("user1 balance is now 1496 (2000 - (500 + 3 fee + 1 routing))") - expect(owner.balance_sats).to.be.equal(3) - T.d("app balance is 3 sats") - -} - -const testFailedExternalPayment = async (T: TestBase) => { - T.d("starting testFailedExternalPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const invoice = await T.externalAccessToOtherLnd.NewInvoice(1500, "test", defaultInvoiceExpiry) - expect(invoice.payRequest).to.startWith("lnbcrt15u") - T.d("generated 1500 sats invoice for external node") - - await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "not enough balance to decrement") - T.d("payment failed as expected, with the expected error message") - const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) - expect(u1.balance_sats).to.be.equal(1496) - T.d("user1 balance is still 1496") - const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) - expect(owner.balance_sats).to.be.equal(3) - T.d("app balance is still 3 sats") +import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' +import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' +export const ignore = false +export const dev = false +export default async (T: TestBase) => { + await safelySetUserBalance(T, T.user1, 2000) + await testSuccessfulExternalPayment(T) + await testFailedExternalPayment(T) + await runSanityCheck(T) +} + + +const testSuccessfulExternalPayment = async (T: TestBase) => { + T.d("starting testSuccessfulExternalPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const invoice = await T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry) + expect(invoice.payRequest).to.startWith("lnbcrt5u") + T.d("generated 500 sats invoice for external node") + + const pay = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application) + expect(pay.amount_paid).to.be.equal(500) + T.d("paid 500 sats invoice from user1") + const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) + const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) + expect(u1.balance_sats).to.be.equal(1496) + T.d("user1 balance is now 1496 (2000 - (500 + 3 fee + 1 routing))") + expect(owner.balance_sats).to.be.equal(3) + T.d("app balance is 3 sats") + +} + +const testFailedExternalPayment = async (T: TestBase) => { + T.d("starting testFailedExternalPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const invoice = await T.externalAccessToOtherLnd.NewInvoice(1500, "test", defaultInvoiceExpiry) + expect(invoice.payRequest).to.startWith("lnbcrt15u") + T.d("generated 1500 sats invoice for external node") + + await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "not enough balance to decrement") + T.d("payment failed as expected, with the expected error message") + const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) + expect(u1.balance_sats).to.be.equal(1496) + T.d("user1 balance is still 1496") + const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) + expect(owner.balance_sats).to.be.equal(3) + T.d("app balance is still 3 sats") } \ No newline at end of file diff --git a/src/tests/internalPayment.spec.ts b/src/tests/internalPayment.spec.ts index 8c4bef53..7a4b3055 100644 --- a/src/tests/internalPayment.spec.ts +++ b/src/tests/internalPayment.spec.ts @@ -1,41 +1,41 @@ -import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' -import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' -export const ignore = false - -export default async (T: TestBase) => { - await safelySetUserBalance(T, T.user1, 2000) - await testSuccessfulInternalPayment(T) - await testFailedInternalPayment(T) - await runSanityCheck(T) -} - -const testSuccessfulInternalPayment = async (T: TestBase) => { - T.d("starting testSuccessfulInternalPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const invoice = await T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 1000, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry }) - expect(invoice.invoice).to.startWith("lnbcrt10u") - T.d("generated 1000 sats invoice for user2") - const pay = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application) - expect(pay.amount_paid).to.be.equal(1000) - T.d("paid 1000 sats invoice from user1") - const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) - const u2 = await T.main.storage.userStorage.GetUser(T.user2.userId) - const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) - expect(u2.balance_sats).to.be.equal(1000) - T.d("user2 balance is 1000") - expect(u1.balance_sats).to.be.equal(994) - T.d("user1 balance is 994 cuz he paid 6 sats fee") - expect(owner.balance_sats).to.be.equal(6) - T.d("app balance is 6 sats") -} - -const testFailedInternalPayment = async (T: TestBase) => { - T.d("starting testFailedInternalPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const invoice = await T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 1000, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry }) - expect(invoice.invoice).to.startWith("lnbcrt10u") - T.d("generated 1000 sats invoice for user2") - await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "not enough balance to decrement") - T.d("payment failed as expected, with the expected error message") -} - +import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' +import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' +export const ignore = false + +export default async (T: TestBase) => { + await safelySetUserBalance(T, T.user1, 2000) + await testSuccessfulInternalPayment(T) + await testFailedInternalPayment(T) + await runSanityCheck(T) +} + +const testSuccessfulInternalPayment = async (T: TestBase) => { + T.d("starting testSuccessfulInternalPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const invoice = await T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 1000, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry }) + expect(invoice.invoice).to.startWith("lnbcrt10u") + T.d("generated 1000 sats invoice for user2") + const pay = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application) + expect(pay.amount_paid).to.be.equal(1000) + T.d("paid 1000 sats invoice from user1") + const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) + const u2 = await T.main.storage.userStorage.GetUser(T.user2.userId) + const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) + expect(u2.balance_sats).to.be.equal(1000) + T.d("user2 balance is 1000") + expect(u1.balance_sats).to.be.equal(994) + T.d("user1 balance is 994 cuz he paid 6 sats fee") + expect(owner.balance_sats).to.be.equal(6) + T.d("app balance is 6 sats") +} + +const testFailedInternalPayment = async (T: TestBase) => { + T.d("starting testFailedInternalPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const invoice = await T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 1000, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry }) + expect(invoice.invoice).to.startWith("lnbcrt10u") + T.d("generated 1000 sats invoice for user2") + await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "not enough balance to decrement") + T.d("payment failed as expected, with the expected error message") +} + diff --git a/src/tests/liquidityProvider.spec.ts b/src/tests/liquidityProvider.spec.ts index bb5d8fdc..09d1a9f1 100644 --- a/src/tests/liquidityProvider.spec.ts +++ b/src/tests/liquidityProvider.spec.ts @@ -1,54 +1,54 @@ -import { disableLoggers } from '../services/helpers/logger.js' -import { runSanityCheck, safelySetUserBalance, TestBase, TestUserData } from './testBase.js' -import { initBootstrappedInstance } from './setupBootstrapped.js' -import Main from '../services/main/index.js' -import { AppData } from '../services/main/init.js' -export const ignore = false -export const dev = false - - - -export default async (T: TestBase) => { - disableLoggers([], ["EventsLogManager", "watchdog", "htlcTracker", "debugHtlcs", "debugLndBalancev3", "metrics", "mainForTest", "main"]) - await safelySetUserBalance(T, T.user1, 2000) - T.d("starting liquidityProvider tests...") - const { bootstrapped, bootstrappedUser, stop } = await initBootstrappedInstance(T) - await testInboundPaymentFromProvider(T, bootstrapped, bootstrappedUser) - await testOutboundPaymentFromProvider(T, bootstrapped, bootstrappedUser) - stop() - await runSanityCheck(T) -} - -const testInboundPaymentFromProvider = async (T: TestBase, bootstrapped: Main, bUser: TestUserData) => { - T.d("starting testInboundPaymentFromProvider") - const invoiceRes = await bootstrapped.appUserManager.NewInvoice({ app_id: bUser.appId, user_id: bUser.userId, app_user_id: bUser.appUserIdentifier }, { amountSats: 2000, memo: "liquidityTest" }) - - await T.externalAccessToOtherLnd.PayInvoice(invoiceRes.invoice, 0, 100) - const userBalance = await bootstrapped.appUserManager.GetUserInfo({ app_id: bUser.appId, user_id: bUser.userId, app_user_id: bUser.appUserIdentifier }) - T.expect(userBalance.balance).to.equal(2000) - - const providerBalance = await bootstrapped.liquidProvider.CheckUserState() - if (!providerBalance) { - throw new Error("provider balance not found") - } - T.expect(providerBalance.balance).to.equal(2000) - T.d("testInboundPaymentFromProvider done") -} - -const testOutboundPaymentFromProvider = async (T: TestBase, bootstrapped: Main, bootstrappedUser: TestUserData) => { - T.d("starting testOutboundPaymentFromProvider") - - const invoice = await T.externalAccessToOtherLnd.NewInvoice(1000, "", 60 * 60) - const ctx = { app_id: bootstrappedUser.appId, user_id: bootstrappedUser.userId, app_user_id: bootstrappedUser.appUserIdentifier } - const res = await bootstrapped.appUserManager.PayInvoice(ctx, { invoice: invoice.payRequest, amount: 0 }) - - const userBalance = await bootstrapped.appUserManager.GetUserInfo(ctx) - T.expect(userBalance.balance).to.equal(986) // 2000 - (1000 + 6(x2) + 2) - - const providerBalance = await bootstrapped.liquidProvider.CheckUserState() - if (!providerBalance) { - throw new Error("provider balance not found") - } - T.expect(providerBalance.balance).to.equal(992) // 2000 - (1000 + 6 +2) - T.d("testOutboundPaymentFromProvider done") +import { disableLoggers } from '../services/helpers/logger.js' +import { runSanityCheck, safelySetUserBalance, TestBase, TestUserData } from './testBase.js' +import { initBootstrappedInstance } from './setupBootstrapped.js' +import Main from '../services/main/index.js' +import { AppData } from '../services/main/init.js' +export const ignore = false +export const dev = false + + + +export default async (T: TestBase) => { + disableLoggers([], ["EventsLogManager", "watchdog", "htlcTracker", "debugHtlcs", "debugLndBalancev3", "metrics", "mainForTest", "main"]) + await safelySetUserBalance(T, T.user1, 2000) + T.d("starting liquidityProvider tests...") + const { bootstrapped, bootstrappedUser, stop } = await initBootstrappedInstance(T) + await testInboundPaymentFromProvider(T, bootstrapped, bootstrappedUser) + await testOutboundPaymentFromProvider(T, bootstrapped, bootstrappedUser) + stop() + await runSanityCheck(T) +} + +const testInboundPaymentFromProvider = async (T: TestBase, bootstrapped: Main, bUser: TestUserData) => { + T.d("starting testInboundPaymentFromProvider") + const invoiceRes = await bootstrapped.appUserManager.NewInvoice({ app_id: bUser.appId, user_id: bUser.userId, app_user_id: bUser.appUserIdentifier }, { amountSats: 2000, memo: "liquidityTest" }) + + await T.externalAccessToOtherLnd.PayInvoice(invoiceRes.invoice, 0, 100) + const userBalance = await bootstrapped.appUserManager.GetUserInfo({ app_id: bUser.appId, user_id: bUser.userId, app_user_id: bUser.appUserIdentifier }) + T.expect(userBalance.balance).to.equal(2000) + + const providerBalance = await bootstrapped.liquidProvider.CheckUserState() + if (!providerBalance) { + throw new Error("provider balance not found") + } + T.expect(providerBalance.balance).to.equal(2000) + T.d("testInboundPaymentFromProvider done") +} + +const testOutboundPaymentFromProvider = async (T: TestBase, bootstrapped: Main, bootstrappedUser: TestUserData) => { + T.d("starting testOutboundPaymentFromProvider") + + const invoice = await T.externalAccessToOtherLnd.NewInvoice(1000, "", 60 * 60) + const ctx = { app_id: bootstrappedUser.appId, user_id: bootstrappedUser.userId, app_user_id: bootstrappedUser.appUserIdentifier } + const res = await bootstrapped.appUserManager.PayInvoice(ctx, { invoice: invoice.payRequest, amount: 0 }) + + const userBalance = await bootstrapped.appUserManager.GetUserInfo(ctx) + T.expect(userBalance.balance).to.equal(986) // 2000 - (1000 + 6(x2) + 2) + + const providerBalance = await bootstrapped.liquidProvider.CheckUserState() + if (!providerBalance) { + throw new Error("provider balance not found") + } + T.expect(providerBalance.balance).to.equal(992) // 2000 - (1000 + 6 +2) + T.d("testOutboundPaymentFromProvider done") } \ No newline at end of file diff --git a/src/tests/networkSetup.ts b/src/tests/networkSetup.ts index 91af289a..9dbdacd0 100644 --- a/src/tests/networkSetup.ts +++ b/src/tests/networkSetup.ts @@ -1,65 +1,65 @@ -import { LoadTestSettingsFromEnv } from "../services/main/settings.js" -import { BitcoinCoreWrapper } from "./bitcoinCore.js" -import LND from '../services/lnd/lnd.js' -import { LiquidityProvider } from "../services/lnd/liquidityProvider.js" - -export const setupNetwork = async () => { - const settings = LoadTestSettingsFromEnv() - const core = new BitcoinCoreWrapper(settings) - await core.InitAddress() - await core.Mine(1) - const alice = new LND(settings.lndSettings, new LiquidityProvider("", () => { }), () => { }, () => { }, () => { }, () => { }) - const bob = new LND({ ...settings.lndSettings, mainNode: settings.lndSettings.otherNode }, new LiquidityProvider("", () => { }), () => { }, () => { }, () => { }, () => { }) - await tryUntil(async i => { - const peers = await alice.ListPeers() - if (peers.peers.length > 0) { - return - } - await alice.ConnectPeer({ pubkey: '0232842d81b2423df97aa8a264f8c0811610a736af65afe2e145279f285625c1e4', host: "carol:9735" }) - await alice.ConnectPeer({ pubkey: '027c50fde118af534ff27e59da722422d2f3e06505c31e94c1b40c112c48a83b1c', host: "dave:9735" }) - }, 15, 2000) - await tryUntil(async i => { - const peers = await bob.ListPeers() - if (peers.peers.length > 0) { - return - } - await bob.ConnectPeer({ pubkey: '0232842d81b2423df97aa8a264f8c0811610a736af65afe2e145279f285625c1e4', host: "carol:9735" }) - }, 15, 2000) - - await tryUntil(async i => { - const info = await alice.GetInfo() - if (!info.syncedToChain) { - throw new Error("alice not synced to chain") - } - if (!info.syncedToGraph) { - //await lnd.ConnectPeer({}) - throw new Error("alice not synced to graph") - } - }, 15, 2000) - - await tryUntil(async i => { - const info = await bob.GetInfo() - if (!info.syncedToChain) { - throw new Error("bob not synced to chain") - } - if (!info.syncedToGraph) { - //await lnd.ConnectPeer({}) - throw new Error("bob not synced to graph") - } - }, 15, 2000) - - alice.Stop() - bob.Stop() -} - -const tryUntil = async (fn: (attempt: number) => Promise, maxTries: number, interval: number) => { - for (let i = 0; i < maxTries; i++) { - try { - return await fn(i) - } catch (e) { - console.log("tryUntil error", e) - await new Promise(resolve => setTimeout(resolve, interval)) - } - } - throw new Error("tryUntil failed") +import { LoadTestSettingsFromEnv } from "../services/main/settings.js" +import { BitcoinCoreWrapper } from "./bitcoinCore.js" +import LND from '../services/lnd/lnd.js' +import { LiquidityProvider } from "../services/lnd/liquidityProvider.js" + +export const setupNetwork = async () => { + const settings = LoadTestSettingsFromEnv() + const core = new BitcoinCoreWrapper(settings) + await core.InitAddress() + await core.Mine(1) + const alice = new LND(settings.lndSettings, new LiquidityProvider("", () => { }), () => { }, () => { }, () => { }, () => { }) + const bob = new LND({ ...settings.lndSettings, mainNode: settings.lndSettings.otherNode }, new LiquidityProvider("", () => { }), () => { }, () => { }, () => { }, () => { }) + await tryUntil(async i => { + const peers = await alice.ListPeers() + if (peers.peers.length > 0) { + return + } + await alice.ConnectPeer({ pubkey: '0232842d81b2423df97aa8a264f8c0811610a736af65afe2e145279f285625c1e4', host: "carol:9735" }) + await alice.ConnectPeer({ pubkey: '027c50fde118af534ff27e59da722422d2f3e06505c31e94c1b40c112c48a83b1c', host: "dave:9735" }) + }, 15, 2000) + await tryUntil(async i => { + const peers = await bob.ListPeers() + if (peers.peers.length > 0) { + return + } + await bob.ConnectPeer({ pubkey: '0232842d81b2423df97aa8a264f8c0811610a736af65afe2e145279f285625c1e4', host: "carol:9735" }) + }, 15, 2000) + + await tryUntil(async i => { + const info = await alice.GetInfo() + if (!info.syncedToChain) { + throw new Error("alice not synced to chain") + } + if (!info.syncedToGraph) { + //await lnd.ConnectPeer({}) + throw new Error("alice not synced to graph") + } + }, 15, 2000) + + await tryUntil(async i => { + const info = await bob.GetInfo() + if (!info.syncedToChain) { + throw new Error("bob not synced to chain") + } + if (!info.syncedToGraph) { + //await lnd.ConnectPeer({}) + throw new Error("bob not synced to graph") + } + }, 15, 2000) + + alice.Stop() + bob.Stop() +} + +const tryUntil = async (fn: (attempt: number) => Promise, maxTries: number, interval: number) => { + for (let i = 0; i < maxTries; i++) { + try { + return await fn(i) + } catch (e) { + console.log("tryUntil error", e) + await new Promise(resolve => setTimeout(resolve, interval)) + } + } + throw new Error("tryUntil failed") } \ No newline at end of file diff --git a/src/tests/setupBootstrapped.ts b/src/tests/setupBootstrapped.ts index 9b1bfc5a..629cbad1 100644 --- a/src/tests/setupBootstrapped.ts +++ b/src/tests/setupBootstrapped.ts @@ -1,92 +1,92 @@ -import { getLogger } from '../services/helpers/logger.js' -import { initMainHandler } from '../services/main/init.js' -import { LoadTestSettingsFromEnv } from '../services/main/settings.js' -import { SendData } from '../services/nostr/handler.js' -import { TestBase, TestUserData } from './testBase.js' -import * as Types from '../../proto/autogenerated/ts/types.js' - -export const initBootstrappedInstance = async (T: TestBase) => { - const settings = LoadTestSettingsFromEnv() - settings.lndSettings.useOnlyLiquidityProvider = true - settings.lndSettings.liquidityProviderPub = T.app.publicKey - settings.lndSettings.mainNode = settings.lndSettings.thirdNode - const initialized = await initMainHandler(getLogger({ component: "bootstrapped" }), settings) - if (!initialized) { - throw new Error("failed to initialize bootstrapped main handler") - } - const { mainHandler: bootstrapped, liquidityProviderInfo, liquidityProviderApp } = initialized - T.main.attachNostrSend(async (_, data, r) => { - if (data.type === 'event') { - throw new Error("unsupported event type") - } - if (data.pub !== liquidityProviderInfo.publicKey) { - throw new Error("invalid pub " + data.pub + " expected " + liquidityProviderInfo.publicKey) - } - const j = JSON.parse(data.content) as { requestId: string } - console.log("sending new operation to provider") - bootstrapped.liquidProvider.onEvent(j, T.app.publicKey) - }) - bootstrapped.liquidProvider.attachNostrSend(async (_, data, r) => { - const res = await handleSend(T, data) - if (data.type === 'event') { - throw new Error("unsupported event type") - } - if (!res) { - return - } - bootstrapped.liquidProvider.onEvent(res, data.pub) - }) - bootstrapped.liquidProvider.setNostrInfo({ clientId: liquidityProviderInfo.clientId, myPub: liquidityProviderInfo.publicKey }) - await new Promise(res => { - const interval = setInterval(() => { - if (bootstrapped.liquidProvider.CanProviderHandle({ action: 'receive', amount: 2000 })) { - clearInterval(interval) - res() - } else { - console.log("waiting for provider to be able to handle the request") - } - }, 500) - }) - const bUser = await bootstrapped.applicationManager.AddAppUser(liquidityProviderApp.appId, { identifier: "user1_bootstrapped", balance: 0, fail_if_exists: true }) - const bootstrappedUser: TestUserData = { userId: bUser.info.userId, appUserIdentifier: bUser.identifier, appId: liquidityProviderApp.appId } - return { - bootstrapped, liquidityProviderInfo, liquidityProviderApp, bootstrappedUser, stop: () => { - bootstrapped.Stop() - } - } -} -type TransportRequest = { requestId: string, authIdentifier: string } & ( - { rpcName: 'GetUserInfo' } | - { rpcName: 'NewInvoice', body: Types.NewInvoiceRequest } | - { rpcName: 'PayInvoice', body: Types.PayInvoiceRequest } | - { rpcName: 'GetLiveUserOperations' } | - { rpcName: "" } -) -const handleSend = async (T: TestBase, data: SendData) => { - if (data.type === 'event') { - throw new Error("unsupported event type") - } - if (data.pub !== T.app.publicKey) { - throw new Error("invalid pub") - } - const j = JSON.parse(data.content) as TransportRequest - const app = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const nostrUser = await T.main.storage.applicationStorage.GetOrCreateNostrAppUser(app, j.authIdentifier) - const userCtx = { app_id: app.app_id, user_id: nostrUser.user.user_id, app_user_id: nostrUser.identifier } - switch (j.rpcName) { - case 'GetUserInfo': - const infoRes = await T.main.appUserManager.GetUserInfo(userCtx) - return { ...infoRes, status: "OK", requestId: j.requestId } - case 'NewInvoice': - const genInvoiceRes = await T.main.appUserManager.NewInvoice(userCtx, j.body) - return { ...genInvoiceRes, status: "OK", requestId: j.requestId } - case 'PayInvoice': - const payRes = await T.main.appUserManager.PayInvoice(userCtx, j.body) - return { ...payRes, status: "OK", requestId: j.requestId } - case 'GetLiveUserOperations': - return - default: - console.log(data) - throw new Error("unsupported rpcName " + j.rpcName) - } +import { getLogger } from '../services/helpers/logger.js' +import { initMainHandler } from '../services/main/init.js' +import { LoadTestSettingsFromEnv } from '../services/main/settings.js' +import { SendData } from '../services/nostr/handler.js' +import { TestBase, TestUserData } from './testBase.js' +import * as Types from '../../proto/autogenerated/ts/types.js' + +export const initBootstrappedInstance = async (T: TestBase) => { + const settings = LoadTestSettingsFromEnv() + settings.lndSettings.useOnlyLiquidityProvider = true + settings.lndSettings.liquidityProviderPub = T.app.publicKey + settings.lndSettings.mainNode = settings.lndSettings.thirdNode + const initialized = await initMainHandler(getLogger({ component: "bootstrapped" }), settings) + if (!initialized) { + throw new Error("failed to initialize bootstrapped main handler") + } + const { mainHandler: bootstrapped, liquidityProviderInfo, liquidityProviderApp } = initialized + T.main.attachNostrSend(async (_, data, r) => { + if (data.type === 'event') { + throw new Error("unsupported event type") + } + if (data.pub !== liquidityProviderInfo.publicKey) { + throw new Error("invalid pub " + data.pub + " expected " + liquidityProviderInfo.publicKey) + } + const j = JSON.parse(data.content) as { requestId: string } + console.log("sending new operation to provider") + bootstrapped.liquidProvider.onEvent(j, T.app.publicKey) + }) + bootstrapped.liquidProvider.attachNostrSend(async (_, data, r) => { + const res = await handleSend(T, data) + if (data.type === 'event') { + throw new Error("unsupported event type") + } + if (!res) { + return + } + bootstrapped.liquidProvider.onEvent(res, data.pub) + }) + bootstrapped.liquidProvider.setNostrInfo({ clientId: liquidityProviderInfo.clientId, myPub: liquidityProviderInfo.publicKey }) + await new Promise(res => { + const interval = setInterval(() => { + if (bootstrapped.liquidProvider.CanProviderHandle({ action: 'receive', amount: 2000 })) { + clearInterval(interval) + res() + } else { + console.log("waiting for provider to be able to handle the request") + } + }, 500) + }) + const bUser = await bootstrapped.applicationManager.AddAppUser(liquidityProviderApp.appId, { identifier: "user1_bootstrapped", balance: 0, fail_if_exists: true }) + const bootstrappedUser: TestUserData = { userId: bUser.info.userId, appUserIdentifier: bUser.identifier, appId: liquidityProviderApp.appId } + return { + bootstrapped, liquidityProviderInfo, liquidityProviderApp, bootstrappedUser, stop: () => { + bootstrapped.Stop() + } + } +} +type TransportRequest = { requestId: string, authIdentifier: string } & ( + { rpcName: 'GetUserInfo' } | + { rpcName: 'NewInvoice', body: Types.NewInvoiceRequest } | + { rpcName: 'PayInvoice', body: Types.PayInvoiceRequest } | + { rpcName: 'GetLiveUserOperations' } | + { rpcName: "" } +) +const handleSend = async (T: TestBase, data: SendData) => { + if (data.type === 'event') { + throw new Error("unsupported event type") + } + if (data.pub !== T.app.publicKey) { + throw new Error("invalid pub") + } + const j = JSON.parse(data.content) as TransportRequest + const app = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const nostrUser = await T.main.storage.applicationStorage.GetOrCreateNostrAppUser(app, j.authIdentifier) + const userCtx = { app_id: app.app_id, user_id: nostrUser.user.user_id, app_user_id: nostrUser.identifier } + switch (j.rpcName) { + case 'GetUserInfo': + const infoRes = await T.main.appUserManager.GetUserInfo(userCtx) + return { ...infoRes, status: "OK", requestId: j.requestId } + case 'NewInvoice': + const genInvoiceRes = await T.main.appUserManager.NewInvoice(userCtx, j.body) + return { ...genInvoiceRes, status: "OK", requestId: j.requestId } + case 'PayInvoice': + const payRes = await T.main.appUserManager.PayInvoice(userCtx, j.body) + return { ...payRes, status: "OK", requestId: j.requestId } + case 'GetLiveUserOperations': + return + default: + console.log(data) + throw new Error("unsupported rpcName " + j.rpcName) + } } \ No newline at end of file diff --git a/src/tests/spamExternalPayments.spec.ts b/src/tests/spamExternalPayments.spec.ts index 6e080469..6e2390ac 100644 --- a/src/tests/spamExternalPayments.spec.ts +++ b/src/tests/spamExternalPayments.spec.ts @@ -1,43 +1,43 @@ -import { disableLoggers } from '../services/helpers/logger.js' -import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' -import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' -export const ignore = false - -export default async (T: TestBase) => { - disableLoggers([], ["EventsLogManager", "htlcTracker", "watchdog"]) - await safelySetUserBalance(T, T.user1, 2000) - await testSpamExternalPayment(T) - await runSanityCheck(T) -} - - -const testSpamExternalPayment = async (T: TestBase) => { - T.d("starting testSpamExternalPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const invoices = await Promise.all(new Array(10).fill(0).map(() => T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry))) - T.d("generated 10 500 sats invoices for external node") - const res = await Promise.all(invoices.map(async (invoice, i) => { - try { - const result = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application) - return { success: true, result } - } catch (e: any) { - return { success: false, err: e } - } - })) - - const successfulPayments = res.filter(r => r.success) - const failedPayments = res.filter(r => !r.success) - failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement")) - successfulPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, network_fee: 1, service_fee: 3 })) - expect(successfulPayments.length).to.be.equal(3) - expect(failedPayments.length).to.be.equal(7) - T.d("3 payments succeeded, 7 failed as expected") - const u = await T.main.storage.userStorage.GetUser(T.user1.userId) - const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) - expect(u.balance_sats).to.be.equal(488) - T.d("user1 balance is now 488 (2000 - (500 + 3 fee + 1 routing) * 3)") - expect(owner.balance_sats).to.be.equal(9) - T.d("app balance is 9 sats") - -} - +import { disableLoggers } from '../services/helpers/logger.js' +import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' +import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' +export const ignore = false + +export default async (T: TestBase) => { + disableLoggers([], ["EventsLogManager", "htlcTracker", "watchdog"]) + await safelySetUserBalance(T, T.user1, 2000) + await testSpamExternalPayment(T) + await runSanityCheck(T) +} + + +const testSpamExternalPayment = async (T: TestBase) => { + T.d("starting testSpamExternalPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const invoices = await Promise.all(new Array(10).fill(0).map(() => T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry))) + T.d("generated 10 500 sats invoices for external node") + const res = await Promise.all(invoices.map(async (invoice, i) => { + try { + const result = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application) + return { success: true, result } + } catch (e: any) { + return { success: false, err: e } + } + })) + + const successfulPayments = res.filter(r => r.success) + const failedPayments = res.filter(r => !r.success) + failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement")) + successfulPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, network_fee: 1, service_fee: 3 })) + expect(successfulPayments.length).to.be.equal(3) + expect(failedPayments.length).to.be.equal(7) + T.d("3 payments succeeded, 7 failed as expected") + const u = await T.main.storage.userStorage.GetUser(T.user1.userId) + const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) + expect(u.balance_sats).to.be.equal(488) + T.d("user1 balance is now 488 (2000 - (500 + 3 fee + 1 routing) * 3)") + expect(owner.balance_sats).to.be.equal(9) + T.d("app balance is 9 sats") + +} + diff --git a/src/tests/spamMixedPayments.spec.ts b/src/tests/spamMixedPayments.spec.ts index 0abf4594..db361e6c 100644 --- a/src/tests/spamMixedPayments.spec.ts +++ b/src/tests/spamMixedPayments.spec.ts @@ -1,51 +1,51 @@ -import { disableLoggers } from '../services/helpers/logger.js' -import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' -import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' -import * as Types from '../../proto/autogenerated/ts/types.js' -export const ignore = false - -export default async (T: TestBase) => { - disableLoggers([], ["EventsLogManager", "htlcTracker", "watchdog"]) - await safelySetUserBalance(T, T.user1, 2000) - await testSpamExternalPayment(T) - await runSanityCheck(T) -} - - -const testSpamExternalPayment = async (T: TestBase) => { - T.d("starting testSpamExternalPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const invoicesForExternal = await Promise.all(new Array(5).fill(0).map(() => T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry))) - const invoicesForUser2 = await Promise.all(new Array(5).fill(0).map(() => T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 500, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry }))) - const invoices = invoicesForExternal.map(i => i.payRequest).concat(invoicesForUser2.map(i => i.invoice)) - T.d("generated 10 500 sats mixed invoices between external node and user 2") - const res = await Promise.all(invoices.map(async (invoice, i) => { - try { - const result = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice, amount: 0 }, application) - return { success: true, result } - } catch (e: any) { - return { success: false, err: e } - } - })) - - const successfulPayments = res.filter(r => r.success) as { success: true, result: Types.PayInvoiceResponse }[] - const failedPayments = res.filter(r => !r.success) - failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement")) - expect(successfulPayments.length).to.be.equal(3) - expect(failedPayments.length).to.be.equal(7) - T.d("3 payments succeeded, 7 failed as expected") - const networkPayments = successfulPayments.filter(s => s.result.network_fee > 0) - const internalPayments = successfulPayments.filter(s => s.result.network_fee === 0) - expect(networkPayments.length).to.be.equal(1) - expect(internalPayments.length).to.be.equal(2) - networkPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, service_fee: 3, network_fee: 1 })) - internalPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, service_fee: 3 })) - const u = await T.main.storage.userStorage.GetUser(T.user1.userId) - const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) - expect(u.balance_sats).to.be.equal(490) - T.d("user1 balance is now 490 (2000 - (500 + 3 fee + 1 routing + (500 + 3fee) * 2))") - expect(owner.balance_sats).to.be.equal(9) - T.d("app balance is 9 sats") - -} - +import { disableLoggers } from '../services/helpers/logger.js' +import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' +import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' +import * as Types from '../../proto/autogenerated/ts/types.js' +export const ignore = false + +export default async (T: TestBase) => { + disableLoggers([], ["EventsLogManager", "htlcTracker", "watchdog"]) + await safelySetUserBalance(T, T.user1, 2000) + await testSpamExternalPayment(T) + await runSanityCheck(T) +} + + +const testSpamExternalPayment = async (T: TestBase) => { + T.d("starting testSpamExternalPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const invoicesForExternal = await Promise.all(new Array(5).fill(0).map(() => T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry))) + const invoicesForUser2 = await Promise.all(new Array(5).fill(0).map(() => T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 500, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry }))) + const invoices = invoicesForExternal.map(i => i.payRequest).concat(invoicesForUser2.map(i => i.invoice)) + T.d("generated 10 500 sats mixed invoices between external node and user 2") + const res = await Promise.all(invoices.map(async (invoice, i) => { + try { + const result = await T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice, amount: 0 }, application) + return { success: true, result } + } catch (e: any) { + return { success: false, err: e } + } + })) + + const successfulPayments = res.filter(r => r.success) as { success: true, result: Types.PayInvoiceResponse }[] + const failedPayments = res.filter(r => !r.success) + failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement")) + expect(successfulPayments.length).to.be.equal(3) + expect(failedPayments.length).to.be.equal(7) + T.d("3 payments succeeded, 7 failed as expected") + const networkPayments = successfulPayments.filter(s => s.result.network_fee > 0) + const internalPayments = successfulPayments.filter(s => s.result.network_fee === 0) + expect(networkPayments.length).to.be.equal(1) + expect(internalPayments.length).to.be.equal(2) + networkPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, service_fee: 3, network_fee: 1 })) + internalPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, service_fee: 3 })) + const u = await T.main.storage.userStorage.GetUser(T.user1.userId) + const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) + expect(u.balance_sats).to.be.equal(490) + T.d("user1 balance is now 490 (2000 - (500 + 3 fee + 1 routing + (500 + 3fee) * 2))") + expect(owner.balance_sats).to.be.equal(9) + T.d("app balance is 9 sats") + +} + diff --git a/src/tests/testBase.ts b/src/tests/testBase.ts index a130703f..e6e0cbc5 100644 --- a/src/tests/testBase.ts +++ b/src/tests/testBase.ts @@ -1,105 +1,105 @@ -import 'dotenv/config' // TODO - test env -import chai from 'chai' -import { AppData, initMainHandler } from '../services/main/init.js' -import Main from '../services/main/index.js' -import Storage from '../services/storage/index.js' -import { User } from '../services/storage/entity/User.js' -import { LoadMainSettingsFromEnv, LoadTestSettingsFromEnv, MainSettings } from '../services/main/settings.js' -import chaiString from 'chai-string' -import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' -import SanityChecker from '../services/main/sanityChecker.js' -import LND from '../services/lnd/lnd.js' -import { getLogger, resetDisabledLoggers } from '../services/helpers/logger.js' -import { LiquidityProvider } from '../services/lnd/liquidityProvider.js' -chai.use(chaiString) -export const expect = chai.expect -export type Describe = (message: string, failure?: boolean) => void -export type TestUserData = { - userId: string; - appUserIdentifier: string; - appId: string; - -} -export type TestBase = { - expect: Chai.ExpectStatic; - main: Main - app: AppData - user1: TestUserData - user2: TestUserData - externalAccessToMainLnd: LND - externalAccessToOtherLnd: LND - externalAccessToThirdLnd: LND - d: Describe -} - -export const SetupTest = async (d: Describe): Promise => { - const settings = LoadTestSettingsFromEnv() - const initialized = await initMainHandler(getLogger({ component: "mainForTest" }), settings) - if (!initialized) { - throw new Error("failed to initialize main handler") - } - const main = initialized.mainHandler - const app = initialized.apps[0] - const u1 = await main.applicationManager.AddAppUser(app.appId, { identifier: "user1", balance: 0, fail_if_exists: true }) - const u2 = await main.applicationManager.AddAppUser(app.appId, { identifier: "user2", balance: 0, fail_if_exists: true }) - const user1 = { userId: u1.info.userId, appUserIdentifier: u1.identifier, appId: app.appId } - const user2 = { userId: u2.info.userId, appUserIdentifier: u2.identifier, appId: app.appId } - - - const externalAccessToMainLnd = new LND(settings.lndSettings, new LiquidityProvider("", () => { }), console.log, console.log, () => { }, () => { }) - await externalAccessToMainLnd.Warmup() - - const otherLndSetting = { ...settings.lndSettings, mainNode: settings.lndSettings.otherNode } - const externalAccessToOtherLnd = new LND(otherLndSetting, new LiquidityProvider("", () => { }), console.log, console.log, () => { }, () => { }) - await externalAccessToOtherLnd.Warmup() - - const thirdLndSetting = { ...settings.lndSettings, mainNode: settings.lndSettings.thirdNode } - const externalAccessToThirdLnd = new LND(thirdLndSetting, new LiquidityProvider("", () => { }), console.log, console.log, () => { }, () => { }) - await externalAccessToThirdLnd.Warmup() - - - return { - expect, main, app, - user1, user2, - externalAccessToMainLnd, externalAccessToOtherLnd, externalAccessToThirdLnd, - d - } -} - -export const teardown = async (T: TestBase) => { - T.main.Stop() - T.externalAccessToMainLnd.Stop() - T.externalAccessToOtherLnd.Stop() - T.externalAccessToThirdLnd.Stop() - resetDisabledLoggers() - console.log("teardown") -} - -export const safelySetUserBalance = async (T: TestBase, user: TestUserData, amount: number) => { - const app = await T.main.storage.applicationStorage.GetApplication(user.appId) - const invoice = await T.main.paymentManager.NewInvoice(user.userId, { amountSats: amount, memo: "test" }, { linkedApplication: app, expiry: defaultInvoiceExpiry }) - await T.externalAccessToOtherLnd.PayInvoice(invoice.invoice, 0, 100) - const u = await T.main.storage.userStorage.GetUser(user.userId) - expect(u.balance_sats).to.be.equal(amount) - T.d(`user ${user.appUserIdentifier} balance is now ${amount}`) -} - -export const runSanityCheck = async (T: TestBase) => { - const sanityChecker = new SanityChecker(T.main.storage, T.main.lnd) - await sanityChecker.VerifyEventsLog() -} - -export const expectThrowsAsync = async (promise: Promise, errorMessage?: string) => { - let error: Error | null = null - try { - await promise - } - catch (err: any) { - error = err as Error - } - expect(error).to.be.an('Error') - console.log(error!.message) - if (errorMessage) { - expect(error!.message).to.equal(errorMessage) - } +import 'dotenv/config' // TODO - test env +import chai from 'chai' +import { AppData, initMainHandler } from '../services/main/init.js' +import Main from '../services/main/index.js' +import Storage from '../services/storage/index.js' +import { User } from '../services/storage/entity/User.js' +import { LoadMainSettingsFromEnv, LoadTestSettingsFromEnv, MainSettings } from '../services/main/settings.js' +import chaiString from 'chai-string' +import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' +import SanityChecker from '../services/main/sanityChecker.js' +import LND from '../services/lnd/lnd.js' +import { getLogger, resetDisabledLoggers } from '../services/helpers/logger.js' +import { LiquidityProvider } from '../services/lnd/liquidityProvider.js' +chai.use(chaiString) +export const expect = chai.expect +export type Describe = (message: string, failure?: boolean) => void +export type TestUserData = { + userId: string; + appUserIdentifier: string; + appId: string; + +} +export type TestBase = { + expect: Chai.ExpectStatic; + main: Main + app: AppData + user1: TestUserData + user2: TestUserData + externalAccessToMainLnd: LND + externalAccessToOtherLnd: LND + externalAccessToThirdLnd: LND + d: Describe +} + +export const SetupTest = async (d: Describe): Promise => { + const settings = LoadTestSettingsFromEnv() + const initialized = await initMainHandler(getLogger({ component: "mainForTest" }), settings) + if (!initialized) { + throw new Error("failed to initialize main handler") + } + const main = initialized.mainHandler + const app = initialized.apps[0] + const u1 = await main.applicationManager.AddAppUser(app.appId, { identifier: "user1", balance: 0, fail_if_exists: true }) + const u2 = await main.applicationManager.AddAppUser(app.appId, { identifier: "user2", balance: 0, fail_if_exists: true }) + const user1 = { userId: u1.info.userId, appUserIdentifier: u1.identifier, appId: app.appId } + const user2 = { userId: u2.info.userId, appUserIdentifier: u2.identifier, appId: app.appId } + + + const externalAccessToMainLnd = new LND(settings.lndSettings, new LiquidityProvider("", () => { }), console.log, console.log, () => { }, () => { }) + await externalAccessToMainLnd.Warmup() + + const otherLndSetting = { ...settings.lndSettings, mainNode: settings.lndSettings.otherNode } + const externalAccessToOtherLnd = new LND(otherLndSetting, new LiquidityProvider("", () => { }), console.log, console.log, () => { }, () => { }) + await externalAccessToOtherLnd.Warmup() + + const thirdLndSetting = { ...settings.lndSettings, mainNode: settings.lndSettings.thirdNode } + const externalAccessToThirdLnd = new LND(thirdLndSetting, new LiquidityProvider("", () => { }), console.log, console.log, () => { }, () => { }) + await externalAccessToThirdLnd.Warmup() + + + return { + expect, main, app, + user1, user2, + externalAccessToMainLnd, externalAccessToOtherLnd, externalAccessToThirdLnd, + d + } +} + +export const teardown = async (T: TestBase) => { + T.main.Stop() + T.externalAccessToMainLnd.Stop() + T.externalAccessToOtherLnd.Stop() + T.externalAccessToThirdLnd.Stop() + resetDisabledLoggers() + console.log("teardown") +} + +export const safelySetUserBalance = async (T: TestBase, user: TestUserData, amount: number) => { + const app = await T.main.storage.applicationStorage.GetApplication(user.appId) + const invoice = await T.main.paymentManager.NewInvoice(user.userId, { amountSats: amount, memo: "test" }, { linkedApplication: app, expiry: defaultInvoiceExpiry }) + await T.externalAccessToOtherLnd.PayInvoice(invoice.invoice, 0, 100) + const u = await T.main.storage.userStorage.GetUser(user.userId) + expect(u.balance_sats).to.be.equal(amount) + T.d(`user ${user.appUserIdentifier} balance is now ${amount}`) +} + +export const runSanityCheck = async (T: TestBase) => { + const sanityChecker = new SanityChecker(T.main.storage, T.main.lnd) + await sanityChecker.VerifyEventsLog() +} + +export const expectThrowsAsync = async (promise: Promise, errorMessage?: string) => { + let error: Error | null = null + try { + await promise + } + catch (err: any) { + error = err as Error + } + expect(error).to.be.an('Error') + console.log(error!.message) + if (errorMessage) { + expect(error!.message).to.equal(errorMessage) + } } \ No newline at end of file diff --git a/src/tests/testRunner.ts b/src/tests/testRunner.ts index b2517250..18d8e66f 100644 --- a/src/tests/testRunner.ts +++ b/src/tests/testRunner.ts @@ -1,85 +1,85 @@ - -import { globby } from 'globby' -import { setupNetwork } from './networkSetup.js' -import { Describe, SetupTest, teardown, TestBase } from './testBase.js' -type TestModule = { - ignore?: boolean - dev?: boolean - default: (T: TestBase) => Promise -} -let failures = 0 -const getDescribe = (fileName: string): Describe => { - return (message, failure) => { - if (failure) { - failures++ - console.error(redConsole, fileName, ": FAILURE ", message, resetConsole) - } else { - console.log(greenConsole, fileName, ":", message, resetConsole) - } - } -} - -const start = async () => { - await setupNetwork() - const files = await globby(["**/*.spec.js", "!**/node_modules/**"]) - const modules: { file: string, module: TestModule }[] = [] - let devModule = -1 - for (const file of files) { - const module = await import(`./${file.slice("build/src/tests/".length)}`) as TestModule - modules.push({ module, file }) - if (module.dev) { - console.log("dev module found", file) - if (devModule !== -1) { - throw new Error("there are multiple dev modules") - } - devModule = modules.length - 1 - } - } - if (devModule !== -1) { - console.log("running dev module") - await runTestFile(modules[devModule].file, modules[devModule].module) - } else { - console.log("running all tests") - for (const { file, module } of modules) { - await runTestFile(file, module) - } - } - console.log(failures) - if (failures) { - throw new Error("there have been " + failures + " failures in all tests") - } else { - console.log(greenConsole, "there have been 0 failures in all tests", resetConsole) - } - -} - -const runTestFile = async (fileName: string, mod: TestModule) => { - console.log(fileName) - const d = getDescribe(fileName) - if (mod.ignore) { - d("-----ignoring this file-----") - return - } - if (mod.dev) { - d("-----running only this file-----") - } - const T = await SetupTest(d) - try { - d("test starting") - await mod.default(T) - d("test finished") - await teardown(T) - } catch (e: any) { - d(e, true) - await teardown(T) - } - if (mod.dev) { - d("dev mod is not allowed to in CI, failing for precaution", true) - } -} - - -const greenConsole = "\x1b[32m" -const redConsole = "\x1b[31m" -const resetConsole = "\x1b[0m" + +import { globby } from 'globby' +import { setupNetwork } from './networkSetup.js' +import { Describe, SetupTest, teardown, TestBase } from './testBase.js' +type TestModule = { + ignore?: boolean + dev?: boolean + default: (T: TestBase) => Promise +} +let failures = 0 +const getDescribe = (fileName: string): Describe => { + return (message, failure) => { + if (failure) { + failures++ + console.error(redConsole, fileName, ": FAILURE ", message, resetConsole) + } else { + console.log(greenConsole, fileName, ":", message, resetConsole) + } + } +} + +const start = async () => { + await setupNetwork() + const files = await globby(["**/*.spec.js", "!**/node_modules/**"]) + const modules: { file: string, module: TestModule }[] = [] + let devModule = -1 + for (const file of files) { + const module = await import(`./${file.slice("build/src/tests/".length)}`) as TestModule + modules.push({ module, file }) + if (module.dev) { + console.log("dev module found", file) + if (devModule !== -1) { + throw new Error("there are multiple dev modules") + } + devModule = modules.length - 1 + } + } + if (devModule !== -1) { + console.log("running dev module") + await runTestFile(modules[devModule].file, modules[devModule].module) + } else { + console.log("running all tests") + for (const { file, module } of modules) { + await runTestFile(file, module) + } + } + console.log(failures) + if (failures) { + throw new Error("there have been " + failures + " failures in all tests") + } else { + console.log(greenConsole, "there have been 0 failures in all tests", resetConsole) + } + +} + +const runTestFile = async (fileName: string, mod: TestModule) => { + console.log(fileName) + const d = getDescribe(fileName) + if (mod.ignore) { + d("-----ignoring this file-----") + return + } + if (mod.dev) { + d("-----running only this file-----") + } + const T = await SetupTest(d) + try { + d("test starting") + await mod.default(T) + d("test finished") + await teardown(T) + } catch (e: any) { + d(e, true) + await teardown(T) + } + if (mod.dev) { + d("dev mod is not allowed to in CI, failing for precaution", true) + } +} + + +const greenConsole = "\x1b[32m" +const redConsole = "\x1b[31m" +const resetConsole = "\x1b[0m" start() \ No newline at end of file diff --git a/src/tests/userPayment.spec.ts b/src/tests/userPayment.spec.ts index 12afbe83..7e807097 100644 --- a/src/tests/userPayment.spec.ts +++ b/src/tests/userPayment.spec.ts @@ -1,18 +1,18 @@ -import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' -import { runSanityCheck, safelySetUserBalance, TestBase } from './testBase.js' -export const ignore = false -export const dev = false - -export default async (T: TestBase) => { - await safelySetUserBalance(T, T.user1, 2000) - await testSuccessfulUserPaymentToExternalNode(T) - await testSuccessfulUserPaymentToExternalNode(T) - await runSanityCheck(T) -} - -const testSuccessfulUserPaymentToExternalNode = async (T: TestBase) => { - T.d("starting testSuccessfulUserPaymentToExternalNode") - const invoice = await T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry) - const payment = await T.main.appUserManager.PayInvoice({ app_id: T.user1.appId, user_id: T.user1.userId, app_user_id: T.user1.appUserIdentifier }, { invoice: invoice.payRequest, amount: 0 }) - T.d("paid 500 sats invoice from user1 to external node") +import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' +import { runSanityCheck, safelySetUserBalance, TestBase } from './testBase.js' +export const ignore = false +export const dev = false + +export default async (T: TestBase) => { + await safelySetUserBalance(T, T.user1, 2000) + await testSuccessfulUserPaymentToExternalNode(T) + await testSuccessfulUserPaymentToExternalNode(T) + await runSanityCheck(T) +} + +const testSuccessfulUserPaymentToExternalNode = async (T: TestBase) => { + T.d("starting testSuccessfulUserPaymentToExternalNode") + const invoice = await T.externalAccessToOtherLnd.NewInvoice(500, "test", defaultInvoiceExpiry) + const payment = await T.main.appUserManager.PayInvoice({ app_id: T.user1.appId, user_id: T.user1.userId, app_user_id: T.user1.appUserIdentifier }, { invoice: invoice.payRequest, amount: 0 }) + T.d("paid 500 sats invoice from user1 to external node") } \ No newline at end of file diff --git a/src/tests/userToUserPayment.spec.ts b/src/tests/userToUserPayment.spec.ts index 7f01c9a2..808cc62c 100644 --- a/src/tests/userToUserPayment.spec.ts +++ b/src/tests/userToUserPayment.spec.ts @@ -1,35 +1,35 @@ -import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' -import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' -export const ignore = false -export const dev = false -export default async (T: TestBase) => { - await safelySetUserBalance(T, T.user1, 2000) - await testSuccessfulU2UPayment(T) - await testFailedInternalPayment(T) - await runSanityCheck(T) -} - -const testSuccessfulU2UPayment = async (T: TestBase) => { - T.d("starting testSuccessfulU2UPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - const sentAmt = await T.main.paymentManager.SendUserToUserPayment(T.user1.userId, T.user2.userId, 1000, application) - expect(sentAmt.amount).to.be.equal(1000) - T.d("paid 1000 sats u2u from user1 to user2") - const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) - const u2 = await T.main.storage.userStorage.GetUser(T.user2.userId) - const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) - expect(u2.balance_sats).to.be.equal(1000) - T.d("user2 balance is 1000") - expect(u1.balance_sats).to.be.equal(994) - T.d("user1 balance is 994 cuz he paid 6 sats fee") - expect(owner.balance_sats).to.be.equal(6) - T.d("app balance is 6 sats") -} - -const testFailedInternalPayment = async (T: TestBase) => { - T.d("starting testFailedInternalPayment") - const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) - await expectThrowsAsync(T.main.paymentManager.SendUserToUserPayment(T.user1.userId, T.user2.userId, 1000, application), "not enough balance to send payment") - T.d("payment failed as expected, with the expected error message") -} - +import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js' +import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalance, SetupTest, TestBase } from './testBase.js' +export const ignore = false +export const dev = false +export default async (T: TestBase) => { + await safelySetUserBalance(T, T.user1, 2000) + await testSuccessfulU2UPayment(T) + await testFailedInternalPayment(T) + await runSanityCheck(T) +} + +const testSuccessfulU2UPayment = async (T: TestBase) => { + T.d("starting testSuccessfulU2UPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + const sentAmt = await T.main.paymentManager.SendUserToUserPayment(T.user1.userId, T.user2.userId, 1000, application) + expect(sentAmt.amount).to.be.equal(1000) + T.d("paid 1000 sats u2u from user1 to user2") + const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) + const u2 = await T.main.storage.userStorage.GetUser(T.user2.userId) + const owner = await T.main.storage.userStorage.GetUser(application.owner.user_id) + expect(u2.balance_sats).to.be.equal(1000) + T.d("user2 balance is 1000") + expect(u1.balance_sats).to.be.equal(994) + T.d("user1 balance is 994 cuz he paid 6 sats fee") + expect(owner.balance_sats).to.be.equal(6) + T.d("app balance is 6 sats") +} + +const testFailedInternalPayment = async (T: TestBase) => { + T.d("starting testFailedInternalPayment") + const application = await T.main.storage.applicationStorage.GetApplication(T.app.appId) + await expectThrowsAsync(T.main.paymentManager.SendUserToUserPayment(T.user1.userId, T.user2.userId, 1000, application), "not enough balance to send payment") + T.d("payment failed as expected, with the expected error message") +} + diff --git a/static/backup.html b/static/backup.html index 61dc63a5..cc8d4f42 100644 --- a/static/backup.html +++ b/static/backup.html @@ -67,7 +67,7 @@ diff --git a/static/liquidity.html b/static/liquidity.html index e31a60d7..249db779 100644 --- a/static/liquidity.html +++ b/static/liquidity.html @@ -59,7 +59,7 @@ -
+
@@ -67,7 +67,7 @@ diff --git a/static/seed.html b/static/seed.html index 97b07183..b1a71241 100644 --- a/static/seed.html +++ b/static/seed.html @@ -156,7 +156,7 @@ id="next-button" class="push-button hidden-button" onclick="location.href='connect.html'" - style="margin-top: 92px" + style="margin-top: 60px" > Next diff --git a/tsconfig.json b/tsconfig.json index 1bff3bae..5db6f82d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,71 +1,71 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig.json to read more about this file */ - /* Basic Options */ - // "incremental": true, /* Enable incremental compilation */ - "target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, - "module": "ES2020" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - // "lib": [], /* Specify library files to be included in the compilation. */ - // "allowJs": true, /* Allow javascript files to be compiled. */ - // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - "sourceMap": true /* Generates corresponding '.map' file. */, - // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "build" /* Redirect output structure to the directory. */, - // "rootDir": "src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, - // "composite": true, /* Enable project compilation */ - // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ - // "removeComments": true, /* Do not emit comments to output. */ - // "noEmit": true, /* Do not emit outputs. */ - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ - // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ - // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ - /* Strict Type-Checking Options */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* Enable strict null checks. */ - // "strictFunctionTypes": true, /* Enable strict checking of function types. */ - // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ - "strictPropertyInitialization": false /* Enable strict checking of property initialization in classes. */, - // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ - // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ - /* Additional Checks */ - // "noUnusedLocals": true, /* Report errors on unused locals. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ - /* Module Resolution Options */ - "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ - // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ - // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ - // "typeRoots": [], /* List of folders to include type definitions from. */ - // "types": [], /* Type declaration files to be included in compilation. */ - // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, - // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - /* Source Map Options */ - // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ - // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ - /* Experimental Options */ - "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, - "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, - /* Advanced Options */ - "skipLibCheck": true /* Skip type checking of declaration files. */, - "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ - }, - "ts-node": { - "esm": true - }, - "exclude": [ - "./tests" - ], -} +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "module": "ES2020" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "sourceMap": true /* Generates corresponding '.map' file. */, + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "build" /* Redirect output structure to the directory. */, + // "rootDir": "src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + "strictPropertyInitialization": false /* Enable strict checking of property initialization in classes. */, + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an 'override' modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ + /* Module Resolution Options */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + /* Experimental Options */ + "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, + "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */, + /* Advanced Options */ + "skipLibCheck": true /* Skip type checking of declaration files. */, + "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ + }, + "ts-node": { + "esm": true + }, + "exclude": [ + "./tests" + ], +}