diff --git a/package.json b/package.json index 46b800f0..30b006c4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": " tsc && node build/src/testRunner.js", - "start": "tsc && cd build && node src/index.js", + "start": "tsc && node build/src/index.js", "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/* ", @@ -68,4 +68,4 @@ "ts-node": "10.7.0", "typescript": "4.5.2" } -} +} \ No newline at end of file diff --git a/proto/autogenerated/debug.txt b/proto/autogenerated/debug.txt index fccff04b..a3789813 100644 --- a/proto/autogenerated/debug.txt +++ b/proto/autogenerated/debug.txt @@ -1,5 +1,5 @@ -([]*main.Method) (len=16 cap=16) { - (*main.Method)(0xc0002be730)({ +([]*main.Method) (len=18 cap=32) { + (*main.Method)(0xc0002c2730)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -9,8 +9,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0002caa80)({ - authType: (*main.supportedAuth)(0xc000428750)({ + opts: (*main.methodOptions)(0xc0002ced20)({ + authType: (*main.supportedAuth)(0xc00045efc0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -26,7 +26,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002be780)({ + (*main.Method)(0xc0002c2780)({ in: (main.MethodMessage) { name: (string) (len=25) "EncryptionExchangeRequest", hasZeroFields: (bool) false @@ -36,8 +36,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0002cac00)({ - authType: (*main.supportedAuth)(0xc000428810)({ + opts: (*main.methodOptions)(0xc0002ceea0)({ + authType: (*main.supportedAuth)(0xc00045f080)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -53,7 +53,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002be7d0)({ + (*main.Method)(0xc0002c27d0)({ in: (main.MethodMessage) { name: (string) (len=17) "LndGetInfoRequest", hasZeroFields: (bool) false @@ -63,8 +63,8 @@ name: (string) (len=18) "LndGetInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cad80)({ - authType: (*main.supportedAuth)(0xc0004288a0)({ + opts: (*main.methodOptions)(0xc0002cf020)({ + authType: (*main.supportedAuth)(0xc00045f110)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", encrypted: (bool) true, @@ -81,7 +81,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002be820)({ + (*main.Method)(0xc0002c2820)({ in: (main.MethodMessage) { name: (string) (len=14) "AddUserRequest", hasZeroFields: (bool) false @@ -91,8 +91,8 @@ name: (string) (len=15) "AddUserResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002caf00)({ - authType: (*main.supportedAuth)(0xc000428930)({ + opts: (*main.methodOptions)(0xc0002cf1a0)({ + authType: (*main.supportedAuth)(0xc00045f1a0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -108,7 +108,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002be870)({ + (*main.Method)(0xc0002c2870)({ in: (main.MethodMessage) { name: (string) (len=15) "AuthUserRequest", hasZeroFields: (bool) false @@ -118,8 +118,8 @@ name: (string) (len=16) "AuthUserResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cb080)({ - authType: (*main.supportedAuth)(0xc0004289c0)({ + opts: (*main.methodOptions)(0xc0002cf320)({ + authType: (*main.supportedAuth)(0xc00045f230)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -135,7 +135,63 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002be910)({ + (*main.Method)(0xc0002c28c0)({ + 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)(0xc0002cf500)({ + authType: (*main.supportedAuth)(0xc00045f2f0)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + encrypted: (bool) false, + context: (map[string]string) (len=1) { + (string) (len=7) "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 + }) + }), + (*main.Method)(0xc0002c2910)({ + 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)(0xc0002cf6e0)({ + authType: (*main.supportedAuth)(0xc00045f380)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + encrypted: (bool) false, + context: (map[string]string) (len=1) { + (string) (len=7) "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 + }) + }), + (*main.Method)(0xc0002c29b0)({ in: (main.MethodMessage) { name: (string) (len=17) "NewAddressRequest", hasZeroFields: (bool) false @@ -145,8 +201,8 @@ name: (string) (len=18) "NewAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cb260)({ - authType: (*main.supportedAuth)(0xc000428a80)({ + opts: (*main.methodOptions)(0xc0002cf8c0)({ + authType: (*main.supportedAuth)(0xc00045f410)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -163,7 +219,7 @@ nostr: (bool) true }) }), - (*main.Method)(0xc0002be9b0)({ + (*main.Method)(0xc0002c2a50)({ in: (main.MethodMessage) { name: (string) (len=17) "PayAddressRequest", hasZeroFields: (bool) false @@ -173,8 +229,8 @@ name: (string) (len=18) "PayAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cb440)({ - authType: (*main.supportedAuth)(0xc000428b10)({ + opts: (*main.methodOptions)(0xc0002cfaa0)({ + authType: (*main.supportedAuth)(0xc00045f4a0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -191,7 +247,7 @@ nostr: (bool) true }) }), - (*main.Method)(0xc0002bea50)({ + (*main.Method)(0xc0002c2af0)({ in: (main.MethodMessage) { name: (string) (len=17) "NewInvoiceRequest", hasZeroFields: (bool) false @@ -201,8 +257,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cb620)({ - authType: (*main.supportedAuth)(0xc000428ba0)({ + opts: (*main.methodOptions)(0xc0002cfc80)({ + authType: (*main.supportedAuth)(0xc00045f530)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -219,7 +275,7 @@ nostr: (bool) true }) }), - (*main.Method)(0xc0002beaf0)({ + (*main.Method)(0xc0002c2b90)({ in: (main.MethodMessage) { name: (string) (len=17) "PayInvoiceRequest", hasZeroFields: (bool) false @@ -229,8 +285,8 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cb800)({ - authType: (*main.supportedAuth)(0xc000428c30)({ + opts: (*main.methodOptions)(0xc0002cfe60)({ + authType: (*main.supportedAuth)(0xc00045f5c0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -247,7 +303,7 @@ nostr: (bool) true }) }), - (*main.Method)(0xc0002beb90)({ + (*main.Method)(0xc0002c2c30)({ in: (main.MethodMessage) { name: (string) (len=18) "OpenChannelRequest", hasZeroFields: (bool) false @@ -257,8 +313,8 @@ name: (string) (len=19) "OpenChannelResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cb9e0)({ - authType: (*main.supportedAuth)(0xc000428cc0)({ + opts: (*main.methodOptions)(0xc000464060)({ + authType: (*main.supportedAuth)(0xc00045f650)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -275,7 +331,7 @@ nostr: (bool) true }) }), - (*main.Method)(0xc0002bec30)({ + (*main.Method)(0xc0002c2cd0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -285,8 +341,8 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cbbc0)({ - authType: (*main.supportedAuth)(0xc000428d50)({ + opts: (*main.methodOptions)(0xc000464240)({ + authType: (*main.supportedAuth)(0xc00045f6e0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -303,7 +359,7 @@ nostr: (bool) true }) }), - (*main.Method)(0xc0002becd0)({ + (*main.Method)(0xc0002c2d70)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -313,8 +369,8 @@ name: (string) (len=25) "LnurlWithdrawInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002cbf20)({ - authType: (*main.supportedAuth)(0xc000428ea0)({ + opts: (*main.methodOptions)(0xc0004645a0)({ + authType: (*main.supportedAuth)(0xc00045f830)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -332,7 +388,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002bed70)({ + (*main.Method)(0xc0002c2e10)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -342,8 +398,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0004302a0)({ - authType: (*main.supportedAuth)(0xc000428ff0)({ + opts: (*main.methodOptions)(0xc000464900)({ + authType: (*main.supportedAuth)(0xc00045f980)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -362,7 +418,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002bee10)({ + (*main.Method)(0xc0002c2eb0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -372,8 +428,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000430600)({ - authType: (*main.supportedAuth)(0xc000429110)({ + opts: (*main.methodOptions)(0xc000464c60)({ + authType: (*main.supportedAuth)(0xc00045faa0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -391,7 +447,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002beeb0)({ + (*main.Method)(0xc0002c2f50)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -401,8 +457,8 @@ name: (string) (len=22) "HandleLnurlPayResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000430960)({ - authType: (*main.supportedAuth)(0xc000429260)({ + opts: (*main.methodOptions)(0xc000464fc0)({ + authType: (*main.supportedAuth)(0xc00045fbf0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -421,7 +477,7 @@ nostr: (bool) false }) }), - (*main.Method)(0xc0002bef50)({ + (*main.Method)(0xc0002c2ff0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -431,8 +487,8 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000430b40)({ - authType: (*main.supportedAuth)(0xc0004292f0)({ + opts: (*main.methodOptions)(0xc0004651a0)({ + authType: (*main.supportedAuth)(0xc00045fc80)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -451,8 +507,8 @@ }) } -([]*main.Enum) (len=1 cap=1) { - (*main.Enum)(0xc000428030)({ +([]*main.Enum) (len=2 cap=2) { + (*main.Enum)(0xc00045e840)({ name: (string) (len=11) "AddressType", values: ([]main.EnumValue) (len=3 cap=4) { (main.EnumValue) { @@ -468,249 +524,36 @@ name: (string) (len=14) "TAPROOT_PUBKEY" } } + }), + (*main.Enum)(0xc00045e8a0)({ + name: (string) (len=17) "UserOperationType", + values: ([]main.EnumValue) (len=4 cap=4) { + (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" + } + } }) } -(map[string]*main.Message) (len=22) { - (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc0002474c0)({ - fullName: (string) (len=18) "PayInvoiceResponse", - name: (string) (len=18) "PayInvoiceResponse", +(map[string]*main.Message) (len=27) { + (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000247400)({ + fullName: (string) (len=18) "NewAddressResponse", + name: (string) (len=18) "NewAddressResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003dd9e0)({ - 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 - }) - } - }), - (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc000247500)({ - fullName: (string) (len=18) "OpenChannelRequest", - name: (string) (len=18) "OpenChannelRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0003dda10)({ - 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)(0xc0003dda40)({ - 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)(0xc0003dda70)({ - 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)(0xc0003ddaa0)({ - 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 - }) - } - }), - (string) (len=15) "AuthUserRequest": (*main.Message)(0xc000247780)({ - fullName: (string) (len=15) "AuthUserRequest", - name: (string) (len=15) "AuthUserRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003ddf20)({ - 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)(0xc0003ddf50)({ - name: (string) (len=6) "secret", - 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)(0xc000247240)({ - fullName: (string) (len=25) "EncryptionExchangeRequest", - name: (string) (len=25) "EncryptionExchangeRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003dd710)({ - 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)(0xc0003dd740)({ - 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=17) "LndGetInfoRequest": (*main.Message)(0xc000247280)({ - fullName: (string) (len=17) "LndGetInfoRequest", - name: (string) (len=17) "LndGetInfoRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003dd770)({ - 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=18) "NewInvoiceResponse": (*main.Message)(0xc000247440)({ - fullName: (string) (len=18) "NewInvoiceResponse", - name: (string) (len=18) "NewInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003dd950)({ - 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=19) "OpenChannelResponse": (*main.Message)(0xc000247540)({ - fullName: (string) (len=19) "OpenChannelResponse", - name: (string) (len=19) "OpenChannelResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003ddad0)({ - 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=20) "LnurlPayInfoResponse": (*main.Message)(0xc000247680)({ - fullName: (string) (len=20) "LnurlPayInfoResponse", - name: (string) (len=20) "LnurlPayInfoResponse", - fields: ([]*main.Field) (len=5 cap=8) { - (*main.Field)(0xc0003ddce0)({ - 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)(0xc0003ddd10)({ - 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)(0xc0003ddd40)({ - 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)(0xc0003ddd70)({ - 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)(0xc0003ddda0)({ - 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 - }) - } - }), - (string) (len=14) "AddUserRequest": (*main.Message)(0xc000247700)({ - fullName: (string) (len=14) "AddUserRequest", - name: (string) (len=14) "AddUserRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0003dde30)({ - name: (string) (len=11) "callbackUrl", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003dde60)({ - 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)(0xc0003dde90)({ - name: (string) (len=6) "secret", - 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)(0xc000247380)({ - fullName: (string) (len=17) "PayAddressRequest", - name: (string) (len=17) "PayAddressRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0003dd830)({ + (*main.Field)(0xc0003ffce0)({ name: (string) (len=7) "address", kind: (string) (len=6) "string", isMap: (bool) false, @@ -718,19 +561,25 @@ isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false - }), - (*main.Field)(0xc0003dd860)({ - name: (string) (len=9) "amoutSats", - kind: (string) (len=5) "int64", + }) + } + }), + (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000247640)({ + fullName: (string) (len=17) "LnurlLinkResponse", + name: (string) (len=17) "LnurlLinkResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00045e000)({ + 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)(0xc0003dd890)({ - name: (string) (len=10) "targetConf", - kind: (string) (len=5) "int64", + (*main.Field)(0xc00045e030)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -739,11 +588,11 @@ }) } }), - (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000247400)({ + (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc0002474c0)({ fullName: (string) (len=17) "NewInvoiceRequest", name: (string) (len=17) "NewInvoiceRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003dd8f0)({ + (*main.Field)(0xc0003ffdd0)({ name: (string) (len=10) "amountSats", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -752,7 +601,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003dd920)({ + (*main.Field)(0xc0003ffe00)({ name: (string) (len=4) "memo", kind: (string) (len=6) "string", isMap: (bool) false, @@ -763,13 +612,40 @@ }) } }), - (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000247340)({ - fullName: (string) (len=18) "NewAddressResponse", - name: (string) (len=18) "NewAddressResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003dd800)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", + (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc000247900)({ + fullName: (string) (len=24) "GetUserOperationsRequest", + name: (string) (len=24) "GetUserOperationsRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc00045e540)({ + 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)(0xc00045e570)({ + 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)(0xc00045e5a0)({ + 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)(0xc00045e5d0)({ + name: (string) (len=16) "latestOutgoingTx", + kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, @@ -778,12 +654,12 @@ }) } }), - (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000247580)({ - fullName: (string) (len=17) "LnurlLinkResponse", - name: (string) (len=17) "LnurlLinkResponse", + (string) (len=15) "AuthUserRequest": (*main.Message)(0xc000247840)({ + fullName: (string) (len=15) "AuthUserRequest", + name: (string) (len=15) "AuthUserRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003ddb00)({ - name: (string) (len=5) "lnurl", + (*main.Field)(0xc00045e420)({ + name: (string) (len=4) "name", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -791,8 +667,8 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003ddb30)({ - name: (string) (len=2) "k1", + (*main.Field)(0xc00045e450)({ + name: (string) (len=6) "secret", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -802,11 +678,11 @@ }) } }), - (string) (len=16) "AuthUserResponse": (*main.Message)(0xc0002477c0)({ + (string) (len=16) "AuthUserResponse": (*main.Message)(0xc000247880)({ fullName: (string) (len=16) "AuthUserResponse", name: (string) (len=16) "AuthUserResponse", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003ddf80)({ + (*main.Field)(0xc00045e480)({ name: (string) (len=6) "userId", kind: (string) (len=6) "string", isMap: (bool) false, @@ -815,7 +691,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003ddfb0)({ + (*main.Field)(0xc00045e4b0)({ name: (string) (len=9) "authToken", kind: (string) (len=6) "string", isMap: (bool) false, @@ -826,17 +702,48 @@ }) } }), - (string) (len=5) "Empty": (*main.Message)(0xc000247200)({ - fullName: (string) (len=5) "Empty", - name: (string) (len=5) "Empty", - fields: ([]*main.Field) - }), - (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc0002472c0)({ - fullName: (string) (len=18) "LndGetInfoResponse", - name: (string) (len=18) "LndGetInfoResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003dd7a0)({ - name: (string) (len=5) "alias", + (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000247740)({ + fullName: (string) (len=20) "LnurlPayInfoResponse", + name: (string) (len=20) "LnurlPayInfoResponse", + fields: ([]*main.Field) (len=5 cap=8) { + (*main.Field)(0xc00045e1e0)({ + 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)(0xc00045e210)({ + 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)(0xc00045e240)({ + 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)(0xc00045e270)({ + 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)(0xc00045e2a0)({ + name: (string) (len=8) "metadata", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -846,11 +753,11 @@ }) } }), - (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000247480)({ + (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000247540)({ fullName: (string) (len=17) "PayInvoiceRequest", name: (string) (len=17) "PayInvoiceRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003dd980)({ + (*main.Field)(0xc0003ffe60)({ name: (string) (len=7) "invoice", kind: (string) (len=6) "string", isMap: (bool) false, @@ -859,7 +766,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003dd9b0)({ + (*main.Field)(0xc0003ffe90)({ name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -870,113 +777,151 @@ }) } }), - (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc000247600)({ - fullName: (string) (len=25) "LnurlWithdrawInfoResponse", - name: (string) (len=25) "LnurlWithdrawInfoResponse", - fields: ([]*main.Field) (len=8 cap=8) { - (*main.Field)(0xc0003ddb60)({ - name: (string) (len=3) "tag", - kind: (string) (len=6) "string", + (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc0002479c0)({ + fullName: (string) (len=25) "GetUserOperationsResponse", + name: (string) (len=25) "GetUserOperationsResponse", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc00045e750)({ + name: (string) (len=31) "latestOutgoingInvoiceOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false }), - (*main.Field)(0xc0003ddb90)({ - name: (string) (len=8) "callback", - kind: (string) (len=6) "string", + (*main.Field)(0xc00045e780)({ + name: (string) (len=31) "latestIncomingInvoiceOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false }), - (*main.Field)(0xc0003ddbc0)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", + (*main.Field)(0xc00045e7b0)({ + name: (string) (len=26) "latestOutgoingTxOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, + isMessage: (bool) true, isOptional: (bool) false }), - (*main.Field)(0xc0003ddbf0)({ - name: (string) (len=18) "defaultDescription", - kind: (string) (len=6) "string", + (*main.Field)(0xc00045e7e0)({ + name: (string) (len=26) "latestIncomingTxOperations", + kind: (string) (len=14) "UserOperations", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003ddc20)({ - 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)(0xc0003ddc50)({ - 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)(0xc0003ddc80)({ - 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)(0xc0003ddcb0)({ - 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=22) "HandleLnurlPayResponse": (*main.Message)(0xc0002476c0)({ - fullName: (string) (len=22) "HandleLnurlPayResponse", - name: (string) (len=22) "HandleLnurlPayResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003dddd0)({ - 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)(0xc0003dde00)({ - 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=15) "AddUserResponse": (*main.Message)(0xc000247740)({ + (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000247380)({ + fullName: (string) (len=18) "LndGetInfoResponse", + name: (string) (len=18) "LndGetInfoResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003ffc80)({ + 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=17) "PayAddressRequest": (*main.Message)(0xc000247440)({ + fullName: (string) (len=17) "PayAddressRequest", + name: (string) (len=17) "PayAddressRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0003ffd10)({ + 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)(0xc0003ffd40)({ + 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)(0xc0003ffd70)({ + name: (string) (len=10) "targetConf", + 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)(0xc000247580)({ + fullName: (string) (len=18) "PayInvoiceResponse", + name: (string) (len=18) "PayInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003ffec0)({ + 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 + }) + } + }), + (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000247600)({ + fullName: (string) (len=19) "OpenChannelResponse", + name: (string) (len=19) "OpenChannelResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003fffb0)({ + 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=5) "Empty": (*main.Message)(0xc0002472c0)({ + fullName: (string) (len=5) "Empty", + name: (string) (len=5) "Empty", + fields: ([]*main.Field) + }), + (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000247500)({ + fullName: (string) (len=18) "NewInvoiceResponse", + name: (string) (len=18) "NewInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003ffe30)({ + 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=15) "AddUserResponse": (*main.Message)(0xc000247800)({ fullName: (string) (len=15) "AddUserResponse", name: (string) (len=15) "AddUserResponse", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003ddec0)({ + (*main.Field)(0xc00045e3c0)({ name: (string) (len=6) "userId", kind: (string) (len=6) "string", isMap: (bool) false, @@ -985,7 +930,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003ddef0)({ + (*main.Field)(0xc00045e3f0)({ name: (string) (len=9) "authToken", kind: (string) (len=6) "string", isMap: (bool) false, @@ -996,11 +941,59 @@ }) } }), - (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000247300)({ + (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc000247780)({ + fullName: (string) (len=22) "HandleLnurlPayResponse", + name: (string) (len=22) "HandleLnurlPayResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00045e2d0)({ + 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)(0xc00045e300)({ + 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=8) "UserInfo": (*main.Message)(0xc0002478c0)({ + fullName: (string) (len=8) "UserInfo", + name: (string) (len=8) "UserInfo", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00045e4e0)({ + 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)(0xc00045e510)({ + 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=17) "NewAddressRequest": (*main.Message)(0xc0002473c0)({ fullName: (string) (len=17) "NewAddressRequest", name: (string) (len=17) "NewAddressRequest", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003dd7d0)({ + (*main.Field)(0xc0003ffcb0)({ name: (string) (len=11) "addressType", kind: (string) (len=11) "AddressType", isMap: (bool) false, @@ -1011,11 +1004,11 @@ }) } }), - (string) (len=18) "PayAddressResponse": (*main.Message)(0xc0002473c0)({ + (string) (len=18) "PayAddressResponse": (*main.Message)(0xc000247480)({ fullName: (string) (len=18) "PayAddressResponse", name: (string) (len=18) "PayAddressResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003dd8c0)({ + (*main.Field)(0xc0003ffda0)({ name: (string) (len=4) "txId", kind: (string) (len=6) "string", isMap: (bool) false, @@ -1025,10 +1018,277 @@ isOptional: (bool) false }) } + }), + (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0002475c0)({ + fullName: (string) (len=18) "OpenChannelRequest", + name: (string) (len=18) "OpenChannelRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0003ffef0)({ + 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)(0xc0003fff20)({ + 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)(0xc0003fff50)({ + 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)(0xc0003fff80)({ + 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 + }) + } + }), + (string) (len=14) "UserOperations": (*main.Message)(0xc000247980)({ + fullName: (string) (len=14) "UserOperations", + name: (string) (len=14) "UserOperations", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc00045e6c0)({ + 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)(0xc00045e6f0)({ + 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)(0xc00045e720)({ + 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=14) "AddUserRequest": (*main.Message)(0xc0002477c0)({ + fullName: (string) (len=14) "AddUserRequest", + name: (string) (len=14) "AddUserRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc00045e330)({ + name: (string) (len=11) "callbackUrl", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00045e360)({ + 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)(0xc00045e390)({ + name: (string) (len=6) "secret", + 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)(0xc000247940)({ + fullName: (string) (len=13) "UserOperation", + name: (string) (len=13) "UserOperation", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc00045e600)({ + 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)(0xc00045e630)({ + 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)(0xc00045e660)({ + 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)(0xc00045e690)({ + 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=25) "EncryptionExchangeRequest": (*main.Message)(0xc000247300)({ + fullName: (string) (len=25) "EncryptionExchangeRequest", + name: (string) (len=25) "EncryptionExchangeRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003ffbf0)({ + 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)(0xc0003ffc20)({ + 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=17) "LndGetInfoRequest": (*main.Message)(0xc000247340)({ + fullName: (string) (len=17) "LndGetInfoRequest", + name: (string) (len=17) "LndGetInfoRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003ffc50)({ + 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=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc0002476c0)({ + fullName: (string) (len=25) "LnurlWithdrawInfoResponse", + name: (string) (len=25) "LnurlWithdrawInfoResponse", + fields: ([]*main.Field) (len=8 cap=8) { + (*main.Field)(0xc00045e060)({ + 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)(0xc00045e090)({ + 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)(0xc00045e0c0)({ + 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)(0xc00045e0f0)({ + 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)(0xc00045e120)({ + 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)(0xc00045e150)({ + 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)(0xc00045e180)({ + 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)(0xc00045e1b0)({ + 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 + }) + } }) } -parsing file: structs 22 +parsing file: structs 27 parsing file: methods 2 -> [{guest Guest false map[]} {user User false map[user_id:string]} {admin Admin true map[admin_id:string]}] diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index 22fd378b..75208c4a 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -94,6 +94,31 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); 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) => { + try { + if (!methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + const query = req.query + const params = req.params + const response = await methods.GetUserInfo({ ...authContext, ...query, ...params }) + res.json({status: 'OK', ...response}) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); 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) => { + try { + if (!methods.GetUserOperations) throw new Error('method: GetUserOperations is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + const request = req.body + const error = Types.GetUserOperationsRequestValidate(request) + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger) + const query = req.query + const params = req.params + const response = await methods.GetUserOperations({ ...authContext, ...query, ...params }, request) + res.json({status: 'OK', ...response}) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); 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) => { try { diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index fdd6aac4..384735e9 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -78,6 +78,34 @@ export default (params: ClientParams) => ({ } 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' } + }, + 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') diff --git a/proto/autogenerated/ts/nostr_client.ts b/proto/autogenerated/ts/nostr_client.ts index fae0082f..da8cb18e 100644 --- a/proto/autogenerated/ts/nostr_client.ts +++ b/proto/autogenerated/ts/nostr_client.ts @@ -9,6 +9,35 @@ export type NostrClientParams = { checkResult?: true } export default (params: NostrClientParams, send: (to:string, message: NostrRequest) => Promise) => ({ + 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' } + }, + 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') diff --git a/proto/autogenerated/ts/nostr_transport.ts b/proto/autogenerated/ts/nostr_transport.ts index 589574e1..cebe3e36 100644 --- a/proto/autogenerated/ts/nostr_transport.ts +++ b/proto/autogenerated/ts/nostr_transport.ts @@ -21,6 +21,29 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => { const logger = opts.logger || { log: console.log, error: console.error } return async (req: NostrRequest, res: NostrResponse) => { switch (req.rpcName) { + case 'GetUserInfo': + try { + if (!methods.GetUserInfo) throw new Error('method: GetUserInfo is not implemented') + const authContext = await opts.NostrUserAuthGuard(req.authIdentifier) + const query = req.query + const params = req.params + const response = await methods.GetUserInfo({ ...authContext, ...query, ...params }) + res({status: 'OK', ...response}) + }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); 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.authIdentifier) + const request = req.body + const error = Types.GetUserOperationsRequestValidate(request) + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger) + const query = req.query + const params = req.params + const response = await methods.GetUserOperations({ ...authContext, ...query, ...params }, request) + res({status: 'OK', ...response}) + }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } + break case 'NewAddress': try { if (!methods.NewAddress) throw new Error('method: NewAddress is not implemented') diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index 46f5526b..c0ba7742 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -35,6 +35,16 @@ export type AuthUser_Query = { export type AuthUser_RouteParams = { } export type AuthUser_Context = AuthUser_Query & AuthUser_RouteParams & GuestContext +export type GetUserInfo_Query = { +} +export type GetUserInfo_RouteParams = { +} +export type GetUserInfo_Context = GetUserInfo_Query & GetUserInfo_RouteParams & UserContext +export type GetUserOperations_Query = { +} +export type GetUserOperations_RouteParams = { +} +export type GetUserOperations_Context = GetUserOperations_Query & GetUserOperations_RouteParams & UserContext export type NewAddress_Query = { } export type NewAddress_RouteParams = { @@ -102,6 +112,8 @@ export type ServerMethods = { LndGetInfo?: (ctx: LndGetInfo_Context, req: LndGetInfoRequest) => Promise AddUser?: (ctx: AddUser_Context, req: AddUserRequest) => Promise AuthUser?: (ctx: AuthUser_Context, req: AuthUserRequest) => Promise + GetUserInfo?: (ctx: GetUserInfo_Context) => Promise + GetUserOperations?: (ctx: GetUserOperations_Context, req: GetUserOperationsRequest) => Promise NewAddress?: (ctx: NewAddress_Context, req: NewAddressRequest) => Promise PayAddress?: (ctx: PayAddress_Context, req: PayAddressRequest) => Promise NewInvoice?: (ctx: NewInvoice_Context, req: NewInvoiceRequest) => Promise @@ -124,11 +136,421 @@ 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', +} +const enumCheckUserOperationType = (e?: UserOperationType): boolean => { + for (const v in UserOperationType) if (e === v) return true + return false +} export type OptionsBaseMessage = { allOptionalsAreSet?: true } +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 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 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 GetUserOperationsRequest = { + latestIncomingInvoice: number + latestOutgoingInvoice: number + latestIncomingTx: number + latestOutgoingTx: 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 +} +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`) + + return null +} + +export type LnurlPayInfoResponse = { + tag: string + callback: string + maxSendable: number + minSendable: number + metadata: 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 +} +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`) + + return null +} + +export type AuthUserRequest = { + name: string + secret: string +} +export const AuthUserRequestOptionalFields: [] = [] +export type AuthUserRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + secret_CustomCheck?: (v: string) => boolean +} +export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserRequestOptions = {}, path: string = 'AuthUserRequest::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.secret !== 'string') return new Error(`${path}.secret: is not a string`) + if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`) + + return null +} + +export type AuthUserResponse = { + userId: string + authToken: string +} +export const AuthUserResponseOptionalFields: [] = [] +export type AuthUserResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + userId_CustomCheck?: (v: string) => boolean + authToken_CustomCheck?: (v: string) => boolean +} +export const AuthUserResponseValidate = (o?: AuthUserResponse, opts: AuthUserResponseOptions = {}, path: string = 'AuthUserResponse::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.authToken !== 'string') return new Error(`${path}.authToken: is not a string`) + if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: 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 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 PayAddressRequest = { + address: string + amoutSats: number + targetConf: number +} +export const PayAddressRequestOptionalFields: [] = [] +export type PayAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean + amoutSats_CustomCheck?: (v: number) => boolean + targetConf_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.targetConf !== 'number') return new Error(`${path}.targetConf: is not a number`) + if (opts.targetConf_CustomCheck && !opts.targetConf_CustomCheck(o.targetConf)) return new Error(`${path}.targetConf: custom check failed`) + + return null +} + +export type PayInvoiceResponse = { + preimage: string +} +export const PayInvoiceResponseOptionalFields: [] = [] +export type PayInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + preimage_CustomCheck?: (v: string) => 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`) + + 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 GetUserOperationsResponse = { + latestOutgoingInvoiceOperations: UserOperations + latestIncomingInvoiceOperations: UserOperations + latestOutgoingTxOperations: UserOperations + latestIncomingTxOperations: UserOperations +} +export const GetUserOperationsResponseOptionalFields: [] = [] +export type GetUserOperationsResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + latestOutgoingInvoiceOperations_Options?: UserOperationsOptions + latestIncomingInvoiceOperations_Options?: UserOperationsOptions + latestOutgoingTxOperations_Options?: UserOperationsOptions + latestIncomingTxOperations_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 + + + 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 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 AddUserResponse = { + userId: string + authToken: string +} +export const AddUserResponseOptionalFields: [] = [] +export type AddUserResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + userId_CustomCheck?: (v: string) => boolean + authToken_CustomCheck?: (v: string) => boolean +} +export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::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.authToken !== 'string') return new Error(`${path}.authToken: is not a string`) + if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: custom check failed`) + + return null +} + +export type UserInfo = { + userId: string + balance: number +} +export const UserInfoOptionalFields: [] = [] +export type UserInfoOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + userId_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => 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`) + + return null +} + export type NewAddressRequest = { addressType: AddressType } @@ -165,25 +587,137 @@ export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddr return null } -export type PayInvoiceRequest = { - invoice: string - amount: number +export type OpenChannelRequest = { + destination: string + fundingAmount: number + pushAmount: number + closeAddress: string } -export const PayInvoiceRequestOptionalFields: [] = [] -export type PayInvoiceRequestOptions = OptionsBaseMessage & { +export const OpenChannelRequestOptionalFields: [] = [] +export type OpenChannelRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean + destination_CustomCheck?: (v: string) => boolean + fundingAmount_CustomCheck?: (v: number) => boolean + pushAmount_CustomCheck?: (v: number) => boolean + closeAddress_CustomCheck?: (v: string) => boolean } -export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => { +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.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.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.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.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 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 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 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 } @@ -241,297 +775,6 @@ export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, 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 AddUserResponse = { - userId: string - authToken: string -} -export const AddUserResponseOptionalFields: [] = [] -export type AddUserResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - userId_CustomCheck?: (v: string) => boolean - authToken_CustomCheck?: (v: string) => boolean -} -export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::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.authToken !== 'string') return new Error(`${path}.authToken: is not a string`) - if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: 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 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 PayInvoiceResponse = { - preimage: string -} -export const PayInvoiceResponseOptionalFields: [] = [] -export type PayInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - preimage_CustomCheck?: (v: string) => 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`) - - 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 AuthUserRequest = { - name: string - secret: string -} -export const AuthUserRequestOptionalFields: [] = [] -export type AuthUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - secret_CustomCheck?: (v: string) => boolean -} -export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserRequestOptions = {}, path: string = 'AuthUserRequest::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.secret !== 'string') return new Error(`${path}.secret: is not a string`) - if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`) - - return null -} - -export type PayAddressRequest = { - address: string - amoutSats: number - targetConf: number -} -export const PayAddressRequestOptionalFields: [] = [] -export type PayAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean - amoutSats_CustomCheck?: (v: number) => boolean - targetConf_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.targetConf !== 'number') return new Error(`${path}.targetConf: is not a number`) - if (opts.targetConf_CustomCheck && !opts.targetConf_CustomCheck(o.targetConf)) return new Error(`${path}.targetConf: 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 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 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 LnurlPayInfoResponse = { - tag: string - callback: string - maxSendable: number - minSendable: number - metadata: 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 -} -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`) - - return null -} - export type AddUserRequest = { callbackUrl: string name: string @@ -560,97 +803,35 @@ export const AddUserRequestValidate = (o?: AddUserRequest, opts: AddUserRequestO return null } -export type Empty = { +export type UserOperation = { + paidAtUnix: number + type: UserOperationType + inbound: boolean + amount: number } -export const EmptyOptionalFields: [] = [] -export type EmptyOptions = OptionsBaseMessage & { +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 } -export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { +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') - - 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 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 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 AuthUserResponse = { - userId: string - authToken: string -} -export const AuthUserResponseOptionalFields: [] = [] -export type AuthUserResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - userId_CustomCheck?: (v: string) => boolean - authToken_CustomCheck?: (v: string) => boolean -} -export const AuthUserResponseValidate = (o?: AuthUserResponse, opts: AuthUserResponseOptions = {}, path: string = 'AuthUserResponse::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.authToken !== 'string') return new Error(`${path}.authToken: is not a string`) - if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: custom check failed`) + + 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`) return null } diff --git a/proto/lnd/invoices.client.ts b/proto/lnd/invoices.client.ts index 54fc20e2..b529cca1 100644 --- a/proto/lnd/invoices.client.ts +++ b/proto/lnd/invoices.client.ts @@ -1,4 +1,4 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number +// @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"; diff --git a/proto/lnd/invoices.ts b/proto/lnd/invoices.ts index a42660cb..4155cf06 100644 --- a/proto/lnd/invoices.ts +++ b/proto/lnd/invoices.ts @@ -1,4 +1,4 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number +// @generated by protobuf-ts 2.8.1 // @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) // tslint:disable import { Invoice } from "./lightning.js"; @@ -59,7 +59,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: int64 value = 3; */ - value: number; + value: bigint; /** * * The value of this invoice in millisatoshis @@ -68,7 +68,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: int64 value_msat = 10; */ - valueMsat: number; + valueMsat: bigint; /** * * Hash (SHA-256) of a description of the payment. Used if the description of @@ -83,7 +83,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: int64 expiry = 5; */ - expiry: number; + expiry: bigint; /** * Fallback on-chain address. * @@ -95,7 +95,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: uint64 cltv_expiry = 7; */ - cltvExpiry: number; + cltvExpiry: bigint; /** * * Route hints that can each be individually used to assist in reaching the @@ -133,7 +133,7 @@ export interface AddHoldInvoiceResp { * * @generated from protobuf field: uint64 add_index = 2; */ - addIndex: number; + addIndex: bigint; /** * * The payment address of the generated invoice. This value should be used @@ -316,18 +316,18 @@ class AddHoldInvoiceRequest$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, valueMsat: 0, descriptionHash: new Uint8Array(0), expiry: 0, fallbackAddr: "", cltvExpiry: 0, routeHints: [], private: false }; + 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); @@ -345,22 +345,22 @@ class AddHoldInvoiceRequest$Type extends MessageType { message.hash = reader.bytes(); break; case /* int64 value */ 3: - message.value = reader.int64().toNumber(); + message.value = reader.int64().toBigInt(); break; case /* int64 value_msat */ 10: - message.valueMsat = reader.int64().toNumber(); + message.valueMsat = reader.int64().toBigInt(); break; case /* bytes description_hash */ 4: message.descriptionHash = reader.bytes(); break; case /* int64 expiry */ 5: - message.expiry = reader.int64().toNumber(); + 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().toNumber(); + message.cltvExpiry = reader.uint64().toBigInt(); break; case /* repeated lnrpc.RouteHint route_hints */ 8: message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); @@ -387,22 +387,22 @@ class AddHoldInvoiceRequest$Type extends MessageType { if (message.hash.length) writer.tag(2, WireType.LengthDelimited).bytes(message.hash); /* int64 value = 3; */ - if (message.value !== 0) + if (message.value !== 0n) writer.tag(3, WireType.Varint).int64(message.value); /* int64 value_msat = 10; */ - if (message.valueMsat !== 0) + 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 !== 0) + 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 !== 0) + 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++) @@ -425,12 +425,12 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, paymentAddr: new Uint8Array(0) }; + 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); @@ -445,7 +445,7 @@ class AddHoldInvoiceResp$Type extends MessageType { message.paymentRequest = reader.string(); break; case /* uint64 add_index */ 2: - message.addIndex = reader.uint64().toNumber(); + message.addIndex = reader.uint64().toBigInt(); break; case /* bytes payment_addr */ 3: message.paymentAddr = reader.bytes(); @@ -466,7 +466,7 @@ class AddHoldInvoiceResp$Type extends MessageType { if (message.paymentRequest !== "") writer.tag(1, WireType.LengthDelimited).string(message.paymentRequest); /* uint64 add_index = 2; */ - if (message.addIndex !== 0) + if (message.addIndex !== 0n) writer.tag(2, WireType.Varint).uint64(message.addIndex); /* bytes payment_addr = 3; */ if (message.paymentAddr.length) diff --git a/proto/lnd/lightning.client.ts b/proto/lnd/lightning.client.ts index 53442dba..65c89d1d 100644 --- a/proto/lnd/lightning.client.ts +++ b/proto/lnd/lightning.client.ts @@ -1,4 +1,4 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number +// @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"; diff --git a/proto/lnd/lightning.ts b/proto/lnd/lightning.ts index e17b6e92..97aa9e52 100644 --- a/proto/lnd/lightning.ts +++ b/proto/lnd/lightning.ts @@ -1,4 +1,4 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number +// @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"; @@ -19,11 +19,11 @@ export interface LookupHtlcRequest { /** * @generated from protobuf field: uint64 chan_id = 1; */ - chanId: number; + chanId: bigint; /** * @generated from protobuf field: uint64 htlc_index = 2; */ - htlcIndex: number; + htlcIndex: bigint; } /** * @generated from protobuf message lnrpc.LookupHtlcResponse @@ -115,7 +115,7 @@ export interface Utxo { * * @generated from protobuf field: int64 amount_sat = 3; */ - amountSat: number; + amountSat: bigint; /** * The pkscript in hex * @@ -133,7 +133,7 @@ export interface Utxo { * * @generated from protobuf field: int64 confirmations = 6; */ - confirmations: number; + confirmations: bigint; } /** * @generated from protobuf message lnrpc.OutputDetail @@ -162,13 +162,13 @@ export interface OutputDetail { * * @generated from protobuf field: int64 output_index = 4; */ - outputIndex: number; + outputIndex: bigint; /** * The value of the output coin in satoshis * * @generated from protobuf field: int64 amount = 5; */ - amount: number; + amount: bigint; /** * Denotes if the output is controlled by the internal wallet * @@ -191,7 +191,7 @@ export interface Transaction { * * @generated from protobuf field: int64 amount = 2; */ - amount: number; + amount: bigint; /** * The number of confirmations * @@ -215,13 +215,13 @@ export interface Transaction { * * @generated from protobuf field: int64 time_stamp = 6; */ - timeStamp: number; + timeStamp: bigint; /** * Fees paid for this transaction * * @generated from protobuf field: int64 total_fees = 7; */ - totalFees: number; + totalFees: bigint; /** * Addresses that received funds for this transaction. Deprecated as it is * now incorporated in the output_details field. @@ -313,7 +313,7 @@ export interface FeeLimit { * * @generated from protobuf field: int64 fixed = 1; */ - fixed: number; + fixed: bigint; } | { oneofKind: "fixedMsat"; /** @@ -324,7 +324,7 @@ export interface FeeLimit { * * @generated from protobuf field: int64 fixed_msat = 3; */ - fixedMsat: number; + fixedMsat: bigint; } | { oneofKind: "percent"; /** @@ -332,7 +332,7 @@ export interface FeeLimit { * * @generated from protobuf field: int64 percent = 2; */ - percent: number; + percent: bigint; } | { oneofKind: undefined; }; @@ -366,7 +366,7 @@ export interface SendRequest { * * @generated from protobuf field: int64 amt = 3; */ - amt: number; + amt: bigint; /** * * The amount to send expressed in millisatoshis. @@ -375,7 +375,7 @@ export interface SendRequest { * * @generated from protobuf field: int64 amt_msat = 12; */ - amtMsat: number; + amtMsat: bigint; /** * * The hash to use within the payment's HTLC. When using REST, this field @@ -560,46 +560,46 @@ export interface ChannelAcceptRequest { * * @generated from protobuf field: uint64 funding_amt = 4; */ - fundingAmt: number; + fundingAmt: bigint; /** * The push amount of the proposed channel in millisatoshis. * * @generated from protobuf field: uint64 push_amt = 5; */ - pushAmt: number; + pushAmt: bigint; /** * The dust limit of the initiator's commitment tx. * * @generated from protobuf field: uint64 dust_limit = 6; */ - dustLimit: number; + 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: number; + 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: number; + channelReserve: bigint; /** * The smallest HTLC in millisatoshis that the initiator will accept. * * @generated from protobuf field: uint64 min_htlc = 9; */ - minHtlc: number; + minHtlc: bigint; /** * The initial fee rate that the initiator suggests for both commitment * transactions. * * @generated from protobuf field: uint64 fee_per_kw = 10; */ - feePerKw: number; + feePerKw: bigint; /** * * The number of blocks to use for the relative time lock in the pay-to-self @@ -696,7 +696,7 @@ export interface ChannelAcceptResponse { * * @generated from protobuf field: uint64 reserve_sat = 6; */ - reserveSat: number; + reserveSat: bigint; /** * * The maximum amount of funds in millisatoshis that we allow the remote peer @@ -704,7 +704,7 @@ export interface ChannelAcceptResponse { * * @generated from protobuf field: uint64 in_flight_max_msat = 7; */ - inFlightMaxMsat: number; + inFlightMaxMsat: bigint; /** * * The maximum number of htlcs that the remote peer can offer us. @@ -718,7 +718,7 @@ export interface ChannelAcceptResponse { * * @generated from protobuf field: uint64 min_htlc_in = 9; */ - minHtlcIn: number; + minHtlcIn: bigint; /** * * The number of confirmations we require before we consider the channel open. @@ -842,7 +842,7 @@ export interface EstimateFeeRequest { * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ addrToAmount: { - [key: string]: number; + [key: string]: bigint; }; /** * The target number of blocks that this transaction should be confirmed @@ -874,7 +874,7 @@ export interface EstimateFeeResponse { * * @generated from protobuf field: int64 fee_sat = 1; */ - feeSat: number; + feeSat: bigint; /** * Deprecated, use sat_per_vbyte. * The fee rate in satoshi/vbyte. @@ -882,13 +882,13 @@ export interface EstimateFeeResponse { * @deprecated * @generated from protobuf field: int64 feerate_sat_per_byte = 2 [deprecated = true]; */ - feerateSatPerByte: number; + feerateSatPerByte: bigint; /** * The fee rate in satoshi/vbyte. * * @generated from protobuf field: uint64 sat_per_vbyte = 3; */ - satPerVbyte: number; + satPerVbyte: bigint; } /** * @generated from protobuf message lnrpc.SendManyRequest @@ -900,7 +900,7 @@ export interface SendManyRequest { * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ addrToAmount: { - [key: string]: number; + [key: string]: bigint; }; /** * The target number of blocks that this transaction should be confirmed @@ -915,7 +915,7 @@ export interface SendManyRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 4; */ - satPerVbyte: number; + satPerVbyte: bigint; /** * Deprecated, use sat_per_vbyte. * A manual fee rate set in sat/vbyte that should be used when crafting the @@ -924,7 +924,7 @@ export interface SendManyRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; */ - satPerByte: number; + satPerByte: bigint; /** * An optional label for the transaction, limited to 500 characters. * @@ -971,7 +971,7 @@ export interface SendCoinsRequest { * * @generated from protobuf field: int64 amount = 2; */ - amount: number; + amount: bigint; /** * The target number of blocks that this transaction should be confirmed * by. @@ -985,7 +985,7 @@ export interface SendCoinsRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 4; */ - satPerVbyte: number; + satPerVbyte: bigint; /** * Deprecated, use sat_per_vbyte. * A manual fee rate set in sat/vbyte that should be used when crafting the @@ -994,7 +994,7 @@ export interface SendCoinsRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; */ - satPerByte: number; + satPerByte: bigint; /** * * If set, then the amount field will be ignored, and lnd will attempt to @@ -1193,7 +1193,7 @@ export interface ConnectPeerRequest { * * @generated from protobuf field: uint64 timeout = 3; */ - timeout: number; + timeout: bigint; } /** * @generated from protobuf message lnrpc.ConnectPeerResponse @@ -1227,7 +1227,7 @@ export interface HTLC { /** * @generated from protobuf field: int64 amount = 2; */ - amount: number; + amount: bigint; /** * @generated from protobuf field: bytes hash_lock = 3; */ @@ -1241,7 +1241,7 @@ export interface HTLC { * * @generated from protobuf field: uint64 htlc_index = 5; */ - htlcIndex: number; + 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. @@ -1253,13 +1253,13 @@ export interface HTLC { * * @generated from protobuf field: uint64 forwarding_channel = 6; */ - forwardingChannel: number; + forwardingChannel: bigint; /** * Index identifying the htlc on the forwarding channel. * * @generated from protobuf field: uint64 forwarding_htlc_index = 7; */ - forwardingHtlcIndex: number; + forwardingHtlcIndex: bigint; } /** * @generated from protobuf message lnrpc.ChannelConstraints @@ -1278,26 +1278,26 @@ export interface ChannelConstraints { * * @generated from protobuf field: uint64 chan_reserve_sat = 2; */ - chanReserveSat: number; + chanReserveSat: bigint; /** * The dust limit (in satoshis) of the initiator's commitment tx. * * @generated from protobuf field: uint64 dust_limit_sat = 3; */ - dustLimitSat: number; + 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: number; + maxPendingAmtMsat: bigint; /** * The smallest HTLC in millisatoshis that the initiator will accept. * * @generated from protobuf field: uint64 min_htlc_msat = 5; */ - minHtlcMsat: number; + minHtlcMsat: bigint; /** * The total number of incoming HTLC's that the initiator will accept. * @@ -1344,19 +1344,19 @@ export interface Channel { * * @generated from protobuf field: int64 capacity = 5; */ - capacity: number; + capacity: bigint; /** * This node's current balance in this channel * * @generated from protobuf field: int64 local_balance = 6; */ - localBalance: number; + localBalance: bigint; /** * The counterparty's current balance in this channel * * @generated from protobuf field: int64 remote_balance = 7; */ - remoteBalance: number; + remoteBalance: bigint; /** * * The amount calculated to be paid in fees for the current set of commitment @@ -1366,13 +1366,13 @@ export interface Channel { * * @generated from protobuf field: int64 commit_fee = 8; */ - commitFee: number; + commitFee: bigint; /** * The weight of the commitment transaction * * @generated from protobuf field: int64 commit_weight = 9; */ - commitWeight: number; + commitWeight: bigint; /** * * The required number of satoshis per kilo-weight that the requester will pay @@ -1381,34 +1381,34 @@ export interface Channel { * * @generated from protobuf field: int64 fee_per_kw = 10; */ - feePerKw: number; + feePerKw: bigint; /** * The unsettled balance in this channel * * @generated from protobuf field: int64 unsettled_balance = 11; */ - unsettledBalance: number; + unsettledBalance: bigint; /** * * The total number of satoshis we've sent within this channel. * * @generated from protobuf field: int64 total_satoshis_sent = 12; */ - totalSatoshisSent: number; + totalSatoshisSent: bigint; /** * * The total number of satoshis we've received within this channel. * * @generated from protobuf field: int64 total_satoshis_received = 13; */ - totalSatoshisReceived: number; + totalSatoshisReceived: bigint; /** * * The total number of updates conducted within this channel. * * @generated from protobuf field: uint64 num_updates = 14; */ - numUpdates: number; + numUpdates: bigint; /** * * The list of active, uncleared HTLCs currently pending within the channel. @@ -1451,7 +1451,7 @@ export interface Channel { * @deprecated * @generated from protobuf field: int64 local_chan_reserve_sat = 20 [deprecated = true]; */ - localChanReserveSat: number; + localChanReserveSat: bigint; /** * * Deprecated. The minimum satoshis the other node is required to reserve in @@ -1460,7 +1460,7 @@ export interface Channel { * @deprecated * @generated from protobuf field: int64 remote_chan_reserve_sat = 21 [deprecated = true]; */ - remoteChanReserveSat: number; + remoteChanReserveSat: bigint; /** * Deprecated. Use commitment_type. * @@ -1482,7 +1482,7 @@ export interface Channel { * * @generated from protobuf field: int64 lifetime = 23; */ - lifetime: number; + lifetime: bigint; /** * * The number of seconds that the remote peer has been observed as being online @@ -1491,7 +1491,7 @@ export interface Channel { * * @generated from protobuf field: int64 uptime = 24; */ - uptime: number; + uptime: bigint; /** * * Close address is the address that we will enforce payout to on cooperative @@ -1513,7 +1513,7 @@ export interface Channel { * * @generated from protobuf field: uint64 push_amount_sat = 27; */ - pushAmountSat: number; + pushAmountSat: bigint; /** * * This uint32 indicates if this channel is to be considered 'frozen'. A @@ -1546,7 +1546,7 @@ export interface Channel { * * @generated from protobuf field: repeated uint64 alias_scids = 31; */ - aliasScids: number[]; + aliasScids: bigint[]; /** * Whether or not this is a zero-conf channel. * @@ -1558,7 +1558,7 @@ export interface Channel { * * @generated from protobuf field: uint64 zero_conf_confirmed_scid = 33; */ - zeroConfConfirmedScid: number; + zeroConfConfirmedScid: bigint; } /** * @generated from protobuf message lnrpc.ListChannelsRequest @@ -1611,13 +1611,13 @@ export interface AliasMap { * * @generated from protobuf field: uint64 base_scid = 1; */ - baseScid: number; + baseScid: bigint; /** * The set of all aliases stored for the base SCID. * * @generated from protobuf field: repeated uint64 aliases = 2; */ - aliases: number[]; + aliases: bigint[]; } /** * @generated from protobuf message lnrpc.ListAliasesRequest @@ -1672,7 +1672,7 @@ export interface ChannelCloseSummary { * * @generated from protobuf field: int64 capacity = 6; */ - capacity: number; + capacity: bigint; /** * Height at which the funding transaction was spent. * @@ -1684,13 +1684,13 @@ export interface ChannelCloseSummary { * * @generated from protobuf field: int64 settled_balance = 8; */ - settledBalance: number; + 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: number; + timeLockedBalance: bigint; /** * Details on how the channel was closed. * @@ -1728,7 +1728,7 @@ export interface ChannelCloseSummary { * * @generated from protobuf field: repeated uint64 alias_scids = 14; */ - aliasScids: number[]; + aliasScids: bigint[]; /** * The confirmed SCID for a zero-conf channel. * @@ -1792,7 +1792,7 @@ export interface Resolution { * * @generated from protobuf field: uint64 amount_sat = 4; */ - amountSat: number; + amountSat: bigint; /** * The hex-encoded transaction ID of the sweep transaction that spent the * output. @@ -1860,25 +1860,25 @@ export interface Peer { * * @generated from protobuf field: uint64 bytes_sent = 4; */ - bytesSent: number; + bytesSent: bigint; /** * Bytes of data transmitted from this peer * * @generated from protobuf field: uint64 bytes_recv = 5; */ - bytesRecv: number; + bytesRecv: bigint; /** * Satoshis sent to this peer * * @generated from protobuf field: int64 sat_sent = 6; */ - satSent: number; + satSent: bigint; /** * Satoshis received from this peer * * @generated from protobuf field: int64 sat_recv = 7; */ - satRecv: number; + satRecv: bigint; /** * A channel is inbound if the counterparty initiated the channel * @@ -1890,7 +1890,7 @@ export interface Peer { * * @generated from protobuf field: int64 ping_time = 9; */ - pingTime: number; + pingTime: bigint; /** * The type of sync we are currently performing with this peer. * @@ -1933,7 +1933,7 @@ export interface Peer { * * @generated from protobuf field: int64 last_flap_ns = 14; */ - lastFlapNs: number; + lastFlapNs: bigint; /** * * The last ping payload the peer has sent to us. @@ -1984,7 +1984,7 @@ export interface TimestampedError { * * @generated from protobuf field: uint64 timestamp = 1; */ - timestamp: number; + timestamp: bigint; /** * The string representation of the error sent by our peer. * @@ -2130,7 +2130,7 @@ export interface GetInfoResponse { * * @generated from protobuf field: int64 best_header_timestamp = 13; */ - bestHeaderTimestamp: number; + bestHeaderTimestamp: bigint; /** * Whether the wallet's view is synced to the main chain * @@ -2301,7 +2301,7 @@ export interface CloseChannelRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 4 [deprecated = true]; */ - satPerByte: number; + satPerByte: bigint; /** * * An optional address to send funds to in the case of a cooperative close. @@ -2318,7 +2318,7 @@ export interface CloseChannelRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 6; */ - satPerVbyte: number; + satPerVbyte: bigint; /** * The maximum fee rate the closer is willing to pay. * @@ -2326,7 +2326,7 @@ export interface CloseChannelRequest { * * @generated from protobuf field: uint64 max_fee_per_vbyte = 7; */ - maxFeePerVbyte: number; + maxFeePerVbyte: bigint; } /** * @generated from protobuf message lnrpc.CloseStatusUpdate @@ -2383,7 +2383,7 @@ export interface ReadyForPsbtFunding { * * @generated from protobuf field: int64 funding_amount = 2; */ - fundingAmount: number; + fundingAmount: bigint; /** * * A raw PSBT that contains the pending channel output. If a base PSBT was @@ -2418,7 +2418,7 @@ export interface BatchOpenChannelRequest { * * @generated from protobuf field: int64 sat_per_vbyte = 3; */ - satPerVbyte: number; + satPerVbyte: bigint; /** * The minimum number of confirmations each one of your outputs used for * the funding transaction must satisfy. @@ -2456,14 +2456,14 @@ export interface BatchOpenChannel { * * @generated from protobuf field: int64 local_funding_amount = 2; */ - localFundingAmount: number; + 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: number; + pushSat: bigint; /** * Whether this channel should be private, not announced to the greater * network. @@ -2477,7 +2477,7 @@ export interface BatchOpenChannel { * * @generated from protobuf field: int64 min_htlc_msat = 5; */ - minHtlcMsat: number; + 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. @@ -2536,7 +2536,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 1; */ - satPerVbyte: number; + satPerVbyte: bigint; /** * * The pubkey of the node to open a channel with. When using REST, this field @@ -2559,14 +2559,14 @@ export interface OpenChannelRequest { * * @generated from protobuf field: int64 local_funding_amount = 4; */ - localFundingAmount: number; + 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: number; + pushSat: bigint; /** * The target number of blocks that the funding transaction should be * confirmed by. @@ -2582,7 +2582,7 @@ export interface OpenChannelRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 7 [deprecated = true]; */ - satPerByte: number; + satPerByte: bigint; /** * Whether this channel should be private, not announced to the greater * network. @@ -2596,7 +2596,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: int64 min_htlc_msat = 9; */ - minHtlcMsat: number; + 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. @@ -2650,7 +2650,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: uint64 remote_max_value_in_flight_msat = 15; */ - remoteMaxValueInFlightMsat: number; + remoteMaxValueInFlightMsat: bigint; /** * * The maximum number of concurrent HTLCs we will allow the remote party to add @@ -2696,7 +2696,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: uint64 base_fee = 21; */ - baseFee: number; + baseFee: bigint; /** * * The fee rate in ppm (parts per million) that will be charged in @@ -2704,7 +2704,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: uint64 fee_rate = 22; */ - feeRate: number; + feeRate: bigint; /** * * If use_base_fee is true the open channel announcement will update the @@ -2733,7 +2733,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: uint64 remote_chan_reserve_sat = 25; */ - remoteChanReserveSat: number; + remoteChanReserveSat: bigint; } /** * @generated from protobuf message lnrpc.OpenStatusUpdate @@ -2831,7 +2831,7 @@ export interface ChanPointShim { * * @generated from protobuf field: int64 amt = 1; */ - amt: number; + amt: bigint; /** * The target channel point to refrence in created commitment transactions. * @@ -3086,7 +3086,7 @@ export interface PendingHTLC { * * @generated from protobuf field: int64 amount = 2; */ - amount: number; + amount: bigint; /** * The final output to be swept back to the user's wallet * @@ -3129,7 +3129,7 @@ export interface PendingChannelsResponse { * * @generated from protobuf field: int64 total_limbo_balance = 1; */ - totalLimboBalance: number; + totalLimboBalance: bigint; /** * Channels pending opening * @@ -3174,22 +3174,22 @@ export interface PendingChannelsResponse_PendingChannel { /** * @generated from protobuf field: int64 capacity = 3; */ - capacity: number; + capacity: bigint; /** * @generated from protobuf field: int64 local_balance = 4; */ - localBalance: number; + localBalance: bigint; /** * @generated from protobuf field: int64 remote_balance = 5; */ - remoteBalance: number; + 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: number; + localChanReserveSat: bigint; /** * * The minimum satoshis the other node is required to reserve in its @@ -3197,7 +3197,7 @@ export interface PendingChannelsResponse_PendingChannel { * * @generated from protobuf field: int64 remote_chan_reserve_sat = 7; */ - remoteChanReserveSat: number; + remoteChanReserveSat: bigint; /** * The party that initiated opening the channel. * @@ -3215,7 +3215,7 @@ export interface PendingChannelsResponse_PendingChannel { * * @generated from protobuf field: int64 num_forwarding_packages = 10; */ - numForwardingPackages: number; + numForwardingPackages: bigint; /** * A set of flags showing the current state of the channel. * @@ -3249,13 +3249,13 @@ export interface PendingChannelsResponse_PendingOpenChannel { * * @generated from protobuf field: int64 commit_fee = 4; */ - commitFee: number; + commitFee: bigint; /** * The weight of the commitment transaction * * @generated from protobuf field: int64 commit_weight = 5; */ - commitWeight: number; + commitWeight: bigint; /** * * The required number of satoshis per kilo-weight that the requester will @@ -3264,7 +3264,7 @@ export interface PendingChannelsResponse_PendingOpenChannel { * * @generated from protobuf field: int64 fee_per_kw = 6; */ - feePerKw: number; + feePerKw: bigint; } /** * @generated from protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel @@ -3281,7 +3281,7 @@ export interface PendingChannelsResponse_WaitingCloseChannel { * * @generated from protobuf field: int64 limbo_balance = 2; */ - limboBalance: number; + limboBalance: bigint; /** * * A list of valid commitment transactions. Any of these can confirm at @@ -3326,7 +3326,7 @@ export interface PendingChannelsResponse_Commitments { * * @generated from protobuf field: uint64 local_commit_fee_sat = 4; */ - localCommitFeeSat: number; + localCommitFeeSat: bigint; /** * * The amount in satoshis calculated to be paid in fees for the remote @@ -3334,7 +3334,7 @@ export interface PendingChannelsResponse_Commitments { * * @generated from protobuf field: uint64 remote_commit_fee_sat = 5; */ - remoteCommitFeeSat: number; + remoteCommitFeeSat: bigint; /** * * The amount in satoshis calculated to be paid in fees for the remote @@ -3342,7 +3342,7 @@ export interface PendingChannelsResponse_Commitments { * * @generated from protobuf field: uint64 remote_pending_commit_fee_sat = 6; */ - remotePendingCommitFeeSat: number; + remotePendingCommitFeeSat: bigint; } /** * @generated from protobuf message lnrpc.PendingChannelsResponse.ClosedChannel @@ -3382,7 +3382,7 @@ export interface PendingChannelsResponse_ForceClosedChannel { * * @generated from protobuf field: int64 limbo_balance = 3; */ - limboBalance: number; + limboBalance: bigint; /** * The height at which funds can be swept into the wallet * @@ -3403,7 +3403,7 @@ export interface PendingChannelsResponse_ForceClosedChannel { * * @generated from protobuf field: int64 recovered_balance = 6; */ - recoveredBalance: number; + recoveredBalance: bigint; /** * @generated from protobuf field: repeated lnrpc.PendingHTLC pending_htlcs = 8; */ @@ -3535,13 +3535,13 @@ export interface WalletAccountBalance { * * @generated from protobuf field: int64 confirmed_balance = 1; */ - confirmedBalance: number; + confirmedBalance: bigint; /** * The unconfirmed balance of the account (with 0 confirmations). * * @generated from protobuf field: int64 unconfirmed_balance = 2; */ - unconfirmedBalance: number; + unconfirmedBalance: bigint; } /** * @generated from protobuf message lnrpc.WalletBalanceRequest @@ -3557,32 +3557,32 @@ export interface WalletBalanceResponse { * * @generated from protobuf field: int64 total_balance = 1; */ - totalBalance: number; + totalBalance: bigint; /** * The confirmed balance of a wallet(with >= 1 confirmations) * * @generated from protobuf field: int64 confirmed_balance = 2; */ - confirmedBalance: number; + confirmedBalance: bigint; /** * The unconfirmed balance of a wallet(with 0 confirmations) * * @generated from protobuf field: int64 unconfirmed_balance = 3; */ - unconfirmedBalance: number; + 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: number; + lockedBalance: bigint; /** * The amount of reserve required. * * @generated from protobuf field: int64 reserved_balance_anchor_chan = 6; */ - reservedBalanceAnchorChan: number; + reservedBalanceAnchorChan: bigint; /** * A mapping of each wallet account's name to its balance. * @@ -3601,13 +3601,13 @@ export interface Amount { * * @generated from protobuf field: uint64 sat = 1; */ - sat: number; + sat: bigint; /** * Value denominated in milli-satoshis. * * @generated from protobuf field: uint64 msat = 2; */ - msat: number; + msat: bigint; } /** * @generated from protobuf message lnrpc.ChannelBalanceRequest @@ -3624,14 +3624,14 @@ export interface ChannelBalanceResponse { * @deprecated * @generated from protobuf field: int64 balance = 1 [deprecated = true]; */ - balance: number; + balance: bigint; /** * Deprecated. Sum of channels pending balances denominated in satoshis * * @deprecated * @generated from protobuf field: int64 pending_open_balance = 2 [deprecated = true]; */ - pendingOpenBalance: number; + pendingOpenBalance: bigint; /** * Sum of channels local balances. * @@ -3687,7 +3687,7 @@ export interface QueryRoutesRequest { * * @generated from protobuf field: int64 amt = 2; */ - amt: number; + amt: bigint; /** * * The amount to send expressed in millisatoshis. @@ -3696,7 +3696,7 @@ export interface QueryRoutesRequest { * * @generated from protobuf field: int64 amt_msat = 12; */ - amtMsat: number; + amtMsat: bigint; /** * * An optional CLTV delta from the current height that should be used for the @@ -3903,17 +3903,17 @@ export interface Hop { * @deprecated * @generated from protobuf field: int64 chan_capacity = 2 [deprecated = true]; */ - chanCapacity: number; + chanCapacity: bigint; /** * @deprecated * @generated from protobuf field: int64 amt_to_forward = 3 [deprecated = true]; */ - amtToForward: number; + amtToForward: bigint; /** * @deprecated * @generated from protobuf field: int64 fee = 4 [deprecated = true]; */ - fee: number; + fee: bigint; /** * @generated from protobuf field: uint32 expiry = 5; */ @@ -3921,11 +3921,11 @@ export interface Hop { /** * @generated from protobuf field: int64 amt_to_forward_msat = 6; */ - amtToForwardMsat: number; + amtToForwardMsat: bigint; /** * @generated from protobuf field: int64 fee_msat = 7; */ - feeMsat: number; + feeMsat: bigint; /** * * An optional public key of the hop. If the public key is given, the payment @@ -4007,7 +4007,7 @@ export interface MPPRecord { * * @generated from protobuf field: int64 total_amt_msat = 10; */ - totalAmtMsat: number; + totalAmtMsat: bigint; } /** * @generated from protobuf message lnrpc.AMPRecord @@ -4056,7 +4056,7 @@ export interface Route { * @deprecated * @generated from protobuf field: int64 total_fees = 2 [deprecated = true]; */ - totalFees: number; + totalFees: bigint; /** * * The total amount of funds required to complete a payment over this route. @@ -4068,7 +4068,7 @@ export interface Route { * @deprecated * @generated from protobuf field: int64 total_amt = 3 [deprecated = true]; */ - totalAmt: number; + totalAmt: bigint; /** * * Contains details concerning the specific forwarding details at each hop. @@ -4082,14 +4082,14 @@ export interface Route { * * @generated from protobuf field: int64 total_fees_msat = 5; */ - totalFeesMsat: number; + totalFeesMsat: bigint; /** * * The total amount in millisatoshis. * * @generated from protobuf field: int64 total_amt_msat = 6; */ - totalAmtMsat: number; + totalAmtMsat: bigint; } /** * @generated from protobuf message lnrpc.NodeInfoRequest @@ -4133,7 +4133,7 @@ export interface NodeInfo { * * @generated from protobuf field: int64 total_capacity = 3; */ - totalCapacity: number; + totalCapacity: bigint; /** * A list of all public channels for the node. * @@ -4210,15 +4210,15 @@ export interface RoutingPolicy { /** * @generated from protobuf field: int64 min_htlc = 2; */ - minHtlc: number; + minHtlc: bigint; /** * @generated from protobuf field: int64 fee_base_msat = 3; */ - feeBaseMsat: number; + feeBaseMsat: bigint; /** * @generated from protobuf field: int64 fee_rate_milli_msat = 4; */ - feeRateMilliMsat: number; + feeRateMilliMsat: bigint; /** * @generated from protobuf field: bool disabled = 5; */ @@ -4226,7 +4226,7 @@ export interface RoutingPolicy { /** * @generated from protobuf field: uint64 max_htlc_msat = 6; */ - maxHtlcMsat: number; + maxHtlcMsat: bigint; /** * @generated from protobuf field: uint32 last_update = 7; */ @@ -4280,7 +4280,7 @@ export interface ChannelEdge { /** * @generated from protobuf field: int64 capacity = 6; */ - capacity: number; + capacity: bigint; /** * @generated from protobuf field: lnrpc.RoutingPolicy node1_policy = 7; */ @@ -4423,7 +4423,7 @@ export interface NetworkInfo { /** * @generated from protobuf field: int64 total_network_capacity = 6; */ - totalNetworkCapacity: number; + totalNetworkCapacity: bigint; /** * @generated from protobuf field: double avg_channel_size = 7; */ @@ -4431,21 +4431,21 @@ export interface NetworkInfo { /** * @generated from protobuf field: int64 min_channel_size = 8; */ - minChannelSize: number; + minChannelSize: bigint; /** * @generated from protobuf field: int64 max_channel_size = 9; */ - maxChannelSize: number; + maxChannelSize: bigint; /** * @generated from protobuf field: int64 median_channel_size_sat = 10; */ - medianChannelSizeSat: number; + medianChannelSizeSat: bigint; /** * The number of edges marked as zombies. * * @generated from protobuf field: uint64 num_zombie_chans = 11; */ - numZombieChans: number; + numZombieChans: bigint; } /** * @generated from protobuf message lnrpc.StopRequest @@ -4546,7 +4546,7 @@ export interface ChannelEdgeUpdate { /** * @generated from protobuf field: int64 capacity = 3; */ - capacity: number; + capacity: bigint; /** * @generated from protobuf field: lnrpc.RoutingPolicy routing_policy = 4; */ @@ -4576,7 +4576,7 @@ export interface ClosedChannelUpdate { /** * @generated from protobuf field: int64 capacity = 2; */ - capacity: number; + capacity: bigint; /** * @generated from protobuf field: uint32 closed_height = 3; */ @@ -4660,19 +4660,19 @@ export interface AMPInvoiceState { * * @generated from protobuf field: uint64 settle_index = 2; */ - settleIndex: number; + settleIndex: bigint; /** * The time this HTLC set was settled expressed in unix epoch. * * @generated from protobuf field: int64 settle_time = 3; */ - settleTime: number; + settleTime: bigint; /** * The total amount paid for the sub-invoice expressed in milli satoshis. * * @generated from protobuf field: int64 amt_paid_msat = 5; */ - amtPaidMsat: number; + amtPaidMsat: bigint; } /** * @generated from protobuf message lnrpc.Invoice @@ -4714,7 +4714,7 @@ export interface Invoice { * * @generated from protobuf field: int64 value = 5; */ - value: number; + value: bigint; /** * * The value of this invoice in millisatoshis @@ -4723,7 +4723,7 @@ export interface Invoice { * * @generated from protobuf field: int64 value_msat = 23; */ - valueMsat: number; + valueMsat: bigint; /** * * Whether this invoice has been fulfilled @@ -4741,7 +4741,7 @@ export interface Invoice { * * @generated from protobuf field: int64 creation_date = 7; */ - creationDate: number; + creationDate: bigint; /** * * When this invoice was settled. @@ -4749,7 +4749,7 @@ export interface Invoice { * * @generated from protobuf field: int64 settle_date = 8; */ - settleDate: number; + settleDate: bigint; /** * * A bare-bones invoice for a payment within the Lightning Network. With the @@ -4775,7 +4775,7 @@ export interface Invoice { * * @generated from protobuf field: int64 expiry = 11; */ - expiry: number; + expiry: bigint; /** * Fallback on-chain address. * @@ -4787,7 +4787,7 @@ export interface Invoice { * * @generated from protobuf field: uint64 cltv_expiry = 13; */ - cltvExpiry: number; + cltvExpiry: bigint; /** * * Route hints that can each be individually used to assist in reaching the @@ -4812,7 +4812,7 @@ export interface Invoice { * * @generated from protobuf field: uint64 add_index = 16; */ - addIndex: number; + addIndex: bigint; /** * * The "settle" index of this invoice. Each newly settled invoice will @@ -4823,14 +4823,14 @@ export interface Invoice { * * @generated from protobuf field: uint64 settle_index = 17; */ - settleIndex: number; + settleIndex: bigint; /** * Deprecated, use amt_paid_sat or amt_paid_msat. * * @deprecated * @generated from protobuf field: int64 amt_paid = 18 [deprecated = true]; */ - amtPaid: number; + amtPaid: bigint; /** * * The amount that was accepted for this invoice, in satoshis. This will ONLY @@ -4843,7 +4843,7 @@ export interface Invoice { * * @generated from protobuf field: int64 amt_paid_sat = 19; */ - amtPaidSat: number; + amtPaidSat: bigint; /** * * The amount that was accepted for this invoice, in millisatoshis. This will @@ -4856,7 +4856,7 @@ export interface Invoice { * * @generated from protobuf field: int64 amt_paid_msat = 20; */ - amtPaidMsat: number; + amtPaidMsat: bigint; /** * * The state the invoice is in. @@ -4963,13 +4963,13 @@ export interface InvoiceHTLC { * * @generated from protobuf field: uint64 htlc_index = 2; */ - htlcIndex: number; + htlcIndex: bigint; /** * The amount of the htlc in msat. * * @generated from protobuf field: uint64 amt_msat = 3; */ - amtMsat: number; + amtMsat: bigint; /** * Block height at which this htlc was accepted. * @@ -4981,13 +4981,13 @@ export interface InvoiceHTLC { * * @generated from protobuf field: int64 accept_time = 5; */ - acceptTime: number; + acceptTime: bigint; /** * Time at which this htlc was settled or canceled. * * @generated from protobuf field: int64 resolve_time = 6; */ - resolveTime: number; + resolveTime: bigint; /** * Block height at which this htlc expires. * @@ -5013,7 +5013,7 @@ export interface InvoiceHTLC { * * @generated from protobuf field: uint64 mpp_total_amt_msat = 10; */ - mppTotalAmtMsat: number; + mppTotalAmtMsat: bigint; /** * Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. * @@ -5088,7 +5088,7 @@ export interface AddInvoiceResponse { * * @generated from protobuf field: uint64 add_index = 16; */ - addIndex: number; + addIndex: bigint; /** * * The payment address of the generated invoice. This value should be used @@ -5142,13 +5142,13 @@ export interface ListInvoiceRequest { * * @generated from protobuf field: uint64 index_offset = 4; */ - indexOffset: number; + 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: number; + numMaxInvoices: bigint; /** * * If set, the invoices returned will result from seeking backwards from the @@ -5177,7 +5177,7 @@ export interface ListInvoiceResponse { * * @generated from protobuf field: uint64 last_index_offset = 2; */ - lastIndexOffset: number; + lastIndexOffset: bigint; /** * * The index of the last item in the set of returned invoices. This can be used @@ -5185,7 +5185,7 @@ export interface ListInvoiceResponse { * * @generated from protobuf field: uint64 first_index_offset = 3; */ - firstIndexOffset: number; + firstIndexOffset: bigint; } /** * @generated from protobuf message lnrpc.InvoiceSubscription @@ -5200,7 +5200,7 @@ export interface InvoiceSubscription { * * @generated from protobuf field: uint64 add_index = 1; */ - addIndex: number; + addIndex: bigint; /** * * If specified (non-zero), then we'll first start by sending out @@ -5210,7 +5210,7 @@ export interface InvoiceSubscription { * * @generated from protobuf field: uint64 settle_index = 2; */ - settleIndex: number; + settleIndex: bigint; } /** * @generated from protobuf message lnrpc.Payment @@ -5228,21 +5228,21 @@ export interface Payment { * @deprecated * @generated from protobuf field: int64 value = 2 [deprecated = true]; */ - value: number; + value: bigint; /** * Deprecated, use creation_time_ns * * @deprecated * @generated from protobuf field: int64 creation_date = 3 [deprecated = true]; */ - creationDate: number; + creationDate: bigint; /** * Deprecated, use fee_sat or fee_msat. * * @deprecated * @generated from protobuf field: int64 fee = 5 [deprecated = true]; */ - fee: number; + fee: bigint; /** * The payment preimage * @@ -5254,13 +5254,13 @@ export interface Payment { * * @generated from protobuf field: int64 value_sat = 7; */ - valueSat: number; + valueSat: bigint; /** * The value of the payment in milli-satoshis * * @generated from protobuf field: int64 value_msat = 8; */ - valueMsat: number; + valueMsat: bigint; /** * The optional payment request being fulfilled. * @@ -5278,19 +5278,19 @@ export interface Payment { * * @generated from protobuf field: int64 fee_sat = 11; */ - feeSat: number; + feeSat: bigint; /** * The fee paid for this payment in milli-satoshis * * @generated from protobuf field: int64 fee_msat = 12; */ - feeMsat: number; + feeMsat: bigint; /** * The time in UNIX nanoseconds at which the payment was created. * * @generated from protobuf field: int64 creation_time_ns = 13; */ - creationTimeNs: number; + creationTimeNs: bigint; /** * The HTLCs made in attempt to settle the payment. * @@ -5305,7 +5305,7 @@ export interface Payment { * * @generated from protobuf field: uint64 payment_index = 15; */ - paymentIndex: number; + paymentIndex: bigint; /** * @generated from protobuf field: lnrpc.PaymentFailureReason failure_reason = 16; */ @@ -5341,7 +5341,7 @@ export interface HTLCAttempt { * * @generated from protobuf field: uint64 attempt_id = 7; */ - attemptId: number; + attemptId: bigint; /** * The status of the HTLC. * @@ -5359,7 +5359,7 @@ export interface HTLCAttempt { * * @generated from protobuf field: int64 attempt_time_ns = 3; */ - attemptTimeNs: number; + attemptTimeNs: bigint; /** * * The time in UNIX nanoseconds at which this HTLC was settled or failed. @@ -5367,7 +5367,7 @@ export interface HTLCAttempt { * * @generated from protobuf field: int64 resolve_time_ns = 4; */ - resolveTimeNs: number; + resolveTimeNs: bigint; /** * Detailed htlc failure info. * @@ -5422,13 +5422,13 @@ export interface ListPaymentsRequest { * * @generated from protobuf field: uint64 index_offset = 2; */ - indexOffset: number; + indexOffset: bigint; /** * The maximal number of payments returned in the response to this query. * * @generated from protobuf field: uint64 max_payments = 3; */ - maxPayments: number; + maxPayments: bigint; /** * * If set, the payments returned will result from seeking backwards from the @@ -5466,7 +5466,7 @@ export interface ListPaymentsResponse { * * @generated from protobuf field: uint64 first_index_offset = 2; */ - firstIndexOffset: number; + firstIndexOffset: bigint; /** * * The index of the last item in the set of returned payments. This can be used @@ -5474,7 +5474,7 @@ export interface ListPaymentsResponse { * * @generated from protobuf field: uint64 last_index_offset = 3; */ - lastIndexOffset: number; + lastIndexOffset: bigint; /** * * Will only be set if count_total_payments in the request was set. Represents @@ -5484,7 +5484,7 @@ export interface ListPaymentsResponse { * * @generated from protobuf field: uint64 total_num_payments = 4; */ - totalNumPayments: number; + totalNumPayments: bigint; } /** * @generated from protobuf message lnrpc.DeletePaymentRequest @@ -5607,15 +5607,15 @@ export interface PayReq { /** * @generated from protobuf field: int64 num_satoshis = 3; */ - numSatoshis: number; + numSatoshis: bigint; /** * @generated from protobuf field: int64 timestamp = 4; */ - timestamp: number; + timestamp: bigint; /** * @generated from protobuf field: int64 expiry = 5; */ - expiry: number; + expiry: bigint; /** * @generated from protobuf field: string description = 6; */ @@ -5631,7 +5631,7 @@ export interface PayReq { /** * @generated from protobuf field: int64 cltv_expiry = 9; */ - cltvExpiry: number; + cltvExpiry: bigint; /** * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; */ @@ -5643,7 +5643,7 @@ export interface PayReq { /** * @generated from protobuf field: int64 num_msat = 12; */ - numMsat: number; + numMsat: bigint; /** * @generated from protobuf field: map features = 13; */ @@ -5694,14 +5694,14 @@ export interface ChannelFeeReport { * * @generated from protobuf field: int64 base_fee_msat = 2; */ - baseFeeMsat: number; + 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: number; + feePerMil: bigint; /** * The effective fee rate in milli-satoshis. Computed by dividing the * fee_per_mil value by 1 million. @@ -5727,21 +5727,21 @@ export interface FeeReportResponse { * * @generated from protobuf field: uint64 day_fee_sum = 2; */ - dayFeeSum: number; + 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: number; + 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: number; + monthFeeSum: bigint; } /** * @generated from protobuf message lnrpc.PolicyUpdateRequest @@ -5774,7 +5774,7 @@ export interface PolicyUpdateRequest { * * @generated from protobuf field: int64 base_fee_msat = 3; */ - baseFeeMsat: number; + baseFeeMsat: bigint; /** * The effective fee rate in milli-satoshis. The precision of this value * goes up to 6 decimal places, so 1e-6. @@ -5800,14 +5800,14 @@ export interface PolicyUpdateRequest { * * @generated from protobuf field: uint64 max_htlc_msat = 6; */ - maxHtlcMsat: number; + 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: number; + minHtlcMsat: bigint; /** * If true, min_htlc_msat is applied. * @@ -5860,7 +5860,7 @@ export interface ForwardingHistoryRequest { * * @generated from protobuf field: uint64 start_time = 1; */ - startTime: number; + 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 @@ -5868,7 +5868,7 @@ export interface ForwardingHistoryRequest { * * @generated from protobuf field: uint64 end_time = 2; */ - endTime: number; + 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 @@ -5902,7 +5902,7 @@ export interface ForwardingEvent { * @deprecated * @generated from protobuf field: uint64 timestamp = 1 [deprecated = true]; */ - timestamp: number; + timestamp: bigint; /** * The incoming channel ID that carried the HTLC that created the circuit. * @@ -5922,47 +5922,47 @@ export interface ForwardingEvent { * * @generated from protobuf field: uint64 amt_in = 5; */ - amtIn: number; + 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: number; + amtOut: bigint; /** * The total fee (in satoshis) that this payment circuit carried. * * @generated from protobuf field: uint64 fee = 7; */ - fee: number; + fee: bigint; /** * The total fee (in milli-satoshis) that this payment circuit carried. * * @generated from protobuf field: uint64 fee_msat = 8; */ - feeMsat: number; + 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: number; + 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: number; + 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: number; + timestampNs: bigint; /** * The peer alias of the incoming channel. * @@ -6165,7 +6165,7 @@ export interface BakeMacaroonRequest { * * @generated from protobuf field: uint64 root_key_id = 2; */ - rootKeyId: number; + rootKeyId: bigint; /** * * Informs the RPC on whether to allow external permissions that LND is not @@ -6200,7 +6200,7 @@ export interface ListMacaroonIDsResponse { * * @generated from protobuf field: repeated uint64 root_key_ids = 1; */ - rootKeyIds: number[]; + rootKeyIds: bigint[]; } /** * @generated from protobuf message lnrpc.DeleteMacaroonIDRequest @@ -6211,7 +6211,7 @@ export interface DeleteMacaroonIDRequest { * * @generated from protobuf field: uint64 root_key_id = 1; */ - rootKeyId: number; + rootKeyId: bigint; } /** * @generated from protobuf message lnrpc.DeleteMacaroonIDResponse @@ -6276,7 +6276,7 @@ export interface Failure { * * @generated from protobuf field: uint64 htlc_msat = 4; */ - htlcMsat: number; + htlcMsat: bigint; /** * The sha256 sum of the onion payload. * @@ -6516,7 +6516,7 @@ export interface ChannelUpdate { * * @generated from protobuf field: uint64 htlc_minimum_msat = 7; */ - htlcMinimumMsat: number; + htlcMinimumMsat: bigint; /** * * The base fee that must be used for incoming HTLC's to this particular @@ -6539,7 +6539,7 @@ export interface ChannelUpdate { * * @generated from protobuf field: uint64 htlc_maximum_msat = 11; */ - htlcMaximumMsat: number; + htlcMaximumMsat: bigint; /** * * The set of data that was appended to this message, some of which we may @@ -6621,7 +6621,7 @@ export interface RPCMiddlewareRequest { * * @generated from protobuf field: uint64 request_id = 1; */ - requestId: number; + requestId: bigint; /** * * The raw bytes of the complete macaroon as sent by the gRPC client in the @@ -6710,7 +6710,7 @@ export interface RPCMiddlewareRequest { * * @generated from protobuf field: uint64 msg_id = 7; */ - msgId: number; + msgId: bigint; } /** * @generated from protobuf message lnrpc.StreamAuth @@ -6785,7 +6785,7 @@ export interface RPCMiddlewareResponse { * * @generated from protobuf field: uint64 ref_msg_id = 1; */ - refMsgId: number; + refMsgId: bigint; /** * @generated from protobuf oneof: middleware_message */ @@ -7343,12 +7343,12 @@ export enum UpdateFailure { class LookupHtlcRequest$Type extends MessageType { constructor() { super("lnrpc.LookupHtlcRequest", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, htlcIndex: 0 }; + const message = { chanId: 0n, htlcIndex: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -7360,10 +7360,10 @@ class LookupHtlcRequest$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 chan_id */ 1: - message.chanId = reader.uint64().toNumber(); + message.chanId = reader.uint64().toBigInt(); break; case /* uint64 htlc_index */ 2: - message.htlcIndex = reader.uint64().toNumber(); + message.htlcIndex = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -7378,10 +7378,10 @@ class LookupHtlcRequest$Type extends MessageType { } internalBinaryWrite(message: LookupHtlcRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 chan_id = 1; */ - if (message.chanId !== 0) + if (message.chanId !== 0n) writer.tag(1, WireType.Varint).uint64(message.chanId); /* uint64 htlc_index = 2; */ - if (message.htlcIndex !== 0) + if (message.htlcIndex !== 0n) writer.tag(2, WireType.Varint).uint64(message.htlcIndex); let u = options.writeUnknownFields; if (u !== false) @@ -7627,14 +7627,14 @@ class Utxo$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ } + { no: 6, name: "confirmations", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): Utxo { - const message = { addressType: 0, address: "", amountSat: 0, pkScript: "", confirmations: 0 }; + 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); @@ -7652,7 +7652,7 @@ class Utxo$Type extends MessageType { message.address = reader.string(); break; case /* int64 amount_sat */ 3: - message.amountSat = reader.int64().toNumber(); + message.amountSat = reader.int64().toBigInt(); break; case /* string pk_script */ 4: message.pkScript = reader.string(); @@ -7661,7 +7661,7 @@ class Utxo$Type extends MessageType { message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); break; case /* int64 confirmations */ 6: - message.confirmations = reader.int64().toNumber(); + message.confirmations = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -7682,7 +7682,7 @@ class Utxo$Type extends MessageType { if (message.address !== "") writer.tag(2, WireType.LengthDelimited).string(message.address); /* int64 amount_sat = 3; */ - if (message.amountSat !== 0) + if (message.amountSat !== 0n) writer.tag(3, WireType.Varint).int64(message.amountSat); /* string pk_script = 4; */ if (message.pkScript !== "") @@ -7691,7 +7691,7 @@ class Utxo$Type extends MessageType { if (message.outpoint) OutPoint.internalBinaryWrite(message.outpoint, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); /* int64 confirmations = 6; */ - if (message.confirmations !== 0) + if (message.confirmations !== 0n) writer.tag(6, WireType.Varint).int64(message.confirmations); let u = options.writeUnknownFields; if (u !== false) @@ -7710,13 +7710,13 @@ class OutputDetail$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, amount: 0, isOurAddress: false }; + 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); @@ -7737,10 +7737,10 @@ class OutputDetail$Type extends MessageType { message.pkScript = reader.string(); break; case /* int64 output_index */ 4: - message.outputIndex = reader.int64().toNumber(); + message.outputIndex = reader.int64().toBigInt(); break; case /* int64 amount */ 5: - message.amount = reader.int64().toNumber(); + message.amount = reader.int64().toBigInt(); break; case /* bool is_our_address */ 6: message.isOurAddress = reader.bool(); @@ -7767,10 +7767,10 @@ class OutputDetail$Type extends MessageType { if (message.pkScript !== "") writer.tag(3, WireType.LengthDelimited).string(message.pkScript); /* int64 output_index = 4; */ - if (message.outputIndex !== 0) + if (message.outputIndex !== 0n) writer.tag(4, WireType.Varint).int64(message.outputIndex); /* int64 amount = 5; */ - if (message.amount !== 0) + if (message.amount !== 0n) writer.tag(5, WireType.Varint).int64(message.amount); /* bool is_our_address = 6; */ if (message.isOurAddress !== false) @@ -7790,12 +7790,12 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -7804,7 +7804,7 @@ class Transaction$Type extends MessageType { ]); } create(value?: PartialMessage): Transaction { - const message = { txHash: "", amount: 0, numConfirmations: 0, blockHash: "", blockHeight: 0, timeStamp: 0, totalFees: 0, destAddresses: [], outputDetails: [], rawTxHex: "", label: "", previousOutpoints: [] }; + 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); @@ -7819,7 +7819,7 @@ class Transaction$Type extends MessageType { message.txHash = reader.string(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); + message.amount = reader.int64().toBigInt(); break; case /* int32 num_confirmations */ 3: message.numConfirmations = reader.int32(); @@ -7831,10 +7831,10 @@ class Transaction$Type extends MessageType { message.blockHeight = reader.int32(); break; case /* int64 time_stamp */ 6: - message.timeStamp = reader.int64().toNumber(); + message.timeStamp = reader.int64().toBigInt(); break; case /* int64 total_fees */ 7: - message.totalFees = reader.int64().toNumber(); + message.totalFees = reader.int64().toBigInt(); break; case /* repeated string dest_addresses = 8 [deprecated = true];*/ 8: message.destAddresses.push(reader.string()); @@ -7867,7 +7867,7 @@ class Transaction$Type extends MessageType { if (message.txHash !== "") writer.tag(1, WireType.LengthDelimited).string(message.txHash); /* int64 amount = 2; */ - if (message.amount !== 0) + if (message.amount !== 0n) writer.tag(2, WireType.Varint).int64(message.amount); /* int32 num_confirmations = 3; */ if (message.numConfirmations !== 0) @@ -7879,10 +7879,10 @@ class Transaction$Type extends MessageType { if (message.blockHeight !== 0) writer.tag(5, WireType.Varint).int32(message.blockHeight); /* int64 time_stamp = 6; */ - if (message.timeStamp !== 0) + if (message.timeStamp !== 0n) writer.tag(6, WireType.Varint).int64(message.timeStamp); /* int64 total_fees = 7; */ - if (message.totalFees !== 0) + 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++) @@ -8021,9 +8021,9 @@ export const TransactionDetails = new TransactionDetails$Type(); class FeeLimit$Type extends MessageType { constructor() { super("lnrpc.FeeLimit", [ - { no: 1, name: "fixed", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "fixed_msat", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "percent", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } + { 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 { @@ -8041,19 +8041,19 @@ class FeeLimit$Type extends MessageType { case /* int64 fixed */ 1: message.limit = { oneofKind: "fixed", - fixed: reader.int64().toNumber() + fixed: reader.int64().toBigInt() }; break; case /* int64 fixed_msat */ 3: message.limit = { oneofKind: "fixedMsat", - fixedMsat: reader.int64().toNumber() + fixedMsat: reader.int64().toBigInt() }; break; case /* int64 percent */ 2: message.limit = { oneofKind: "percent", - percent: reader.int64().toNumber() + percent: reader.int64().toBigInt() }; break; default: @@ -8093,8 +8093,8 @@ class SendRequest$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -8110,7 +8110,7 @@ class SendRequest$Type extends MessageType { ]); } create(value?: PartialMessage): SendRequest { - const message = { dest: new Uint8Array(0), destString: "", amt: 0, amtMsat: 0, paymentHash: new Uint8Array(0), paymentHashString: "", paymentRequest: "", finalCltvDelta: 0, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), cltvLimit: 0, destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], paymentAddr: new Uint8Array(0) }; + 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); @@ -8128,10 +8128,10 @@ class SendRequest$Type extends MessageType { message.destString = reader.string(); break; case /* int64 amt */ 3: - message.amt = reader.int64().toNumber(); + message.amt = reader.int64().toBigInt(); break; case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toNumber(); + message.amtMsat = reader.int64().toBigInt(); break; case /* bytes payment_hash */ 4: message.paymentHash = reader.bytes(); @@ -8208,10 +8208,10 @@ class SendRequest$Type extends MessageType { if (message.destString !== "") writer.tag(2, WireType.LengthDelimited).string(message.destString); /* int64 amt = 3; */ - if (message.amt !== 0) + if (message.amt !== 0n) writer.tag(3, WireType.Varint).int64(message.amt); /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0) + if (message.amtMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.amtMsat); /* bytes payment_hash = 4; */ if (message.paymentHash.length) @@ -8399,13 +8399,13 @@ class ChannelAcceptRequest$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "push_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "dust_limit", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "max_value_in_flight", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "channel_reserve", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "min_htlc", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -8415,7 +8415,7 @@ class ChannelAcceptRequest$Type extends MessageType { ]); } create(value?: PartialMessage): ChannelAcceptRequest { - const message = { nodePubkey: new Uint8Array(0), chainHash: new Uint8Array(0), pendingChanId: new Uint8Array(0), fundingAmt: 0, pushAmt: 0, dustLimit: 0, maxValueInFlight: 0, channelReserve: 0, minHtlc: 0, feePerKw: 0, csvDelay: 0, maxAcceptedHtlcs: 0, channelFlags: 0, commitmentType: 0, wantsZeroConf: false, wantsScidAlias: false }; + 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); @@ -8436,25 +8436,25 @@ class ChannelAcceptRequest$Type extends MessageType { message.pendingChanId = reader.bytes(); break; case /* uint64 funding_amt */ 4: - message.fundingAmt = reader.uint64().toNumber(); + message.fundingAmt = reader.uint64().toBigInt(); break; case /* uint64 push_amt */ 5: - message.pushAmt = reader.uint64().toNumber(); + message.pushAmt = reader.uint64().toBigInt(); break; case /* uint64 dust_limit */ 6: - message.dustLimit = reader.uint64().toNumber(); + message.dustLimit = reader.uint64().toBigInt(); break; case /* uint64 max_value_in_flight */ 7: - message.maxValueInFlight = reader.uint64().toNumber(); + message.maxValueInFlight = reader.uint64().toBigInt(); break; case /* uint64 channel_reserve */ 8: - message.channelReserve = reader.uint64().toNumber(); + message.channelReserve = reader.uint64().toBigInt(); break; case /* uint64 min_htlc */ 9: - message.minHtlc = reader.uint64().toNumber(); + message.minHtlc = reader.uint64().toBigInt(); break; case /* uint64 fee_per_kw */ 10: - message.feePerKw = reader.uint64().toNumber(); + message.feePerKw = reader.uint64().toBigInt(); break; case /* uint32 csv_delay */ 11: message.csvDelay = reader.uint32(); @@ -8496,25 +8496,25 @@ class ChannelAcceptRequest$Type extends MessageType { if (message.pendingChanId.length) writer.tag(3, WireType.LengthDelimited).bytes(message.pendingChanId); /* uint64 funding_amt = 4; */ - if (message.fundingAmt !== 0) + if (message.fundingAmt !== 0n) writer.tag(4, WireType.Varint).uint64(message.fundingAmt); /* uint64 push_amt = 5; */ - if (message.pushAmt !== 0) + if (message.pushAmt !== 0n) writer.tag(5, WireType.Varint).uint64(message.pushAmt); /* uint64 dust_limit = 6; */ - if (message.dustLimit !== 0) + if (message.dustLimit !== 0n) writer.tag(6, WireType.Varint).uint64(message.dustLimit); /* uint64 max_value_in_flight = 7; */ - if (message.maxValueInFlight !== 0) + if (message.maxValueInFlight !== 0n) writer.tag(7, WireType.Varint).uint64(message.maxValueInFlight); /* uint64 channel_reserve = 8; */ - if (message.channelReserve !== 0) + if (message.channelReserve !== 0n) writer.tag(8, WireType.Varint).uint64(message.channelReserve); /* uint64 min_htlc = 9; */ - if (message.minHtlc !== 0) + if (message.minHtlc !== 0n) writer.tag(9, WireType.Varint).uint64(message.minHtlc); /* uint64 fee_per_kw = 10; */ - if (message.feePerKw !== 0) + if (message.feePerKw !== 0n) writer.tag(10, WireType.Varint).uint64(message.feePerKw); /* uint32 csv_delay = 11; */ if (message.csvDelay !== 0) @@ -8553,16 +8553,16 @@ class ChannelAcceptResponse$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "in_flight_max_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, inFlightMaxMsat: 0, maxHtlcCount: 0, minHtlcIn: 0, minAcceptDepth: 0, zeroConf: false }; + 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); @@ -8589,16 +8589,16 @@ class ChannelAcceptResponse$Type extends MessageType { message.csvDelay = reader.uint32(); break; case /* uint64 reserve_sat */ 6: - message.reserveSat = reader.uint64().toNumber(); + message.reserveSat = reader.uint64().toBigInt(); break; case /* uint64 in_flight_max_msat */ 7: - message.inFlightMaxMsat = reader.uint64().toNumber(); + 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().toNumber(); + message.minHtlcIn = reader.uint64().toBigInt(); break; case /* uint32 min_accept_depth */ 10: message.minAcceptDepth = reader.uint32(); @@ -8634,16 +8634,16 @@ class ChannelAcceptResponse$Type extends MessageType { if (message.csvDelay !== 0) writer.tag(5, WireType.Varint).uint32(message.csvDelay); /* uint64 reserve_sat = 6; */ - if (message.reserveSat !== 0) + if (message.reserveSat !== 0n) writer.tag(6, WireType.Varint).uint64(message.reserveSat); /* uint64 in_flight_max_msat = 7; */ - if (message.inFlightMaxMsat !== 0) + 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 !== 0) + if (message.minHtlcIn !== 0n) writer.tag(9, WireType.Varint).uint64(message.minHtlcIn); /* uint32 min_accept_depth = 10; */ if (message.minAcceptDepth !== 0) @@ -8901,7 +8901,7 @@ export const LightningAddress = new LightningAddress$Type(); 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: 2 /*LongType.NUMBER*/ } }, + { 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*/ } @@ -8951,12 +8951,12 @@ class EstimateFeeRequest$Type extends MessageType { key = reader.string(); break; case 2: - val = reader.int64().toNumber(); + val = reader.int64().toBigInt(); break; default: throw new globalThis.Error("unknown map entry field for field lnrpc.EstimateFeeRequest.AddrToAmount"); } } - map[key ?? ""] = val ?? 0; + map[key ?? ""] = val ?? 0n; } internalBinaryWrite(message: EstimateFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ @@ -8985,13 +8985,13 @@ export const EstimateFeeRequest = new EstimateFeeRequest$Type(); class EstimateFeeResponse$Type extends MessageType { constructor() { super("lnrpc.EstimateFeeResponse", [ - { no: 1, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "feerate_sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, feerateSatPerByte: 0, satPerVbyte: 0 }; + 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); @@ -9003,13 +9003,13 @@ class EstimateFeeResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 fee_sat */ 1: - message.feeSat = reader.int64().toNumber(); + message.feeSat = reader.int64().toBigInt(); break; case /* int64 feerate_sat_per_byte = 2 [deprecated = true];*/ 2: - message.feerateSatPerByte = reader.int64().toNumber(); + message.feerateSatPerByte = reader.int64().toBigInt(); break; case /* uint64 sat_per_vbyte */ 3: - message.satPerVbyte = reader.uint64().toNumber(); + message.satPerVbyte = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -9024,13 +9024,13 @@ class EstimateFeeResponse$Type extends MessageType { } internalBinaryWrite(message: EstimateFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 fee_sat = 1; */ - if (message.feeSat !== 0) + if (message.feeSat !== 0n) writer.tag(1, WireType.Varint).int64(message.feeSat); /* int64 feerate_sat_per_byte = 2 [deprecated = true]; */ - if (message.feerateSatPerByte !== 0) + if (message.feerateSatPerByte !== 0n) writer.tag(2, WireType.Varint).int64(message.feerateSatPerByte); /* uint64 sat_per_vbyte = 3; */ - if (message.satPerVbyte !== 0) + if (message.satPerVbyte !== 0n) writer.tag(3, WireType.Varint).uint64(message.satPerVbyte); let u = options.writeUnknownFields; if (u !== false) @@ -9046,17 +9046,17 @@ export const EstimateFeeResponse = new EstimateFeeResponse$Type(); 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: 2 /*LongType.NUMBER*/ } }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, satPerByte: 0, label: "", minConfs: 0, spendUnconfirmed: false }; + 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); @@ -9074,10 +9074,10 @@ class SendManyRequest$Type extends MessageType { message.targetConf = reader.int32(); break; case /* uint64 sat_per_vbyte */ 4: - message.satPerVbyte = reader.uint64().toNumber(); + message.satPerVbyte = reader.uint64().toBigInt(); break; case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toNumber(); + message.satPerByte = reader.int64().toBigInt(); break; case /* string label */ 6: message.label = reader.string(); @@ -9108,12 +9108,12 @@ class SendManyRequest$Type extends MessageType { key = reader.string(); break; case 2: - val = reader.int64().toNumber(); + val = reader.int64().toBigInt(); break; default: throw new globalThis.Error("unknown map entry field for field lnrpc.SendManyRequest.AddrToAmount"); } } - map[key ?? ""] = val ?? 0; + map[key ?? ""] = val ?? 0n; } internalBinaryWrite(message: SendManyRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ @@ -9123,10 +9123,10 @@ class SendManyRequest$Type extends MessageType { if (message.targetConf !== 0) writer.tag(3, WireType.Varint).int32(message.targetConf); /* uint64 sat_per_vbyte = 4; */ - if (message.satPerVbyte !== 0) + if (message.satPerVbyte !== 0n) writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== 0) + if (message.satPerByte !== 0n) writer.tag(5, WireType.Varint).int64(message.satPerByte); /* string label = 6; */ if (message.label !== "") @@ -9199,10 +9199,10 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -9210,7 +9210,7 @@ class SendCoinsRequest$Type extends MessageType { ]); } create(value?: PartialMessage): SendCoinsRequest { - const message = { addr: "", amount: 0, targetConf: 0, satPerVbyte: 0, satPerByte: 0, sendAll: false, label: "", minConfs: 0, spendUnconfirmed: false }; + 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); @@ -9225,16 +9225,16 @@ class SendCoinsRequest$Type extends MessageType { message.addr = reader.string(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); + 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().toNumber(); + message.satPerVbyte = reader.uint64().toBigInt(); break; case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toNumber(); + message.satPerByte = reader.int64().toBigInt(); break; case /* bool send_all */ 6: message.sendAll = reader.bool(); @@ -9264,16 +9264,16 @@ class SendCoinsRequest$Type extends MessageType { if (message.addr !== "") writer.tag(1, WireType.LengthDelimited).string(message.addr); /* int64 amount = 2; */ - if (message.amount !== 0) + 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 !== 0) + if (message.satPerVbyte !== 0n) writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== 0) + if (message.satPerByte !== 0n) writer.tag(5, WireType.Varint).int64(message.satPerByte); /* bool send_all = 6; */ if (message.sendAll !== false) @@ -9768,11 +9768,11 @@ class ConnectPeerRequest$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ } + { no: 3, name: "timeout", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): ConnectPeerRequest { - const message = { perm: false, timeout: 0 }; + const message = { perm: false, timeout: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -9790,7 +9790,7 @@ class ConnectPeerRequest$Type extends MessageType { message.perm = reader.bool(); break; case /* uint64 timeout */ 3: - message.timeout = reader.uint64().toNumber(); + message.timeout = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -9811,7 +9811,7 @@ class ConnectPeerRequest$Type extends MessageType { if (message.perm !== false) writer.tag(2, WireType.Varint).bool(message.perm); /* uint64 timeout = 3; */ - if (message.timeout !== 0) + if (message.timeout !== 0n) writer.tag(3, WireType.Varint).uint64(message.timeout); let u = options.writeUnknownFields; if (u !== false) @@ -9927,16 +9927,16 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "forwarding_channel", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "forwarding_htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, hashLock: new Uint8Array(0), expirationHeight: 0, htlcIndex: 0, forwardingChannel: 0, forwardingHtlcIndex: 0 }; + 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); @@ -9951,7 +9951,7 @@ class HTLC$Type extends MessageType { message.incoming = reader.bool(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); + message.amount = reader.int64().toBigInt(); break; case /* bytes hash_lock */ 3: message.hashLock = reader.bytes(); @@ -9960,13 +9960,13 @@ class HTLC$Type extends MessageType { message.expirationHeight = reader.uint32(); break; case /* uint64 htlc_index */ 5: - message.htlcIndex = reader.uint64().toNumber(); + message.htlcIndex = reader.uint64().toBigInt(); break; case /* uint64 forwarding_channel */ 6: - message.forwardingChannel = reader.uint64().toNumber(); + message.forwardingChannel = reader.uint64().toBigInt(); break; case /* uint64 forwarding_htlc_index */ 7: - message.forwardingHtlcIndex = reader.uint64().toNumber(); + message.forwardingHtlcIndex = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -9984,7 +9984,7 @@ class HTLC$Type extends MessageType { if (message.incoming !== false) writer.tag(1, WireType.Varint).bool(message.incoming); /* int64 amount = 2; */ - if (message.amount !== 0) + if (message.amount !== 0n) writer.tag(2, WireType.Varint).int64(message.amount); /* bytes hash_lock = 3; */ if (message.hashLock.length) @@ -9993,13 +9993,13 @@ class HTLC$Type extends MessageType { if (message.expirationHeight !== 0) writer.tag(4, WireType.Varint).uint32(message.expirationHeight); /* uint64 htlc_index = 5; */ - if (message.htlcIndex !== 0) + if (message.htlcIndex !== 0n) writer.tag(5, WireType.Varint).uint64(message.htlcIndex); /* uint64 forwarding_channel = 6; */ - if (message.forwardingChannel !== 0) + if (message.forwardingChannel !== 0n) writer.tag(6, WireType.Varint).uint64(message.forwardingChannel); /* uint64 forwarding_htlc_index = 7; */ - if (message.forwardingHtlcIndex !== 0) + if (message.forwardingHtlcIndex !== 0n) writer.tag(7, WireType.Varint).uint64(message.forwardingHtlcIndex); let u = options.writeUnknownFields; if (u !== false) @@ -10016,15 +10016,15 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "dust_limit_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "max_pending_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, dustLimitSat: 0, maxPendingAmtMsat: 0, minHtlcMsat: 0, maxAcceptedHtlcs: 0 }; + 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); @@ -10039,16 +10039,16 @@ class ChannelConstraints$Type extends MessageType { message.csvDelay = reader.uint32(); break; case /* uint64 chan_reserve_sat */ 2: - message.chanReserveSat = reader.uint64().toNumber(); + message.chanReserveSat = reader.uint64().toBigInt(); break; case /* uint64 dust_limit_sat */ 3: - message.dustLimitSat = reader.uint64().toNumber(); + message.dustLimitSat = reader.uint64().toBigInt(); break; case /* uint64 max_pending_amt_msat */ 4: - message.maxPendingAmtMsat = reader.uint64().toNumber(); + message.maxPendingAmtMsat = reader.uint64().toBigInt(); break; case /* uint64 min_htlc_msat */ 5: - message.minHtlcMsat = reader.uint64().toNumber(); + message.minHtlcMsat = reader.uint64().toBigInt(); break; case /* uint32 max_accepted_htlcs */ 6: message.maxAcceptedHtlcs = reader.uint32(); @@ -10069,16 +10069,16 @@ class ChannelConstraints$Type extends MessageType { if (message.csvDelay !== 0) writer.tag(1, WireType.Varint).uint32(message.csvDelay); /* uint64 chan_reserve_sat = 2; */ - if (message.chanReserveSat !== 0) + if (message.chanReserveSat !== 0n) writer.tag(2, WireType.Varint).uint64(message.chanReserveSat); /* uint64 dust_limit_sat = 3; */ - if (message.dustLimitSat !== 0) + if (message.dustLimitSat !== 0n) writer.tag(3, WireType.Varint).uint64(message.dustLimitSat); /* uint64 max_pending_amt_msat = 4; */ - if (message.maxPendingAmtMsat !== 0) + if (message.maxPendingAmtMsat !== 0n) writer.tag(4, WireType.Varint).uint64(message.maxPendingAmtMsat); /* uint64 min_htlc_msat = 5; */ - if (message.minHtlcMsat !== 0) + if (message.minHtlcMsat !== 0n) writer.tag(5, WireType.Varint).uint64(message.minHtlcMsat); /* uint32 max_accepted_htlcs = 6; */ if (message.maxAcceptedHtlcs !== 0) @@ -10101,39 +10101,39 @@ class Channel$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "unsettled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "total_satoshis_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 13, name: "total_satoshis_received", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 14, name: "num_updates", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 21, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 24, name: "uptime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ } + { 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: 0, localBalance: 0, remoteBalance: 0, commitFee: 0, commitWeight: 0, feePerKw: 0, unsettledBalance: 0, totalSatoshisSent: 0, totalSatoshisReceived: 0, numUpdates: 0, pendingHtlcs: [], csvDelay: 0, private: false, initiator: false, chanStatusFlags: "", localChanReserveSat: 0, remoteChanReserveSat: 0, staticRemoteKey: false, commitmentType: 0, lifetime: 0, uptime: 0, closeAddress: "", pushAmountSat: 0, thawHeight: 0, aliasScids: [], zeroConf: false, zeroConfConfirmedScid: 0 }; + 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); @@ -10157,34 +10157,34 @@ class Channel$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* int64 capacity */ 5: - message.capacity = reader.int64().toNumber(); + message.capacity = reader.int64().toBigInt(); break; case /* int64 local_balance */ 6: - message.localBalance = reader.int64().toNumber(); + message.localBalance = reader.int64().toBigInt(); break; case /* int64 remote_balance */ 7: - message.remoteBalance = reader.int64().toNumber(); + message.remoteBalance = reader.int64().toBigInt(); break; case /* int64 commit_fee */ 8: - message.commitFee = reader.int64().toNumber(); + message.commitFee = reader.int64().toBigInt(); break; case /* int64 commit_weight */ 9: - message.commitWeight = reader.int64().toNumber(); + message.commitWeight = reader.int64().toBigInt(); break; case /* int64 fee_per_kw */ 10: - message.feePerKw = reader.int64().toNumber(); + message.feePerKw = reader.int64().toBigInt(); break; case /* int64 unsettled_balance */ 11: - message.unsettledBalance = reader.int64().toNumber(); + message.unsettledBalance = reader.int64().toBigInt(); break; case /* int64 total_satoshis_sent */ 12: - message.totalSatoshisSent = reader.int64().toNumber(); + message.totalSatoshisSent = reader.int64().toBigInt(); break; case /* int64 total_satoshis_received */ 13: - message.totalSatoshisReceived = reader.int64().toNumber(); + message.totalSatoshisReceived = reader.int64().toBigInt(); break; case /* uint64 num_updates */ 14: - message.numUpdates = reader.uint64().toNumber(); + message.numUpdates = reader.uint64().toBigInt(); break; case /* repeated lnrpc.HTLC pending_htlcs */ 15: message.pendingHtlcs.push(HTLC.internalBinaryRead(reader, reader.uint32(), options)); @@ -10202,10 +10202,10 @@ class Channel$Type extends MessageType { message.chanStatusFlags = reader.string(); break; case /* int64 local_chan_reserve_sat = 20 [deprecated = true];*/ 20: - message.localChanReserveSat = reader.int64().toNumber(); + message.localChanReserveSat = reader.int64().toBigInt(); break; case /* int64 remote_chan_reserve_sat = 21 [deprecated = true];*/ 21: - message.remoteChanReserveSat = reader.int64().toNumber(); + message.remoteChanReserveSat = reader.int64().toBigInt(); break; case /* bool static_remote_key = 22 [deprecated = true];*/ 22: message.staticRemoteKey = reader.bool(); @@ -10214,16 +10214,16 @@ class Channel$Type extends MessageType { message.commitmentType = reader.int32(); break; case /* int64 lifetime */ 23: - message.lifetime = reader.int64().toNumber(); + message.lifetime = reader.int64().toBigInt(); break; case /* int64 uptime */ 24: - message.uptime = reader.int64().toNumber(); + 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().toNumber(); + message.pushAmountSat = reader.uint64().toBigInt(); break; case /* uint32 thaw_height */ 28: message.thawHeight = reader.uint32(); @@ -10237,15 +10237,15 @@ class Channel$Type extends MessageType { 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().toNumber()); + message.aliasScids.push(reader.uint64().toBigInt()); else - message.aliasScids.push(reader.uint64().toNumber()); + 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().toNumber(); + message.zeroConfConfirmedScid = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -10272,34 +10272,34 @@ class Channel$Type extends MessageType { if (message.chanId !== "0") writer.tag(4, WireType.Varint).uint64(message.chanId); /* int64 capacity = 5; */ - if (message.capacity !== 0) + if (message.capacity !== 0n) writer.tag(5, WireType.Varint).int64(message.capacity); /* int64 local_balance = 6; */ - if (message.localBalance !== 0) + if (message.localBalance !== 0n) writer.tag(6, WireType.Varint).int64(message.localBalance); /* int64 remote_balance = 7; */ - if (message.remoteBalance !== 0) + if (message.remoteBalance !== 0n) writer.tag(7, WireType.Varint).int64(message.remoteBalance); /* int64 commit_fee = 8; */ - if (message.commitFee !== 0) + if (message.commitFee !== 0n) writer.tag(8, WireType.Varint).int64(message.commitFee); /* int64 commit_weight = 9; */ - if (message.commitWeight !== 0) + if (message.commitWeight !== 0n) writer.tag(9, WireType.Varint).int64(message.commitWeight); /* int64 fee_per_kw = 10; */ - if (message.feePerKw !== 0) + if (message.feePerKw !== 0n) writer.tag(10, WireType.Varint).int64(message.feePerKw); /* int64 unsettled_balance = 11; */ - if (message.unsettledBalance !== 0) + if (message.unsettledBalance !== 0n) writer.tag(11, WireType.Varint).int64(message.unsettledBalance); /* int64 total_satoshis_sent = 12; */ - if (message.totalSatoshisSent !== 0) + if (message.totalSatoshisSent !== 0n) writer.tag(12, WireType.Varint).int64(message.totalSatoshisSent); /* int64 total_satoshis_received = 13; */ - if (message.totalSatoshisReceived !== 0) + if (message.totalSatoshisReceived !== 0n) writer.tag(13, WireType.Varint).int64(message.totalSatoshisReceived); /* uint64 num_updates = 14; */ - if (message.numUpdates !== 0) + 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++) @@ -10317,10 +10317,10 @@ class Channel$Type extends MessageType { if (message.chanStatusFlags !== "") writer.tag(19, WireType.LengthDelimited).string(message.chanStatusFlags); /* int64 local_chan_reserve_sat = 20 [deprecated = true]; */ - if (message.localChanReserveSat !== 0) + if (message.localChanReserveSat !== 0n) writer.tag(20, WireType.Varint).int64(message.localChanReserveSat); /* int64 remote_chan_reserve_sat = 21 [deprecated = true]; */ - if (message.remoteChanReserveSat !== 0) + if (message.remoteChanReserveSat !== 0n) writer.tag(21, WireType.Varint).int64(message.remoteChanReserveSat); /* bool static_remote_key = 22 [deprecated = true]; */ if (message.staticRemoteKey !== false) @@ -10329,16 +10329,16 @@ class Channel$Type extends MessageType { if (message.commitmentType !== 0) writer.tag(26, WireType.Varint).int32(message.commitmentType); /* int64 lifetime = 23; */ - if (message.lifetime !== 0) + if (message.lifetime !== 0n) writer.tag(23, WireType.Varint).int64(message.lifetime); /* int64 uptime = 24; */ - if (message.uptime !== 0) + 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 !== 0) + if (message.pushAmountSat !== 0n) writer.tag(27, WireType.Varint).uint64(message.pushAmountSat); /* uint32 thaw_height = 28; */ if (message.thawHeight !== 0) @@ -10360,7 +10360,7 @@ class Channel$Type extends MessageType { if (message.zeroConf !== false) writer.tag(32, WireType.Varint).bool(message.zeroConf); /* uint64 zero_conf_confirmed_scid = 33; */ - if (message.zeroConfConfirmedScid !== 0) + if (message.zeroConfConfirmedScid !== 0n) writer.tag(33, WireType.Varint).uint64(message.zeroConfConfirmedScid); let u = options.writeUnknownFields; if (u !== false) @@ -10498,12 +10498,12 @@ export const ListChannelsResponse = new ListChannelsResponse$Type(); class AliasMap$Type extends MessageType { constructor() { super("lnrpc.AliasMap", [ - { no: 1, name: "base_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "aliases", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, aliases: [] }; + const message = { baseScid: 0n, aliases: [] }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -10515,14 +10515,14 @@ class AliasMap$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 base_scid */ 1: - message.baseScid = reader.uint64().toNumber(); + 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().toNumber()); + message.aliases.push(reader.uint64().toBigInt()); else - message.aliases.push(reader.uint64().toNumber()); + message.aliases.push(reader.uint64().toBigInt()); break; default: let u = options.readUnknownField; @@ -10537,7 +10537,7 @@ class AliasMap$Type extends MessageType { } internalBinaryWrite(message: AliasMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 base_scid = 1; */ - if (message.baseScid !== 0) + if (message.baseScid !== 0n) writer.tag(1, WireType.Varint).uint64(message.baseScid); /* repeated uint64 aliases = 2; */ if (message.aliases.length) { @@ -10638,20 +10638,20 @@ class ChannelCloseSummary$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "time_locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, closeHeight: 0, settledBalance: 0, timeLockedBalance: 0, closeType: 0, openInitiator: 0, closeInitiator: 0, resolutions: [], aliasScids: [], zeroConfConfirmedScid: "0" }; + 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); @@ -10678,16 +10678,16 @@ class ChannelCloseSummary$Type extends MessageType { message.remotePubkey = reader.string(); break; case /* int64 capacity */ 6: - message.capacity = reader.int64().toNumber(); + 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().toNumber(); + message.settledBalance = reader.int64().toBigInt(); break; case /* int64 time_locked_balance */ 9: - message.timeLockedBalance = reader.int64().toNumber(); + message.timeLockedBalance = reader.int64().toBigInt(); break; case /* lnrpc.ChannelCloseSummary.ClosureType close_type */ 10: message.closeType = reader.int32(); @@ -10704,9 +10704,9 @@ class ChannelCloseSummary$Type extends MessageType { 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().toNumber()); + message.aliasScids.push(reader.uint64().toBigInt()); else - message.aliasScids.push(reader.uint64().toNumber()); + message.aliasScids.push(reader.uint64().toBigInt()); break; case /* uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING];*/ 15: message.zeroConfConfirmedScid = reader.uint64().toString(); @@ -10739,16 +10739,16 @@ class ChannelCloseSummary$Type extends MessageType { if (message.remotePubkey !== "") writer.tag(5, WireType.LengthDelimited).string(message.remotePubkey); /* int64 capacity = 6; */ - if (message.capacity !== 0) + 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 !== 0) + if (message.settledBalance !== 0n) writer.tag(8, WireType.Varint).int64(message.settledBalance); /* int64 time_locked_balance = 9; */ - if (message.timeLockedBalance !== 0) + if (message.timeLockedBalance !== 0n) writer.tag(9, WireType.Varint).int64(message.timeLockedBalance); /* lnrpc.ChannelCloseSummary.ClosureType close_type = 10; */ if (message.closeType !== 0) @@ -10789,12 +10789,12 @@ class Resolution$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, sweepTxid: "" }; + 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); @@ -10815,7 +10815,7 @@ class Resolution$Type extends MessageType { message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); break; case /* uint64 amount_sat */ 4: - message.amountSat = reader.uint64().toNumber(); + message.amountSat = reader.uint64().toBigInt(); break; case /* string sweep_txid */ 5: message.sweepTxid = reader.string(); @@ -10842,7 +10842,7 @@ class Resolution$Type extends MessageType { if (message.outpoint) OutPoint.internalBinaryWrite(message.outpoint, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); /* uint64 amount_sat = 4; */ - if (message.amountSat !== 0) + if (message.amountSat !== 0n) writer.tag(4, WireType.Varint).uint64(message.amountSat); /* string sweep_txid = 5; */ if (message.sweepTxid !== "") @@ -10992,22 +10992,22 @@ class Peer$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "bytes_recv", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "sat_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "sat_recv", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, bytesRecv: 0, satSent: 0, satRecv: 0, inbound: false, pingTime: 0, syncType: 0, features: {}, errors: [], flapCount: 0, lastFlapNs: 0, lastPingPayload: new Uint8Array(0) }; + 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); @@ -11025,22 +11025,22 @@ class Peer$Type extends MessageType { message.address = reader.string(); break; case /* uint64 bytes_sent */ 4: - message.bytesSent = reader.uint64().toNumber(); + message.bytesSent = reader.uint64().toBigInt(); break; case /* uint64 bytes_recv */ 5: - message.bytesRecv = reader.uint64().toNumber(); + message.bytesRecv = reader.uint64().toBigInt(); break; case /* int64 sat_sent */ 6: - message.satSent = reader.int64().toNumber(); + message.satSent = reader.int64().toBigInt(); break; case /* int64 sat_recv */ 7: - message.satRecv = reader.int64().toNumber(); + message.satRecv = reader.int64().toBigInt(); break; case /* bool inbound */ 8: message.inbound = reader.bool(); break; case /* int64 ping_time */ 9: - message.pingTime = reader.int64().toNumber(); + message.pingTime = reader.int64().toBigInt(); break; case /* lnrpc.Peer.SyncType sync_type */ 10: message.syncType = reader.int32(); @@ -11055,7 +11055,7 @@ class Peer$Type extends MessageType { message.flapCount = reader.int32(); break; case /* int64 last_flap_ns */ 14: - message.lastFlapNs = reader.int64().toNumber(); + message.lastFlapNs = reader.int64().toBigInt(); break; case /* bytes last_ping_payload */ 15: message.lastPingPayload = reader.bytes(); @@ -11095,22 +11095,22 @@ class Peer$Type extends MessageType { if (message.address !== "") writer.tag(3, WireType.LengthDelimited).string(message.address); /* uint64 bytes_sent = 4; */ - if (message.bytesSent !== 0) + if (message.bytesSent !== 0n) writer.tag(4, WireType.Varint).uint64(message.bytesSent); /* uint64 bytes_recv = 5; */ - if (message.bytesRecv !== 0) + if (message.bytesRecv !== 0n) writer.tag(5, WireType.Varint).uint64(message.bytesRecv); /* int64 sat_sent = 6; */ - if (message.satSent !== 0) + if (message.satSent !== 0n) writer.tag(6, WireType.Varint).int64(message.satSent); /* int64 sat_recv = 7; */ - if (message.satRecv !== 0) + 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 !== 0) + if (message.pingTime !== 0n) writer.tag(9, WireType.Varint).int64(message.pingTime); /* lnrpc.Peer.SyncType sync_type = 10; */ if (message.syncType !== 0) @@ -11129,7 +11129,7 @@ class Peer$Type extends MessageType { if (message.flapCount !== 0) writer.tag(13, WireType.Varint).int32(message.flapCount); /* int64 last_flap_ns = 14; */ - if (message.lastFlapNs !== 0) + if (message.lastFlapNs !== 0n) writer.tag(14, WireType.Varint).int64(message.lastFlapNs); /* bytes last_ping_payload = 15; */ if (message.lastPingPayload.length) @@ -11148,12 +11148,12 @@ export const Peer = new Peer$Type(); class TimestampedError$Type extends MessageType { constructor() { super("lnrpc.TimestampedError", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, error: "" }; + const message = { timestamp: 0n, error: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11165,7 +11165,7 @@ class TimestampedError$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 timestamp */ 1: - message.timestamp = reader.uint64().toNumber(); + message.timestamp = reader.uint64().toBigInt(); break; case /* string error */ 2: message.error = reader.string(); @@ -11183,7 +11183,7 @@ class TimestampedError$Type extends MessageType { } internalBinaryWrite(message: TimestampedError, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 timestamp = 1; */ - if (message.timestamp !== 0) + if (message.timestamp !== 0n) writer.tag(1, WireType.Varint).uint64(message.timestamp); /* string error = 2; */ if (message.error !== "") @@ -11413,7 +11413,7 @@ class GetInfoResponse$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -11424,7 +11424,7 @@ class GetInfoResponse$Type extends MessageType { ]); } create(value?: PartialMessage): GetInfoResponse { - const message = { version: "", commitHash: "", identityPubkey: "", alias: "", color: "", numPendingChannels: 0, numActiveChannels: 0, numInactiveChannels: 0, numPeers: 0, blockHeight: 0, blockHash: "", bestHeaderTimestamp: 0, syncedToChain: false, syncedToGraph: false, testnet: false, chains: [], uris: [], features: {}, requireHtlcInterceptor: false }; + 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); @@ -11469,7 +11469,7 @@ class GetInfoResponse$Type extends MessageType { message.blockHash = reader.string(); break; case /* int64 best_header_timestamp */ 13: - message.bestHeaderTimestamp = reader.int64().toNumber(); + message.bestHeaderTimestamp = reader.int64().toBigInt(); break; case /* bool synced_to_chain */ 9: message.syncedToChain = reader.bool(); @@ -11554,7 +11554,7 @@ class GetInfoResponse$Type extends MessageType { if (message.blockHash !== "") writer.tag(8, WireType.LengthDelimited).string(message.blockHash); /* int64 best_header_timestamp = 13; */ - if (message.bestHeaderTimestamp !== 0) + if (message.bestHeaderTimestamp !== 0n) writer.tag(13, WireType.Varint).int64(message.bestHeaderTimestamp); /* bool synced_to_chain = 9; */ if (message.syncedToChain !== false) @@ -11901,14 +11901,14 @@ class CloseChannelRequest$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "max_fee_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, deliveryAddress: "", satPerVbyte: 0, maxFeePerVbyte: 0 }; + 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); @@ -11929,16 +11929,16 @@ class CloseChannelRequest$Type extends MessageType { message.targetConf = reader.int32(); break; case /* int64 sat_per_byte = 4 [deprecated = true];*/ 4: - message.satPerByte = reader.int64().toNumber(); + 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().toNumber(); + message.satPerVbyte = reader.uint64().toBigInt(); break; case /* uint64 max_fee_per_vbyte */ 7: - message.maxFeePerVbyte = reader.uint64().toNumber(); + message.maxFeePerVbyte = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -11962,16 +11962,16 @@ class CloseChannelRequest$Type extends MessageType { if (message.targetConf !== 0) writer.tag(3, WireType.Varint).int32(message.targetConf); /* int64 sat_per_byte = 4 [deprecated = true]; */ - if (message.satPerByte !== 0) + 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 !== 0) + if (message.satPerVbyte !== 0n) writer.tag(6, WireType.Varint).uint64(message.satPerVbyte); /* uint64 max_fee_per_vbyte = 7; */ - if (message.maxFeePerVbyte !== 0) + if (message.maxFeePerVbyte !== 0n) writer.tag(7, WireType.Varint).uint64(message.maxFeePerVbyte); let u = options.writeUnknownFields; if (u !== false) @@ -12102,12 +12102,12 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, psbt: new Uint8Array(0) }; + 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); @@ -12122,7 +12122,7 @@ class ReadyForPsbtFunding$Type extends MessageType { message.fundingAddress = reader.string(); break; case /* int64 funding_amount */ 2: - message.fundingAmount = reader.int64().toNumber(); + message.fundingAmount = reader.int64().toBigInt(); break; case /* bytes psbt */ 3: message.psbt = reader.bytes(); @@ -12143,7 +12143,7 @@ class ReadyForPsbtFunding$Type extends MessageType { if (message.fundingAddress !== "") writer.tag(1, WireType.LengthDelimited).string(message.fundingAddress); /* int64 funding_amount = 2; */ - if (message.fundingAmount !== 0) + if (message.fundingAmount !== 0n) writer.tag(2, WireType.Varint).int64(message.fundingAmount); /* bytes psbt = 3; */ if (message.psbt.length) @@ -12164,14 +12164,14 @@ class BatchOpenChannelRequest$Type extends MessageType 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, minConfs: 0, spendUnconfirmed: false, label: "" }; + 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); @@ -12189,7 +12189,7 @@ class BatchOpenChannelRequest$Type extends MessageType message.targetConf = reader.int32(); break; case /* int64 sat_per_vbyte */ 3: - message.satPerVbyte = reader.int64().toNumber(); + message.satPerVbyte = reader.int64().toBigInt(); break; case /* int32 min_confs */ 4: message.minConfs = reader.int32(); @@ -12219,7 +12219,7 @@ class BatchOpenChannelRequest$Type extends MessageType if (message.targetConf !== 0) writer.tag(2, WireType.Varint).int32(message.targetConf); /* int64 sat_per_vbyte = 3; */ - if (message.satPerVbyte !== 0) + if (message.satPerVbyte !== 0n) writer.tag(3, WireType.Varint).int64(message.satPerVbyte); /* int32 min_confs = 4; */ if (message.minConfs !== 0) @@ -12245,10 +12245,10 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -12256,7 +12256,7 @@ class BatchOpenChannel$Type extends MessageType { ]); } create(value?: PartialMessage): BatchOpenChannel { - const message = { nodePubkey: new Uint8Array(0), localFundingAmount: 0, pushSat: 0, private: false, minHtlcMsat: 0, remoteCsvDelay: 0, closeAddress: "", pendingChanId: new Uint8Array(0), commitmentType: 0 }; + 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); @@ -12271,16 +12271,16 @@ class BatchOpenChannel$Type extends MessageType { message.nodePubkey = reader.bytes(); break; case /* int64 local_funding_amount */ 2: - message.localFundingAmount = reader.int64().toNumber(); + message.localFundingAmount = reader.int64().toBigInt(); break; case /* int64 push_sat */ 3: - message.pushSat = reader.int64().toNumber(); + 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().toNumber(); + message.minHtlcMsat = reader.int64().toBigInt(); break; case /* uint32 remote_csv_delay */ 6: message.remoteCsvDelay = reader.uint32(); @@ -12310,16 +12310,16 @@ class BatchOpenChannel$Type extends MessageType { if (message.nodePubkey.length) writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); /* int64 local_funding_amount = 2; */ - if (message.localFundingAmount !== 0) + if (message.localFundingAmount !== 0n) writer.tag(2, WireType.Varint).int64(message.localFundingAmount); /* int64 push_sat = 3; */ - if (message.pushSat !== 0) + 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 !== 0) + if (message.minHtlcMsat !== 0n) writer.tag(5, WireType.Varint).int64(message.minHtlcMsat); /* uint32 remote_csv_delay = 6; */ if (message.remoteCsvDelay !== 0) @@ -12394,35 +12394,35 @@ export const BatchOpenChannelResponse = new BatchOpenChannelResponse$Type(); class OpenChannelRequest$Type extends MessageType { constructor() { super("lnrpc.OpenChannelRequest", [ - { no: 1, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 22, name: "fee_rate", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ } + { no: 25, name: "remote_chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): OpenChannelRequest { - const message = { satPerVbyte: 0, nodePubkey: new Uint8Array(0), nodePubkeyString: "", localFundingAmount: 0, pushSat: 0, targetConf: 0, satPerByte: 0, private: false, minHtlcMsat: 0, remoteCsvDelay: 0, minConfs: 0, spendUnconfirmed: false, closeAddress: "", remoteMaxValueInFlightMsat: 0, remoteMaxHtlcs: 0, maxLocalCsv: 0, commitmentType: 0, zeroConf: false, scidAlias: false, baseFee: 0, feeRate: 0, useBaseFee: false, useFeeRate: false, remoteChanReserveSat: 0 }; + 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); @@ -12434,7 +12434,7 @@ class OpenChannelRequest$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 sat_per_vbyte */ 1: - message.satPerVbyte = reader.uint64().toNumber(); + message.satPerVbyte = reader.uint64().toBigInt(); break; case /* bytes node_pubkey */ 2: message.nodePubkey = reader.bytes(); @@ -12443,22 +12443,22 @@ class OpenChannelRequest$Type extends MessageType { message.nodePubkeyString = reader.string(); break; case /* int64 local_funding_amount */ 4: - message.localFundingAmount = reader.int64().toNumber(); + message.localFundingAmount = reader.int64().toBigInt(); break; case /* int64 push_sat */ 5: - message.pushSat = reader.int64().toNumber(); + 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().toNumber(); + 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().toNumber(); + message.minHtlcMsat = reader.int64().toBigInt(); break; case /* uint32 remote_csv_delay */ 10: message.remoteCsvDelay = reader.uint32(); @@ -12476,7 +12476,7 @@ class OpenChannelRequest$Type extends MessageType { message.fundingShim = FundingShim.internalBinaryRead(reader, reader.uint32(), options, message.fundingShim); break; case /* uint64 remote_max_value_in_flight_msat */ 15: - message.remoteMaxValueInFlightMsat = reader.uint64().toNumber(); + message.remoteMaxValueInFlightMsat = reader.uint64().toBigInt(); break; case /* uint32 remote_max_htlcs */ 16: message.remoteMaxHtlcs = reader.uint32(); @@ -12494,10 +12494,10 @@ class OpenChannelRequest$Type extends MessageType { message.scidAlias = reader.bool(); break; case /* uint64 base_fee */ 21: - message.baseFee = reader.uint64().toNumber(); + message.baseFee = reader.uint64().toBigInt(); break; case /* uint64 fee_rate */ 22: - message.feeRate = reader.uint64().toNumber(); + message.feeRate = reader.uint64().toBigInt(); break; case /* bool use_base_fee */ 23: message.useBaseFee = reader.bool(); @@ -12506,7 +12506,7 @@ class OpenChannelRequest$Type extends MessageType { message.useFeeRate = reader.bool(); break; case /* uint64 remote_chan_reserve_sat */ 25: - message.remoteChanReserveSat = reader.uint64().toNumber(); + message.remoteChanReserveSat = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -12521,7 +12521,7 @@ class OpenChannelRequest$Type extends MessageType { } internalBinaryWrite(message: OpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 sat_per_vbyte = 1; */ - if (message.satPerVbyte !== 0) + if (message.satPerVbyte !== 0n) writer.tag(1, WireType.Varint).uint64(message.satPerVbyte); /* bytes node_pubkey = 2; */ if (message.nodePubkey.length) @@ -12530,22 +12530,22 @@ class OpenChannelRequest$Type extends MessageType { if (message.nodePubkeyString !== "") writer.tag(3, WireType.LengthDelimited).string(message.nodePubkeyString); /* int64 local_funding_amount = 4; */ - if (message.localFundingAmount !== 0) + if (message.localFundingAmount !== 0n) writer.tag(4, WireType.Varint).int64(message.localFundingAmount); /* int64 push_sat = 5; */ - if (message.pushSat !== 0) + 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 !== 0) + 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 !== 0) + if (message.minHtlcMsat !== 0n) writer.tag(9, WireType.Varint).int64(message.minHtlcMsat); /* uint32 remote_csv_delay = 10; */ if (message.remoteCsvDelay !== 0) @@ -12563,7 +12563,7 @@ class OpenChannelRequest$Type extends MessageType { 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 !== 0) + if (message.remoteMaxValueInFlightMsat !== 0n) writer.tag(15, WireType.Varint).uint64(message.remoteMaxValueInFlightMsat); /* uint32 remote_max_htlcs = 16; */ if (message.remoteMaxHtlcs !== 0) @@ -12581,10 +12581,10 @@ class OpenChannelRequest$Type extends MessageType { if (message.scidAlias !== false) writer.tag(20, WireType.Varint).bool(message.scidAlias); /* uint64 base_fee = 21; */ - if (message.baseFee !== 0) + if (message.baseFee !== 0n) writer.tag(21, WireType.Varint).uint64(message.baseFee); /* uint64 fee_rate = 22; */ - if (message.feeRate !== 0) + if (message.feeRate !== 0n) writer.tag(22, WireType.Varint).uint64(message.feeRate); /* bool use_base_fee = 23; */ if (message.useBaseFee !== false) @@ -12593,7 +12593,7 @@ class OpenChannelRequest$Type extends MessageType { if (message.useFeeRate !== false) writer.tag(24, WireType.Varint).bool(message.useFeeRate); /* uint64 remote_chan_reserve_sat = 25; */ - if (message.remoteChanReserveSat !== 0) + if (message.remoteChanReserveSat !== 0n) writer.tag(25, WireType.Varint).uint64(message.remoteChanReserveSat); let u = options.writeUnknownFields; if (u !== false) @@ -12794,7 +12794,7 @@ export const KeyDescriptor = new KeyDescriptor$Type(); class ChanPointShim$Type extends MessageType { constructor() { super("lnrpc.ChanPointShim", [ - { no: 1, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -12803,7 +12803,7 @@ class ChanPointShim$Type extends MessageType { ]); } create(value?: PartialMessage): ChanPointShim { - const message = { amt: 0, remoteKey: new Uint8Array(0), pendingChanId: new Uint8Array(0), thawHeight: 0 }; + 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); @@ -12815,7 +12815,7 @@ class ChanPointShim$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 amt */ 1: - message.amt = reader.int64().toNumber(); + message.amt = reader.int64().toBigInt(); break; case /* lnrpc.ChannelPoint chan_point */ 2: message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); @@ -12845,7 +12845,7 @@ class ChanPointShim$Type extends MessageType { } internalBinaryWrite(message: ChanPointShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 amt = 1; */ - if (message.amt !== 0) + if (message.amt !== 0n) writer.tag(1, WireType.Varint).int64(message.amt); /* lnrpc.ChannelPoint chan_point = 2; */ if (message.chanPoint) @@ -13273,7 +13273,7 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -13281,7 +13281,7 @@ class PendingHTLC$Type extends MessageType { ]); } create(value?: PartialMessage): PendingHTLC { - const message = { incoming: false, amount: 0, outpoint: "", maturityHeight: 0, blocksTilMaturity: 0, stage: 0 }; + 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); @@ -13296,7 +13296,7 @@ class PendingHTLC$Type extends MessageType { message.incoming = reader.bool(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); + message.amount = reader.int64().toBigInt(); break; case /* string outpoint */ 3: message.outpoint = reader.string(); @@ -13326,7 +13326,7 @@ class PendingHTLC$Type extends MessageType { if (message.incoming !== false) writer.tag(1, WireType.Varint).bool(message.incoming); /* int64 amount = 2; */ - if (message.amount !== 0) + if (message.amount !== 0n) writer.tag(2, WireType.Varint).int64(message.amount); /* string outpoint = 3; */ if (message.outpoint !== "") @@ -13380,7 +13380,7 @@ export const PendingChannelsRequest = new PendingChannelsRequest$Type(); class PendingChannelsResponse$Type extends MessageType { constructor() { super("lnrpc.PendingChannelsResponse", [ - { no: 1, name: "total_limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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 }, @@ -13388,7 +13388,7 @@ class PendingChannelsResponse$Type extends MessageType ]); } create(value?: PartialMessage): PendingChannelsResponse { - const message = { totalLimboBalance: 0, pendingOpenChannels: [], pendingClosingChannels: [], pendingForceClosingChannels: [], waitingCloseChannels: [] }; + 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); @@ -13400,7 +13400,7 @@ class PendingChannelsResponse$Type extends MessageType let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 total_limbo_balance */ 1: - message.totalLimboBalance = reader.int64().toNumber(); + 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)); @@ -13427,7 +13427,7 @@ class PendingChannelsResponse$Type extends MessageType } internalBinaryWrite(message: PendingChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 total_limbo_balance = 1; */ - if (message.totalLimboBalance !== 0) + 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++) @@ -13457,20 +13457,20 @@ class PendingChannelsResponse_PendingChannel$Type extends MessageType ["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: 2 /*LongType.NUMBER*/ }, + { 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: 0, localBalance: 0, remoteBalance: 0, localChanReserveSat: 0, remoteChanReserveSat: 0, initiator: 0, commitmentType: 0, numForwardingPackages: 0, chanStatusFlags: "", private: false }; + 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); @@ -13488,19 +13488,19 @@ class PendingChannelsResponse_PendingChannel$Type extends MessageType PendingChannelsResponse_PendingChannel }, - { no: 4, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, commitWeight: 0, feePerKw: 0 }; + 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); @@ -13601,13 +13601,13 @@ class PendingChannelsResponse_PendingOpenChannel$Type extends MessageType PendingChannelsResponse_PendingChannel }, - { no: 2, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, closingTxid: "" }; + const message = { limboBalance: 0n, closingTxid: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -13669,7 +13669,7 @@ class PendingChannelsResponse_WaitingCloseChannel$Type extends MessageType): PendingChannelsResponse_Commitments { - const message = { localTxid: "", remoteTxid: "", remotePendingTxid: "", localCommitFeeSat: 0, remoteCommitFeeSat: 0, remotePendingCommitFeeSat: 0 }; + 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); @@ -13745,13 +13745,13 @@ class PendingChannelsResponse_Commitments$Type extends MessageType 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, maturityHeight: 0, blocksTilMaturity: 0, recoveredBalance: 0, pendingHtlcs: [], anchor: 0 }; + 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); @@ -13880,7 +13880,7 @@ class PendingChannelsResponse_ForceClosedChannel$Type extends MessageType { constructor() { super("lnrpc.WalletAccountBalance", [ - { no: 1, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, unconfirmedBalance: 0 }; + const message = { confirmedBalance: 0n, unconfirmedBalance: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14097,10 +14097,10 @@ class WalletAccountBalance$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 confirmed_balance */ 1: - message.confirmedBalance = reader.int64().toNumber(); + message.confirmedBalance = reader.int64().toBigInt(); break; case /* int64 unconfirmed_balance */ 2: - message.unconfirmedBalance = reader.int64().toNumber(); + message.unconfirmedBalance = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -14115,10 +14115,10 @@ class WalletAccountBalance$Type extends MessageType { } internalBinaryWrite(message: WalletAccountBalance, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 confirmed_balance = 1; */ - if (message.confirmedBalance !== 0) + if (message.confirmedBalance !== 0n) writer.tag(1, WireType.Varint).int64(message.confirmedBalance); /* int64 unconfirmed_balance = 2; */ - if (message.unconfirmedBalance !== 0) + if (message.unconfirmedBalance !== 0n) writer.tag(2, WireType.Varint).int64(message.unconfirmedBalance); let u = options.writeUnknownFields; if (u !== false) @@ -14160,16 +14160,16 @@ export const WalletBalanceRequest = new WalletBalanceRequest$Type(); class WalletBalanceResponse$Type extends MessageType { constructor() { super("lnrpc.WalletBalanceResponse", [ - { no: 1, name: "total_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "reserved_balance_anchor_chan", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, confirmedBalance: 0, unconfirmedBalance: 0, lockedBalance: 0, reservedBalanceAnchorChan: 0, accountBalance: {} }; + 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); @@ -14181,19 +14181,19 @@ class WalletBalanceResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 total_balance */ 1: - message.totalBalance = reader.int64().toNumber(); + message.totalBalance = reader.int64().toBigInt(); break; case /* int64 confirmed_balance */ 2: - message.confirmedBalance = reader.int64().toNumber(); + message.confirmedBalance = reader.int64().toBigInt(); break; case /* int64 unconfirmed_balance */ 3: - message.unconfirmedBalance = reader.int64().toNumber(); + message.unconfirmedBalance = reader.int64().toBigInt(); break; case /* int64 locked_balance */ 5: - message.lockedBalance = reader.int64().toNumber(); + message.lockedBalance = reader.int64().toBigInt(); break; case /* int64 reserved_balance_anchor_chan */ 6: - message.reservedBalanceAnchorChan = reader.int64().toNumber(); + message.reservedBalanceAnchorChan = reader.int64().toBigInt(); break; case /* map account_balance */ 4: this.binaryReadMap4(message.accountBalance, reader, options); @@ -14227,19 +14227,19 @@ class WalletBalanceResponse$Type extends MessageType { } internalBinaryWrite(message: WalletBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 total_balance = 1; */ - if (message.totalBalance !== 0) + if (message.totalBalance !== 0n) writer.tag(1, WireType.Varint).int64(message.totalBalance); /* int64 confirmed_balance = 2; */ - if (message.confirmedBalance !== 0) + if (message.confirmedBalance !== 0n) writer.tag(2, WireType.Varint).int64(message.confirmedBalance); /* int64 unconfirmed_balance = 3; */ - if (message.unconfirmedBalance !== 0) + if (message.unconfirmedBalance !== 0n) writer.tag(3, WireType.Varint).int64(message.unconfirmedBalance); /* int64 locked_balance = 5; */ - if (message.lockedBalance !== 0) + if (message.lockedBalance !== 0n) writer.tag(5, WireType.Varint).int64(message.lockedBalance); /* int64 reserved_balance_anchor_chan = 6; */ - if (message.reservedBalanceAnchorChan !== 0) + if (message.reservedBalanceAnchorChan !== 0n) writer.tag(6, WireType.Varint).int64(message.reservedBalanceAnchorChan); /* map account_balance = 4; */ for (let k of Object.keys(message.accountBalance)) { @@ -14262,12 +14262,12 @@ export const WalletBalanceResponse = new WalletBalanceResponse$Type(); class Amount$Type extends MessageType { constructor() { super("lnrpc.Amount", [ - { no: 1, name: "sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, msat: 0 }; + const message = { sat: 0n, msat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14279,10 +14279,10 @@ class Amount$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 sat */ 1: - message.sat = reader.uint64().toNumber(); + message.sat = reader.uint64().toBigInt(); break; case /* uint64 msat */ 2: - message.msat = reader.uint64().toNumber(); + message.msat = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -14297,10 +14297,10 @@ class Amount$Type extends MessageType { } internalBinaryWrite(message: Amount, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 sat = 1; */ - if (message.sat !== 0) + if (message.sat !== 0n) writer.tag(1, WireType.Varint).uint64(message.sat); /* uint64 msat = 2; */ - if (message.msat !== 0) + if (message.msat !== 0n) writer.tag(2, WireType.Varint).uint64(message.msat); let u = options.writeUnknownFields; if (u !== false) @@ -14342,8 +14342,8 @@ export const ChannelBalanceRequest = new ChannelBalanceRequest$Type(); class ChannelBalanceResponse$Type extends MessageType { constructor() { super("lnrpc.ChannelBalanceResponse", [ - { no: 1, name: "balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "pending_open_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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 }, @@ -14353,7 +14353,7 @@ class ChannelBalanceResponse$Type extends MessageType { ]); } create(value?: PartialMessage): ChannelBalanceResponse { - const message = { balance: 0, pendingOpenBalance: 0 }; + const message = { balance: 0n, pendingOpenBalance: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14365,10 +14365,10 @@ class ChannelBalanceResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 balance = 1 [deprecated = true];*/ 1: - message.balance = reader.int64().toNumber(); + message.balance = reader.int64().toBigInt(); break; case /* int64 pending_open_balance = 2 [deprecated = true];*/ 2: - message.pendingOpenBalance = reader.int64().toNumber(); + message.pendingOpenBalance = reader.int64().toBigInt(); break; case /* lnrpc.Amount local_balance */ 3: message.localBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.localBalance); @@ -14401,10 +14401,10 @@ class ChannelBalanceResponse$Type extends MessageType { } internalBinaryWrite(message: ChannelBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 balance = 1 [deprecated = true]; */ - if (message.balance !== 0) + if (message.balance !== 0n) writer.tag(1, WireType.Varint).int64(message.balance); /* int64 pending_open_balance = 2 [deprecated = true]; */ - if (message.pendingOpenBalance !== 0) + if (message.pendingOpenBalance !== 0n) writer.tag(2, WireType.Varint).int64(message.pendingOpenBalance); /* lnrpc.Amount local_balance = 3; */ if (message.localBalance) @@ -14439,8 +14439,8 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -14458,7 +14458,7 @@ class QueryRoutesRequest$Type extends MessageType { ]); } create(value?: PartialMessage): QueryRoutesRequest { - const message = { pubKey: "", amt: 0, amtMsat: 0, finalCltvDelta: 0, ignoredNodes: [], ignoredEdges: [], sourcePubKey: "", useMissionControl: false, ignoredPairs: [], cltvLimit: 0, destCustomRecords: {}, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), routeHints: [], destFeatures: [], timePref: 0 }; + 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); @@ -14473,10 +14473,10 @@ class QueryRoutesRequest$Type extends MessageType { message.pubKey = reader.string(); break; case /* int64 amt */ 2: - message.amt = reader.int64().toNumber(); + message.amt = reader.int64().toBigInt(); break; case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toNumber(); + message.amtMsat = reader.int64().toBigInt(); break; case /* int32 final_cltv_delta */ 4: message.finalCltvDelta = reader.int32(); @@ -14556,10 +14556,10 @@ class QueryRoutesRequest$Type extends MessageType { if (message.pubKey !== "") writer.tag(1, WireType.LengthDelimited).string(message.pubKey); /* int64 amt = 2; */ - if (message.amt !== 0) + if (message.amt !== 0n) writer.tag(2, WireType.Varint).int64(message.amt); /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0) + if (message.amtMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.amtMsat); /* int32 final_cltv_delta = 4; */ if (message.finalCltvDelta !== 0) @@ -14784,12 +14784,12 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "amt_to_forward", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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 }, @@ -14799,7 +14799,7 @@ class Hop$Type extends MessageType { ]); } create(value?: PartialMessage): Hop { - const message = { chanId: "0", chanCapacity: 0, amtToForward: 0, fee: 0, expiry: 0, amtToForwardMsat: 0, feeMsat: 0, pubKey: "", tlvPayload: false, customRecords: {}, metadata: new Uint8Array(0) }; + 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); @@ -14814,22 +14814,22 @@ class Hop$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* int64 chan_capacity = 2 [deprecated = true];*/ 2: - message.chanCapacity = reader.int64().toNumber(); + message.chanCapacity = reader.int64().toBigInt(); break; case /* int64 amt_to_forward = 3 [deprecated = true];*/ 3: - message.amtToForward = reader.int64().toNumber(); + message.amtToForward = reader.int64().toBigInt(); break; case /* int64 fee = 4 [deprecated = true];*/ 4: - message.fee = reader.int64().toNumber(); + 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().toNumber(); + message.amtToForwardMsat = reader.int64().toBigInt(); break; case /* int64 fee_msat */ 7: - message.feeMsat = reader.int64().toNumber(); + message.feeMsat = reader.int64().toBigInt(); break; case /* string pub_key */ 8: message.pubKey = reader.string(); @@ -14881,22 +14881,22 @@ class Hop$Type extends MessageType { if (message.chanId !== "0") writer.tag(1, WireType.Varint).uint64(message.chanId); /* int64 chan_capacity = 2 [deprecated = true]; */ - if (message.chanCapacity !== 0) + if (message.chanCapacity !== 0n) writer.tag(2, WireType.Varint).int64(message.chanCapacity); /* int64 amt_to_forward = 3 [deprecated = true]; */ - if (message.amtToForward !== 0) + if (message.amtToForward !== 0n) writer.tag(3, WireType.Varint).int64(message.amtToForward); /* int64 fee = 4 [deprecated = true]; */ - if (message.fee !== 0) + 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 !== 0) + if (message.amtToForwardMsat !== 0n) writer.tag(6, WireType.Varint).int64(message.amtToForwardMsat); /* int64 fee_msat = 7; */ - if (message.feeMsat !== 0) + if (message.feeMsat !== 0n) writer.tag(7, WireType.Varint).int64(message.feeMsat); /* string pub_key = 8; */ if (message.pubKey !== "") @@ -14931,11 +14931,11 @@ 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: 2 /*LongType.NUMBER*/ } + { 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: 0 }; + 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); @@ -14950,7 +14950,7 @@ class MPPRecord$Type extends MessageType { message.paymentAddr = reader.bytes(); break; case /* int64 total_amt_msat */ 10: - message.totalAmtMsat = reader.int64().toNumber(); + message.totalAmtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -14968,7 +14968,7 @@ class MPPRecord$Type extends MessageType { if (message.paymentAddr.length) writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); /* int64 total_amt_msat = 10; */ - if (message.totalAmtMsat !== 0) + if (message.totalAmtMsat !== 0n) writer.tag(10, WireType.Varint).int64(message.totalAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -15046,15 +15046,15 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "total_amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, totalAmt: 0, hops: [], totalFeesMsat: 0, totalAmtMsat: 0 }; + 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); @@ -15069,19 +15069,19 @@ class Route$Type extends MessageType { message.totalTimeLock = reader.uint32(); break; case /* int64 total_fees = 2 [deprecated = true];*/ 2: - message.totalFees = reader.int64().toNumber(); + message.totalFees = reader.int64().toBigInt(); break; case /* int64 total_amt = 3 [deprecated = true];*/ 3: - message.totalAmt = reader.int64().toNumber(); + 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().toNumber(); + message.totalFeesMsat = reader.int64().toBigInt(); break; case /* int64 total_amt_msat */ 6: - message.totalAmtMsat = reader.int64().toNumber(); + message.totalAmtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -15099,19 +15099,19 @@ class Route$Type extends MessageType { if (message.totalTimeLock !== 0) writer.tag(1, WireType.Varint).uint32(message.totalTimeLock); /* int64 total_fees = 2 [deprecated = true]; */ - if (message.totalFees !== 0) + if (message.totalFees !== 0n) writer.tag(2, WireType.Varint).int64(message.totalFees); /* int64 total_amt = 3 [deprecated = true]; */ - if (message.totalAmt !== 0) + 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 !== 0) + if (message.totalFeesMsat !== 0n) writer.tag(5, WireType.Varint).int64(message.totalFeesMsat); /* int64 total_amt_msat = 6; */ - if (message.totalAmtMsat !== 0) + if (message.totalAmtMsat !== 0n) writer.tag(6, WireType.Varint).int64(message.totalAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -15183,12 +15183,12 @@ class NodeInfo$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, channels: [] }; + const message = { numChannels: 0, totalCapacity: 0n, channels: [] }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15206,7 +15206,7 @@ class NodeInfo$Type extends MessageType { message.numChannels = reader.uint32(); break; case /* int64 total_capacity */ 3: - message.totalCapacity = reader.int64().toNumber(); + message.totalCapacity = reader.int64().toBigInt(); break; case /* repeated lnrpc.ChannelEdge channels */ 4: message.channels.push(ChannelEdge.internalBinaryRead(reader, reader.uint32(), options)); @@ -15230,7 +15230,7 @@ class NodeInfo$Type extends MessageType { if (message.numChannels !== 0) writer.tag(2, WireType.Varint).uint32(message.numChannels); /* int64 total_capacity = 3; */ - if (message.totalCapacity !== 0) + 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++) @@ -15429,17 +15429,17 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "fee_base_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "fee_rate_milli_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, feeBaseMsat: 0, feeRateMilliMsat: 0, disabled: false, maxHtlcMsat: 0, lastUpdate: 0, customRecords: {} }; + 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); @@ -15454,19 +15454,19 @@ class RoutingPolicy$Type extends MessageType { message.timeLockDelta = reader.uint32(); break; case /* int64 min_htlc */ 2: - message.minHtlc = reader.int64().toNumber(); + message.minHtlc = reader.int64().toBigInt(); break; case /* int64 fee_base_msat */ 3: - message.feeBaseMsat = reader.int64().toNumber(); + message.feeBaseMsat = reader.int64().toBigInt(); break; case /* int64 fee_rate_milli_msat */ 4: - message.feeRateMilliMsat = reader.int64().toNumber(); + 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().toNumber(); + message.maxHtlcMsat = reader.uint64().toBigInt(); break; case /* uint32 last_update */ 7: message.lastUpdate = reader.uint32(); @@ -15506,19 +15506,19 @@ class RoutingPolicy$Type extends MessageType { if (message.timeLockDelta !== 0) writer.tag(1, WireType.Varint).uint32(message.timeLockDelta); /* int64 min_htlc = 2; */ - if (message.minHtlc !== 0) + if (message.minHtlc !== 0n) writer.tag(2, WireType.Varint).int64(message.minHtlc); /* int64 fee_base_msat = 3; */ - if (message.feeBaseMsat !== 0) + if (message.feeBaseMsat !== 0n) writer.tag(3, WireType.Varint).int64(message.feeBaseMsat); /* int64 fee_rate_milli_msat = 4; */ - if (message.feeRateMilliMsat !== 0) + 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 !== 0) + if (message.maxHtlcMsat !== 0n) writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); /* uint32 last_update = 7; */ if (message.lastUpdate !== 0) @@ -15545,14 +15545,14 @@ class ChannelEdge$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, customRecords: {} }; + 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); @@ -15579,7 +15579,7 @@ class ChannelEdge$Type extends MessageType { message.node2Pub = reader.string(); break; case /* int64 capacity */ 6: - message.capacity = reader.int64().toNumber(); + message.capacity = reader.int64().toBigInt(); break; case /* lnrpc.RoutingPolicy node1_policy */ 7: message.node1Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node1Policy); @@ -15634,7 +15634,7 @@ class ChannelEdge$Type extends MessageType { if (message.node2Pub !== "") writer.tag(5, WireType.LengthDelimited).string(message.node2Pub); /* int64 capacity = 6; */ - if (message.capacity !== 0) + if (message.capacity !== 0n) writer.tag(6, WireType.Varint).int64(message.capacity); /* lnrpc.RoutingPolicy node1_policy = 7; */ if (message.node1Policy) @@ -16014,16 +16014,16 @@ class NetworkInfo$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "max_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "median_channel_size_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "num_zombie_chans", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, avgChannelSize: 0, minChannelSize: 0, maxChannelSize: 0, medianChannelSizeSat: 0, numZombieChans: 0 }; + 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); @@ -16050,22 +16050,22 @@ class NetworkInfo$Type extends MessageType { message.numChannels = reader.uint32(); break; case /* int64 total_network_capacity */ 6: - message.totalNetworkCapacity = reader.int64().toNumber(); + 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().toNumber(); + message.minChannelSize = reader.int64().toBigInt(); break; case /* int64 max_channel_size */ 9: - message.maxChannelSize = reader.int64().toNumber(); + message.maxChannelSize = reader.int64().toBigInt(); break; case /* int64 median_channel_size_sat */ 10: - message.medianChannelSizeSat = reader.int64().toNumber(); + message.medianChannelSizeSat = reader.int64().toBigInt(); break; case /* uint64 num_zombie_chans */ 11: - message.numZombieChans = reader.uint64().toNumber(); + message.numZombieChans = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -16095,22 +16095,22 @@ class NetworkInfo$Type extends MessageType { if (message.numChannels !== 0) writer.tag(5, WireType.Varint).uint32(message.numChannels); /* int64 total_network_capacity = 6; */ - if (message.totalNetworkCapacity !== 0) + 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 !== 0) + if (message.minChannelSize !== 0n) writer.tag(8, WireType.Varint).int64(message.minChannelSize); /* int64 max_channel_size = 9; */ - if (message.maxChannelSize !== 0) + if (message.maxChannelSize !== 0n) writer.tag(9, WireType.Varint).int64(message.maxChannelSize); /* int64 median_channel_size_sat = 10; */ - if (message.medianChannelSizeSat !== 0) + if (message.medianChannelSizeSat !== 0n) writer.tag(10, WireType.Varint).int64(message.medianChannelSizeSat); /* uint64 num_zombie_chans = 11; */ - if (message.numZombieChans !== 0) + if (message.numZombieChans !== 0n) writer.tag(11, WireType.Varint).uint64(message.numZombieChans); let u = options.writeUnknownFields; if (u !== false) @@ -16376,14 +16376,14 @@ class ChannelEdgeUpdate$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, advertisingNode: "", connectingNode: "" }; + 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); @@ -16401,7 +16401,7 @@ class ChannelEdgeUpdate$Type extends MessageType { message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); break; case /* int64 capacity */ 3: - message.capacity = reader.int64().toNumber(); + message.capacity = reader.int64().toBigInt(); break; case /* lnrpc.RoutingPolicy routing_policy */ 4: message.routingPolicy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.routingPolicy); @@ -16431,7 +16431,7 @@ class ChannelEdgeUpdate$Type extends MessageType { if (message.chanPoint) ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* int64 capacity = 3; */ - if (message.capacity !== 0) + if (message.capacity !== 0n) writer.tag(3, WireType.Varint).int64(message.capacity); /* lnrpc.RoutingPolicy routing_policy = 4; */ if (message.routingPolicy) @@ -16457,13 +16457,13 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, closedHeight: 0 }; + 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); @@ -16478,7 +16478,7 @@ class ClosedChannelUpdate$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* int64 capacity */ 2: - message.capacity = reader.int64().toNumber(); + message.capacity = reader.int64().toBigInt(); break; case /* uint32 closed_height */ 3: message.closedHeight = reader.uint32(); @@ -16502,7 +16502,7 @@ class ClosedChannelUpdate$Type extends MessageType { if (message.chanId !== "0") writer.tag(1, WireType.Varint).uint64(message.chanId); /* int64 capacity = 2; */ - if (message.capacity !== 0) + if (message.capacity !== 0n) writer.tag(2, WireType.Varint).int64(message.capacity); /* uint32 closed_height = 3; */ if (message.closedHeight !== 0) @@ -16694,13 +16694,13 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "settle_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, settleTime: 0, amtPaidMsat: 0 }; + 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); @@ -16715,13 +16715,13 @@ class AMPInvoiceState$Type extends MessageType { message.state = reader.int32(); break; case /* uint64 settle_index */ 2: - message.settleIndex = reader.uint64().toNumber(); + message.settleIndex = reader.uint64().toBigInt(); break; case /* int64 settle_time */ 3: - message.settleTime = reader.int64().toNumber(); + message.settleTime = reader.int64().toBigInt(); break; case /* int64 amt_paid_msat */ 5: - message.amtPaidMsat = reader.int64().toNumber(); + message.amtPaidMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -16739,13 +16739,13 @@ class AMPInvoiceState$Type extends MessageType { if (message.state !== 0) writer.tag(1, WireType.Varint).int32(message.state); /* uint64 settle_index = 2; */ - if (message.settleIndex !== 0) + if (message.settleIndex !== 0n) writer.tag(2, WireType.Varint).uint64(message.settleIndex); /* int64 settle_time = 3; */ - if (message.settleTime !== 0) + if (message.settleTime !== 0n) writer.tag(3, WireType.Varint).int64(message.settleTime); /* int64 amt_paid_msat = 5; */ - if (message.amtPaidMsat !== 0) + if (message.amtPaidMsat !== 0n) writer.tag(5, WireType.Varint).int64(message.amtPaidMsat); let u = options.writeUnknownFields; if (u !== false) @@ -16764,23 +16764,23 @@ class Invoice$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, - { no: 23, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "settle_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 17, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 18, name: "amt_paid", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 19, name: "amt_paid_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 20, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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 } }, @@ -16791,7 +16791,7 @@ class Invoice$Type extends MessageType { ]); } create(value?: PartialMessage): Invoice { - const message = { memo: "", rPreimage: new Uint8Array(0), rHash: new Uint8Array(0), value: 0, valueMsat: 0, settled: false, creationDate: 0, settleDate: 0, paymentRequest: "", descriptionHash: new Uint8Array(0), expiry: 0, fallbackAddr: "", cltvExpiry: 0, routeHints: [], private: false, addIndex: 0, settleIndex: 0, amtPaid: 0, amtPaidSat: 0, amtPaidMsat: 0, state: 0, htlcs: [], features: {}, isKeysend: false, paymentAddr: new Uint8Array(0), isAmp: false, ampInvoiceState: {} }; + 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); @@ -16812,19 +16812,19 @@ class Invoice$Type extends MessageType { message.rHash = reader.bytes(); break; case /* int64 value */ 5: - message.value = reader.int64().toNumber(); + message.value = reader.int64().toBigInt(); break; case /* int64 value_msat */ 23: - message.valueMsat = reader.int64().toNumber(); + 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().toNumber(); + message.creationDate = reader.int64().toBigInt(); break; case /* int64 settle_date */ 8: - message.settleDate = reader.int64().toNumber(); + message.settleDate = reader.int64().toBigInt(); break; case /* string payment_request */ 9: message.paymentRequest = reader.string(); @@ -16833,13 +16833,13 @@ class Invoice$Type extends MessageType { message.descriptionHash = reader.bytes(); break; case /* int64 expiry */ 11: - message.expiry = reader.int64().toNumber(); + 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().toNumber(); + message.cltvExpiry = reader.uint64().toBigInt(); break; case /* repeated lnrpc.RouteHint route_hints */ 14: message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); @@ -16848,19 +16848,19 @@ class Invoice$Type extends MessageType { message.private = reader.bool(); break; case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toNumber(); + message.addIndex = reader.uint64().toBigInt(); break; case /* uint64 settle_index */ 17: - message.settleIndex = reader.uint64().toNumber(); + message.settleIndex = reader.uint64().toBigInt(); break; case /* int64 amt_paid = 18 [deprecated = true];*/ 18: - message.amtPaid = reader.int64().toNumber(); + message.amtPaid = reader.int64().toBigInt(); break; case /* int64 amt_paid_sat */ 19: - message.amtPaidSat = reader.int64().toNumber(); + message.amtPaidSat = reader.int64().toBigInt(); break; case /* int64 amt_paid_msat */ 20: - message.amtPaidMsat = reader.int64().toNumber(); + message.amtPaidMsat = reader.int64().toBigInt(); break; case /* lnrpc.Invoice.InvoiceState state */ 21: message.state = reader.int32(); @@ -16937,19 +16937,19 @@ class Invoice$Type extends MessageType { if (message.rHash.length) writer.tag(4, WireType.LengthDelimited).bytes(message.rHash); /* int64 value = 5; */ - if (message.value !== 0) + if (message.value !== 0n) writer.tag(5, WireType.Varint).int64(message.value); /* int64 value_msat = 23; */ - if (message.valueMsat !== 0) + 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 !== 0) + if (message.creationDate !== 0n) writer.tag(7, WireType.Varint).int64(message.creationDate); /* int64 settle_date = 8; */ - if (message.settleDate !== 0) + if (message.settleDate !== 0n) writer.tag(8, WireType.Varint).int64(message.settleDate); /* string payment_request = 9; */ if (message.paymentRequest !== "") @@ -16958,13 +16958,13 @@ class Invoice$Type extends MessageType { if (message.descriptionHash.length) writer.tag(10, WireType.LengthDelimited).bytes(message.descriptionHash); /* int64 expiry = 11; */ - if (message.expiry !== 0) + 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 !== 0) + 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++) @@ -16973,19 +16973,19 @@ class Invoice$Type extends MessageType { if (message.private !== false) writer.tag(15, WireType.Varint).bool(message.private); /* uint64 add_index = 16; */ - if (message.addIndex !== 0) + if (message.addIndex !== 0n) writer.tag(16, WireType.Varint).uint64(message.addIndex); /* uint64 settle_index = 17; */ - if (message.settleIndex !== 0) + if (message.settleIndex !== 0n) writer.tag(17, WireType.Varint).uint64(message.settleIndex); /* int64 amt_paid = 18 [deprecated = true]; */ - if (message.amtPaid !== 0) + if (message.amtPaid !== 0n) writer.tag(18, WireType.Varint).int64(message.amtPaid); /* int64 amt_paid_sat = 19; */ - if (message.amtPaidSat !== 0) + if (message.amtPaidSat !== 0n) writer.tag(19, WireType.Varint).int64(message.amtPaidSat); /* int64 amt_paid_msat = 20; */ - if (message.amtPaidMsat !== 0) + if (message.amtPaidMsat !== 0n) writer.tag(20, WireType.Varint).int64(message.amtPaidMsat); /* lnrpc.Invoice.InvoiceState state = 21; */ if (message.state !== 0) @@ -17031,20 +17031,20 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "resolve_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, amtMsat: 0, acceptHeight: 0, acceptTime: 0, resolveTime: 0, expiryHeight: 0, state: 0, customRecords: {}, mppTotalAmtMsat: 0 }; + 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); @@ -17059,19 +17059,19 @@ class InvoiceHTLC$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* uint64 htlc_index */ 2: - message.htlcIndex = reader.uint64().toNumber(); + message.htlcIndex = reader.uint64().toBigInt(); break; case /* uint64 amt_msat */ 3: - message.amtMsat = reader.uint64().toNumber(); + 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().toNumber(); + message.acceptTime = reader.int64().toBigInt(); break; case /* int64 resolve_time */ 6: - message.resolveTime = reader.int64().toNumber(); + message.resolveTime = reader.int64().toBigInt(); break; case /* int32 expiry_height */ 7: message.expiryHeight = reader.int32(); @@ -17083,7 +17083,7 @@ class InvoiceHTLC$Type extends MessageType { this.binaryReadMap9(message.customRecords, reader, options); break; case /* uint64 mpp_total_amt_msat */ 10: - message.mppTotalAmtMsat = reader.uint64().toNumber(); + message.mppTotalAmtMsat = reader.uint64().toBigInt(); break; case /* lnrpc.AMP amp */ 11: message.amp = AMP.internalBinaryRead(reader, reader.uint32(), options, message.amp); @@ -17120,19 +17120,19 @@ class InvoiceHTLC$Type extends MessageType { if (message.chanId !== "0") writer.tag(1, WireType.Varint).uint64(message.chanId); /* uint64 htlc_index = 2; */ - if (message.htlcIndex !== 0) + if (message.htlcIndex !== 0n) writer.tag(2, WireType.Varint).uint64(message.htlcIndex); /* uint64 amt_msat = 3; */ - if (message.amtMsat !== 0) + 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 !== 0) + if (message.acceptTime !== 0n) writer.tag(5, WireType.Varint).int64(message.acceptTime); /* int64 resolve_time = 6; */ - if (message.resolveTime !== 0) + if (message.resolveTime !== 0n) writer.tag(6, WireType.Varint).int64(message.resolveTime); /* int32 expiry_height = 7; */ if (message.expiryHeight !== 0) @@ -17144,7 +17144,7 @@ class InvoiceHTLC$Type extends MessageType { 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 !== 0) + if (message.mppTotalAmtMsat !== 0n) writer.tag(10, WireType.Varint).uint64(message.mppTotalAmtMsat); /* lnrpc.AMP amp = 11; */ if (message.amp) @@ -17240,12 +17240,12 @@ class AddInvoiceResponse$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, paymentAddr: new Uint8Array(0) }; + 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); @@ -17263,7 +17263,7 @@ class AddInvoiceResponse$Type extends MessageType { message.paymentRequest = reader.string(); break; case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toNumber(); + message.addIndex = reader.uint64().toBigInt(); break; case /* bytes payment_addr */ 17: message.paymentAddr = reader.bytes(); @@ -17287,7 +17287,7 @@ class AddInvoiceResponse$Type extends MessageType { if (message.paymentRequest !== "") writer.tag(2, WireType.LengthDelimited).string(message.paymentRequest); /* uint64 add_index = 16; */ - if (message.addIndex !== 0) + if (message.addIndex !== 0n) writer.tag(16, WireType.Varint).uint64(message.addIndex); /* bytes payment_addr = 17; */ if (message.paymentAddr.length) @@ -17361,13 +17361,13 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "num_max_invoices", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, numMaxInvoices: 0, reversed: false }; + 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); @@ -17382,10 +17382,10 @@ class ListInvoiceRequest$Type extends MessageType { message.pendingOnly = reader.bool(); break; case /* uint64 index_offset */ 4: - message.indexOffset = reader.uint64().toNumber(); + message.indexOffset = reader.uint64().toBigInt(); break; case /* uint64 num_max_invoices */ 5: - message.numMaxInvoices = reader.uint64().toNumber(); + message.numMaxInvoices = reader.uint64().toBigInt(); break; case /* bool reversed */ 6: message.reversed = reader.bool(); @@ -17406,10 +17406,10 @@ class ListInvoiceRequest$Type extends MessageType { if (message.pendingOnly !== false) writer.tag(1, WireType.Varint).bool(message.pendingOnly); /* uint64 index_offset = 4; */ - if (message.indexOffset !== 0) + if (message.indexOffset !== 0n) writer.tag(4, WireType.Varint).uint64(message.indexOffset); /* uint64 num_max_invoices = 5; */ - if (message.numMaxInvoices !== 0) + if (message.numMaxInvoices !== 0n) writer.tag(5, WireType.Varint).uint64(message.numMaxInvoices); /* bool reversed = 6; */ if (message.reversed !== false) @@ -17429,12 +17429,12 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, firstIndexOffset: 0 }; + const message = { invoices: [], lastIndexOffset: 0n, firstIndexOffset: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -17449,10 +17449,10 @@ class ListInvoiceResponse$Type extends MessageType { message.invoices.push(Invoice.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 last_index_offset */ 2: - message.lastIndexOffset = reader.uint64().toNumber(); + message.lastIndexOffset = reader.uint64().toBigInt(); break; case /* uint64 first_index_offset */ 3: - message.firstIndexOffset = reader.uint64().toNumber(); + message.firstIndexOffset = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -17470,10 +17470,10 @@ class ListInvoiceResponse$Type extends MessageType { 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 !== 0) + if (message.lastIndexOffset !== 0n) writer.tag(2, WireType.Varint).uint64(message.lastIndexOffset); /* uint64 first_index_offset = 3; */ - if (message.firstIndexOffset !== 0) + if (message.firstIndexOffset !== 0n) writer.tag(3, WireType.Varint).uint64(message.firstIndexOffset); let u = options.writeUnknownFields; if (u !== false) @@ -17489,12 +17489,12 @@ export const ListInvoiceResponse = new ListInvoiceResponse$Type(); class InvoiceSubscription$Type extends MessageType { constructor() { super("lnrpc.InvoiceSubscription", [ - { no: 1, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, settleIndex: 0 }; + const message = { addIndex: 0n, settleIndex: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -17506,10 +17506,10 @@ class InvoiceSubscription$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 add_index */ 1: - message.addIndex = reader.uint64().toNumber(); + message.addIndex = reader.uint64().toBigInt(); break; case /* uint64 settle_index */ 2: - message.settleIndex = reader.uint64().toNumber(); + message.settleIndex = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -17524,10 +17524,10 @@ class InvoiceSubscription$Type extends MessageType { } internalBinaryWrite(message: InvoiceSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 add_index = 1; */ - if (message.addIndex !== 0) + if (message.addIndex !== 0n) writer.tag(1, WireType.Varint).uint64(message.addIndex); /* uint64 settle_index = 2; */ - if (message.settleIndex !== 0) + if (message.settleIndex !== 0n) writer.tag(2, WireType.Varint).uint64(message.settleIndex); let u = options.writeUnknownFields; if (u !== false) @@ -17544,24 +17544,24 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 13, name: "creation_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, creationDate: 0, fee: 0, paymentPreimage: "", valueSat: 0, valueMsat: 0, paymentRequest: "", status: 0, feeSat: 0, feeMsat: 0, creationTimeNs: 0, htlcs: [], paymentIndex: 0, failureReason: 0 }; + 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); @@ -17576,22 +17576,22 @@ class Payment$Type extends MessageType { message.paymentHash = reader.string(); break; case /* int64 value = 2 [deprecated = true];*/ 2: - message.value = reader.int64().toNumber(); + message.value = reader.int64().toBigInt(); break; case /* int64 creation_date = 3 [deprecated = true];*/ 3: - message.creationDate = reader.int64().toNumber(); + message.creationDate = reader.int64().toBigInt(); break; case /* int64 fee = 5 [deprecated = true];*/ 5: - message.fee = reader.int64().toNumber(); + 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().toNumber(); + message.valueSat = reader.int64().toBigInt(); break; case /* int64 value_msat */ 8: - message.valueMsat = reader.int64().toNumber(); + message.valueMsat = reader.int64().toBigInt(); break; case /* string payment_request */ 9: message.paymentRequest = reader.string(); @@ -17600,19 +17600,19 @@ class Payment$Type extends MessageType { message.status = reader.int32(); break; case /* int64 fee_sat */ 11: - message.feeSat = reader.int64().toNumber(); + message.feeSat = reader.int64().toBigInt(); break; case /* int64 fee_msat */ 12: - message.feeMsat = reader.int64().toNumber(); + message.feeMsat = reader.int64().toBigInt(); break; case /* int64 creation_time_ns */ 13: - message.creationTimeNs = reader.int64().toNumber(); + 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().toNumber(); + message.paymentIndex = reader.uint64().toBigInt(); break; case /* lnrpc.PaymentFailureReason failure_reason */ 16: message.failureReason = reader.int32(); @@ -17633,22 +17633,22 @@ class Payment$Type extends MessageType { if (message.paymentHash !== "") writer.tag(1, WireType.LengthDelimited).string(message.paymentHash); /* int64 value = 2 [deprecated = true]; */ - if (message.value !== 0) + if (message.value !== 0n) writer.tag(2, WireType.Varint).int64(message.value); /* int64 creation_date = 3 [deprecated = true]; */ - if (message.creationDate !== 0) + if (message.creationDate !== 0n) writer.tag(3, WireType.Varint).int64(message.creationDate); /* int64 fee = 5 [deprecated = true]; */ - if (message.fee !== 0) + 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 !== 0) + if (message.valueSat !== 0n) writer.tag(7, WireType.Varint).int64(message.valueSat); /* int64 value_msat = 8; */ - if (message.valueMsat !== 0) + if (message.valueMsat !== 0n) writer.tag(8, WireType.Varint).int64(message.valueMsat); /* string payment_request = 9; */ if (message.paymentRequest !== "") @@ -17657,19 +17657,19 @@ class Payment$Type extends MessageType { if (message.status !== 0) writer.tag(10, WireType.Varint).int32(message.status); /* int64 fee_sat = 11; */ - if (message.feeSat !== 0) + if (message.feeSat !== 0n) writer.tag(11, WireType.Varint).int64(message.feeSat); /* int64 fee_msat = 12; */ - if (message.feeMsat !== 0) + if (message.feeMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.feeMsat); /* int64 creation_time_ns = 13; */ - if (message.creationTimeNs !== 0) + 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 !== 0) + if (message.paymentIndex !== 0n) writer.tag(15, WireType.Varint).uint64(message.paymentIndex); /* lnrpc.PaymentFailureReason failure_reason = 16; */ if (message.failureReason !== 0) @@ -17688,17 +17688,17 @@ export const Payment = new Payment$Type(); class HTLCAttempt$Type extends MessageType { constructor() { super("lnrpc.HTLCAttempt", [ - { no: 7, name: "attempt_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "resolve_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, status: 0, attemptTimeNs: 0, resolveTimeNs: 0, preimage: new Uint8Array(0) }; + 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); @@ -17710,7 +17710,7 @@ class HTLCAttempt$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 attempt_id */ 7: - message.attemptId = reader.uint64().toNumber(); + message.attemptId = reader.uint64().toBigInt(); break; case /* lnrpc.HTLCAttempt.HTLCStatus status */ 1: message.status = reader.int32(); @@ -17719,10 +17719,10 @@ class HTLCAttempt$Type extends MessageType { message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); break; case /* int64 attempt_time_ns */ 3: - message.attemptTimeNs = reader.int64().toNumber(); + message.attemptTimeNs = reader.int64().toBigInt(); break; case /* int64 resolve_time_ns */ 4: - message.resolveTimeNs = reader.int64().toNumber(); + message.resolveTimeNs = reader.int64().toBigInt(); break; case /* lnrpc.Failure failure */ 5: message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); @@ -17743,7 +17743,7 @@ class HTLCAttempt$Type extends MessageType { } internalBinaryWrite(message: HTLCAttempt, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 attempt_id = 7; */ - if (message.attemptId !== 0) + if (message.attemptId !== 0n) writer.tag(7, WireType.Varint).uint64(message.attemptId); /* lnrpc.HTLCAttempt.HTLCStatus status = 1; */ if (message.status !== 0) @@ -17752,10 +17752,10 @@ class HTLCAttempt$Type extends MessageType { if (message.route) Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* int64 attempt_time_ns = 3; */ - if (message.attemptTimeNs !== 0) + if (message.attemptTimeNs !== 0n) writer.tag(3, WireType.Varint).int64(message.attemptTimeNs); /* int64 resolve_time_ns = 4; */ - if (message.resolveTimeNs !== 0) + if (message.resolveTimeNs !== 0n) writer.tag(4, WireType.Varint).int64(message.resolveTimeNs); /* lnrpc.Failure failure = 5; */ if (message.failure) @@ -17778,14 +17778,14 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "max_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, maxPayments: 0, reversed: false, countTotalPayments: false }; + 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); @@ -17800,10 +17800,10 @@ class ListPaymentsRequest$Type extends MessageType { message.includeIncomplete = reader.bool(); break; case /* uint64 index_offset */ 2: - message.indexOffset = reader.uint64().toNumber(); + message.indexOffset = reader.uint64().toBigInt(); break; case /* uint64 max_payments */ 3: - message.maxPayments = reader.uint64().toNumber(); + message.maxPayments = reader.uint64().toBigInt(); break; case /* bool reversed */ 4: message.reversed = reader.bool(); @@ -17827,10 +17827,10 @@ class ListPaymentsRequest$Type extends MessageType { if (message.includeIncomplete !== false) writer.tag(1, WireType.Varint).bool(message.includeIncomplete); /* uint64 index_offset = 2; */ - if (message.indexOffset !== 0) + if (message.indexOffset !== 0n) writer.tag(2, WireType.Varint).uint64(message.indexOffset); /* uint64 max_payments = 3; */ - if (message.maxPayments !== 0) + if (message.maxPayments !== 0n) writer.tag(3, WireType.Varint).uint64(message.maxPayments); /* bool reversed = 4; */ if (message.reversed !== false) @@ -17853,13 +17853,13 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "total_num_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, lastIndexOffset: 0, totalNumPayments: 0 }; + 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); @@ -17874,13 +17874,13 @@ class ListPaymentsResponse$Type extends MessageType { message.payments.push(Payment.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 first_index_offset */ 2: - message.firstIndexOffset = reader.uint64().toNumber(); + message.firstIndexOffset = reader.uint64().toBigInt(); break; case /* uint64 last_index_offset */ 3: - message.lastIndexOffset = reader.uint64().toNumber(); + message.lastIndexOffset = reader.uint64().toBigInt(); break; case /* uint64 total_num_payments */ 4: - message.totalNumPayments = reader.uint64().toNumber(); + message.totalNumPayments = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -17898,13 +17898,13 @@ class ListPaymentsResponse$Type extends MessageType { 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 !== 0) + if (message.firstIndexOffset !== 0n) writer.tag(2, WireType.Varint).uint64(message.firstIndexOffset); /* uint64 last_index_offset = 3; */ - if (message.lastIndexOffset !== 0) + if (message.lastIndexOffset !== 0n) writer.tag(3, WireType.Varint).uint64(message.lastIndexOffset); /* uint64 total_num_payments = 4; */ - if (message.totalNumPayments !== 0) + if (message.totalNumPayments !== 0n) writer.tag(4, WireType.Varint).uint64(message.totalNumPayments); let u = options.writeUnknownFields; if (u !== false) @@ -18317,21 +18317,21 @@ class PayReq$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, timestamp: 0, expiry: 0, description: "", descriptionHash: "", fallbackAddr: "", cltvExpiry: 0, routeHints: [], paymentAddr: new Uint8Array(0), numMsat: 0, features: {} }; + 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); @@ -18349,13 +18349,13 @@ class PayReq$Type extends MessageType { message.paymentHash = reader.string(); break; case /* int64 num_satoshis */ 3: - message.numSatoshis = reader.int64().toNumber(); + message.numSatoshis = reader.int64().toBigInt(); break; case /* int64 timestamp */ 4: - message.timestamp = reader.int64().toNumber(); + message.timestamp = reader.int64().toBigInt(); break; case /* int64 expiry */ 5: - message.expiry = reader.int64().toNumber(); + message.expiry = reader.int64().toBigInt(); break; case /* string description */ 6: message.description = reader.string(); @@ -18367,7 +18367,7 @@ class PayReq$Type extends MessageType { message.fallbackAddr = reader.string(); break; case /* int64 cltv_expiry */ 9: - message.cltvExpiry = reader.int64().toNumber(); + message.cltvExpiry = reader.int64().toBigInt(); break; case /* repeated lnrpc.RouteHint route_hints */ 10: message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); @@ -18376,7 +18376,7 @@ class PayReq$Type extends MessageType { message.paymentAddr = reader.bytes(); break; case /* int64 num_msat */ 12: - message.numMsat = reader.int64().toNumber(); + message.numMsat = reader.int64().toBigInt(); break; case /* map features */ 13: this.binaryReadMap13(message.features, reader, options); @@ -18416,13 +18416,13 @@ class PayReq$Type extends MessageType { if (message.paymentHash !== "") writer.tag(2, WireType.LengthDelimited).string(message.paymentHash); /* int64 num_satoshis = 3; */ - if (message.numSatoshis !== 0) + if (message.numSatoshis !== 0n) writer.tag(3, WireType.Varint).int64(message.numSatoshis); /* int64 timestamp = 4; */ - if (message.timestamp !== 0) + if (message.timestamp !== 0n) writer.tag(4, WireType.Varint).int64(message.timestamp); /* int64 expiry = 5; */ - if (message.expiry !== 0) + if (message.expiry !== 0n) writer.tag(5, WireType.Varint).int64(message.expiry); /* string description = 6; */ if (message.description !== "") @@ -18434,7 +18434,7 @@ class PayReq$Type extends MessageType { if (message.fallbackAddr !== "") writer.tag(8, WireType.LengthDelimited).string(message.fallbackAddr); /* int64 cltv_expiry = 9; */ - if (message.cltvExpiry !== 0) + 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++) @@ -18443,7 +18443,7 @@ class PayReq$Type extends MessageType { if (message.paymentAddr.length) writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); /* int64 num_msat = 12; */ - if (message.numMsat !== 0) + if (message.numMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.numMsat); /* map features = 13; */ for (let k of Object.keys(message.features)) { @@ -18555,13 +18555,13 @@ class ChannelFeeReport$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "fee_per_mil", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, feePerMil: 0, feeRate: 0 }; + 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); @@ -18579,10 +18579,10 @@ class ChannelFeeReport$Type extends MessageType { message.channelPoint = reader.string(); break; case /* int64 base_fee_msat */ 2: - message.baseFeeMsat = reader.int64().toNumber(); + message.baseFeeMsat = reader.int64().toBigInt(); break; case /* int64 fee_per_mil */ 3: - message.feePerMil = reader.int64().toNumber(); + message.feePerMil = reader.int64().toBigInt(); break; case /* double fee_rate */ 4: message.feeRate = reader.double(); @@ -18606,10 +18606,10 @@ class ChannelFeeReport$Type extends MessageType { if (message.channelPoint !== "") writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); /* int64 base_fee_msat = 2; */ - if (message.baseFeeMsat !== 0) + if (message.baseFeeMsat !== 0n) writer.tag(2, WireType.Varint).int64(message.baseFeeMsat); /* int64 fee_per_mil = 3; */ - if (message.feePerMil !== 0) + if (message.feePerMil !== 0n) writer.tag(3, WireType.Varint).int64(message.feePerMil); /* double fee_rate = 4; */ if (message.feeRate !== 0) @@ -18629,13 +18629,13 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "week_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "month_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, weekFeeSum: 0, monthFeeSum: 0 }; + 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); @@ -18650,13 +18650,13 @@ class FeeReportResponse$Type extends MessageType { message.channelFees.push(ChannelFeeReport.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 day_fee_sum */ 2: - message.dayFeeSum = reader.uint64().toNumber(); + message.dayFeeSum = reader.uint64().toBigInt(); break; case /* uint64 week_fee_sum */ 3: - message.weekFeeSum = reader.uint64().toNumber(); + message.weekFeeSum = reader.uint64().toBigInt(); break; case /* uint64 month_fee_sum */ 4: - message.monthFeeSum = reader.uint64().toNumber(); + message.monthFeeSum = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -18674,13 +18674,13 @@ class FeeReportResponse$Type extends MessageType { 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 !== 0) + if (message.dayFeeSum !== 0n) writer.tag(2, WireType.Varint).uint64(message.dayFeeSum); /* uint64 week_fee_sum = 3; */ - if (message.weekFeeSum !== 0) + if (message.weekFeeSum !== 0n) writer.tag(3, WireType.Varint).uint64(message.weekFeeSum); /* uint64 month_fee_sum = 4; */ - if (message.monthFeeSum !== 0) + if (message.monthFeeSum !== 0n) writer.tag(4, WireType.Varint).uint64(message.monthFeeSum); let u = options.writeUnknownFields; if (u !== false) @@ -18698,17 +18698,17 @@ class PolicyUpdateRequest$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, feeRate: 0, feeRatePpm: 0, timeLockDelta: 0, maxHtlcMsat: 0, minHtlcMsat: 0, minHtlcMsatSpecified: false }; + 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); @@ -18732,7 +18732,7 @@ class PolicyUpdateRequest$Type extends MessageType { }; break; case /* int64 base_fee_msat */ 3: - message.baseFeeMsat = reader.int64().toNumber(); + message.baseFeeMsat = reader.int64().toBigInt(); break; case /* double fee_rate */ 4: message.feeRate = reader.double(); @@ -18744,10 +18744,10 @@ class PolicyUpdateRequest$Type extends MessageType { message.timeLockDelta = reader.uint32(); break; case /* uint64 max_htlc_msat */ 6: - message.maxHtlcMsat = reader.uint64().toNumber(); + message.maxHtlcMsat = reader.uint64().toBigInt(); break; case /* uint64 min_htlc_msat */ 7: - message.minHtlcMsat = reader.uint64().toNumber(); + message.minHtlcMsat = reader.uint64().toBigInt(); break; case /* bool min_htlc_msat_specified */ 8: message.minHtlcMsatSpecified = reader.bool(); @@ -18771,7 +18771,7 @@ class PolicyUpdateRequest$Type extends MessageType { 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 !== 0) + if (message.baseFeeMsat !== 0n) writer.tag(3, WireType.Varint).int64(message.baseFeeMsat); /* double fee_rate = 4; */ if (message.feeRate !== 0) @@ -18783,10 +18783,10 @@ class PolicyUpdateRequest$Type extends MessageType { if (message.timeLockDelta !== 0) writer.tag(5, WireType.Varint).uint32(message.timeLockDelta); /* uint64 max_htlc_msat = 6; */ - if (message.maxHtlcMsat !== 0) + if (message.maxHtlcMsat !== 0n) writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); /* uint64 min_htlc_msat = 7; */ - if (message.minHtlcMsat !== 0) + if (message.minHtlcMsat !== 0n) writer.tag(7, WireType.Varint).uint64(message.minHtlcMsat); /* bool min_htlc_msat_specified = 8; */ if (message.minHtlcMsatSpecified !== false) @@ -18913,15 +18913,15 @@ export const PolicyUpdateResponse = new PolicyUpdateResponse$Type(); class ForwardingHistoryRequest$Type extends MessageType { constructor() { super("lnrpc.ForwardingHistoryRequest", [ - { no: 1, name: "start_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "end_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, endTime: 0, indexOffset: 0, numMaxEvents: 0, peerAliasLookup: false }; + 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); @@ -18933,10 +18933,10 @@ class ForwardingHistoryRequest$Type extends MessageType { constructor() { super("lnrpc.ForwardingEvent", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "amt_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "fee_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "amt_in_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "amt_out_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, chanIdIn: "0", chanIdOut: "0", amtIn: 0, amtOut: 0, fee: 0, feeMsat: 0, amtInMsat: 0, amtOutMsat: 0, timestampNs: 0, peerAliasIn: "", peerAliasOut: "" }; + 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); @@ -19015,7 +19015,7 @@ class ForwardingEvent$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 timestamp = 1 [deprecated = true];*/ 1: - message.timestamp = reader.uint64().toNumber(); + message.timestamp = reader.uint64().toBigInt(); break; case /* uint64 chan_id_in = 2 [jstype = JS_STRING];*/ 2: message.chanIdIn = reader.uint64().toString(); @@ -19024,25 +19024,25 @@ class ForwardingEvent$Type extends MessageType { message.chanIdOut = reader.uint64().toString(); break; case /* uint64 amt_in */ 5: - message.amtIn = reader.uint64().toNumber(); + message.amtIn = reader.uint64().toBigInt(); break; case /* uint64 amt_out */ 6: - message.amtOut = reader.uint64().toNumber(); + message.amtOut = reader.uint64().toBigInt(); break; case /* uint64 fee */ 7: - message.fee = reader.uint64().toNumber(); + message.fee = reader.uint64().toBigInt(); break; case /* uint64 fee_msat */ 8: - message.feeMsat = reader.uint64().toNumber(); + message.feeMsat = reader.uint64().toBigInt(); break; case /* uint64 amt_in_msat */ 9: - message.amtInMsat = reader.uint64().toNumber(); + message.amtInMsat = reader.uint64().toBigInt(); break; case /* uint64 amt_out_msat */ 10: - message.amtOutMsat = reader.uint64().toNumber(); + message.amtOutMsat = reader.uint64().toBigInt(); break; case /* uint64 timestamp_ns */ 11: - message.timestampNs = reader.uint64().toNumber(); + message.timestampNs = reader.uint64().toBigInt(); break; case /* string peer_alias_in */ 12: message.peerAliasIn = reader.string(); @@ -19063,7 +19063,7 @@ class ForwardingEvent$Type extends MessageType { } internalBinaryWrite(message: ForwardingEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 timestamp = 1 [deprecated = true]; */ - if (message.timestamp !== 0) + if (message.timestamp !== 0n) writer.tag(1, WireType.Varint).uint64(message.timestamp); /* uint64 chan_id_in = 2 [jstype = JS_STRING]; */ if (message.chanIdIn !== "0") @@ -19072,25 +19072,25 @@ class ForwardingEvent$Type extends MessageType { if (message.chanIdOut !== "0") writer.tag(4, WireType.Varint).uint64(message.chanIdOut); /* uint64 amt_in = 5; */ - if (message.amtIn !== 0) + if (message.amtIn !== 0n) writer.tag(5, WireType.Varint).uint64(message.amtIn); /* uint64 amt_out = 6; */ - if (message.amtOut !== 0) + if (message.amtOut !== 0n) writer.tag(6, WireType.Varint).uint64(message.amtOut); /* uint64 fee = 7; */ - if (message.fee !== 0) + if (message.fee !== 0n) writer.tag(7, WireType.Varint).uint64(message.fee); /* uint64 fee_msat = 8; */ - if (message.feeMsat !== 0) + if (message.feeMsat !== 0n) writer.tag(8, WireType.Varint).uint64(message.feeMsat); /* uint64 amt_in_msat = 9; */ - if (message.amtInMsat !== 0) + if (message.amtInMsat !== 0n) writer.tag(9, WireType.Varint).uint64(message.amtInMsat); /* uint64 amt_out_msat = 10; */ - if (message.amtOutMsat !== 0) + if (message.amtOutMsat !== 0n) writer.tag(10, WireType.Varint).uint64(message.amtOutMsat); /* uint64 timestamp_ns = 11; */ - if (message.timestampNs !== 0) + if (message.timestampNs !== 0n) writer.tag(11, WireType.Varint).uint64(message.timestampNs); /* string peer_alias_in = 12; */ if (message.peerAliasIn !== "") @@ -19641,12 +19641,12 @@ 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, allowExternalPermissions: false }; + const message = { permissions: [], rootKeyId: 0n, allowExternalPermissions: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -19661,7 +19661,7 @@ class BakeMacaroonRequest$Type extends MessageType { message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 root_key_id */ 2: - message.rootKeyId = reader.uint64().toNumber(); + message.rootKeyId = reader.uint64().toBigInt(); break; case /* bool allow_external_permissions */ 3: message.allowExternalPermissions = reader.bool(); @@ -19682,7 +19682,7 @@ class BakeMacaroonRequest$Type extends MessageType { 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 !== 0) + if (message.rootKeyId !== 0n) writer.tag(2, WireType.Varint).uint64(message.rootKeyId); /* bool allow_external_permissions = 3; */ if (message.allowExternalPermissions !== false) @@ -19774,7 +19774,7 @@ export const ListMacaroonIDsRequest = new ListMacaroonIDsRequest$Type(); 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: 2 /*LongType.NUMBER*/ } + { no: 1, name: "root_key_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): ListMacaroonIDsResponse { @@ -19792,9 +19792,9 @@ class ListMacaroonIDsResponse$Type extends MessageType 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().toNumber()); + message.rootKeyIds.push(reader.uint64().toBigInt()); else - message.rootKeyIds.push(reader.uint64().toNumber()); + message.rootKeyIds.push(reader.uint64().toBigInt()); break; default: let u = options.readUnknownField; @@ -19829,11 +19829,11 @@ export const ListMacaroonIDsResponse = new ListMacaroonIDsResponse$Type(); class DeleteMacaroonIDRequest$Type extends MessageType { constructor() { super("lnrpc.DeleteMacaroonIDRequest", [ - { no: 1, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { no: 1, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): DeleteMacaroonIDRequest { - const message = { rootKeyId: 0 }; + const message = { rootKeyId: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -19845,7 +19845,7 @@ class DeleteMacaroonIDRequest$Type extends MessageType let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 root_key_id */ 1: - message.rootKeyId = reader.uint64().toNumber(); + message.rootKeyId = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -19860,7 +19860,7 @@ class DeleteMacaroonIDRequest$Type extends MessageType } internalBinaryWrite(message: DeleteMacaroonIDRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 root_key_id = 1; */ - if (message.rootKeyId !== 0) + if (message.rootKeyId !== 0n) writer.tag(1, WireType.Varint).uint64(message.rootKeyId); let u = options.writeUnknownFields; if (u !== false) @@ -20065,7 +20065,7 @@ class Failure$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -20074,7 +20074,7 @@ class Failure$Type extends MessageType { ]); } create(value?: PartialMessage): Failure { - const message = { code: 0, htlcMsat: 0, onionSha256: new Uint8Array(0), cltvExpiry: 0, flags: 0, failureSourceIndex: 0, height: 0 }; + 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); @@ -20092,7 +20092,7 @@ class Failure$Type extends MessageType { message.channelUpdate = ChannelUpdate.internalBinaryRead(reader, reader.uint32(), options, message.channelUpdate); break; case /* uint64 htlc_msat */ 4: - message.htlcMsat = reader.uint64().toNumber(); + message.htlcMsat = reader.uint64().toBigInt(); break; case /* bytes onion_sha_256 */ 5: message.onionSha256 = reader.bytes(); @@ -20128,7 +20128,7 @@ class Failure$Type extends MessageType { if (message.channelUpdate) ChannelUpdate.internalBinaryWrite(message.channelUpdate, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); /* uint64 htlc_msat = 4; */ - if (message.htlcMsat !== 0) + if (message.htlcMsat !== 0n) writer.tag(4, WireType.Varint).uint64(message.htlcMsat); /* bytes onion_sha_256 = 5; */ if (message.onionSha256.length) @@ -20166,15 +20166,15 @@ class ChannelUpdate$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, baseFee: 0, feeRate: 0, htlcMaximumMsat: 0, extraOpaqueData: new Uint8Array(0) }; + 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); @@ -20207,7 +20207,7 @@ class ChannelUpdate$Type extends MessageType { message.timeLockDelta = reader.uint32(); break; case /* uint64 htlc_minimum_msat */ 7: - message.htlcMinimumMsat = reader.uint64().toNumber(); + message.htlcMinimumMsat = reader.uint64().toBigInt(); break; case /* uint32 base_fee */ 8: message.baseFee = reader.uint32(); @@ -20216,7 +20216,7 @@ class ChannelUpdate$Type extends MessageType { message.feeRate = reader.uint32(); break; case /* uint64 htlc_maximum_msat */ 11: - message.htlcMaximumMsat = reader.uint64().toNumber(); + message.htlcMaximumMsat = reader.uint64().toBigInt(); break; case /* bytes extra_opaque_data */ 12: message.extraOpaqueData = reader.bytes(); @@ -20255,7 +20255,7 @@ class ChannelUpdate$Type extends MessageType { if (message.timeLockDelta !== 0) writer.tag(6, WireType.Varint).uint32(message.timeLockDelta); /* uint64 htlc_minimum_msat = 7; */ - if (message.htlcMinimumMsat !== 0) + if (message.htlcMinimumMsat !== 0n) writer.tag(7, WireType.Varint).uint64(message.htlcMinimumMsat); /* uint32 base_fee = 8; */ if (message.baseFee !== 0) @@ -20264,7 +20264,7 @@ class ChannelUpdate$Type extends MessageType { if (message.feeRate !== 0) writer.tag(9, WireType.Varint).uint32(message.feeRate); /* uint64 htlc_maximum_msat = 11; */ - if (message.htlcMaximumMsat !== 0) + if (message.htlcMaximumMsat !== 0n) writer.tag(11, WireType.Varint).uint64(message.htlcMaximumMsat); /* bytes extra_opaque_data = 12; */ if (message.extraOpaqueData.length) @@ -20506,18 +20506,18 @@ export const CheckMacPermResponse = new CheckMacPermResponse$Type(); class RPCMiddlewareRequest$Type extends MessageType { constructor() { super("lnrpc.RPCMiddlewareRequest", [ - { no: 1, name: "request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ } + { no: 7, name: "msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): RPCMiddlewareRequest { - const message = { requestId: 0, rawMacaroon: new Uint8Array(0), customCaveatCondition: "", interceptType: { oneofKind: undefined }, msgId: 0 }; + 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); @@ -20529,7 +20529,7 @@ class RPCMiddlewareRequest$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 request_id */ 1: - message.requestId = reader.uint64().toNumber(); + message.requestId = reader.uint64().toBigInt(); break; case /* bytes raw_macaroon */ 2: message.rawMacaroon = reader.bytes(); @@ -20562,7 +20562,7 @@ class RPCMiddlewareRequest$Type extends MessageType { }; break; case /* uint64 msg_id */ 7: - message.msgId = reader.uint64().toNumber(); + message.msgId = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -20577,7 +20577,7 @@ class RPCMiddlewareRequest$Type extends MessageType { } internalBinaryWrite(message: RPCMiddlewareRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 request_id = 1; */ - if (message.requestId !== 0) + if (message.requestId !== 0n) writer.tag(1, WireType.Varint).uint64(message.requestId); /* bytes raw_macaroon = 2; */ if (message.rawMacaroon.length) @@ -20598,7 +20598,7 @@ class RPCMiddlewareRequest$Type extends MessageType { if (message.interceptType.oneofKind === "regComplete") writer.tag(8, WireType.Varint).bool(message.interceptType.regComplete); /* uint64 msg_id = 7; */ - if (message.msgId !== 0) + if (message.msgId !== 0n) writer.tag(7, WireType.Varint).uint64(message.msgId); let u = options.writeUnknownFields; if (u !== false) @@ -20736,13 +20736,13 @@ export const RPCMessage = new RPCMessage$Type(); class RPCMiddlewareResponse$Type extends MessageType { constructor() { super("lnrpc.RPCMiddlewareResponse", [ - { no: 1, name: "ref_msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 0, middlewareMessage: { oneofKind: undefined } }; + const message = { refMsgId: 0n, middlewareMessage: { oneofKind: undefined } }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -20754,7 +20754,7 @@ class RPCMiddlewareResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 ref_msg_id */ 1: - message.refMsgId = reader.uint64().toNumber(); + message.refMsgId = reader.uint64().toBigInt(); break; case /* lnrpc.MiddlewareRegistration register */ 2: message.middlewareMessage = { @@ -20781,7 +20781,7 @@ class RPCMiddlewareResponse$Type extends MessageType { } internalBinaryWrite(message: RPCMiddlewareResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 ref_msg_id = 1; */ - if (message.refMsgId !== 0) + if (message.refMsgId !== 0n) writer.tag(1, WireType.Varint).uint64(message.refMsgId); /* lnrpc.MiddlewareRegistration register = 2; */ if (message.middlewareMessage.oneofKind === "register") diff --git a/proto/lnd/router.client.ts b/proto/lnd/router.client.ts index bea1ae0a..27722e38 100644 --- a/proto/lnd/router.client.ts +++ b/proto/lnd/router.client.ts @@ -1,4 +1,4 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number +// @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"; diff --git a/proto/lnd/router.ts b/proto/lnd/router.ts index e4371c17..edb624cd 100644 --- a/proto/lnd/router.ts +++ b/proto/lnd/router.ts @@ -1,4 +1,4 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number +// @generated by protobuf-ts 2.8.1 // @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) // tslint:disable import { Payment } from "./lightning.js"; @@ -38,7 +38,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 amt = 2; */ - amt: number; + amt: bigint; /** * * Number of millisatoshis to send. @@ -47,7 +47,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 amt_msat = 12; */ - amtMsat: number; + amtMsat: bigint; /** * The hash to use within the payment's HTLC * @@ -100,7 +100,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 fee_limit_sat = 7; */ - feeLimitSat: number; + feeLimitSat: bigint; /** * * The maximum number of millisatoshis that will be paid as a fee of the @@ -113,7 +113,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 fee_limit_msat = 13; */ - feeLimitMsat: number; + feeLimitMsat: bigint; /** * * Deprecated, use outgoing_chan_ids. The channel id of the channel that must @@ -131,7 +131,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: repeated uint64 outgoing_chan_ids = 19; */ - outgoingChanIds: number[]; + outgoingChanIds: bigint[]; /** * * The pubkey of the last hop of the route. If empty, any hop may be used. @@ -210,7 +210,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: uint64 max_shard_size_msat = 21; */ - maxShardSizeMsat: number; + maxShardSizeMsat: bigint; /** * * If set, an AMP-payment will be attempted. @@ -276,7 +276,7 @@ export interface RouteFeeRequest { * * @generated from protobuf field: int64 amt_sat = 2; */ - amtSat: number; + amtSat: bigint; } /** * @generated from protobuf message routerrpc.RouteFeeResponse @@ -289,7 +289,7 @@ export interface RouteFeeResponse { * * @generated from protobuf field: int64 routing_fee_msat = 1; */ - routingFeeMsat: number; + routingFeeMsat: bigint; /** * * An estimate of the worst case time delay that can occur. Note that callers @@ -298,7 +298,7 @@ export interface RouteFeeResponse { * * @generated from protobuf field: int64 time_lock_delay = 2; */ - timeLockDelay: number; + timeLockDelay: bigint; } /** * @generated from protobuf message routerrpc.SendToRouteRequest @@ -428,7 +428,7 @@ export interface PairData { * * @generated from protobuf field: int64 fail_time = 1; */ - failTime: number; + failTime: bigint; /** * * Lowest amount that failed to forward rounded to whole sats. This may be @@ -436,7 +436,7 @@ export interface PairData { * * @generated from protobuf field: int64 fail_amt_sat = 2; */ - failAmtSat: number; + failAmtSat: bigint; /** * * Lowest amount that failed to forward in millisats. This may be @@ -444,25 +444,25 @@ export interface PairData { * * @generated from protobuf field: int64 fail_amt_msat = 4; */ - failAmtMsat: number; + failAmtMsat: bigint; /** * Time of last success. * * @generated from protobuf field: int64 success_time = 5; */ - successTime: number; + successTime: bigint; /** * Highest amount that we could successfully forward rounded to whole sats. * * @generated from protobuf field: int64 success_amt_sat = 6; */ - successAmtSat: number; + successAmtSat: bigint; /** * Highest amount that we could successfully forward in millisats. * * @generated from protobuf field: int64 success_amt_msat = 7; */ - successAmtMsat: number; + successAmtMsat: bigint; } /** * @generated from protobuf message routerrpc.GetMissionControlConfigRequest @@ -513,7 +513,7 @@ export interface MissionControlConfig { * * @generated from protobuf field: uint64 half_life_seconds = 1; */ - halfLifeSeconds: number; + halfLifeSeconds: bigint; /** * * The probability of success mission control should assign to hop in a route @@ -550,7 +550,7 @@ export interface MissionControlConfig { * * @generated from protobuf field: uint64 minimum_failure_relax_interval = 5; */ - minimumFailureRelaxInterval: number; + minimumFailureRelaxInterval: bigint; } /** * @generated from protobuf message routerrpc.QueryProbabilityRequest @@ -573,7 +573,7 @@ export interface QueryProbabilityRequest { * * @generated from protobuf field: int64 amt_msat = 3; */ - amtMsat: number; + amtMsat: bigint; } /** * @generated from protobuf message routerrpc.QueryProbabilityResponse @@ -603,7 +603,7 @@ export interface BuildRouteRequest { * * @generated from protobuf field: int64 amt_msat = 1; */ - amtMsat: number; + amtMsat: bigint; /** * * CLTV delta from the current height that should be used for the timelock @@ -671,7 +671,7 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 incoming_channel_id = 1; */ - incomingChannelId: number; + incomingChannelId: bigint; /** * * The short channel id that the outgoing htlc left our node on. This value @@ -679,7 +679,7 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 outgoing_channel_id = 2; */ - outgoingChannelId: number; + outgoingChannelId: bigint; /** * * Incoming id is the index of the incoming htlc in the incoming channel. @@ -687,7 +687,7 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 incoming_htlc_id = 3; */ - incomingHtlcId: number; + incomingHtlcId: bigint; /** * * Outgoing id is the index of the outgoing htlc in the outgoing channel. @@ -695,14 +695,14 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 outgoing_htlc_id = 4; */ - outgoingHtlcId: number; + outgoingHtlcId: bigint; /** * * The time in unix nanoseconds that the event occurred. * * @generated from protobuf field: uint64 timestamp_ns = 5; */ - timestampNs: number; + timestampNs: bigint; /** * * The event type indicates whether the htlc was part of a send, receive or @@ -796,13 +796,13 @@ export interface HtlcInfo { * * @generated from protobuf field: uint64 incoming_amt_msat = 3; */ - incomingAmtMsat: number; + incomingAmtMsat: bigint; /** * The amount of the outgoing htlc. * * @generated from protobuf field: uint64 outgoing_amt_msat = 4; */ - outgoingAmtMsat: number; + outgoingAmtMsat: bigint; } /** * @generated from protobuf message routerrpc.ForwardEvent @@ -915,13 +915,13 @@ export interface CircuitKey { * * @generated from protobuf field: uint64 chan_id = 1; */ - chanId: number; + chanId: bigint; /** * / The index of the incoming htlc in the incoming channel. * * @generated from protobuf field: uint64 htlc_id = 2; */ - htlcId: number; + htlcId: bigint; } /** * @generated from protobuf message routerrpc.ForwardHtlcInterceptRequest @@ -940,7 +940,7 @@ export interface ForwardHtlcInterceptRequest { * * @generated from protobuf field: uint64 incoming_amount_msat = 5; */ - incomingAmountMsat: number; + incomingAmountMsat: bigint; /** * The incoming htlc expiry. * @@ -963,13 +963,13 @@ export interface ForwardHtlcInterceptRequest { * * @generated from protobuf field: uint64 outgoing_requested_chan_id = 7; */ - outgoingRequestedChanId: number; + outgoingRequestedChanId: bigint; /** * The outgoing htlc amount. * * @generated from protobuf field: uint64 outgoing_amount_msat = 3; */ - outgoingAmountMsat: number; + outgoingAmountMsat: bigint; /** * The outgoing htlc expiry. * @@ -1261,17 +1261,17 @@ 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: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, + { 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 }, @@ -1280,13 +1280,13 @@ class SendPaymentRequest$Type extends MessageType { { 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: 2 /*LongType.NUMBER*/ }, + { 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: 0, amtMsat: 0, paymentHash: new Uint8Array(0), finalCltvDelta: 0, paymentAddr: new Uint8Array(0), paymentRequest: "", timeoutSeconds: 0, feeLimitSat: 0, feeLimitMsat: 0, outgoingChanId: "0", outgoingChanIds: [], lastHopPubkey: new Uint8Array(0), cltvLimit: 0, routeHints: [], destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], maxParts: 0, noInflightUpdates: false, maxShardSizeMsat: 0, amp: false, timePref: 0 }; + 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); @@ -1301,10 +1301,10 @@ class SendPaymentRequest$Type extends MessageType { message.dest = reader.bytes(); break; case /* int64 amt */ 2: - message.amt = reader.int64().toNumber(); + message.amt = reader.int64().toBigInt(); break; case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toNumber(); + message.amtMsat = reader.int64().toBigInt(); break; case /* bytes payment_hash */ 3: message.paymentHash = reader.bytes(); @@ -1322,10 +1322,10 @@ class SendPaymentRequest$Type extends MessageType { message.timeoutSeconds = reader.int32(); break; case /* int64 fee_limit_sat */ 7: - message.feeLimitSat = reader.int64().toNumber(); + message.feeLimitSat = reader.int64().toBigInt(); break; case /* int64 fee_limit_msat */ 13: - message.feeLimitMsat = reader.int64().toNumber(); + message.feeLimitMsat = reader.int64().toBigInt(); break; case /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING];*/ 8: message.outgoingChanId = reader.uint64().toString(); @@ -1333,9 +1333,9 @@ class SendPaymentRequest$Type extends MessageType { 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().toNumber()); + message.outgoingChanIds.push(reader.uint64().toBigInt()); else - message.outgoingChanIds.push(reader.uint64().toNumber()); + message.outgoingChanIds.push(reader.uint64().toBigInt()); break; case /* bytes last_hop_pubkey */ 14: message.lastHopPubkey = reader.bytes(); @@ -1366,7 +1366,7 @@ class SendPaymentRequest$Type extends MessageType { message.noInflightUpdates = reader.bool(); break; case /* uint64 max_shard_size_msat */ 21: - message.maxShardSizeMsat = reader.uint64().toNumber(); + message.maxShardSizeMsat = reader.uint64().toBigInt(); break; case /* bool amp */ 22: message.amp = reader.bool(); @@ -1406,10 +1406,10 @@ class SendPaymentRequest$Type extends MessageType { if (message.dest.length) writer.tag(1, WireType.LengthDelimited).bytes(message.dest); /* int64 amt = 2; */ - if (message.amt !== 0) + if (message.amt !== 0n) writer.tag(2, WireType.Varint).int64(message.amt); /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0) + if (message.amtMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.amtMsat); /* bytes payment_hash = 3; */ if (message.paymentHash.length) @@ -1427,10 +1427,10 @@ class SendPaymentRequest$Type extends MessageType { if (message.timeoutSeconds !== 0) writer.tag(6, WireType.Varint).int32(message.timeoutSeconds); /* int64 fee_limit_sat = 7; */ - if (message.feeLimitSat !== 0) + if (message.feeLimitSat !== 0n) writer.tag(7, WireType.Varint).int64(message.feeLimitSat); /* int64 fee_limit_msat = 13; */ - if (message.feeLimitMsat !== 0) + 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") @@ -1471,7 +1471,7 @@ class SendPaymentRequest$Type extends MessageType { if (message.noInflightUpdates !== false) writer.tag(18, WireType.Varint).bool(message.noInflightUpdates); /* uint64 max_shard_size_msat = 21; */ - if (message.maxShardSizeMsat !== 0) + if (message.maxShardSizeMsat !== 0n) writer.tag(21, WireType.Varint).uint64(message.maxShardSizeMsat); /* bool amp = 22; */ if (message.amp !== false) @@ -1595,11 +1595,11 @@ 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: 2 /*LongType.NUMBER*/ } + { 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: 0 }; + 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); @@ -1614,7 +1614,7 @@ class RouteFeeRequest$Type extends MessageType { message.dest = reader.bytes(); break; case /* int64 amt_sat */ 2: - message.amtSat = reader.int64().toNumber(); + message.amtSat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -1632,7 +1632,7 @@ class RouteFeeRequest$Type extends MessageType { if (message.dest.length) writer.tag(1, WireType.LengthDelimited).bytes(message.dest); /* int64 amt_sat = 2; */ - if (message.amtSat !== 0) + if (message.amtSat !== 0n) writer.tag(2, WireType.Varint).int64(message.amtSat); let u = options.writeUnknownFields; if (u !== false) @@ -1648,12 +1648,12 @@ export const RouteFeeRequest = new RouteFeeRequest$Type(); class RouteFeeResponse$Type extends MessageType { constructor() { super("routerrpc.RouteFeeResponse", [ - { no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, timeLockDelay: 0 }; + const message = { routingFeeMsat: 0n, timeLockDelay: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -1665,10 +1665,10 @@ class RouteFeeResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 routing_fee_msat */ 1: - message.routingFeeMsat = reader.int64().toNumber(); + message.routingFeeMsat = reader.int64().toBigInt(); break; case /* int64 time_lock_delay */ 2: - message.timeLockDelay = reader.int64().toNumber(); + message.timeLockDelay = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -1683,10 +1683,10 @@ class RouteFeeResponse$Type extends MessageType { } internalBinaryWrite(message: RouteFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 routing_fee_msat = 1; */ - if (message.routingFeeMsat !== 0) + if (message.routingFeeMsat !== 0n) writer.tag(1, WireType.Varint).int64(message.routingFeeMsat); /* int64 time_lock_delay = 2; */ - if (message.timeLockDelay !== 0) + if (message.timeLockDelay !== 0n) writer.tag(2, WireType.Varint).int64(message.timeLockDelay); let u = options.writeUnknownFields; if (u !== false) @@ -2083,16 +2083,16 @@ export const PairHistory = new PairHistory$Type(); class PairData$Type extends MessageType { constructor() { super("routerrpc.PairData", [ - { no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, failAmtSat: 0, failAmtMsat: 0, successTime: 0, successAmtSat: 0, successAmtMsat: 0 }; + 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); @@ -2104,22 +2104,22 @@ class PairData$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 fail_time */ 1: - message.failTime = reader.int64().toNumber(); + message.failTime = reader.int64().toBigInt(); break; case /* int64 fail_amt_sat */ 2: - message.failAmtSat = reader.int64().toNumber(); + message.failAmtSat = reader.int64().toBigInt(); break; case /* int64 fail_amt_msat */ 4: - message.failAmtMsat = reader.int64().toNumber(); + message.failAmtMsat = reader.int64().toBigInt(); break; case /* int64 success_time */ 5: - message.successTime = reader.int64().toNumber(); + message.successTime = reader.int64().toBigInt(); break; case /* int64 success_amt_sat */ 6: - message.successAmtSat = reader.int64().toNumber(); + message.successAmtSat = reader.int64().toBigInt(); break; case /* int64 success_amt_msat */ 7: - message.successAmtMsat = reader.int64().toNumber(); + message.successAmtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2134,22 +2134,22 @@ class PairData$Type extends MessageType { } internalBinaryWrite(message: PairData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 fail_time = 1; */ - if (message.failTime !== 0) + if (message.failTime !== 0n) writer.tag(1, WireType.Varint).int64(message.failTime); /* int64 fail_amt_sat = 2; */ - if (message.failAmtSat !== 0) + if (message.failAmtSat !== 0n) writer.tag(2, WireType.Varint).int64(message.failAmtSat); /* int64 fail_amt_msat = 4; */ - if (message.failAmtMsat !== 0) + if (message.failAmtMsat !== 0n) writer.tag(4, WireType.Varint).int64(message.failAmtMsat); /* int64 success_time = 5; */ - if (message.successTime !== 0) + if (message.successTime !== 0n) writer.tag(5, WireType.Varint).int64(message.successTime); /* int64 success_amt_sat = 6; */ - if (message.successAmtSat !== 0) + if (message.successAmtSat !== 0n) writer.tag(6, WireType.Varint).int64(message.successAmtSat); /* int64 success_amt_msat = 7; */ - if (message.successAmtMsat !== 0) + if (message.successAmtMsat !== 0n) writer.tag(7, WireType.Varint).int64(message.successAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -2311,15 +2311,15 @@ export const SetMissionControlConfigResponse = new SetMissionControlConfigRespon class MissionControlConfig$Type extends MessageType { constructor() { super("routerrpc.MissionControlConfig", [ - { no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ } + { no: 5, name: "minimum_failure_relax_interval", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): MissionControlConfig { - const message = { halfLifeSeconds: 0, hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: 0 }; + 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); @@ -2331,7 +2331,7 @@ class MissionControlConfig$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 half_life_seconds */ 1: - message.halfLifeSeconds = reader.uint64().toNumber(); + message.halfLifeSeconds = reader.uint64().toBigInt(); break; case /* float hop_probability */ 2: message.hopProbability = reader.float(); @@ -2343,7 +2343,7 @@ class MissionControlConfig$Type extends MessageType { message.maximumPaymentResults = reader.uint32(); break; case /* uint64 minimum_failure_relax_interval */ 5: - message.minimumFailureRelaxInterval = reader.uint64().toNumber(); + message.minimumFailureRelaxInterval = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2358,7 +2358,7 @@ class MissionControlConfig$Type extends MessageType { } internalBinaryWrite(message: MissionControlConfig, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 half_life_seconds = 1; */ - if (message.halfLifeSeconds !== 0) + if (message.halfLifeSeconds !== 0n) writer.tag(1, WireType.Varint).uint64(message.halfLifeSeconds); /* float hop_probability = 2; */ if (message.hopProbability !== 0) @@ -2370,7 +2370,7 @@ class MissionControlConfig$Type extends MessageType { if (message.maximumPaymentResults !== 0) writer.tag(4, WireType.Varint).uint32(message.maximumPaymentResults); /* uint64 minimum_failure_relax_interval = 5; */ - if (message.minimumFailureRelaxInterval !== 0) + if (message.minimumFailureRelaxInterval !== 0n) writer.tag(5, WireType.Varint).uint64(message.minimumFailureRelaxInterval); let u = options.writeUnknownFields; if (u !== false) @@ -2388,11 +2388,11 @@ class QueryProbabilityRequest$Type extends MessageType 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: 2 /*LongType.NUMBER*/ } + { 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: 0 }; + 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); @@ -2410,7 +2410,7 @@ class QueryProbabilityRequest$Type extends MessageType message.toNode = reader.bytes(); break; case /* int64 amt_msat */ 3: - message.amtMsat = reader.int64().toNumber(); + message.amtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2431,7 +2431,7 @@ class QueryProbabilityRequest$Type extends MessageType if (message.toNode.length) writer.tag(2, WireType.LengthDelimited).bytes(message.toNode); /* int64 amt_msat = 3; */ - if (message.amtMsat !== 0) + if (message.amtMsat !== 0n) writer.tag(3, WireType.Varint).int64(message.amtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -2501,7 +2501,7 @@ export const QueryProbabilityResponse = new QueryProbabilityResponse$Type(); class BuildRouteRequest$Type extends MessageType { constructor() { super("routerrpc.BuildRouteRequest", [ - { no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -2509,7 +2509,7 @@ class BuildRouteRequest$Type extends MessageType { ]); } create(value?: PartialMessage): BuildRouteRequest { - const message = { amtMsat: 0, finalCltvDelta: 0, outgoingChanId: "0", hopPubkeys: [], paymentAddr: new Uint8Array(0) }; + 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); @@ -2521,7 +2521,7 @@ class BuildRouteRequest$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 amt_msat */ 1: - message.amtMsat = reader.int64().toNumber(); + message.amtMsat = reader.int64().toBigInt(); break; case /* int32 final_cltv_delta */ 2: message.finalCltvDelta = reader.int32(); @@ -2548,7 +2548,7 @@ class BuildRouteRequest$Type extends MessageType { } internalBinaryWrite(message: BuildRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 amt_msat = 1; */ - if (message.amtMsat !== 0) + if (message.amtMsat !== 0n) writer.tag(1, WireType.Varint).int64(message.amtMsat); /* int32 final_cltv_delta = 2; */ if (message.finalCltvDelta !== 0) @@ -2649,11 +2649,11 @@ export const SubscribeHtlcEventsRequest = new SubscribeHtlcEventsRequest$Type(); class HtlcEvent$Type extends MessageType { constructor() { super("routerrpc.HtlcEvent", [ - { no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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 }, @@ -2664,7 +2664,7 @@ class HtlcEvent$Type extends MessageType { ]); } create(value?: PartialMessage): HtlcEvent { - const message = { incomingChannelId: 0, outgoingChannelId: 0, incomingHtlcId: 0, outgoingHtlcId: 0, timestampNs: 0, eventType: 0, event: { oneofKind: undefined } }; + 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); @@ -2676,19 +2676,19 @@ class HtlcEvent$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 incoming_channel_id */ 1: - message.incomingChannelId = reader.uint64().toNumber(); + message.incomingChannelId = reader.uint64().toBigInt(); break; case /* uint64 outgoing_channel_id */ 2: - message.outgoingChannelId = reader.uint64().toNumber(); + message.outgoingChannelId = reader.uint64().toBigInt(); break; case /* uint64 incoming_htlc_id */ 3: - message.incomingHtlcId = reader.uint64().toNumber(); + message.incomingHtlcId = reader.uint64().toBigInt(); break; case /* uint64 outgoing_htlc_id */ 4: - message.outgoingHtlcId = reader.uint64().toNumber(); + message.outgoingHtlcId = reader.uint64().toBigInt(); break; case /* uint64 timestamp_ns */ 5: - message.timestampNs = reader.uint64().toNumber(); + message.timestampNs = reader.uint64().toBigInt(); break; case /* routerrpc.HtlcEvent.EventType event_type */ 6: message.eventType = reader.int32(); @@ -2742,19 +2742,19 @@ class HtlcEvent$Type extends MessageType { } internalBinaryWrite(message: HtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 incoming_channel_id = 1; */ - if (message.incomingChannelId !== 0) + if (message.incomingChannelId !== 0n) writer.tag(1, WireType.Varint).uint64(message.incomingChannelId); /* uint64 outgoing_channel_id = 2; */ - if (message.outgoingChannelId !== 0) + if (message.outgoingChannelId !== 0n) writer.tag(2, WireType.Varint).uint64(message.outgoingChannelId); /* uint64 incoming_htlc_id = 3; */ - if (message.incomingHtlcId !== 0) + if (message.incomingHtlcId !== 0n) writer.tag(3, WireType.Varint).uint64(message.incomingHtlcId); /* uint64 outgoing_htlc_id = 4; */ - if (message.outgoingHtlcId !== 0) + if (message.outgoingHtlcId !== 0n) writer.tag(4, WireType.Varint).uint64(message.outgoingHtlcId); /* uint64 timestamp_ns = 5; */ - if (message.timestampNs !== 0) + if (message.timestampNs !== 0n) writer.tag(5, WireType.Varint).uint64(message.timestampNs); /* routerrpc.HtlcEvent.EventType event_type = 6; */ if (message.eventType !== 0) @@ -2793,12 +2793,12 @@ class HtlcInfo$Type extends MessageType { 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: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, outgoingAmtMsat: 0 }; + 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); @@ -2816,10 +2816,10 @@ class HtlcInfo$Type extends MessageType { message.outgoingTimelock = reader.uint32(); break; case /* uint64 incoming_amt_msat */ 3: - message.incomingAmtMsat = reader.uint64().toNumber(); + message.incomingAmtMsat = reader.uint64().toBigInt(); break; case /* uint64 outgoing_amt_msat */ 4: - message.outgoingAmtMsat = reader.uint64().toNumber(); + message.outgoingAmtMsat = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2840,10 +2840,10 @@ class HtlcInfo$Type extends MessageType { if (message.outgoingTimelock !== 0) writer.tag(2, WireType.Varint).uint32(message.outgoingTimelock); /* uint64 incoming_amt_msat = 3; */ - if (message.incomingAmtMsat !== 0) + if (message.incomingAmtMsat !== 0n) writer.tag(3, WireType.Varint).uint64(message.incomingAmtMsat); /* uint64 outgoing_amt_msat = 4; */ - if (message.outgoingAmtMsat !== 0) + if (message.outgoingAmtMsat !== 0n) writer.tag(4, WireType.Varint).uint64(message.outgoingAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -3188,12 +3188,12 @@ export const PaymentStatus = new PaymentStatus$Type(); class CircuitKey$Type extends MessageType { constructor() { super("routerrpc.CircuitKey", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } + { 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: 0, htlcId: 0 }; + const message = { chanId: 0n, htlcId: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -3205,10 +3205,10 @@ class CircuitKey$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 chan_id */ 1: - message.chanId = reader.uint64().toNumber(); + message.chanId = reader.uint64().toBigInt(); break; case /* uint64 htlc_id */ 2: - message.htlcId = reader.uint64().toNumber(); + message.htlcId = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -3223,10 +3223,10 @@ class CircuitKey$Type extends MessageType { } internalBinaryWrite(message: CircuitKey, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 chan_id = 1; */ - if (message.chanId !== 0) + if (message.chanId !== 0n) writer.tag(1, WireType.Varint).uint64(message.chanId); /* uint64 htlc_id = 2; */ - if (message.htlcId !== 0) + if (message.htlcId !== 0n) writer.tag(2, WireType.Varint).uint64(message.htlcId); let u = options.writeUnknownFields; if (u !== false) @@ -3243,11 +3243,11 @@ class ForwardHtlcInterceptRequest$Type extends MessageType CircuitKey }, - { no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, + { 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*/ }, @@ -3255,7 +3255,7 @@ class ForwardHtlcInterceptRequest$Type extends MessageType): ForwardHtlcInterceptRequest { - const message = { incomingAmountMsat: 0, incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: 0, outgoingAmountMsat: 0, outgoingExpiry: 0, customRecords: {}, onionBlob: new Uint8Array(0), autoFailHeight: 0 }; + 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); @@ -3270,7 +3270,7 @@ class ForwardHtlcInterceptRequest$Type extends MessageType { GuestAuthGuard: async (_) => ({}), encryptCallback: async (_, b) => b, decryptCallback: async (_, b) => b, + throwErrors: true } } export default serverOptions \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index f3ad4792..b34f8e30 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,19 +1,19 @@ import 'dotenv/config' -import NewServer from '../proto/autogenerated/ts/express_server' -import GetServerMethods from './services/serverMethods' -import serverOptions from './auth'; -import Main, { LoadMainSettingsFromEnv } from './services/main' -import { LoadNosrtSettingsFromEnv } from './services/nostr' +import NewServer from '../proto/autogenerated/ts/express_server.js' +import GetServerMethods from './services/serverMethods/index.js' +import serverOptions from './auth.js'; +import Main, { LoadMainSettingsFromEnv } from './services/main/index.js' +import { LoadNosrtSettingsFromEnv } from './services/nostr/index.js' import nostrMiddleware from './nostrMiddleware.js' const start = async () => { const mainHandler = new Main(LoadMainSettingsFromEnv()) await mainHandler.storage.Connect() - + await mainHandler.lnd.Warmup() const serverMethods = GetServerMethods(mainHandler) const nostrSettings = LoadNosrtSettingsFromEnv() nostrMiddleware(serverMethods, mainHandler, nostrSettings) const Server = NewServer(serverMethods, serverOptions(mainHandler)) - Server.Listen(3000) + Server.Listen(8080) } start() diff --git a/src/nostrMiddleware.ts b/src/nostrMiddleware.ts index da60f07b..615bdfa9 100644 --- a/src/nostrMiddleware.ts +++ b/src/nostrMiddleware.ts @@ -9,7 +9,7 @@ export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSett const nostrTransport = NewNostrTransport(serverMethods, { NostrUserAuthGuard: async pub => { if (!pub || !nostrSettings.allowedPubs.includes(pub)) { - throw new Error("nostr pub invalid or not allowed") + throw new Error("nostr pub invalid or not allowed" + pub) } let nostrUser = await mainHandler.storage.FindNostrUser(pub) if (!nostrUser) { // TODO: add POW @@ -19,6 +19,7 @@ export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSett } }) const nostr = new Nostr(nostrSettings, event => { + console.log(event) let j: NostrRequest try { j = JSON.parse(event.content) diff --git a/src/services/lnd/addInvoiceReq.ts b/src/services/lnd/addInvoiceReq.ts index fd0a21bb..f981598b 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, memo = "", privateHints = false, expiry = 60 * 60): Invoice => ({ - expiry: expiry, + expiry: BigInt(expiry), memo: memo, private: privateHints, - value: value, + value: BigInt(value), fallbackAddr: "", - cltvExpiry: 0, + cltvExpiry: 0n, descriptionHash: Buffer.alloc(0), features: {}, isAmp: false, rPreimage: Buffer.alloc(0), routeHints: [], - valueMsat: 0, + valueMsat: 0n, - addIndex: 0, + addIndex: 0n, ampInvoiceState: {}, - amtPaidMsat: 0, - amtPaidSat: 0, - creationDate: 0, + amtPaidMsat: 0n, + amtPaidSat: 0n, + creationDate: 0n, htlcs: [], isKeysend: false, paymentAddr: Buffer.alloc(0), paymentRequest: "", rHash: Buffer.alloc(0), - settleDate: 0, - settleIndex: 0, + settleDate: 0n, + settleIndex: 0n, state: 0, - amtPaid: 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 d2299bd2..574c7e4a 100644 --- a/src/services/lnd/index.ts +++ b/src/services/lnd/index.ts @@ -6,7 +6,7 @@ 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 { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment } from '../../../proto/lnd/lightning.js' +import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment, PaymentFailureReason } from '../../../proto/lnd/lightning.js' import { OpenChannelReq } from './openChannelReq.js'; import { AddInvoiceReq } from './addInvoiceReq.js'; import { PayInvoiceReq } from './payInvoiceReq.js'; @@ -69,6 +69,7 @@ export default class { this.invoices = new InvoicesClient(transport) this.router = new RouterClient(transport) this.SubscribeAddressPaid() + this.SubscribeInvoicePaid() } Stop() { this.abortController.abort() @@ -107,8 +108,8 @@ export default class { SubscribeInvoicePaid() { const stream = this.lightning.subscribeInvoices({ - settleIndex: this.latestKnownSettleIndex, - addIndex: 0, + settleIndex: BigInt(this.latestKnownSettleIndex), + addIndex: 0n, }, { abort: this.abortController.signal }) stream.responses.onMessage(invoice => { if (invoice.state === Invoice_InvoiceState.SETTLED) { @@ -162,15 +163,18 @@ export default class { async PayInvoice(invoice: string, amount: number, feeLimit: number): Promise { this.checkReady() const abortController = new AbortController() - const stream = this.router.sendPaymentV2(PayInvoiceReq(invoice, amount, feeLimit), { abort: abortController.signal }) + const req = PayInvoiceReq(invoice, amount, feeLimit) + console.log(req) + const stream = this.router.sendPaymentV2(req, { abort: abortController.signal }) return new Promise((res, rej) => { stream.responses.onError(error => { rej(error) }) stream.responses.onMessage(payment => { + console.log(payment) switch (payment.status) { case Payment_PaymentStatus.FAILED: - rej(payment.failureReason) + rej(PaymentFailureReason[payment.failureReason]) return case Payment_PaymentStatus.SUCCEEDED: res(payment) @@ -182,7 +186,7 @@ export default class { async EstimateChainFees(address: string, amount: number, targetConf: number) { this.checkReady() const res = await this.lightning.estimateFee({ - addrToAmount: { [address]: amount }, + addrToAmount: { [address]: BigInt(amount) }, minConfs: 1, spendUnconfirmed: false, targetConf: targetConf diff --git a/src/services/lnd/openChannelReq.ts b/src/services/lnd/openChannelReq.ts index 0bcdbc11..ed04d202 100644 --- a/src/services/lnd/openChannelReq.ts +++ b/src/services/lnd/openChannelReq.ts @@ -3,23 +3,23 @@ import { OpenChannelRequest } from "../../../proto/lnd/lightning"; export const OpenChannelReq = (destination: string, closeAddress: string, fundingAmount: number, pushSats: number): OpenChannelRequest => ({ nodePubkey: Buffer.from(destination, 'hex'), closeAddress: closeAddress, - localFundingAmount: fundingAmount, - pushSat: pushSats, + localFundingAmount: BigInt(fundingAmount), + pushSat: BigInt(pushSats), - satPerVbyte: 0, // TBD + satPerVbyte: 0n, // TBD private: false, minConfs: 0, // TBD - baseFee: 0, // TBD - feeRate: 0, // TBD + baseFee: 0n, // TBD + feeRate: 0n, // TBD targetConf: 0, zeroConf: false, maxLocalCsv: 0, remoteCsvDelay: 0, spendUnconfirmed: false, - minHtlcMsat: 0, - remoteChanReserveSat: 0, + minHtlcMsat: 0n, + remoteChanReserveSat: 0n, remoteMaxHtlcs: 0, - remoteMaxValueInFlightMsat: 0, + remoteMaxValueInFlightMsat: 0n, useBaseFee: false, useFeeRate: false, @@ -27,7 +27,7 @@ export const OpenChannelReq = (destination: string, closeAddress: string, fundin commitmentType: 0, scidAlias: false, nodePubkeyString: "", - satPerByte: 0, + 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 138ee5f7..dd45dad1 100644 --- a/src/services/lnd/payInvoiceReq.ts +++ b/src/services/lnd/payInvoiceReq.ts @@ -2,8 +2,8 @@ import { OpenChannelRequest } from "../../../proto/lnd/lightning"; import { SendPaymentRequest } from "../../../proto/lnd/router"; export const PayInvoiceReq = (invoice: string, amount: number, feeLimit: number): SendPaymentRequest => ({ - amt: amount, - feeLimitSat: feeLimit, + amt: BigInt(amount), + feeLimitSat: BigInt(feeLimit), noInflightUpdates: true, paymentRequest: invoice, maxParts: 3, @@ -11,20 +11,20 @@ export const PayInvoiceReq = (invoice: string, amount: number, feeLimit: number) allowSelfPayment: false, amp: false, - amtMsat: 0, + amtMsat: 0n, cltvLimit: 0, dest: Buffer.alloc(0), destCustomRecords: {}, destFeatures: [], - feeLimitMsat: 0, + feeLimitMsat: 0n, finalCltvDelta: 0, lastHopPubkey: Buffer.alloc(0), - maxShardSizeMsat: 0, + maxShardSizeMsat: 0n, outgoingChanIds: [], paymentAddr: Buffer.alloc(0), paymentHash: Buffer.alloc(0), routeHints: [], timePref: 0, - outgoingChanId: "" + outgoingChanId: '0' }) \ No newline at end of file diff --git a/src/services/lnd/sendCoinsReq.ts b/src/services/lnd/sendCoinsReq.ts index 942196e8..93aacd24 100644 --- a/src/services/lnd/sendCoinsReq.ts +++ b/src/services/lnd/sendCoinsReq.ts @@ -2,12 +2,12 @@ import { SendCoinsRequest } from "../../../proto/lnd/lightning"; export const SendCoinsReq = (address: string, amount: number, satPerVByte: number, label = ""): SendCoinsRequest => ({ addr: address, - amount: amount, + amount: BigInt(amount), label: label, - satPerVbyte: satPerVByte, + satPerVbyte: BigInt(satPerVByte), targetConf: 0, minConfs: 1, sendAll: false, spendUnconfirmed: false, - satPerByte: 0 + satPerByte: BigInt(0) }) \ No newline at end of file diff --git a/src/services/main/index.ts b/src/services/main/index.ts index 7c9fc7c3..7b2f5ee7 100644 --- a/src/services/main/index.ts +++ b/src/services/main/index.ts @@ -4,6 +4,8 @@ import Storage, { LoadStorageSettingsFromEnv, StorageSettings } from '../storage import * as Types from '../../../proto/autogenerated/ts/types.js' import LND, { AddressPaidCb, InvoicePaidCb, LndSettings, LoadLndSettingsFromEnv } from '../lnd/index.js' import { EnvMustBeInteger, EnvMustBeNonEmptyString } from '../helpers/envParser.js' +import { UserReceivingInvoice } from '../storage/entity/UserReceivingInvoice.js' +import { Type } from 'typescript' export type MainSettings = { storageSettings: StorageSettings, lndSettings: LndSettings, @@ -26,32 +28,39 @@ export const LoadMainSettingsFromEnv = (test = false): MainSettings => { serviceUrl: EnvMustBeNonEmptyString("SERVICE_URL") } } -enum ActionType { - INCOMING_TX = "INCOMING_TX", - OUTGOING_TX = "OUTGOING_TX", - INCOMING_INVOICE = "INCOMING_INVOICE", - OUTGOING_INVOICE = "OUTGOING_INVOICE" +type UserOperationsSub = { + id: string + newIncomingInvoice: (operation: Types.UserOperation) => void + newOutgoingInvoice: (operation: Types.UserOperation) => void + newIncomingTx: (operation: Types.UserOperation) => void + newOutgoingTx: (operation: Types.UserOperation) => void +} +interface UserOperationInfo { + serial_id: number + paid_amount: number + paid_at_unix: number } const defaultLnurlPayMetadata = '[["text/plain", "lnurl pay to Lightning.pub"]]' export default class { storage: Storage lnd: LND settings: MainSettings + userOperationsSub: UserOperationsSub | null = null constructor(settings: MainSettings) { this.settings = settings this.storage = new Storage(settings.storageSettings) this.lnd = new LND(settings.lndSettings, this.addressPaidCb, this.invoicePaidCb) } - getServiceFee(action: ActionType, amount: number): number { + getServiceFee(action: Types.UserOperationType, amount: number): number { switch (action) { - case ActionType.INCOMING_TX: + case Types.UserOperationType.INCOMING_TX: return Math.ceil(this.settings.incomingTxFee * amount) - case ActionType.OUTGOING_TX: + case Types.UserOperationType.OUTGOING_TX: return Math.ceil(this.settings.outgoingTxFee * amount) - case ActionType.INCOMING_INVOICE: + case Types.UserOperationType.INCOMING_INVOICE: return Math.ceil(this.settings.incomingInvoiceFee * amount) - case ActionType.OUTGOING_INVOICE: + case Types.UserOperationType.OUTGOING_INVOICE: return Math.ceil(this.settings.outgoingInvoiceFee * amount) default: throw new Error("Unknown service action type") @@ -61,21 +70,22 @@ export default class { this.storage.StartTransaction(async tx => { const userAddress = await this.storage.GetAddressOwner(address, tx) if (!userAddress) { return } - const fee = this.getServiceFee(ActionType.INCOMING_TX, amount) + const fee = this.getServiceFee(Types.UserOperationType.INCOMING_TX, amount) try { // This call will fail if the transaction is already registered const addedTx = await this.storage.AddAddressReceivingTransaction(userAddress, txOutput.hash, txOutput.index, amount, fee, tx) - await this.storage.IncrementUserBalance(userAddress.user.user_id, addedTx.amount, tx) + await this.storage.IncrementUserBalance(userAddress.user.user_id, addedTx.paid_amount, tx) } catch { } }) } invoicePaidCb: InvoicePaidCb = (paymentRequest, amount) => { + this.storage.StartTransaction(async tx => { const userInvoice = await this.storage.GetInvoiceOwner(paymentRequest, tx) - if (!userInvoice || userInvoice.paid) { return } - const fee = this.getServiceFee(ActionType.INCOMING_INVOICE, amount) + if (!userInvoice || userInvoice.paid_at_unix > 0) { return } + const fee = this.getServiceFee(Types.UserOperationType.INCOMING_INVOICE, amount) try { // This call will fail if the invoice is already registered await this.storage.FlagInvoiceAsPaid(userInvoice, amount, fee, tx) @@ -134,14 +144,14 @@ export default class { async PayInvoice(userId: string, req: Types.PayInvoiceRequest): Promise { const decoded = await this.lnd.DecodeInvoice(req.invoice) - if (decoded.numSatoshis !== 0 && req.amount !== 0) { + if (decoded.numSatoshis !== 0n && req.amount !== 0) { throw new Error("invoice has value, do not provide amount the the request") } - if (decoded.numSatoshis === 0 && req.amount === 0) { + if (decoded.numSatoshis === 0n && 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 serviceFee = this.getServiceFee(ActionType.OUTGOING_INVOICE, payAmount) + const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_INVOICE, payAmount) const totalAmountToDecrement = payAmount + serviceFee @@ -161,7 +171,7 @@ export default class { const satPerVByte = Number(estimate.satPerVbyte) const chainFees = Number(estimate.feeSat) const total = req.amoutSats + chainFees - const serviceFee = this.getServiceFee(ActionType.OUTGOING_INVOICE, req.amoutSats) + const serviceFee = this.getServiceFee(Types.UserOperationType.OUTGOING_INVOICE, req.amoutSats) await this.lockUserWithMinBalance(userId, total + serviceFee) const payment = await this.lnd.PayAddress(req.address, req.amoutSats, satPerVByte) await this.storage.DecrementUserBalance(userId, total + serviceFee) @@ -243,6 +253,50 @@ export default class { 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 => ({ + inbound, + type, + amount: o.paid_amount, + paidAtUnix: o.paid_at_unix + })) + } + } + + async GetUserInfo(userId: string): Promise { + const user = await this.storage.GetUser(userId) + return { + userId: userId, + balance: user.balance_sats + } + } + + async GetUserOperations(userId: string, req: Types.GetUserOperationsRequest): Promise { + const [outgoingInvoices, outgoingTransactions, incomingInvoices, incomingTransactions] = await Promise.all([ + this.storage.GetUserInvoicePayments(userId, req.latestOutgoingInvoice), + this.storage.GetUserTransactionPayments(userId, req.latestOutgoingTx), + this.storage.GetUserInvoicesFlaggedAsPaid(userId, req.latestIncomingInvoice), + this.storage.GetUserReceivingTransactions(userId, req.latestIncomingTx) + ]) + 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) + } + } + 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") @@ -250,5 +304,4 @@ export default class { let words = bech32.toWords(Buffer.from(base, 'utf8')); return bech32.encode('lnurl', words, 1023); } - } \ No newline at end of file diff --git a/src/services/nostr/handler.ts b/src/services/nostr/handler.ts index 2cbcf249..5031c867 100644 --- a/src/services/nostr/handler.ts +++ b/src/services/nostr/handler.ts @@ -119,7 +119,7 @@ export default class Handler { //@ts-ignore tags: [['p', nostrPub]] }, (status, url) => { - console.log(status, url) // TODO + console.log("sent message to", nostrPub) // TODO }) } } \ No newline at end of file diff --git a/src/services/serverMethods/index.ts b/src/services/serverMethods/index.ts index cb80efbf..d59ec83b 100644 --- a/src/services/serverMethods/index.ts +++ b/src/services/serverMethods/index.ts @@ -20,6 +20,12 @@ export default (mainHandler: Main): Types.ServerMethods => { AuthUser: async (ctx, req) => { throw new Error("unimplemented") }, + GetUserInfo: async (ctx) => { + return mainHandler.GetUserInfo(ctx.user_id) + }, + GetUserOperations: async (ctx, req) => { + return mainHandler.GetUserOperations(ctx.user_id, req) + }, OpenChannel: async (ctx, req) => { const err = Types.OpenChannelRequestValidate(req, { fundingAmount_CustomCheck: amt => amt > 0, @@ -42,10 +48,14 @@ export default (mainHandler: Main): Types.ServerMethods => { return mainHandler.PayAddress(ctx.user_id, req) }, NewInvoice: async (ctx, req) => { - throw new Error("unimplemented") + return mainHandler.NewInvoice(ctx.user_id, req) }, PayInvoice: async (ctx, req) => { - throw new Error("unimplemented") + const err = Types.PayInvoiceRequestValidate(req, { + invoice_CustomCheck: invoice => invoice !== '' + }) + if (err != null) throw new Error(err.message) + return mainHandler.PayInvoice(ctx.user_id, req) }, GetLnurlWithdrawLink: async (ctx) => { return mainHandler.GetLnurlChannelLink(ctx.user_id) diff --git a/src/services/storage/entity/AddressReceivingTransaction.ts b/src/services/storage/entity/AddressReceivingTransaction.ts index e8e2967c..399d5b6e 100644 --- a/src/services/storage/entity/AddressReceivingTransaction.ts +++ b/src/services/storage/entity/AddressReceivingTransaction.ts @@ -20,8 +20,11 @@ export class AddressReceivingTransaction { output_index: number @Column() - amount: number + paid_amount: number @Column() service_fee: number + + @Column() + paid_at_unix: number } diff --git a/src/services/storage/entity/UserInvoicePayment.ts b/src/services/storage/entity/UserInvoicePayment.ts index 8e3fd1b7..7c28b214 100644 --- a/src/services/storage/entity/UserInvoicePayment.ts +++ b/src/services/storage/entity/UserInvoicePayment.ts @@ -16,11 +16,14 @@ export class UserInvoicePayment { invoice: string @Column() - amount: number + paid_amount: number @Column() routing_fees: number @Column() service_fees: number + + @Column() + paid_at_unix: number } diff --git a/src/services/storage/entity/UserReceivingInvoice.ts b/src/services/storage/entity/UserReceivingInvoice.ts index 64c24b59..6da376c4 100644 --- a/src/services/storage/entity/UserReceivingInvoice.ts +++ b/src/services/storage/entity/UserReceivingInvoice.ts @@ -15,15 +15,15 @@ export class UserReceivingInvoice { @Index({ unique: true }) invoice: string - @Column({ default: false }) - paid: boolean + @Column({ default: 0 }) + paid_at_unix: number @Column() callbackUrl: string @Column({ default: 0 }) - settle_amount: number + paid_amount: number - @Column() + @Column({ default: 0 }) service_fee: number } diff --git a/src/services/storage/entity/UserTransactionPayment.ts b/src/services/storage/entity/UserTransactionPayment.ts index f6ce95f2..e4305e63 100644 --- a/src/services/storage/entity/UserTransactionPayment.ts +++ b/src/services/storage/entity/UserTransactionPayment.ts @@ -22,11 +22,14 @@ export class UserTransactionPayment { output_index: number @Column() - amount: number + paid_amount: number @Column() chain_fees: number @Column() service_fees: number + + @Column() + paid_at_unix: number } diff --git a/src/services/storage/index.ts b/src/services/storage/index.ts index ab6fb41a..3a6fed86 100644 --- a/src/services/storage/index.ts +++ b/src/services/storage/index.ts @@ -1,4 +1,4 @@ -import { DataSource, EntityManager } from "typeorm" +import { DataSource, EntityManager, MoreThan, MoreThanOrEqual } from "typeorm" import crypto from 'crypto'; import NewDB, { DbSettings, LoadDbSettingsFromEnv } from "./db.js" import { User } from "./entity/User.js" @@ -86,12 +86,26 @@ export default class { user_address: address, tx_hash: txHash, output_index: outputIndex, - amount: amount, - service_fee: serviceFee + paid_amount: amount, + service_fee: serviceFee, + paid_at_unix: Math.floor(Date.now() / 1000) }) return entityManager.getRepository(AddressReceivingTransaction).save(newAddressTransaction) } + GetUserReceivingTransactions(userId: string, fromIndex: number, 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' + } + }) + } + async AddUserAddress(userId: string, address: string, callbackUrl = "", entityManager = this.DB): Promise { const newUserAddress = entityManager.getRepository(UserReceivingAddress).create({ address, @@ -102,7 +116,22 @@ export default class { } async FlagInvoiceAsPaid(invoice: UserReceivingInvoice, amount: number, serviceFee: number, entityManager = this.DB) { - return entityManager.getRepository(UserReceivingInvoice).update(invoice.serial_id, { paid: true, settle_amount: amount, service_fee: serviceFee }) + return entityManager.getRepository(UserReceivingInvoice).update(invoice.serial_id, { paid_at_unix: Math.floor(Date.now() / 1000), paid_amount: amount, service_fee: serviceFee }) + } + + GetUserInvoicesFlaggedAsPaid(userId: string, fromIndex: number, 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' + } + }) } async AddUserInvoice(userId: string, invoice: string, callbackUrl = "", entityManager = this.DB): Promise { @@ -133,26 +162,58 @@ export default class { async AddUserInvoicePayment(userId: string, invoice: string, amount: number, routingFees: number, serviceFees: number, entityManager = this.DB): Promise { const newPayment = entityManager.getRepository(UserInvoicePayment).create({ user: await this.GetUser(userId), - amount, + paid_amount: amount, invoice, routing_fees: routingFees, - service_fees: serviceFees + service_fees: serviceFees, + paid_at_unix: Math.floor(Date.now() / 1000) }) return entityManager.getRepository(UserInvoicePayment).save(newPayment) } + GetUserInvoicePayments(userId: string, fromIndex: number, 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' + } + }) + } + async AddUserTransactionPayment(userId: string, address: string, txHash: string, txOutput: number, amount: number, chainFees: number, serviceFees: number, entityManager = this.DB): Promise { const newTx = entityManager.getRepository(UserTransactionPayment).create({ user: await this.GetUser(userId), address, - amount, + paid_amount: amount, chain_fees: chainFees, output_index: txOutput, tx_hash: txHash, - service_fees: serviceFees + service_fees: serviceFees, + paid_at_unix: Math.floor(Date.now() / 1000) }) return entityManager.getRepository(UserTransactionPayment).save(newTx) } + + GetUserTransactionPayments(userId: string, fromIndex: number, 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' + } + }) + } async LockUser(userId: string, entityManager = this.DB) { const res = await entityManager.getRepository(User).update({ user_id: userId