From 3d4bd4be63885c22b88da879e1d84a46be48d85a Mon Sep 17 00:00:00 2001 From: boufni95 Date: Fri, 1 Dec 2023 22:06:39 +0100 Subject: [PATCH] ln address --- proto/autogenerated/client.md | 341 +-- proto/autogenerated/debug.txt | 2660 ++++++++++---------- proto/autogenerated/ts/express_server.ts | 12 + proto/autogenerated/ts/http_client.ts | 15 + proto/autogenerated/ts/types.ts | 1973 +++++++-------- proto/service/methods.proto | 5 + src/services/main/paymentManager.ts | 8 + src/services/serverMethods/index.ts | 6 + src/services/storage/applicationStorage.ts | 6 +- 9 files changed, 2561 insertions(+), 2465 deletions(-) diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index cf492e20..befa4843 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -100,9 +100,9 @@ The nostr server will send back a message response, and inside the body there wi - __User__: - expected context content - - __user_id__: _string_ - __app_id__: _string_ - __app_user_id__: _string_ + - __user_id__: _string_ - __Admin__: - expected context content @@ -197,6 +197,15 @@ The nostr server will send back a message response, and inside the body there wi - This methods has an __empty__ __request__ body - output: [HandleLnurlPayResponse](#HandleLnurlPayResponse) +- HandleLnurlAddress + - auth type: __Guest__ + - http method: __get__ + - http route: __/.well-known/lnurlp/:address_name__ + - the request url __params__ are the following string items: + - address_name + - This methods has an __empty__ __request__ body + - output: [LnurlPayInfoResponse](#LnurlPayInfoResponse) + - GetApp - auth type: __App__ - http method: __post__ @@ -386,109 +395,48 @@ The nostr server will send back a message response, and inside the body there wi ## Messages ### The content of requests and response from the methods -### OpenChannelRequest - - __destination__: _string_ - - __fundingAmount__: _number_ - - __pushAmount__: _number_ - - __closeAddress__: _string_ - -### HandleLnurlPayResponse - - __pr__: _string_ - - __routes__: ARRAY of: _[Empty](#Empty)_ - -### GetUserOperationsResponse - - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ - - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ - - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ - -### AddProductRequest - - __name__: _string_ - - __price_sats__: _number_ - -### NewAddressRequest - - __addressType__: _[AddressType](#AddressType)_ - -### NewInvoiceResponse - - __invoice__: _string_ - -### DecodeInvoiceResponse - - __amount__: _number_ - -### PayInvoiceResponse - - __preimage__: _string_ - - __amount_paid__: _number_ +### PayAddressResponse + - __txId__: _string_ - __operation_id__: _string_ - __service_fee__: _number_ - __network_fee__: _number_ -### EncryptionExchangeRequest - - __publicKey__: _string_ - - __deviceId__: _string_ - -### AddAppRequest - - __name__: _string_ - - __allow_user_creation__: _boolean_ - -### AddAppUserRequest - - __identifier__: _string_ - - __fail_if_exists__: _boolean_ - - __balance__: _number_ - -### UserInfo - - __userId__: _string_ - - __balance__: _number_ - - __max_withdrawable__: _number_ - -### GetUserOperationsRequest - - __latestIncomingInvoice__: _number_ - - __latestOutgoingInvoice__: _number_ - - __latestIncomingTx__: _number_ - - __latestOutgoingTx__: _number_ - - __latestIncomingUserToUserPayment__: _number_ - - __latestOutgoingUserToUserPayment__: _number_ - -### GetProductBuyLinkResponse - - __link__: _string_ - -### LndGetInfoResponse - - __alias__: _string_ - -### GetAppUserRequest - - __user_identifier__: _string_ - ### NewInvoiceRequest - __amountSats__: _number_ - __memo__: _string_ +### UserOperations + - __fromIndex__: _number_ + - __toIndex__: _number_ + - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ + +### AddProductRequest + - __name__: _string_ + - __price_sats__: _number_ + +### EncryptionExchangeRequest + - __publicKey__: _string_ + - __deviceId__: _string_ + +### AddAppInvoiceRequest + - __payer_identifier__: _string_ + - __http_callback_url__: _string_ + - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ + +### PayAppUserInvoiceRequest + - __user_identifier__: _string_ + - __invoice__: _string_ + - __amount__: _number_ + +### NewAddressResponse + - __address__: _string_ + ### LnurlLinkResponse - __lnurl__: _string_ - __k1__: _string_ -### SetMockInvoiceAsPaidRequest - - __invoice__: _string_ - - __amount__: _number_ - -### Application - - __name__: _string_ - - __id__: _string_ - - __balance__: _number_ - - __npub__: _string_ - -### PayInvoiceRequest - - __invoice__: _string_ - - __amount__: _number_ - -### RelaysMigration - - __relays__: ARRAY of: _string_ - -### LndGetInfoRequest - - __nodeId__: _number_ - -### NewAddressResponse - - __address__: _string_ +### ClosureMigration + - __closes_at_unix__: _number_ ### UserOperation - __paidAtUnix__: _number_ @@ -501,81 +449,15 @@ The nostr server will send back a message response, and inside the body there wi - __network_fee__: _number_ - __confirmed__: _boolean_ -### LiveUserOperation - - __operation__: _[UserOperation](#UserOperation)_ +### GetProductBuyLinkResponse + - __link__: _string_ -### UserOperations - - __fromIndex__: _number_ - - __toIndex__: _number_ - - __operations__: ARRAY of: _[UserOperation](#UserOperation)_ - -### MigrationUpdate - - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional - - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional - -### ClosureMigration - - __closes_at_unix__: _number_ +### Empty ### AuthAppRequest - __name__: _string_ - __allow_user_creation__: _boolean_ *this field is optional -### SendAppUserToAppPaymentRequest - - __from_user_identifier__: _string_ - - __amount__: _number_ - -### PayAddressResponse - - __txId__: _string_ - - __operation_id__: _string_ - - __service_fee__: _number_ - - __network_fee__: _number_ - -### OpenChannelResponse - - __channelId__: _string_ - -### AddAppUserInvoiceRequest - - __receiver_identifier__: _string_ - - __payer_identifier__: _string_ - - __http_callback_url__: _string_ - - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ - -### SetMockAppBalanceRequest - - __amount__: _number_ - -### LnurlPayInfoResponse - - __tag__: _string_ - - __callback__: _string_ - - __maxSendable__: _number_ - - __minSendable__: _number_ - - __metadata__: _string_ - - __allowsNostr__: _boolean_ - - __nostrPubkey__: _string_ - -### Product - - __id__: _string_ - - __name__: _string_ - - __price_sats__: _number_ - -### PayAppUserInvoiceRequest - - __user_identifier__: _string_ - - __invoice__: _string_ - - __amount__: _number_ - -### SendAppUserToAppUserPaymentRequest - - __from_user_identifier__: _string_ - - __to_user_identifier__: _string_ - - __amount__: _number_ - -### GetAppUserLNURLInfoRequest - - __user_identifier__: _string_ - - __base_url_override__: _string_ - -### SetMockAppUserBalanceRequest - - __user_identifier__: _string_ - - __amount__: _number_ - -### Empty - ### AuthApp - __app__: _[Application](#Application)_ - __auth_token__: _string_ @@ -585,19 +467,113 @@ The nostr server will send back a message response, and inside the body there wi - __info__: _[UserInfo](#UserInfo)_ - __max_withdrawable__: _number_ -### AddAppInvoiceRequest +### SendAppUserToAppPaymentRequest + - __from_user_identifier__: _string_ + - __amount__: _number_ + +### SetMockAppUserBalanceRequest + - __user_identifier__: _string_ + - __amount__: _number_ + +### RelaysMigration + - __relays__: ARRAY of: _string_ + +### Application + - __name__: _string_ + - __id__: _string_ + - __balance__: _number_ + - __npub__: _string_ + +### GetAppUserLNURLInfoRequest + - __user_identifier__: _string_ + - __base_url_override__: _string_ + +### SetMockAppBalanceRequest + - __amount__: _number_ + +### PayInvoiceResponse + - __preimage__: _string_ + - __amount_paid__: _number_ + - __operation_id__: _string_ + - __service_fee__: _number_ + - __network_fee__: _number_ + +### OpenChannelResponse + - __channelId__: _string_ + +### LnurlPayInfoResponse + - __tag__: _string_ + - __callback__: _string_ + - __maxSendable__: _number_ + - __minSendable__: _number_ + - __metadata__: _string_ + - __allowsNostr__: _boolean_ + - __nostrPubkey__: _string_ + +### AddAppRequest + - __name__: _string_ + - __allow_user_creation__: _boolean_ + +### AddAppUserRequest + - __identifier__: _string_ + - __fail_if_exists__: _boolean_ + - __balance__: _number_ + +### NewAddressRequest + - __addressType__: _[AddressType](#AddressType)_ + +### PayInvoiceRequest + - __invoice__: _string_ + - __amount__: _number_ + +### OpenChannelRequest + - __destination__: _string_ + - __fundingAmount__: _number_ + - __pushAmount__: _number_ + - __closeAddress__: _string_ + +### GetUserOperationsRequest + - __latestIncomingInvoice__: _number_ + - __latestOutgoingInvoice__: _number_ + - __latestIncomingTx__: _number_ + - __latestOutgoingTx__: _number_ + - __latestIncomingUserToUserPayment__: _number_ + - __latestOutgoingUserToUserPayment__: _number_ + +### Product + - __id__: _string_ + - __name__: _string_ + - __price_sats__: _number_ + +### SetMockInvoiceAsPaidRequest + - __invoice__: _string_ + - __amount__: _number_ + +### AddAppUserInvoiceRequest + - __receiver_identifier__: _string_ - __payer_identifier__: _string_ - __http_callback_url__: _string_ - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ -### PayAddressRequest - - __address__: _string_ - - __amoutSats__: _number_ - - __satsPerVByte__: _number_ +### SendAppUserToAppUserPaymentRequest + - __from_user_identifier__: _string_ + - __to_user_identifier__: _string_ + - __amount__: _number_ ### DecodeInvoiceRequest - __invoice__: _string_ +### DecodeInvoiceResponse + - __amount__: _number_ + +### UserInfo + - __userId__: _string_ + - __balance__: _number_ + - __max_withdrawable__: _number_ + +### NewInvoiceResponse + - __invoice__: _string_ + ### LnurlWithdrawInfoResponse - __tag__: _string_ - __callback__: _string_ @@ -607,6 +583,39 @@ The nostr server will send back a message response, and inside the body there wi - __maxWithdrawable__: _number_ - __balanceCheck__: _string_ - __payLink__: _string_ + +### HandleLnurlPayResponse + - __pr__: _string_ + - __routes__: ARRAY of: _[Empty](#Empty)_ + +### MigrationUpdate + - __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional + - __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional + +### LndGetInfoRequest + - __nodeId__: _number_ + +### LndGetInfoResponse + - __alias__: _string_ + +### GetAppUserRequest + - __user_identifier__: _string_ + +### PayAddressRequest + - __address__: _string_ + - __amoutSats__: _number_ + - __satsPerVByte__: _number_ + +### GetUserOperationsResponse + - __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ + - __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ + - __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_ + +### LiveUserOperation + - __operation__: _[UserOperation](#UserOperation)_ ## Enums ### The enumerators used in the messages diff --git a/proto/autogenerated/debug.txt b/proto/autogenerated/debug.txt index 6d9b8255..5b05b0f4 100644 --- a/proto/autogenerated/debug.txt +++ b/proto/autogenerated/debug.txt @@ -1,5 +1,5 @@ -([]*main.Method) (len=36 cap=64) { - (*main.Method)(0xc0002f8500)({ +([]*main.Method) (len=37 cap=64) { + (*main.Method)(0xc0002ca4b0)({ in: (main.MethodMessage) { name: (string) (len=17) "LndGetInfoRequest", hasZeroFields: (bool) false @@ -9,8 +9,8 @@ name: (string) (len=18) "LndGetInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000747e0)({ - authType: (*main.supportedAuth)(0xc00020c930)({ + opts: (*main.methodOptions)(0xc00006c3c0)({ + authType: (*main.supportedAuth)(0xc0001b0990)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", encrypted: (bool) false, @@ -28,7 +28,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8780)({ + (*main.Method)(0xc0002ca730)({ in: (main.MethodMessage) { name: (string) (len=13) "AddAppRequest", hasZeroFields: (bool) false @@ -38,8 +38,8 @@ name: (string) (len=7) "AuthApp", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000074960)({ - authType: (*main.supportedAuth)(0xc00020c9c0)({ + opts: (*main.methodOptions)(0xc00006c540)({ + authType: (*main.supportedAuth)(0xc0001b0a20)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", encrypted: (bool) false, @@ -57,7 +57,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8910)({ + (*main.Method)(0xc0002ca8c0)({ in: (main.MethodMessage) { name: (string) (len=14) "AuthAppRequest", hasZeroFields: (bool) false @@ -67,8 +67,8 @@ name: (string) (len=7) "AuthApp", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000074ae0)({ - authType: (*main.supportedAuth)(0xc00020ca50)({ + opts: (*main.methodOptions)(0xc00006c6c0)({ + authType: (*main.supportedAuth)(0xc0001b0ab0)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", encrypted: (bool) false, @@ -86,7 +86,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8960)({ + (*main.Method)(0xc0002ca910)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -96,8 +96,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000074c60)({ - authType: (*main.supportedAuth)(0xc00020cae0)({ + opts: (*main.methodOptions)(0xc00006c840)({ + authType: (*main.supportedAuth)(0xc0001b0b40)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -114,7 +114,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f89b0)({ + (*main.Method)(0xc0002ca960)({ in: (main.MethodMessage) { name: (string) (len=25) "EncryptionExchangeRequest", hasZeroFields: (bool) false @@ -124,8 +124,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000074de0)({ - authType: (*main.supportedAuth)(0xc00020cba0)({ + opts: (*main.methodOptions)(0xc00006c9c0)({ + authType: (*main.supportedAuth)(0xc0001b0c00)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -142,7 +142,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8a00)({ + (*main.Method)(0xc0002ca9b0)({ in: (main.MethodMessage) { name: (string) (len=27) "SetMockInvoiceAsPaidRequest", hasZeroFields: (bool) false @@ -152,8 +152,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000075020)({ - authType: (*main.supportedAuth)(0xc00020cc30)({ + opts: (*main.methodOptions)(0xc00006cba0)({ + authType: (*main.supportedAuth)(0xc0001b0c90)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -170,7 +170,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8aa0)({ + (*main.Method)(0xc0002caa50)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -180,8 +180,8 @@ name: (string) (len=25) "LnurlWithdrawInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0000753e0)({ - authType: (*main.supportedAuth)(0xc00020cd80)({ + opts: (*main.methodOptions)(0xc00006cf00)({ + authType: (*main.supportedAuth)(0xc0001b0de0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -200,7 +200,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8b40)({ + (*main.Method)(0xc0002caaf0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -210,8 +210,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000212240)({ - authType: (*main.supportedAuth)(0xc00020ced0)({ + opts: (*main.methodOptions)(0xc00006d260)({ + authType: (*main.supportedAuth)(0xc0001b0f30)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -231,7 +231,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8be0)({ + (*main.Method)(0xc0002cab90)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -241,8 +241,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002125a0)({ - authType: (*main.supportedAuth)(0xc00020cff0)({ + opts: (*main.methodOptions)(0xc00006d5c0)({ + authType: (*main.supportedAuth)(0xc0001b1050)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -261,7 +261,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8c80)({ + (*main.Method)(0xc0002cac30)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -271,8 +271,8 @@ name: (string) (len=22) "HandleLnurlPayResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000212960)({ - authType: (*main.supportedAuth)(0xc00020d140)({ + opts: (*main.methodOptions)(0xc00006d980)({ + authType: (*main.supportedAuth)(0xc0001b11a0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -294,7 +294,37 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8cd0)({ + (*main.Method)(0xc0002cac80)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=18) "HandleLnurlAddress", + out: (main.MethodMessage) { + name: (string) (len=20) "LnurlPayInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00006db00)({ + authType: (*main.supportedAuth)(0xc0001b1230)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + encrypted: (bool) false, + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=33) "/.well-known/lnurlp/:address_name", + params: ([]string) (len=1 cap=1) { + (string) (len=12) "address_name" + } + }, + query: ([]string) , + nostr: (bool) false + }), + serverStream: (bool) false + }), + (*main.Method)(0xc0002cacd0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -304,8 +334,8 @@ name: (string) (len=11) "Application", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000212ae0)({ - authType: (*main.supportedAuth)(0xc00020d1d0)({ + opts: (*main.methodOptions)(0xc00006dc80)({ + authType: (*main.supportedAuth)(0xc0001b12c0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -323,7 +353,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8d70)({ + (*main.Method)(0xc0002cad70)({ in: (main.MethodMessage) { name: (string) (len=17) "AddAppUserRequest", hasZeroFields: (bool) false @@ -333,8 +363,8 @@ name: (string) (len=7) "AppUser", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000212c60)({ - authType: (*main.supportedAuth)(0xc00020d260)({ + opts: (*main.methodOptions)(0xc00006de00)({ + authType: (*main.supportedAuth)(0xc0001b1350)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -352,7 +382,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8e10)({ + (*main.Method)(0xc0002cae10)({ in: (main.MethodMessage) { name: (string) (len=20) "AddAppInvoiceRequest", hasZeroFields: (bool) false @@ -362,8 +392,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000212de0)({ - authType: (*main.supportedAuth)(0xc00020d2f0)({ + opts: (*main.methodOptions)(0xc00006df80)({ + authType: (*main.supportedAuth)(0xc0001b13e0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -381,7 +411,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8e60)({ + (*main.Method)(0xc0002cae60)({ in: (main.MethodMessage) { name: (string) (len=24) "AddAppUserInvoiceRequest", hasZeroFields: (bool) false @@ -391,8 +421,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000212fc0)({ - authType: (*main.supportedAuth)(0xc00020d380)({ + opts: (*main.methodOptions)(0xc00009c600)({ + authType: (*main.supportedAuth)(0xc0001b1470)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -410,7 +440,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8f00)({ + (*main.Method)(0xc0002caf00)({ in: (main.MethodMessage) { name: (string) (len=17) "GetAppUserRequest", hasZeroFields: (bool) false @@ -420,8 +450,8 @@ name: (string) (len=7) "AppUser", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000213140)({ - authType: (*main.supportedAuth)(0xc00020d410)({ + opts: (*main.methodOptions)(0xc00009c7e0)({ + authType: (*main.supportedAuth)(0xc0001b1500)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -439,7 +469,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8fa0)({ + (*main.Method)(0xc0002cafa0)({ in: (main.MethodMessage) { name: (string) (len=24) "PayAppUserInvoiceRequest", hasZeroFields: (bool) false @@ -449,8 +479,8 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002132c0)({ - authType: (*main.supportedAuth)(0xc00020d4a0)({ + opts: (*main.methodOptions)(0xc00009c960)({ + authType: (*main.supportedAuth)(0xc0001b1590)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -468,7 +498,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f8ff0)({ + (*main.Method)(0xc0002caff0)({ in: (main.MethodMessage) { name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", hasZeroFields: (bool) false @@ -478,8 +508,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0002134a0)({ - authType: (*main.supportedAuth)(0xc00020d530)({ + opts: (*main.methodOptions)(0xc00009cb40)({ + authType: (*main.supportedAuth)(0xc0001b1620)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -497,7 +527,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9090)({ + (*main.Method)(0xc0002cb090)({ in: (main.MethodMessage) { name: (string) (len=30) "SendAppUserToAppPaymentRequest", hasZeroFields: (bool) false @@ -507,8 +537,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000213620)({ - authType: (*main.supportedAuth)(0xc00020d5c0)({ + opts: (*main.methodOptions)(0xc00009ccc0)({ + authType: (*main.supportedAuth)(0xc0001b16b0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -526,7 +556,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f90e0)({ + (*main.Method)(0xc0002cb0e0)({ in: (main.MethodMessage) { name: (string) (len=26) "GetAppUserLNURLInfoRequest", hasZeroFields: (bool) false @@ -536,8 +566,8 @@ name: (string) (len=20) "LnurlPayInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002137a0)({ - authType: (*main.supportedAuth)(0xc00020d650)({ + opts: (*main.methodOptions)(0xc00009ce40)({ + authType: (*main.supportedAuth)(0xc0001b1740)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -555,7 +585,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9130)({ + (*main.Method)(0xc0002cb130)({ in: (main.MethodMessage) { name: (string) (len=28) "SetMockAppUserBalanceRequest", hasZeroFields: (bool) false @@ -565,8 +595,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000213920)({ - authType: (*main.supportedAuth)(0xc00020d6e0)({ + opts: (*main.methodOptions)(0xc00009d080)({ + authType: (*main.supportedAuth)(0xc0001b17d0)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -584,7 +614,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9180)({ + (*main.Method)(0xc0002cb180)({ in: (main.MethodMessage) { name: (string) (len=24) "SetMockAppBalanceRequest", hasZeroFields: (bool) false @@ -594,8 +624,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc000213b00)({ - authType: (*main.supportedAuth)(0xc00020d770)({ + opts: (*main.methodOptions)(0xc00009d260)({ + authType: (*main.supportedAuth)(0xc0001b1860)({ id: (string) (len=3) "app", name: (string) (len=3) "App", encrypted: (bool) false, @@ -613,7 +643,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f91d0)({ + (*main.Method)(0xc0002cb1d0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -623,15 +653,15 @@ name: (string) (len=8) "UserInfo", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000213ce0)({ - authType: (*main.supportedAuth)(0xc00020d830)({ + opts: (*main.methodOptions)(0xc00009d4a0)({ + authType: (*main.supportedAuth)(0xc0001b1920)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { + (string) (len=6) "app_id": (string) (len=6) "string", (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -644,7 +674,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9270)({ + (*main.Method)(0xc0002cb270)({ in: (main.MethodMessage) { name: (string) (len=17) "AddProductRequest", hasZeroFields: (bool) false @@ -654,8 +684,8 @@ name: (string) (len=7) "Product", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000213ec0)({ - authType: (*main.supportedAuth)(0xc00020d8c0)({ + opts: (*main.methodOptions)(0xc0001d6180)({ + authType: (*main.supportedAuth)(0xc0001b19b0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -675,7 +705,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f92c0)({ + (*main.Method)(0xc0002cb2c0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -685,15 +715,15 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000218360)({ - authType: (*main.supportedAuth)(0xc00020d9e0)({ + opts: (*main.methodOptions)(0xc0001d6600)({ + authType: (*main.supportedAuth)(0xc0001b1ad0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=3) "get", @@ -708,7 +738,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9310)({ + (*main.Method)(0xc0002cb310)({ in: (main.MethodMessage) { name: (string) (len=24) "GetUserOperationsRequest", hasZeroFields: (bool) false @@ -718,8 +748,8 @@ name: (string) (len=25) "GetUserOperationsResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000218540)({ - authType: (*main.supportedAuth)(0xc00020da70)({ + opts: (*main.methodOptions)(0xc0001d67e0)({ + authType: (*main.supportedAuth)(0xc0001b1b60)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -739,7 +769,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f93b0)({ + (*main.Method)(0xc0002cb3b0)({ in: (main.MethodMessage) { name: (string) (len=17) "NewAddressRequest", hasZeroFields: (bool) false @@ -749,15 +779,15 @@ name: (string) (len=18) "NewAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000218720)({ - authType: (*main.supportedAuth)(0xc00020db00)({ + opts: (*main.methodOptions)(0xc0001d69c0)({ + authType: (*main.supportedAuth)(0xc0001b1bf0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { - (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string", + (string) (len=11) "app_user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -770,7 +800,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9450)({ + (*main.Method)(0xc0002cb450)({ in: (main.MethodMessage) { name: (string) (len=17) "PayAddressRequest", hasZeroFields: (bool) false @@ -780,8 +810,8 @@ name: (string) (len=18) "PayAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000218900)({ - authType: (*main.supportedAuth)(0xc00020db90)({ + opts: (*main.methodOptions)(0xc0001d6ba0)({ + authType: (*main.supportedAuth)(0xc0001b1c80)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -801,7 +831,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f94f0)({ + (*main.Method)(0xc0002cb4f0)({ in: (main.MethodMessage) { name: (string) (len=17) "NewInvoiceRequest", hasZeroFields: (bool) false @@ -811,15 +841,15 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000218ae0)({ - authType: (*main.supportedAuth)(0xc00020dc20)({ + opts: (*main.methodOptions)(0xc0001d6d80)({ + authType: (*main.supportedAuth)(0xc0001b1d10)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { + (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -832,7 +862,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9590)({ + (*main.Method)(0xc0002cb590)({ in: (main.MethodMessage) { name: (string) (len=20) "DecodeInvoiceRequest", hasZeroFields: (bool) false @@ -842,15 +872,15 @@ name: (string) (len=21) "DecodeInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000218cc0)({ - authType: (*main.supportedAuth)(0xc00020dcb0)({ + opts: (*main.methodOptions)(0xc0001d6f60)({ + authType: (*main.supportedAuth)(0xc0001b1da0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { + (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -863,7 +893,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9630)({ + (*main.Method)(0xc0002cb630)({ in: (main.MethodMessage) { name: (string) (len=17) "PayInvoiceRequest", hasZeroFields: (bool) false @@ -873,15 +903,15 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000218ea0)({ - authType: (*main.supportedAuth)(0xc00020dd40)({ + opts: (*main.methodOptions)(0xc0001d7140)({ + authType: (*main.supportedAuth)(0xc0001b1e30)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { + (string) (len=6) "app_id": (string) (len=6) "string", (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -894,7 +924,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f96d0)({ + (*main.Method)(0xc0002cb6d0)({ in: (main.MethodMessage) { name: (string) (len=18) "OpenChannelRequest", hasZeroFields: (bool) false @@ -904,15 +934,15 @@ name: (string) (len=19) "OpenChannelResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000219080)({ - authType: (*main.supportedAuth)(0xc00020ddd0)({ + opts: (*main.methodOptions)(0xc0001d7320)({ + authType: (*main.supportedAuth)(0xc0001b1ec0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { + (string) (len=11) "app_user_id": (string) (len=6) "string", (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -925,7 +955,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9770)({ + (*main.Method)(0xc0002cb770)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -935,15 +965,15 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000219260)({ - authType: (*main.supportedAuth)(0xc00020de60)({ + opts: (*main.methodOptions)(0xc0001d7500)({ + authType: (*main.supportedAuth)(0xc0001b1f50)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=3) "get", @@ -956,7 +986,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9810)({ + (*main.Method)(0xc0002cb810)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -966,15 +996,15 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000219440)({ - authType: (*main.supportedAuth)(0xc00020def0)({ + opts: (*main.methodOptions)(0xc0001d76e0)({ + authType: (*main.supportedAuth)(0xc0001da000)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { - (string) (len=6) "app_id": (string) (len=6) "string", (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string" + (string) (len=7) "user_id": (string) (len=6) "string", + (string) (len=6) "app_id": (string) (len=6) "string" } }), method: (string) (len=3) "get", @@ -987,7 +1017,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f98b0)({ + (*main.Method)(0xc0002cb8b0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -997,15 +1027,15 @@ name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000219620)({ - authType: (*main.supportedAuth)(0xc00020df80)({ + opts: (*main.methodOptions)(0xc0001d78c0)({ + authType: (*main.supportedAuth)(0xc0001da090)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -1018,7 +1048,7 @@ }), serverStream: (bool) false }), - (*main.Method)(0xc0002f9950)({ + (*main.Method)(0xc0002cb950)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1028,15 +1058,15 @@ name: (string) (len=17) "LiveUserOperation", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc000219800)({ - authType: (*main.supportedAuth)(0xc00021e030)({ + opts: (*main.methodOptions)(0xc0001d7aa0)({ + authType: (*main.supportedAuth)(0xc0001da120)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { + (string) (len=6) "app_id": (string) (len=6) "string", (string) (len=11) "app_user_id": (string) (len=6) "string", - (string) (len=7) "user_id": (string) (len=6) "string", - (string) (len=6) "app_id": (string) (len=6) "string" + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -1049,7 +1079,7 @@ }), serverStream: (bool) true }), - (*main.Method)(0xc0002f99f0)({ + (*main.Method)(0xc0002cb9f0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -1059,15 +1089,15 @@ name: (string) (len=15) "MigrationUpdate", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0002199e0)({ - authType: (*main.supportedAuth)(0xc00021e0c0)({ + opts: (*main.methodOptions)(0xc0001d7c80)({ + authType: (*main.supportedAuth)(0xc0001da1b0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, context: (map[string]string) (len=3) { - (string) (len=7) "user_id": (string) (len=6) "string", (string) (len=6) "app_id": (string) (len=6) "string", - (string) (len=11) "app_user_id": (string) (len=6) "string" + (string) (len=11) "app_user_id": (string) (len=6) "string", + (string) (len=7) "user_id": (string) (len=6) "string" } }), method: (string) (len=4) "post", @@ -1083,7 +1113,7 @@ } ([]*main.Enum) (len=2 cap=2) { - (*main.Enum)(0xc00020c060)({ + (*main.Enum)(0xc0001b00c0)({ name: (string) (len=11) "AddressType", values: ([]main.EnumValue) (len=3 cap=4) { (main.EnumValue) { @@ -1100,7 +1130,7 @@ } } }), - (*main.Enum)(0xc00020c0c0)({ + (*main.Enum)(0xc0001b0120)({ name: (string) (len=17) "UserOperationType", values: ([]main.EnumValue) (len=6 cap=8) { (main.EnumValue) { @@ -1132,298 +1162,11 @@ } (map[string]*main.Message) (len=48) { - (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc000436ac0)({ - fullName: (string) (len=24) "AddAppUserInvoiceRequest", - name: (string) (len=24) "AddAppUserInvoiceRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001ccd20)({ - name: (string) (len=19) "receiver_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccd50)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccd80)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccdb0)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc000436c80)({ - fullName: (string) (len=24) "SetMockAppBalanceRequest", - name: (string) (len=24) "SetMockAppBalanceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cd050)({ - name: (string) (len=6) "amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000437100)({ - fullName: (string) (len=20) "LnurlPayInfoResponse", - name: (string) (len=20) "LnurlPayInfoResponse", - fields: ([]*main.Field) (len=7 cap=8) { - (*main.Field)(0xc0001cd740)({ - 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)(0xc0001cd770)({ - 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)(0xc0001cd7a0)({ - 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)(0xc0001cd7d0)({ - 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)(0xc0001cd800)({ - name: (string) (len=8) "metadata", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd830)({ - name: (string) (len=11) "allowsNostr", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd860)({ - name: (string) (len=11) "nostrPubkey", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=7) "Product": (*main.Message)(0xc0004373c0)({ - fullName: (string) (len=7) "Product", - name: (string) (len=7) "Product", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001cde60)({ - name: (string) (len=2) "id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cde90)({ - 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)(0xc0001cdec0)({ - name: (string) (len=10) "price_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=5) "Empty": (*main.Message)(0xc0004367c0)({ - fullName: (string) (len=5) "Empty", - name: (string) (len=5) "Empty", - fields: ([]*main.Field) - }), - (string) (len=7) "AuthApp": (*main.Message)(0xc0004369c0)({ - fullName: (string) (len=7) "AuthApp", - name: (string) (len=7) "AuthApp", + (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc00037ac40)({ + fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", + name: (string) (len=30) "SendAppUserToAppPaymentRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001ccb10)({ - name: (string) (len=3) "app", - kind: (string) (len=11) "Application", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccb40)({ - name: (string) (len=10) "auth_token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=7) "AppUser": (*main.Message)(0xc000436a40)({ - fullName: (string) (len=7) "AppUser", - name: (string) (len=7) "AppUser", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001ccc00)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccc30)({ - name: (string) (len=4) "info", - kind: (string) (len=8) "UserInfo", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccc60)({ - name: (string) (len=16) "max_withdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "AddAppInvoiceRequest": (*main.Message)(0xc000436a80)({ - fullName: (string) (len=20) "AddAppInvoiceRequest", - name: (string) (len=20) "AddAppInvoiceRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001ccc90)({ - name: (string) (len=16) "payer_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cccc0)({ - name: (string) (len=17) "http_callback_url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cccf0)({ - name: (string) (len=11) "invoice_req", - kind: (string) (len=17) "NewInvoiceRequest", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc000436b40)({ - fullName: (string) (len=24) "PayAppUserInvoiceRequest", - name: (string) (len=24) "PayAppUserInvoiceRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001cce10)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cce40)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cce70)({ - 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=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc000436b80)({ - fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001ccea0)({ + (*main.Field)(0xc00008cf90)({ name: (string) (len=20) "from_user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, @@ -1432,16 +1175,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cced0)({ - name: (string) (len=18) "to_user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccf00)({ + (*main.Field)(0xc00008d080)({ name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -1452,35 +1186,11 @@ }) } }), - (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc000436c00)({ - fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", - name: (string) (len=26) "GetAppUserLNURLInfoRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001ccf90)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccfc0)({ - name: (string) (len=17) "base_url_override", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc000436c40)({ + (string) (len=28) "SetMockAppUserBalanceRequest": (*main.Message)(0xc00037acc0)({ fullName: (string) (len=28) "SetMockAppUserBalanceRequest", name: (string) (len=28) "SetMockAppUserBalanceRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001ccff0)({ + (*main.Field)(0xc00008d1a0)({ name: (string) (len=15) "user_identifier", kind: (string) (len=6) "string", isMap: (bool) false, @@ -1489,7 +1199,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cd020)({ + (*main.Field)(0xc00008d1d0)({ name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -1500,785 +1210,11 @@ }) } }), - (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000436d40)({ - fullName: (string) (len=17) "PayAddressRequest", - name: (string) (len=17) "PayAddressRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001cd0e0)({ - 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)(0xc0001cd110)({ - 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)(0xc0001cd140)({ - name: (string) (len=12) "satsPerVByte", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc000436e40)({ - fullName: (string) (len=20) "DecodeInvoiceRequest", - name: (string) (len=20) "DecodeInvoiceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cd2c0)({ - 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=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc000437080)({ - fullName: (string) (len=25) "LnurlWithdrawInfoResponse", - name: (string) (len=25) "LnurlWithdrawInfoResponse", - fields: ([]*main.Field) (len=8 cap=8) { - (*main.Field)(0xc0001cd5c0)({ - 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)(0xc0001cd5f0)({ - 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)(0xc0001cd620)({ - 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)(0xc0001cd650)({ - 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)(0xc0001cd680)({ - 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)(0xc0001cd6b0)({ - 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)(0xc0001cd6e0)({ - 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)(0xc0001cd710)({ - 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=17) "NewAddressRequest": (*main.Message)(0xc000436cc0)({ - fullName: (string) (len=17) "NewAddressRequest", - name: (string) (len=17) "NewAddressRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cd080)({ - name: (string) (len=11) "addressType", - kind: (string) (len=11) "AddressType", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) true, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000436e00)({ - fullName: (string) (len=18) "NewInvoiceResponse", - name: (string) (len=18) "NewInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cd290)({ - 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=21) "DecodeInvoiceResponse": (*main.Message)(0xc000436e80)({ - fullName: (string) (len=21) "DecodeInvoiceResponse", - name: (string) (len=21) "DecodeInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cd2f0)({ - 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=18) "PayInvoiceResponse": (*main.Message)(0xc000436f40)({ - fullName: (string) (len=18) "PayInvoiceResponse", - name: (string) (len=18) "PayInvoiceResponse", - fields: ([]*main.Field) (len=5 cap=8) { - (*main.Field)(0xc0001cd380)({ - name: (string) (len=8) "preimage", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd3b0)({ - name: (string) (len=11) "amount_paid", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd3e0)({ - name: (string) (len=12) "operation_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd410)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd440)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc000436f80)({ - fullName: (string) (len=18) "OpenChannelRequest", - name: (string) (len=18) "OpenChannelRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001cd470)({ - 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)(0xc0001cd4a0)({ - 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)(0xc0001cd4d0)({ - 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)(0xc0001cd500)({ - 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=22) "HandleLnurlPayResponse": (*main.Message)(0xc000437140)({ - fullName: (string) (len=22) "HandleLnurlPayResponse", - name: (string) (len=22) "HandleLnurlPayResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cd890)({ - 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)(0xc0001cd8c0)({ - 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=25) "GetUserOperationsResponse": (*main.Message)(0xc000437340)({ - fullName: (string) (len=25) "GetUserOperationsResponse", - name: (string) (len=25) "GetUserOperationsResponse", - fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc0001cdce0)({ - name: (string) (len=31) "latestOutgoingInvoiceOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cdd10)({ - name: (string) (len=31) "latestIncomingInvoiceOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cdd40)({ - name: (string) (len=26) "latestOutgoingTxOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cdd70)({ - name: (string) (len=26) "latestIncomingTxOperations", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cdda0)({ - name: (string) (len=32) "latestOutgoingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cddd0)({ - name: (string) (len=32) "latestIncomingUserToUserPayemnts", - kind: (string) (len=14) "UserOperations", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) true, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "AddProductRequest": (*main.Message)(0xc000437380)({ - fullName: (string) (len=17) "AddProductRequest", - name: (string) (len=17) "AddProductRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cde00)({ - 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)(0xc0001cde30)({ - name: (string) (len=10) "price_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000436800)({ - fullName: (string) (len=25) "EncryptionExchangeRequest", - name: (string) (len=25) "EncryptionExchangeRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cc870)({ - 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)(0xc0001cc8a0)({ - 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=13) "AddAppRequest": (*main.Message)(0xc000436900)({ - fullName: (string) (len=13) "AddAppRequest", - name: (string) (len=13) "AddAppRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cc990)({ - 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)(0xc0001cc9c0)({ - name: (string) (len=19) "allow_user_creation", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc000436a00)({ - fullName: (string) (len=17) "AddAppUserRequest", - name: (string) (len=17) "AddAppUserRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001ccb70)({ - name: (string) (len=10) "identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccba0)({ - name: (string) (len=14) "fail_if_exists", - kind: (string) (len=4) "bool", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccbd0)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc0004368c0)({ - fullName: (string) (len=18) "LndGetInfoResponse", - name: (string) (len=18) "LndGetInfoResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cc960)({ - 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) "GetAppUserRequest": (*main.Message)(0xc000436b00)({ - fullName: (string) (len=17) "GetAppUserRequest", - name: (string) (len=17) "GetAppUserRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001ccde0)({ - name: (string) (len=15) "user_identifier", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000436dc0)({ - fullName: (string) (len=17) "NewInvoiceRequest", - name: (string) (len=17) "NewInvoiceRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cd230)({ - name: (string) (len=10) "amountSats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd260)({ - name: (string) (len=4) "memo", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000437000)({ - fullName: (string) (len=17) "LnurlLinkResponse", - name: (string) (len=17) "LnurlLinkResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cd560)({ - 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)(0xc0001cd590)({ - name: (string) (len=2) "k1", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=8) "UserInfo": (*main.Message)(0xc000437180)({ - fullName: (string) (len=8) "UserInfo", - name: (string) (len=8) "UserInfo", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001cd8f0)({ - 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)(0xc0001cd920)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd950)({ - name: (string) (len=16) "max_withdrawable", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc000437200)({ - fullName: (string) (len=24) "GetUserOperationsRequest", - name: (string) (len=24) "GetUserOperationsRequest", - fields: ([]*main.Field) (len=6 cap=8) { - (*main.Field)(0xc0001cd980)({ - 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)(0xc0001cd9b0)({ - 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)(0xc0001cd9e0)({ - 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)(0xc0001cda10)({ - name: (string) (len=16) "latestOutgoingTx", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cda40)({ - name: (string) (len=31) "latestIncomingUserToUserPayment", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cda70)({ - name: (string) (len=31) "latestOutgoingUserToUserPayment", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc000437400)({ - fullName: (string) (len=25) "GetProductBuyLinkResponse", - name: (string) (len=25) "GetProductBuyLinkResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cdef0)({ - name: (string) (len=4) "link", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc000436880)({ - fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", - name: (string) (len=27) "SetMockInvoiceAsPaidRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cc900)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cc930)({ - 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=11) "Application": (*main.Message)(0xc000436980)({ - fullName: (string) (len=11) "Application", - name: (string) (len=11) "Application", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001cca50)({ - 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)(0xc0001cca80)({ - name: (string) (len=2) "id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccab0)({ - name: (string) (len=7) "balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001ccae0)({ - name: (string) (len=4) "npub", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000436ec0)({ - fullName: (string) (len=17) "PayInvoiceRequest", - name: (string) (len=17) "PayInvoiceRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cd320)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd350)({ - 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=15) "RelaysMigration": (*main.Message)(0xc000437500)({ - fullName: (string) (len=15) "RelaysMigration", - name: (string) (len=15) "RelaysMigration", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc00020c000)({ - name: (string) (len=6) "relays", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) true, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000436840)({ - fullName: (string) (len=17) "LndGetInfoRequest", - name: (string) (len=17) "LndGetInfoRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cc8d0)({ - 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) "NewAddressResponse": (*main.Message)(0xc000436d00)({ - fullName: (string) (len=18) "NewAddressResponse", - name: (string) (len=18) "NewAddressResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cd0b0)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=13) "UserOperation": (*main.Message)(0xc000437280)({ + (string) (len=13) "UserOperation": (*main.Message)(0xc00037b300)({ fullName: (string) (len=13) "UserOperation", name: (string) (len=13) "UserOperation", fields: ([]*main.Field) (len=9 cap=16) { - (*main.Field)(0xc0001cdaa0)({ + (*main.Field)(0xc0001f8c30)({ name: (string) (len=10) "paidAtUnix", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -2287,7 +1223,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdad0)({ + (*main.Field)(0xc0001f8c60)({ name: (string) (len=4) "type", kind: (string) (len=17) "UserOperationType", isMap: (bool) false, @@ -2296,7 +1232,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdb00)({ + (*main.Field)(0xc0001f8c90)({ name: (string) (len=7) "inbound", kind: (string) (len=4) "bool", isMap: (bool) false, @@ -2305,7 +1241,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdb30)({ + (*main.Field)(0xc0001f8cc0)({ name: (string) (len=6) "amount", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -2314,7 +1250,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdb60)({ + (*main.Field)(0xc0001f94a0)({ name: (string) (len=10) "identifier", kind: (string) (len=6) "string", isMap: (bool) false, @@ -2323,7 +1259,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdb90)({ + (*main.Field)(0xc0001f94d0)({ name: (string) (len=11) "operationId", kind: (string) (len=6) "string", isMap: (bool) false, @@ -2332,7 +1268,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdbc0)({ + (*main.Field)(0xc0001f9500)({ name: (string) (len=11) "service_fee", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -2341,7 +1277,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdbf0)({ + (*main.Field)(0xc0001f9530)({ name: (string) (len=11) "network_fee", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -2350,7 +1286,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdc20)({ + (*main.Field)(0xc0001f9620)({ name: (string) (len=9) "confirmed", kind: (string) (len=4) "bool", isMap: (bool) false, @@ -2361,26 +1297,31 @@ }) } }), - (string) (len=17) "LiveUserOperation": (*main.Message)(0xc000437440)({ - fullName: (string) (len=17) "LiveUserOperation", - name: (string) (len=17) "LiveUserOperation", + (string) (len=25) "GetProductBuyLinkResponse": (*main.Message)(0xc00037b480)({ + fullName: (string) (len=25) "GetProductBuyLinkResponse", + name: (string) (len=25) "GetProductBuyLinkResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cdf20)({ - name: (string) (len=9) "operation", - kind: (string) (len=13) "UserOperation", + (*main.Field)(0xc0001f9ec0)({ + name: (string) (len=4) "link", + kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, - isMessage: (bool) true, + isMessage: (bool) false, isOptional: (bool) false }) } }), - (string) (len=14) "AuthAppRequest": (*main.Message)(0xc000436940)({ + (string) (len=5) "Empty": (*main.Message)(0xc00037a840)({ + fullName: (string) (len=5) "Empty", + name: (string) (len=5) "Empty", + fields: ([]*main.Field) + }), + (string) (len=14) "AuthAppRequest": (*main.Message)(0xc00037a9c0)({ fullName: (string) (len=14) "AuthAppRequest", name: (string) (len=14) "AuthAppRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cc9f0)({ + (*main.Field)(0xc00048de00)({ name: (string) (len=4) "name", kind: (string) (len=6) "string", isMap: (bool) false, @@ -2389,7 +1330,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cca20)({ + (*main.Field)(0xc00048de30)({ name: (string) (len=19) "allow_user_creation", kind: (string) (len=4) "bool", isMap: (bool) false, @@ -2400,12 +1341,36 @@ }) } }), - (string) (len=30) "SendAppUserToAppPaymentRequest": (*main.Message)(0xc000436bc0)({ - fullName: (string) (len=30) "SendAppUserToAppPaymentRequest", - name: (string) (len=30) "SendAppUserToAppPaymentRequest", + (string) (len=7) "AuthApp": (*main.Message)(0xc00037aa40)({ + fullName: (string) (len=7) "AuthApp", + name: (string) (len=7) "AuthApp", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001ccf30)({ - name: (string) (len=20) "from_user_identifier", + (*main.Field)(0xc00048df20)({ + name: (string) (len=3) "app", + kind: (string) (len=11) "Application", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc00048df50)({ + name: (string) (len=10) "auth_token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=7) "AppUser": (*main.Message)(0xc00037aac0)({ + fullName: (string) (len=7) "AppUser", + name: (string) (len=7) "AppUser", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc00008c210)({ + name: (string) (len=10) "identifier", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -2413,8 +1378,17 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001ccf60)({ - name: (string) (len=6) "amount", + (*main.Field)(0xc00008c270)({ + name: (string) (len=4) "info", + kind: (string) (len=8) "UserInfo", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc00008c2a0)({ + name: (string) (len=16) "max_withdrawable", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2424,53 +1398,26 @@ }) } }), - (string) (len=18) "PayAddressResponse": (*main.Message)(0xc000436d80)({ - fullName: (string) (len=18) "PayAddressResponse", - name: (string) (len=18) "PayAddressResponse", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0001cd170)({ - name: (string) (len=4) "txId", + (string) (len=15) "RelaysMigration": (*main.Message)(0xc00037b580)({ + fullName: (string) (len=15) "RelaysMigration", + name: (string) (len=15) "RelaysMigration", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0001b0060)({ + name: (string) (len=6) "relays", kind: (string) (len=6) "string", isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd1a0)({ - name: (string) (len=12) "operation_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd1d0)({ - name: (string) (len=11) "service_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0001cd200)({ - name: (string) (len=11) "network_fee", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, + isArray: (bool) true, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false }) } }), - (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000436fc0)({ + (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc00037b040)({ fullName: (string) (len=19) "OpenChannelResponse", name: (string) (len=19) "OpenChannelResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cd530)({ + (*main.Field)(0xc00008d860)({ name: (string) (len=9) "channelId", kind: (string) (len=6) "string", isMap: (bool) false, @@ -2481,12 +1428,375 @@ }) } }), - (string) (len=14) "UserOperations": (*main.Message)(0xc0004372c0)({ - fullName: (string) (len=14) "UserOperations", - name: (string) (len=14) "UserOperations", + (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc00037b180)({ + fullName: (string) (len=20) "LnurlPayInfoResponse", + name: (string) (len=20) "LnurlPayInfoResponse", + fields: ([]*main.Field) (len=7 cap=8) { + (*main.Field)(0xc00008de30)({ + 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)(0xc00008de60)({ + 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)(0xc0001f8000)({ + 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)(0xc0001f8030)({ + 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)(0xc0001f8060)({ + name: (string) (len=8) "metadata", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f8090)({ + name: (string) (len=11) "allowsNostr", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f8630)({ + name: (string) (len=11) "nostrPubkey", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=11) "Application": (*main.Message)(0xc00037aa00)({ + fullName: (string) (len=11) "Application", + name: (string) (len=11) "Application", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc00048de60)({ + 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)(0xc00048de90)({ + name: (string) (len=2) "id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00048dec0)({ + name: (string) (len=7) "balance", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00048def0)({ + name: (string) (len=4) "npub", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=26) "GetAppUserLNURLInfoRequest": (*main.Message)(0xc00037ac80)({ + fullName: (string) (len=26) "GetAppUserLNURLInfoRequest", + name: (string) (len=26) "GetAppUserLNURLInfoRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00008d140)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d170)({ + name: (string) (len=17) "base_url_override", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "SetMockAppBalanceRequest": (*main.Message)(0xc00037ad00)({ + fullName: (string) (len=24) "SetMockAppBalanceRequest", + name: (string) (len=24) "SetMockAppBalanceRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00008d200)({ + 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=18) "PayInvoiceResponse": (*main.Message)(0xc00037afc0)({ + fullName: (string) (len=18) "PayInvoiceResponse", + name: (string) (len=18) "PayInvoiceResponse", + fields: ([]*main.Field) (len=5 cap=8) { + (*main.Field)(0xc00008d530)({ + name: (string) (len=8) "preimage", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d560)({ + name: (string) (len=11) "amount_paid", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d590)({ + name: (string) (len=12) "operation_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d5c0)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d5f0)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc00037b000)({ + fullName: (string) (len=18) "OpenChannelRequest", + name: (string) (len=18) "OpenChannelRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc00008d620)({ + 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)(0xc00008d650)({ + 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)(0xc00008d680)({ + 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)(0xc00008d830)({ + 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=13) "AddAppRequest": (*main.Message)(0xc00037a980)({ + fullName: (string) (len=13) "AddAppRequest", + name: (string) (len=13) "AddAppRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00048dda0)({ + 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)(0xc00048ddd0)({ + name: (string) (len=19) "allow_user_creation", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "AddAppUserRequest": (*main.Message)(0xc00037aa80)({ + fullName: (string) (len=17) "AddAppUserRequest", + name: (string) (len=17) "AddAppUserRequest", fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0001cdc50)({ - name: (string) (len=9) "fromIndex", + (*main.Field)(0xc00048df80)({ + name: (string) (len=10) "identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00048dfb0)({ + name: (string) (len=14) "fail_if_exists", + kind: (string) (len=4) "bool", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008c1e0)({ + 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)(0xc00037ad40)({ + fullName: (string) (len=17) "NewAddressRequest", + name: (string) (len=17) "NewAddressRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00008d230)({ + name: (string) (len=11) "addressType", + kind: (string) (len=11) "AddressType", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc00037af40)({ + fullName: (string) (len=17) "PayInvoiceRequest", + name: (string) (len=17) "PayInvoiceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00008d4d0)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d500)({ + 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=21) "DecodeInvoiceResponse": (*main.Message)(0xc00037af00)({ + fullName: (string) (len=21) "DecodeInvoiceResponse", + name: (string) (len=21) "DecodeInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00008d4a0)({ + 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=8) "UserInfo": (*main.Message)(0xc00037b200)({ + fullName: (string) (len=8) "UserInfo", + name: (string) (len=8) "UserInfo", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0001f86c0)({ + 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)(0xc0001f87e0)({ + name: (string) (len=7) "balance", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2494,8 +1804,23 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdc80)({ - name: (string) (len=7) "toIndex", + (*main.Field)(0xc0001f8810)({ + name: (string) (len=16) "max_withdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "GetUserOperationsRequest": (*main.Message)(0xc00037b280)({ + fullName: (string) (len=24) "GetUserOperationsRequest", + name: (string) (len=24) "GetUserOperationsRequest", + fields: ([]*main.Field) (len=6 cap=8) { + (*main.Field)(0xc0001f8840)({ + name: (string) (len=21) "latestIncomingInvoice", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, @@ -2503,9 +1828,309 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0001cdcb0)({ - name: (string) (len=10) "operations", - kind: (string) (len=13) "UserOperation", + (*main.Field)(0xc0001f8870)({ + 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)(0xc0001f8a20)({ + 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)(0xc0001f8a50)({ + name: (string) (len=16) "latestOutgoingTx", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f8a80)({ + name: (string) (len=31) "latestIncomingUserToUserPayment", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f8ab0)({ + name: (string) (len=31) "latestOutgoingUserToUserPayment", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=7) "Product": (*main.Message)(0xc00037b440)({ + fullName: (string) (len=7) "Product", + name: (string) (len=7) "Product", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0001f9e30)({ + name: (string) (len=2) "id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f9e60)({ + 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)(0xc0001f9e90)({ + name: (string) (len=10) "price_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=27) "SetMockInvoiceAsPaidRequest": (*main.Message)(0xc00037a900)({ + fullName: (string) (len=27) "SetMockInvoiceAsPaidRequest", + name: (string) (len=27) "SetMockInvoiceAsPaidRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00048dd10)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00048dd40)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "AddAppUserInvoiceRequest": (*main.Message)(0xc00037ab40)({ + fullName: (string) (len=24) "AddAppUserInvoiceRequest", + name: (string) (len=24) "AddAppUserInvoiceRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc00008c690)({ + name: (string) (len=19) "receiver_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008c6c0)({ + name: (string) (len=16) "payer_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008c750)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008cde0)({ + name: (string) (len=11) "invoice_req", + kind: (string) (len=17) "NewInvoiceRequest", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=34) "SendAppUserToAppUserPaymentRequest": (*main.Message)(0xc00037ac00)({ + fullName: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + name: (string) (len=34) "SendAppUserToAppUserPaymentRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc00008cf00)({ + name: (string) (len=20) "from_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008cf30)({ + name: (string) (len=18) "to_user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008cf60)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=20) "DecodeInvoiceRequest": (*main.Message)(0xc00037aec0)({ + fullName: (string) (len=20) "DecodeInvoiceRequest", + name: (string) (len=20) "DecodeInvoiceRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00008d470)({ + 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=18) "NewInvoiceResponse": (*main.Message)(0xc00037ae80)({ + fullName: (string) (len=18) "NewInvoiceResponse", + name: (string) (len=18) "NewInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00008d440)({ + 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=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc00037b100)({ + fullName: (string) (len=25) "LnurlWithdrawInfoResponse", + name: (string) (len=25) "LnurlWithdrawInfoResponse", + fields: ([]*main.Field) (len=8 cap=8) { + (*main.Field)(0xc00008d8f0)({ + 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)(0xc00008d920)({ + 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)(0xc00008dad0)({ + 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)(0xc00008db00)({ + 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)(0xc00008db30)({ + 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)(0xc00008db60)({ + 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)(0xc00008ddd0)({ + 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)(0xc00008de00)({ + 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)(0xc00037b1c0)({ + fullName: (string) (len=22) "HandleLnurlPayResponse", + name: (string) (len=22) "HandleLnurlPayResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0001f8660)({ + 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)(0xc0001f8690)({ + name: (string) (len=6) "routes", + kind: (string) (len=5) "Empty", isMap: (bool) false, isArray: (bool) true, isEnum: (bool) false, @@ -2514,11 +2139,86 @@ }) } }), - (string) (len=15) "MigrationUpdate": (*main.Message)(0xc000437480)({ + (string) (len=25) "GetUserOperationsResponse": (*main.Message)(0xc00037b3c0)({ + fullName: (string) (len=25) "GetUserOperationsResponse", + name: (string) (len=25) "GetUserOperationsResponse", + fields: ([]*main.Field) (len=6 cap=8) { + (*main.Field)(0xc0001f9860)({ + name: (string) (len=31) "latestOutgoingInvoiceOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f9890)({ + name: (string) (len=31) "latestIncomingInvoiceOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f98c0)({ + name: (string) (len=26) "latestOutgoingTxOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f98f0)({ + name: (string) (len=26) "latestIncomingTxOperations", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f9c50)({ + name: (string) (len=32) "latestOutgoingUserToUserPayemnts", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }), + (*main.Field)(0xc0001f9c80)({ + name: (string) (len=32) "latestIncomingUserToUserPayemnts", + kind: (string) (len=14) "UserOperations", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LiveUserOperation": (*main.Message)(0xc00037b4c0)({ + fullName: (string) (len=17) "LiveUserOperation", + name: (string) (len=17) "LiveUserOperation", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0002feab0)({ + name: (string) (len=9) "operation", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "MigrationUpdate": (*main.Message)(0xc00037b500)({ fullName: (string) (len=15) "MigrationUpdate", name: (string) (len=15) "MigrationUpdate", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0001cdf50)({ + (*main.Field)(0xc0002feae0)({ name: (string) (len=7) "closure", kind: (string) (len=16) "ClosureMigration", isMap: (bool) false, @@ -2527,7 +2227,7 @@ isMessage: (bool) true, isOptional: (bool) true }), - (*main.Field)(0xc0001cdf80)({ + (*main.Field)(0xc0001b0000)({ name: (string) (len=6) "relays", kind: (string) (len=15) "RelaysMigration", isMap: (bool) false, @@ -2538,11 +2238,236 @@ }) } }), - (string) (len=16) "ClosureMigration": (*main.Message)(0xc0004374c0)({ + (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc00037a8c0)({ + fullName: (string) (len=17) "LndGetInfoRequest", + name: (string) (len=17) "LndGetInfoRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00048dce0)({ + 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) "LndGetInfoResponse": (*main.Message)(0xc00037a940)({ + fullName: (string) (len=18) "LndGetInfoResponse", + name: (string) (len=18) "LndGetInfoResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00048dd70)({ + 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) "GetAppUserRequest": (*main.Message)(0xc00037ab80)({ + fullName: (string) (len=17) "GetAppUserRequest", + name: (string) (len=17) "GetAppUserRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00008ce10)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayAddressRequest": (*main.Message)(0xc00037adc0)({ + fullName: (string) (len=17) "PayAddressRequest", + name: (string) (len=17) "PayAddressRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc00008d290)({ + 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)(0xc00008d2c0)({ + 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)(0xc00008d2f0)({ + name: (string) (len=12) "satsPerVByte", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "PayAddressResponse": (*main.Message)(0xc00037ae00)({ + fullName: (string) (len=18) "PayAddressResponse", + name: (string) (len=18) "PayAddressResponse", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc00008d320)({ + name: (string) (len=4) "txId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d350)({ + name: (string) (len=12) "operation_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d380)({ + name: (string) (len=11) "service_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d3b0)({ + name: (string) (len=11) "network_fee", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc00037ae40)({ + fullName: (string) (len=17) "NewInvoiceRequest", + name: (string) (len=17) "NewInvoiceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00008d3e0)({ + name: (string) (len=10) "amountSats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008d410)({ + name: (string) (len=4) "memo", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "UserOperations": (*main.Message)(0xc00037b340)({ + fullName: (string) (len=14) "UserOperations", + name: (string) (len=14) "UserOperations", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0001f9650)({ + 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)(0xc0001f9680)({ + 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)(0xc0001f96b0)({ + name: (string) (len=10) "operations", + kind: (string) (len=13) "UserOperation", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "AddProductRequest": (*main.Message)(0xc00037b400)({ + fullName: (string) (len=17) "AddProductRequest", + name: (string) (len=17) "AddProductRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0001f9cb0)({ + 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)(0xc0001f9ce0)({ + name: (string) (len=10) "price_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc00037b080)({ + fullName: (string) (len=17) "LnurlLinkResponse", + name: (string) (len=17) "LnurlLinkResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00008d890)({ + 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)(0xc00008d8c0)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=16) "ClosureMigration": (*main.Message)(0xc00037b540)({ fullName: (string) (len=16) "ClosureMigration", name: (string) (len=16) "ClosureMigration", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0001cdfb0)({ + (*main.Field)(0xc0001b0030)({ name: (string) (len=14) "closes_at_unix", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -2552,6 +2477,111 @@ isOptional: (bool) false }) } + }), + (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc00037a880)({ + fullName: (string) (len=25) "EncryptionExchangeRequest", + name: (string) (len=25) "EncryptionExchangeRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc00048dc80)({ + 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)(0xc00048dcb0)({ + 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=20) "AddAppInvoiceRequest": (*main.Message)(0xc00037ab00)({ + fullName: (string) (len=20) "AddAppInvoiceRequest", + name: (string) (len=20) "AddAppInvoiceRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc00008c300)({ + name: (string) (len=16) "payer_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008c330)({ + name: (string) (len=17) "http_callback_url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008c570)({ + name: (string) (len=11) "invoice_req", + kind: (string) (len=17) "NewInvoiceRequest", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false + }) + } + }), + (string) (len=24) "PayAppUserInvoiceRequest": (*main.Message)(0xc00037abc0)({ + fullName: (string) (len=24) "PayAppUserInvoiceRequest", + name: (string) (len=24) "PayAppUserInvoiceRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc00008ce40)({ + name: (string) (len=15) "user_identifier", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008ce70)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc00008ced0)({ + 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=18) "NewAddressResponse": (*main.Message)(0xc00037ad80)({ + fullName: (string) (len=18) "NewAddressResponse", + name: (string) (len=18) "NewAddressResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc00008d260)({ + 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 + }) + } }) } diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index 6001be94..08e87ce8 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -156,6 +156,17 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { if (overrides.HandleLnurlPay_Override) await overrides.HandleLnurlPay_Override(res, response); else 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.HandleLnurlAddress) throw new Error('method: HandleLnurlAddress is not implemented') + app.get('/.well-known/lnurlp/:address_name', async (req, res) => { + try { + if (!methods.HandleLnurlAddress) throw new Error('method: HandleLnurlAddress is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + const query = req.query + const params = req.params + const response = await methods.HandleLnurlAddress({ ...authContext, ...query, ...params }) + if (overrides.HandleLnurlAddress_Override) await overrides.HandleLnurlAddress_Override(res, response); else 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.GetApp) throw new Error('method: GetApp is not implemented') app.post('/api/app/get', async (req, res) => { try { @@ -495,6 +506,7 @@ export type MethodsOverride = { HandleLnurlWithdraw_Override?: (httpRes:Response) => Promise GetLnurlPayInfo_Override?: (httpRes:Response, handlerRes:Types.LnurlPayInfoResponse) => Promise HandleLnurlPay_Override?: (httpRes:Response, handlerRes:Types.HandleLnurlPayResponse) => Promise + HandleLnurlAddress_Override?: (httpRes:Response, handlerRes:Types.LnurlPayInfoResponse) => Promise GetApp_Override?: (httpRes:Response, handlerRes:Types.Application) => Promise AddAppUser_Override?: (httpRes:Response, handlerRes:Types.AppUser) => Promise AddAppInvoice_Override?: (httpRes:Response, handlerRes:Types.NewInvoiceResponse) => Promise diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index 3bc2b7b5..7b762d8e 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -151,6 +151,21 @@ export default (params: ClientParams) => ({ } return { status: 'ERROR', reason: 'invalid response' } }, + HandleLnurlAddress: async (routeParams: Types.HandleLnurlAddress_RouteParams): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/.well-known/lnurlp/:address_name' + finalRoute = finalRoute.replace(':address_name', routeParams['address_name']) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlPayInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, GetApp: async (): Promise => { const auth = await params.retrieveAppAuth() if (auth === null) throw new Error('retrieveAppAuth() returned null') diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index a70623f7..94a7f912 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -73,6 +73,12 @@ export type HandleLnurlPay_Query = { export type HandleLnurlPay_RouteParams = { } export type HandleLnurlPay_Context = HandleLnurlPay_Query & HandleLnurlPay_RouteParams & GuestContext +export type HandleLnurlAddress_Query = { +} +export type HandleLnurlAddress_RouteParams = { + address_name: string +} +export type HandleLnurlAddress_Context = HandleLnurlAddress_Query & HandleLnurlAddress_RouteParams & GuestContext export type GetApp_Query = { } export type GetApp_RouteParams = { @@ -215,6 +221,7 @@ export type ServerMethods = { HandleLnurlWithdraw?: (ctx: HandleLnurlWithdraw_Context) => Promise GetLnurlPayInfo?: (ctx: GetLnurlPayInfo_Context) => Promise HandleLnurlPay?: (ctx: HandleLnurlPay_Context) => Promise + HandleLnurlAddress?: (ctx: HandleLnurlAddress_Context) => Promise GetApp?: (ctx: GetApp_Context) => Promise AddAppUser?: (ctx: AddAppUser_Context, req: AddAppUserRequest) => Promise AddAppInvoice?: (ctx: AddAppInvoice_Context, req: AddAppInvoiceRequest) => Promise @@ -269,79 +276,48 @@ export type OptionsBaseMessage = { allOptionalsAreSet?: true } -export type RelaysMigration = { - relays: string[] -} -export const RelaysMigrationOptionalFields: [] = [] -export type RelaysMigrationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - relays_CustomCheck?: (v: string[]) => boolean -} -export const RelaysMigrationValidate = (o?: RelaysMigration, opts: RelaysMigrationOptions = {}, path: string = 'RelaysMigration::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!Array.isArray(o.relays)) return new Error(`${path}.relays: is not an array`) - for (let index = 0; index < o.relays.length; index++) { - if (typeof o.relays[index] !== 'string') return new Error(`${path}.relays[${index}]: is not a string`) - } - if (opts.relays_CustomCheck && !opts.relays_CustomCheck(o.relays)) return new Error(`${path}.relays: custom check failed`) - - return null -} - -export type SetMockInvoiceAsPaidRequest = { - invoice: string - amount: number -} -export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] -export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockInvoiceAsPaidRequestValidate = (o?: SetMockInvoiceAsPaidRequest, opts: SetMockInvoiceAsPaidRequestOptions = {}, path: string = 'SetMockInvoiceAsPaidRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type Application = { - name: string - id: string +export type AddAppUserRequest = { + identifier: string + fail_if_exists: boolean balance: number - npub: string } -export const ApplicationOptionalFields: [] = [] -export type ApplicationOptions = OptionsBaseMessage & { +export const AddAppUserRequestOptionalFields: [] = [] +export type AddAppUserRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - id_CustomCheck?: (v: string) => boolean + identifier_CustomCheck?: (v: string) => boolean + fail_if_exists_CustomCheck?: (v: boolean) => boolean balance_CustomCheck?: (v: number) => boolean - npub_CustomCheck?: (v: string) => boolean } -export const ApplicationValidate = (o?: Application, opts: ApplicationOptions = {}, path: string = 'Application::root.'): Error | null => { +export const AddAppUserRequestValidate = (o?: AddAppUserRequest, opts: AddAppUserRequestOptions = {}, path: string = 'AddAppUserRequest::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.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.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) - if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) + if (typeof o.fail_if_exists !== 'boolean') return new Error(`${path}.fail_if_exists: is not a boolean`) + if (opts.fail_if_exists_CustomCheck && !opts.fail_if_exists_CustomCheck(o.fail_if_exists)) return new Error(`${path}.fail_if_exists: custom check failed`) if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - if (typeof o.npub !== 'string') return new Error(`${path}.npub: is not a string`) - if (opts.npub_CustomCheck && !opts.npub_CustomCheck(o.npub)) return new Error(`${path}.npub: custom check failed`) + return null +} + +export type NewAddressRequest = { + addressType: AddressType +} +export const NewAddressRequestOptionalFields: [] = [] +export type NewAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + addressType_CustomCheck?: (v: AddressType) => boolean +} +export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`) + if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`) return null } @@ -369,326 +345,62 @@ export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoic return null } -export type LiveUserOperation = { - operation: UserOperation +export type OpenChannelRequest = { + destination: string + fundingAmount: number + pushAmount: number + closeAddress: string } -export const LiveUserOperationOptionalFields: [] = [] -export type LiveUserOperationOptions = OptionsBaseMessage & { +export const OpenChannelRequestOptionalFields: [] = [] +export type OpenChannelRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - operation_Options?: UserOperationOptions + destination_CustomCheck?: (v: string) => boolean + fundingAmount_CustomCheck?: (v: number) => boolean + pushAmount_CustomCheck?: (v: number) => boolean + closeAddress_CustomCheck?: (v: string) => boolean } -export const LiveUserOperationValidate = (o?: LiveUserOperation, opts: LiveUserOperationOptions = {}, path: string = 'LiveUserOperation::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') - const operationErr = UserOperationValidate(o.operation, opts.operation_Options, `${path}.operation`) - if (operationErr !== null) return operationErr - + 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 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 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 UserOperation = { - paidAtUnix: number - type: UserOperationType - inbound: boolean - amount: number - identifier: string - operationId: string - service_fee: number - network_fee: number - confirmed: boolean -} -export const UserOperationOptionalFields: [] = [] -export type UserOperationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - paidAtUnix_CustomCheck?: (v: number) => boolean - type_CustomCheck?: (v: UserOperationType) => boolean - inbound_CustomCheck?: (v: boolean) => boolean - amount_CustomCheck?: (v: number) => boolean - identifier_CustomCheck?: (v: string) => boolean - operationId_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean - confirmed_CustomCheck?: (v: boolean) => boolean -} -export const UserOperationValidate = (o?: UserOperation, opts: UserOperationOptions = {}, path: string = 'UserOperation::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.paidAtUnix !== 'number') return new Error(`${path}.paidAtUnix: is not a number`) - if (opts.paidAtUnix_CustomCheck && !opts.paidAtUnix_CustomCheck(o.paidAtUnix)) return new Error(`${path}.paidAtUnix: custom check failed`) - - if (!enumCheckUserOperationType(o.type)) return new Error(`${path}.type: is not a valid UserOperationType`) - if (opts.type_CustomCheck && !opts.type_CustomCheck(o.type)) return new Error(`${path}.type: custom check failed`) - - if (typeof o.inbound !== 'boolean') return new Error(`${path}.inbound: is not a boolean`) - if (opts.inbound_CustomCheck && !opts.inbound_CustomCheck(o.inbound)) return new Error(`${path}.inbound: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - if (typeof o.operationId !== 'string') return new Error(`${path}.operationId: is not a string`) - if (opts.operationId_CustomCheck && !opts.operationId_CustomCheck(o.operationId)) return new Error(`${path}.operationId: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - if (typeof o.confirmed !== 'boolean') return new Error(`${path}.confirmed: is not a boolean`) - if (opts.confirmed_CustomCheck && !opts.confirmed_CustomCheck(o.confirmed)) return new Error(`${path}.confirmed: custom check failed`) - - 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 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 MigrationUpdate = { - closure?: ClosureMigration - relays?: RelaysMigration -} -export type MigrationUpdateOptionalField = 'closure' | 'relays' -export const MigrationUpdateOptionalFields: MigrationUpdateOptionalField[] = ['closure', 'relays'] -export type MigrationUpdateOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: MigrationUpdateOptionalField[] - closure_Options?: ClosureMigrationOptions - relays_Options?: RelaysMigrationOptions -} -export const MigrationUpdateValidate = (o?: MigrationUpdate, opts: MigrationUpdateOptions = {}, path: string = 'MigrationUpdate::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.closure === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('closure')) { - const closureErr = ClosureMigrationValidate(o.closure, opts.closure_Options, `${path}.closure`) - if (closureErr !== null) return closureErr - } - - - if (typeof o.relays === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('relays')) { - const relaysErr = RelaysMigrationValidate(o.relays, opts.relays_Options, `${path}.relays`) - if (relaysErr !== null) return relaysErr - } - - - return null -} - -export type ClosureMigration = { - closes_at_unix: number -} -export const ClosureMigrationOptionalFields: [] = [] -export type ClosureMigrationOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - closes_at_unix_CustomCheck?: (v: number) => boolean -} -export const ClosureMigrationValidate = (o?: ClosureMigration, opts: ClosureMigrationOptions = {}, path: string = 'ClosureMigration::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.closes_at_unix !== 'number') return new Error(`${path}.closes_at_unix: is not a number`) - if (opts.closes_at_unix_CustomCheck && !opts.closes_at_unix_CustomCheck(o.closes_at_unix)) return new Error(`${path}.closes_at_unix: custom check failed`) - - return null -} - -export type AuthAppRequest = { +export type AddAppRequest = { name: string - allow_user_creation?: boolean + allow_user_creation: boolean } -export type AuthAppRequestOptionalField = 'allow_user_creation' -export const AuthAppRequestOptionalFields: AuthAppRequestOptionalField[] = ['allow_user_creation'] -export type AuthAppRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: AuthAppRequestOptionalField[] +export const AddAppRequestOptionalFields: [] = [] +export type AddAppRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] name_CustomCheck?: (v: string) => boolean - allow_user_creation_CustomCheck?: (v?: boolean) => boolean + allow_user_creation_CustomCheck?: (v: boolean) => boolean } -export const AuthAppRequestValidate = (o?: AuthAppRequest, opts: AuthAppRequestOptions = {}, path: string = 'AuthAppRequest::root.'): Error | null => { +export const AddAppRequestValidate = (o?: AddAppRequest, opts: AddAppRequestOptions = {}, path: string = 'AddAppRequest::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - if ((o.allow_user_creation || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('allow_user_creation')) && typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) + if (typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) return null } -export type SendAppUserToAppPaymentRequest = { - from_user_identifier: string - amount: number -} -export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] -export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - from_user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SendAppUserToAppPaymentRequestValidate = (o?: SendAppUserToAppPaymentRequest, opts: SendAppUserToAppPaymentRequestOptions = {}, path: string = 'SendAppUserToAppPaymentRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) - if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type PayAddressResponse = { - txId: string - operation_id: string - service_fee: number - network_fee: number -} -export const PayAddressResponseOptionalFields: [] = [] -export type PayAddressResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - txId_CustomCheck?: (v: string) => boolean - operation_id_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean -} -export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.txId !== 'string') return new Error(`${path}.txId: is not a string`) - if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`) - - if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) - if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - return null -} - -export type Product = { - id: string - name: string - price_sats: number -} -export const ProductOptionalFields: [] = [] -export type ProductOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - id_CustomCheck?: (v: string) => boolean - name_CustomCheck?: (v: string) => boolean - price_sats_CustomCheck?: (v: number) => boolean -} -export const ProductValidate = (o?: Product, opts: ProductOptions = {}, path: string = 'Product::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) - if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) - if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) - - return null -} - export type AddAppUserInvoiceRequest = { receiver_identifier: string payer_identifier: string @@ -723,129 +435,6 @@ export const AddAppUserInvoiceRequestValidate = (o?: AddAppUserInvoiceRequest, o return null } -export type SetMockAppBalanceRequest = { - amount: number -} -export const SetMockAppBalanceRequestOptionalFields: [] = [] -export type SetMockAppBalanceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, opts: SetMockAppBalanceRequestOptions = {}, path: string = 'SetMockAppBalanceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type LnurlPayInfoResponse = { - tag: string - callback: string - maxSendable: number - minSendable: number - metadata: string - allowsNostr: boolean - nostrPubkey: string -} -export const LnurlPayInfoResponseOptionalFields: [] = [] -export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - tag_CustomCheck?: (v: string) => boolean - callback_CustomCheck?: (v: string) => boolean - maxSendable_CustomCheck?: (v: number) => boolean - minSendable_CustomCheck?: (v: number) => boolean - metadata_CustomCheck?: (v: string) => boolean - allowsNostr_CustomCheck?: (v: boolean) => boolean - nostrPubkey_CustomCheck?: (v: string) => boolean -} -export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) - if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) - - if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) - if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) - - if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`) - if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`) - - if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`) - if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`) - - if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`) - if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`) - - if (typeof o.allowsNostr !== 'boolean') return new Error(`${path}.allowsNostr: is not a boolean`) - if (opts.allowsNostr_CustomCheck && !opts.allowsNostr_CustomCheck(o.allowsNostr)) return new Error(`${path}.allowsNostr: custom check failed`) - - if (typeof o.nostrPubkey !== 'string') return new Error(`${path}.nostrPubkey: is not a string`) - if (opts.nostrPubkey_CustomCheck && !opts.nostrPubkey_CustomCheck(o.nostrPubkey)) return new Error(`${path}.nostrPubkey: custom check failed`) - - return null -} - -export type AddAppInvoiceRequest = { - payer_identifier: string - http_callback_url: string - invoice_req: NewInvoiceRequest -} -export const AddAppInvoiceRequestOptionalFields: [] = [] -export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - payer_identifier_CustomCheck?: (v: string) => boolean - http_callback_url_CustomCheck?: (v: string) => boolean - invoice_req_Options?: NewInvoiceRequestOptions -} -export const AddAppInvoiceRequestValidate = (o?: AddAppInvoiceRequest, opts: AddAppInvoiceRequestOptions = {}, path: string = 'AddAppInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) - if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) - - if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) - if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) - - const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) - if (invoice_reqErr !== null) return invoice_reqErr - - - return null -} - -export type PayAppUserInvoiceRequest = { - user_identifier: string - invoice: string - amount: number -} -export const PayAppUserInvoiceRequestOptionalFields: [] = [] -export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - invoice_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const PayAppUserInvoiceRequestValidate = (o?: PayAppUserInvoiceRequest, opts: PayAppUserInvoiceRequestOptions = {}, path: string = 'PayAppUserInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - export type SendAppUserToAppUserPaymentRequest = { from_user_identifier: string to_user_identifier: string @@ -874,146 +463,6 @@ export const SendAppUserToAppUserPaymentRequestValidate = (o?: SendAppUserToAppU return null } -export type GetAppUserLNURLInfoRequest = { - user_identifier: string - base_url_override: string -} -export const GetAppUserLNURLInfoRequestOptionalFields: [] = [] -export type GetAppUserLNURLInfoRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - base_url_override_CustomCheck?: (v: string) => boolean -} -export const GetAppUserLNURLInfoRequestValidate = (o?: GetAppUserLNURLInfoRequest, opts: GetAppUserLNURLInfoRequestOptions = {}, path: string = 'GetAppUserLNURLInfoRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.base_url_override !== 'string') return new Error(`${path}.base_url_override: is not a string`) - if (opts.base_url_override_CustomCheck && !opts.base_url_override_CustomCheck(o.base_url_override)) return new Error(`${path}.base_url_override: custom check failed`) - - return null -} - -export type SetMockAppUserBalanceRequest = { - user_identifier: string - amount: number -} -export const SetMockAppUserBalanceRequestOptionalFields: [] = [] -export type SetMockAppUserBalanceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_identifier_CustomCheck?: (v: string) => boolean - amount_CustomCheck?: (v: number) => boolean -} -export const SetMockAppUserBalanceRequestValidate = (o?: SetMockAppUserBalanceRequest, opts: SetMockAppUserBalanceRequestOptions = {}, path: string = 'SetMockAppUserBalanceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) - if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) - - if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) - if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) - - return null -} - -export type 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 AuthApp = { - app: Application - auth_token: string -} -export const AuthAppOptionalFields: [] = [] -export type AuthAppOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - app_Options?: ApplicationOptions - auth_token_CustomCheck?: (v: string) => boolean -} -export const AuthAppValidate = (o?: AuthApp, opts: AuthAppOptions = {}, path: string = 'AuthApp::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) - if (appErr !== null) return appErr - - - if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) - if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) - - return null -} - -export type AppUser = { - identifier: string - info: UserInfo - max_withdrawable: number -} -export const AppUserOptionalFields: [] = [] -export type AppUserOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - identifier_CustomCheck?: (v: string) => boolean - info_Options?: UserInfoOptions - max_withdrawable_CustomCheck?: (v: number) => boolean -} -export const AppUserValidate = (o?: AppUser, opts: AppUserOptions = {}, path: string = 'AppUser::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) - if (infoErr !== null) return infoErr - - - if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) - if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) - - return null -} - -export type PayAddressRequest = { - address: string - amoutSats: number - satsPerVByte: number -} -export const PayAddressRequestOptionalFields: [] = [] -export type PayAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean - amoutSats_CustomCheck?: (v: number) => boolean - satsPerVByte_CustomCheck?: (v: number) => boolean -} -export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) - if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) - - if (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`) - if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`) - - if (typeof o.satsPerVByte !== 'number') return new Error(`${path}.satsPerVByte: is not a number`) - if (opts.satsPerVByte_CustomCheck && !opts.satsPerVByte_CustomCheck(o.satsPerVByte)) return new Error(`${path}.satsPerVByte: custom check failed`) - - return null -} - export type DecodeInvoiceRequest = { invoice: string } @@ -1032,266 +481,6 @@ export const DecodeInvoiceRequestValidate = (o?: DecodeInvoiceRequest, opts: Dec return null } -export type LnurlWithdrawInfoResponse = { - tag: string - callback: string - k1: string - defaultDescription: string - minWithdrawable: number - maxWithdrawable: number - balanceCheck: string - payLink: string -} -export const LnurlWithdrawInfoResponseOptionalFields: [] = [] -export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - tag_CustomCheck?: (v: string) => boolean - callback_CustomCheck?: (v: string) => boolean - k1_CustomCheck?: (v: string) => boolean - defaultDescription_CustomCheck?: (v: string) => boolean - minWithdrawable_CustomCheck?: (v: number) => boolean - maxWithdrawable_CustomCheck?: (v: number) => boolean - balanceCheck_CustomCheck?: (v: string) => boolean - payLink_CustomCheck?: (v: string) => boolean -} -export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) - if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) - - if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) - if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) - - if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) - if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) - - if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`) - if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`) - - if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`) - if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`) - - if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`) - if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`) - - if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`) - if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`) - - if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`) - if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`) - - return null -} - -export type PayInvoiceResponse = { - preimage: string - amount_paid: number - operation_id: string - service_fee: number - network_fee: number -} -export const PayInvoiceResponseOptionalFields: [] = [] -export type PayInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - preimage_CustomCheck?: (v: string) => boolean - amount_paid_CustomCheck?: (v: number) => boolean - operation_id_CustomCheck?: (v: string) => boolean - service_fee_CustomCheck?: (v: number) => boolean - network_fee_CustomCheck?: (v: number) => boolean -} -export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) - if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) - - if (typeof o.amount_paid !== 'number') return new Error(`${path}.amount_paid: is not a number`) - if (opts.amount_paid_CustomCheck && !opts.amount_paid_CustomCheck(o.amount_paid)) return new Error(`${path}.amount_paid: custom check failed`) - - if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) - if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) - - if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) - if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) - - if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) - if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) - - return null -} - -export type 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 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 GetUserOperationsResponse = { - latestOutgoingInvoiceOperations: UserOperations - latestIncomingInvoiceOperations: UserOperations - latestOutgoingTxOperations: UserOperations - latestIncomingTxOperations: UserOperations - latestOutgoingUserToUserPayemnts: UserOperations - latestIncomingUserToUserPayemnts: UserOperations -} -export const GetUserOperationsResponseOptionalFields: [] = [] -export type GetUserOperationsResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - latestOutgoingInvoiceOperations_Options?: UserOperationsOptions - latestIncomingInvoiceOperations_Options?: UserOperationsOptions - latestOutgoingTxOperations_Options?: UserOperationsOptions - latestIncomingTxOperations_Options?: UserOperationsOptions - latestOutgoingUserToUserPayemnts_Options?: UserOperationsOptions - latestIncomingUserToUserPayemnts_Options?: UserOperationsOptions -} -export const GetUserOperationsResponseValidate = (o?: GetUserOperationsResponse, opts: GetUserOperationsResponseOptions = {}, path: string = 'GetUserOperationsResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - const latestOutgoingInvoiceOperationsErr = UserOperationsValidate(o.latestOutgoingInvoiceOperations, opts.latestOutgoingInvoiceOperations_Options, `${path}.latestOutgoingInvoiceOperations`) - if (latestOutgoingInvoiceOperationsErr !== null) return latestOutgoingInvoiceOperationsErr - - - const latestIncomingInvoiceOperationsErr = UserOperationsValidate(o.latestIncomingInvoiceOperations, opts.latestIncomingInvoiceOperations_Options, `${path}.latestIncomingInvoiceOperations`) - if (latestIncomingInvoiceOperationsErr !== null) return latestIncomingInvoiceOperationsErr - - - const latestOutgoingTxOperationsErr = UserOperationsValidate(o.latestOutgoingTxOperations, opts.latestOutgoingTxOperations_Options, `${path}.latestOutgoingTxOperations`) - if (latestOutgoingTxOperationsErr !== null) return latestOutgoingTxOperationsErr - - - const latestIncomingTxOperationsErr = UserOperationsValidate(o.latestIncomingTxOperations, opts.latestIncomingTxOperations_Options, `${path}.latestIncomingTxOperations`) - if (latestIncomingTxOperationsErr !== null) return latestIncomingTxOperationsErr - - - const latestOutgoingUserToUserPayemntsErr = UserOperationsValidate(o.latestOutgoingUserToUserPayemnts, opts.latestOutgoingUserToUserPayemnts_Options, `${path}.latestOutgoingUserToUserPayemnts`) - if (latestOutgoingUserToUserPayemntsErr !== null) return latestOutgoingUserToUserPayemntsErr - - - const latestIncomingUserToUserPayemntsErr = UserOperationsValidate(o.latestIncomingUserToUserPayemnts, opts.latestIncomingUserToUserPayemnts_Options, `${path}.latestIncomingUserToUserPayemnts`) - if (latestIncomingUserToUserPayemntsErr !== null) return latestIncomingUserToUserPayemntsErr - - - return null -} - -export type AddProductRequest = { - name: string - price_sats: number -} -export const AddProductRequestOptionalFields: [] = [] -export type AddProductRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - price_sats_CustomCheck?: (v: number) => boolean -} -export const AddProductRequestValidate = (o?: AddProductRequest, opts: AddProductRequestOptions = {}, path: string = 'AddProductRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) - if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) - - return null -} - -export type NewAddressRequest = { - addressType: AddressType -} -export const NewAddressRequestOptionalFields: [] = [] -export type NewAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - addressType_CustomCheck?: (v: AddressType) => boolean -} -export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`) - if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`) - - return null -} - -export type 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 DecodeInvoiceResponse = { amount: number } @@ -1310,103 +499,6 @@ export const DecodeInvoiceResponseValidate = (o?: DecodeInvoiceResponse, opts: D 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 AddAppRequest = { - name: string - allow_user_creation: boolean -} -export const AddAppRequestOptionalFields: [] = [] -export type AddAppRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - allow_user_creation_CustomCheck?: (v: boolean) => boolean -} -export const AddAppRequestValidate = (o?: AddAppRequest, opts: AddAppRequestOptions = {}, path: string = 'AddAppRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) - - if (typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) - if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) - - return null -} - -export type AddAppUserRequest = { - identifier: string - fail_if_exists: boolean - balance: number -} -export const AddAppUserRequestOptionalFields: [] = [] -export type AddAppUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - identifier_CustomCheck?: (v: string) => boolean - fail_if_exists_CustomCheck?: (v: boolean) => boolean - balance_CustomCheck?: (v: number) => boolean -} -export const AddAppUserRequestValidate = (o?: AddAppUserRequest, opts: AddAppUserRequestOptions = {}, path: string = 'AddAppUserRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) - if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) - - if (typeof o.fail_if_exists !== 'boolean') return new Error(`${path}.fail_if_exists: is not a boolean`) - if (opts.fail_if_exists_CustomCheck && !opts.fail_if_exists_CustomCheck(o.fail_if_exists)) return new Error(`${path}.fail_if_exists: custom check failed`) - - if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) - if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) - - return null -} - -export type 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 UserInfo = { userId: string balance: number @@ -1478,20 +570,152 @@ export const GetUserOperationsRequestValidate = (o?: GetUserOperationsRequest, o return null } -export type GetProductBuyLinkResponse = { - link: string +export type Product = { + id: string + name: string + price_sats: number } -export const GetProductBuyLinkResponseOptionalFields: [] = [] -export type GetProductBuyLinkResponseOptions = OptionsBaseMessage & { +export const ProductOptionalFields: [] = [] +export type ProductOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - link_CustomCheck?: (v: string) => boolean + id_CustomCheck?: (v: string) => boolean + name_CustomCheck?: (v: string) => boolean + price_sats_CustomCheck?: (v: number) => boolean } -export const GetProductBuyLinkResponseValidate = (o?: GetProductBuyLinkResponse, opts: GetProductBuyLinkResponseOptions = {}, path: string = 'GetProductBuyLinkResponse::root.'): Error | null => { +export const ProductValidate = (o?: Product, opts: ProductOptions = {}, path: string = 'Product::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.link !== 'string') return new Error(`${path}.link: is not a string`) - if (opts.link_CustomCheck && !opts.link_CustomCheck(o.link)) return new Error(`${path}.link: custom check failed`) + if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) + if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) + if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) + + return null +} + +export type SetMockInvoiceAsPaidRequest = { + invoice: string + amount: number +} +export const SetMockInvoiceAsPaidRequestOptionalFields: [] = [] +export type SetMockInvoiceAsPaidRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockInvoiceAsPaidRequestValidate = (o?: SetMockInvoiceAsPaidRequest, opts: SetMockInvoiceAsPaidRequestOptions = {}, path: string = 'SetMockInvoiceAsPaidRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type LnurlWithdrawInfoResponse = { + tag: string + callback: string + k1: string + defaultDescription: string + minWithdrawable: number + maxWithdrawable: number + balanceCheck: string + payLink: string +} +export const LnurlWithdrawInfoResponseOptionalFields: [] = [] +export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean + defaultDescription_CustomCheck?: (v: string) => boolean + minWithdrawable_CustomCheck?: (v: number) => boolean + maxWithdrawable_CustomCheck?: (v: number) => boolean + balanceCheck_CustomCheck?: (v: string) => boolean + payLink_CustomCheck?: (v: string) => boolean +} +export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) + if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) + + if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`) + if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`) + + if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`) + if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`) + + if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`) + if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`) + + if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`) + if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`) + + if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`) + if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`) + + return null +} + +export type 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 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 } @@ -1532,6 +756,150 @@ export const GetAppUserRequestValidate = (o?: GetAppUserRequest, opts: GetAppUse return null } +export type PayAddressRequest = { + address: string + amoutSats: number + satsPerVByte: number +} +export const PayAddressRequestOptionalFields: [] = [] +export type PayAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean + amoutSats_CustomCheck?: (v: number) => boolean + satsPerVByte_CustomCheck?: (v: number) => boolean +} +export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) + if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) + + if (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`) + if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`) + + if (typeof o.satsPerVByte !== 'number') return new Error(`${path}.satsPerVByte: is not a number`) + if (opts.satsPerVByte_CustomCheck && !opts.satsPerVByte_CustomCheck(o.satsPerVByte)) return new Error(`${path}.satsPerVByte: custom check failed`) + + return null +} + +export type GetUserOperationsResponse = { + latestOutgoingInvoiceOperations: UserOperations + latestIncomingInvoiceOperations: UserOperations + latestOutgoingTxOperations: UserOperations + latestIncomingTxOperations: UserOperations + latestOutgoingUserToUserPayemnts: UserOperations + latestIncomingUserToUserPayemnts: UserOperations +} +export const GetUserOperationsResponseOptionalFields: [] = [] +export type GetUserOperationsResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + latestOutgoingInvoiceOperations_Options?: UserOperationsOptions + latestIncomingInvoiceOperations_Options?: UserOperationsOptions + latestOutgoingTxOperations_Options?: UserOperationsOptions + latestIncomingTxOperations_Options?: UserOperationsOptions + latestOutgoingUserToUserPayemnts_Options?: UserOperationsOptions + latestIncomingUserToUserPayemnts_Options?: UserOperationsOptions +} +export const GetUserOperationsResponseValidate = (o?: GetUserOperationsResponse, opts: GetUserOperationsResponseOptions = {}, path: string = 'GetUserOperationsResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + const latestOutgoingInvoiceOperationsErr = UserOperationsValidate(o.latestOutgoingInvoiceOperations, opts.latestOutgoingInvoiceOperations_Options, `${path}.latestOutgoingInvoiceOperations`) + if (latestOutgoingInvoiceOperationsErr !== null) return latestOutgoingInvoiceOperationsErr + + + const latestIncomingInvoiceOperationsErr = UserOperationsValidate(o.latestIncomingInvoiceOperations, opts.latestIncomingInvoiceOperations_Options, `${path}.latestIncomingInvoiceOperations`) + if (latestIncomingInvoiceOperationsErr !== null) return latestIncomingInvoiceOperationsErr + + + const latestOutgoingTxOperationsErr = UserOperationsValidate(o.latestOutgoingTxOperations, opts.latestOutgoingTxOperations_Options, `${path}.latestOutgoingTxOperations`) + if (latestOutgoingTxOperationsErr !== null) return latestOutgoingTxOperationsErr + + + const latestIncomingTxOperationsErr = UserOperationsValidate(o.latestIncomingTxOperations, opts.latestIncomingTxOperations_Options, `${path}.latestIncomingTxOperations`) + if (latestIncomingTxOperationsErr !== null) return latestIncomingTxOperationsErr + + + const latestOutgoingUserToUserPayemntsErr = UserOperationsValidate(o.latestOutgoingUserToUserPayemnts, opts.latestOutgoingUserToUserPayemnts_Options, `${path}.latestOutgoingUserToUserPayemnts`) + if (latestOutgoingUserToUserPayemntsErr !== null) return latestOutgoingUserToUserPayemntsErr + + + const latestIncomingUserToUserPayemntsErr = UserOperationsValidate(o.latestIncomingUserToUserPayemnts, opts.latestIncomingUserToUserPayemnts_Options, `${path}.latestIncomingUserToUserPayemnts`) + if (latestIncomingUserToUserPayemntsErr !== null) return latestIncomingUserToUserPayemntsErr + + + return null +} + +export type LiveUserOperation = { + operation: UserOperation +} +export const LiveUserOperationOptionalFields: [] = [] +export type LiveUserOperationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + operation_Options?: UserOperationOptions +} +export const LiveUserOperationValidate = (o?: LiveUserOperation, opts: LiveUserOperationOptions = {}, path: string = 'LiveUserOperation::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + const operationErr = UserOperationValidate(o.operation, opts.operation_Options, `${path}.operation`) + if (operationErr !== null) return operationErr + + + return null +} + +export type MigrationUpdate = { + closure?: ClosureMigration + relays?: RelaysMigration +} +export type MigrationUpdateOptionalField = 'closure' | 'relays' +export const MigrationUpdateOptionalFields: MigrationUpdateOptionalField[] = ['closure', 'relays'] +export type MigrationUpdateOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: MigrationUpdateOptionalField[] + closure_Options?: ClosureMigrationOptions + relays_Options?: RelaysMigrationOptions +} +export const MigrationUpdateValidate = (o?: MigrationUpdate, opts: MigrationUpdateOptions = {}, path: string = 'MigrationUpdate::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.closure === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('closure')) { + const closureErr = ClosureMigrationValidate(o.closure, opts.closure_Options, `${path}.closure`) + if (closureErr !== null) return closureErr + } + + + if (typeof o.relays === 'object' || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('relays')) { + const relaysErr = RelaysMigrationValidate(o.relays, opts.relays_Options, `${path}.relays`) + if (relaysErr !== null) return relaysErr + } + + + return null +} + +export type 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 NewInvoiceRequest = { amountSats: number memo: string @@ -1555,3 +923,642 @@ export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoic 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 AddProductRequest = { + name: string + price_sats: number +} +export const AddProductRequestOptionalFields: [] = [] +export type AddProductRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + price_sats_CustomCheck?: (v: number) => boolean +} +export const AddProductRequestValidate = (o?: AddProductRequest, opts: AddProductRequestOptions = {}, path: string = 'AddProductRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.price_sats !== 'number') return new Error(`${path}.price_sats: is not a number`) + if (opts.price_sats_CustomCheck && !opts.price_sats_CustomCheck(o.price_sats)) return new Error(`${path}.price_sats: custom check failed`) + + return null +} + +export type PayAddressResponse = { + txId: string + operation_id: string + service_fee: number + network_fee: number +} +export const PayAddressResponseOptionalFields: [] = [] +export type PayAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + txId_CustomCheck?: (v: string) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean +} +export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.txId !== 'string') return new Error(`${path}.txId: is not a string`) + if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`) + + if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) + if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + return null +} + +export type AddAppInvoiceRequest = { + payer_identifier: string + http_callback_url: string + invoice_req: NewInvoiceRequest +} +export const AddAppInvoiceRequestOptionalFields: [] = [] +export type AddAppInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + payer_identifier_CustomCheck?: (v: string) => boolean + http_callback_url_CustomCheck?: (v: string) => boolean + invoice_req_Options?: NewInvoiceRequestOptions +} +export const AddAppInvoiceRequestValidate = (o?: AddAppInvoiceRequest, opts: AddAppInvoiceRequestOptions = {}, path: string = 'AddAppInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.payer_identifier !== 'string') return new Error(`${path}.payer_identifier: is not a string`) + if (opts.payer_identifier_CustomCheck && !opts.payer_identifier_CustomCheck(o.payer_identifier)) return new Error(`${path}.payer_identifier: custom check failed`) + + if (typeof o.http_callback_url !== 'string') return new Error(`${path}.http_callback_url: is not a string`) + if (opts.http_callback_url_CustomCheck && !opts.http_callback_url_CustomCheck(o.http_callback_url)) return new Error(`${path}.http_callback_url: custom check failed`) + + const invoice_reqErr = NewInvoiceRequestValidate(o.invoice_req, opts.invoice_req_Options, `${path}.invoice_req`) + if (invoice_reqErr !== null) return invoice_reqErr + + + return null +} + +export type PayAppUserInvoiceRequest = { + user_identifier: string + invoice: string + amount: number +} +export const PayAppUserInvoiceRequestOptionalFields: [] = [] +export type PayAppUserInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const PayAppUserInvoiceRequestValidate = (o?: PayAppUserInvoiceRequest, opts: PayAppUserInvoiceRequestOptions = {}, path: string = 'PayAppUserInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type 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 ClosureMigration = { + closes_at_unix: number +} +export const ClosureMigrationOptionalFields: [] = [] +export type ClosureMigrationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + closes_at_unix_CustomCheck?: (v: number) => boolean +} +export const ClosureMigrationValidate = (o?: ClosureMigration, opts: ClosureMigrationOptions = {}, path: string = 'ClosureMigration::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.closes_at_unix !== 'number') return new Error(`${path}.closes_at_unix: is not a number`) + if (opts.closes_at_unix_CustomCheck && !opts.closes_at_unix_CustomCheck(o.closes_at_unix)) return new Error(`${path}.closes_at_unix: custom check failed`) + + return null +} + +export type 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 AuthAppRequest = { + name: string + allow_user_creation?: boolean +} +export type AuthAppRequestOptionalField = 'allow_user_creation' +export const AuthAppRequestOptionalFields: AuthAppRequestOptionalField[] = ['allow_user_creation'] +export type AuthAppRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: AuthAppRequestOptionalField[] + name_CustomCheck?: (v: string) => boolean + allow_user_creation_CustomCheck?: (v?: boolean) => boolean +} +export const AuthAppRequestValidate = (o?: AuthAppRequest, opts: AuthAppRequestOptions = {}, path: string = 'AuthAppRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if ((o.allow_user_creation || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('allow_user_creation')) && typeof o.allow_user_creation !== 'boolean') return new Error(`${path}.allow_user_creation: is not a boolean`) + if (opts.allow_user_creation_CustomCheck && !opts.allow_user_creation_CustomCheck(o.allow_user_creation)) return new Error(`${path}.allow_user_creation: custom check failed`) + + return null +} + +export type AuthApp = { + app: Application + auth_token: string +} +export const AuthAppOptionalFields: [] = [] +export type AuthAppOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + app_Options?: ApplicationOptions + auth_token_CustomCheck?: (v: string) => boolean +} +export const AuthAppValidate = (o?: AuthApp, opts: AuthAppOptions = {}, path: string = 'AuthApp::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + const appErr = ApplicationValidate(o.app, opts.app_Options, `${path}.app`) + if (appErr !== null) return appErr + + + if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) + if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) + + return null +} + +export type AppUser = { + identifier: string + info: UserInfo + max_withdrawable: number +} +export const AppUserOptionalFields: [] = [] +export type AppUserOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + identifier_CustomCheck?: (v: string) => boolean + info_Options?: UserInfoOptions + max_withdrawable_CustomCheck?: (v: number) => boolean +} +export const AppUserValidate = (o?: AppUser, opts: AppUserOptions = {}, path: string = 'AppUser::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + const infoErr = UserInfoValidate(o.info, opts.info_Options, `${path}.info`) + if (infoErr !== null) return infoErr + + + if (typeof o.max_withdrawable !== 'number') return new Error(`${path}.max_withdrawable: is not a number`) + if (opts.max_withdrawable_CustomCheck && !opts.max_withdrawable_CustomCheck(o.max_withdrawable)) return new Error(`${path}.max_withdrawable: custom check failed`) + + return null +} + +export type SendAppUserToAppPaymentRequest = { + from_user_identifier: string + amount: number +} +export const SendAppUserToAppPaymentRequestOptionalFields: [] = [] +export type SendAppUserToAppPaymentRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + from_user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SendAppUserToAppPaymentRequestValidate = (o?: SendAppUserToAppPaymentRequest, opts: SendAppUserToAppPaymentRequestOptions = {}, path: string = 'SendAppUserToAppPaymentRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.from_user_identifier !== 'string') return new Error(`${path}.from_user_identifier: is not a string`) + if (opts.from_user_identifier_CustomCheck && !opts.from_user_identifier_CustomCheck(o.from_user_identifier)) return new Error(`${path}.from_user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type SetMockAppUserBalanceRequest = { + user_identifier: string + amount: number +} +export const SetMockAppUserBalanceRequestOptionalFields: [] = [] +export type SetMockAppUserBalanceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockAppUserBalanceRequestValidate = (o?: SetMockAppUserBalanceRequest, opts: SetMockAppUserBalanceRequestOptions = {}, path: string = 'SetMockAppUserBalanceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type UserOperation = { + paidAtUnix: number + type: UserOperationType + inbound: boolean + amount: number + identifier: string + operationId: string + service_fee: number + network_fee: number + confirmed: boolean +} +export const UserOperationOptionalFields: [] = [] +export type UserOperationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + paidAtUnix_CustomCheck?: (v: number) => boolean + type_CustomCheck?: (v: UserOperationType) => boolean + inbound_CustomCheck?: (v: boolean) => boolean + amount_CustomCheck?: (v: number) => boolean + identifier_CustomCheck?: (v: string) => boolean + operationId_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean + confirmed_CustomCheck?: (v: boolean) => boolean +} +export const UserOperationValidate = (o?: UserOperation, opts: UserOperationOptions = {}, path: string = 'UserOperation::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.paidAtUnix !== 'number') return new Error(`${path}.paidAtUnix: is not a number`) + if (opts.paidAtUnix_CustomCheck && !opts.paidAtUnix_CustomCheck(o.paidAtUnix)) return new Error(`${path}.paidAtUnix: custom check failed`) + + if (!enumCheckUserOperationType(o.type)) return new Error(`${path}.type: is not a valid UserOperationType`) + if (opts.type_CustomCheck && !opts.type_CustomCheck(o.type)) return new Error(`${path}.type: custom check failed`) + + if (typeof o.inbound !== 'boolean') return new Error(`${path}.inbound: is not a boolean`) + if (opts.inbound_CustomCheck && !opts.inbound_CustomCheck(o.inbound)) return new Error(`${path}.inbound: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + if (typeof o.identifier !== 'string') return new Error(`${path}.identifier: is not a string`) + if (opts.identifier_CustomCheck && !opts.identifier_CustomCheck(o.identifier)) return new Error(`${path}.identifier: custom check failed`) + + if (typeof o.operationId !== 'string') return new Error(`${path}.operationId: is not a string`) + if (opts.operationId_CustomCheck && !opts.operationId_CustomCheck(o.operationId)) return new Error(`${path}.operationId: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + if (typeof o.confirmed !== 'boolean') return new Error(`${path}.confirmed: is not a boolean`) + if (opts.confirmed_CustomCheck && !opts.confirmed_CustomCheck(o.confirmed)) return new Error(`${path}.confirmed: custom check failed`) + + return null +} + +export type GetProductBuyLinkResponse = { + link: string +} +export const GetProductBuyLinkResponseOptionalFields: [] = [] +export type GetProductBuyLinkResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + link_CustomCheck?: (v: string) => boolean +} +export const GetProductBuyLinkResponseValidate = (o?: GetProductBuyLinkResponse, opts: GetProductBuyLinkResponseOptions = {}, path: string = 'GetProductBuyLinkResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.link !== 'string') return new Error(`${path}.link: is not a string`) + if (opts.link_CustomCheck && !opts.link_CustomCheck(o.link)) return new Error(`${path}.link: custom check failed`) + + return null +} + +export type 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 RelaysMigration = { + relays: string[] +} +export const RelaysMigrationOptionalFields: [] = [] +export type RelaysMigrationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + relays_CustomCheck?: (v: string[]) => boolean +} +export const RelaysMigrationValidate = (o?: RelaysMigration, opts: RelaysMigrationOptions = {}, path: string = 'RelaysMigration::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (!Array.isArray(o.relays)) return new Error(`${path}.relays: is not an array`) + for (let index = 0; index < o.relays.length; index++) { + if (typeof o.relays[index] !== 'string') return new Error(`${path}.relays[${index}]: is not a string`) + } + if (opts.relays_CustomCheck && !opts.relays_CustomCheck(o.relays)) return new Error(`${path}.relays: custom check failed`) + + return null +} + +export type GetAppUserLNURLInfoRequest = { + user_identifier: string + base_url_override: string +} +export const GetAppUserLNURLInfoRequestOptionalFields: [] = [] +export type GetAppUserLNURLInfoRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_identifier_CustomCheck?: (v: string) => boolean + base_url_override_CustomCheck?: (v: string) => boolean +} +export const GetAppUserLNURLInfoRequestValidate = (o?: GetAppUserLNURLInfoRequest, opts: GetAppUserLNURLInfoRequestOptions = {}, path: string = 'GetAppUserLNURLInfoRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_identifier !== 'string') return new Error(`${path}.user_identifier: is not a string`) + if (opts.user_identifier_CustomCheck && !opts.user_identifier_CustomCheck(o.user_identifier)) return new Error(`${path}.user_identifier: custom check failed`) + + if (typeof o.base_url_override !== 'string') return new Error(`${path}.base_url_override: is not a string`) + if (opts.base_url_override_CustomCheck && !opts.base_url_override_CustomCheck(o.base_url_override)) return new Error(`${path}.base_url_override: custom check failed`) + + return null +} + +export type SetMockAppBalanceRequest = { + amount: number +} +export const SetMockAppBalanceRequestOptionalFields: [] = [] +export type SetMockAppBalanceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amount_CustomCheck?: (v: number) => boolean +} +export const SetMockAppBalanceRequestValidate = (o?: SetMockAppBalanceRequest, opts: SetMockAppBalanceRequestOptions = {}, path: string = 'SetMockAppBalanceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type PayInvoiceResponse = { + preimage: string + amount_paid: number + operation_id: string + service_fee: number + network_fee: number +} +export const PayInvoiceResponseOptionalFields: [] = [] +export type PayInvoiceResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + preimage_CustomCheck?: (v: string) => boolean + amount_paid_CustomCheck?: (v: number) => boolean + operation_id_CustomCheck?: (v: string) => boolean + service_fee_CustomCheck?: (v: number) => boolean + network_fee_CustomCheck?: (v: number) => boolean +} +export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) + if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) + + if (typeof o.amount_paid !== 'number') return new Error(`${path}.amount_paid: is not a number`) + if (opts.amount_paid_CustomCheck && !opts.amount_paid_CustomCheck(o.amount_paid)) return new Error(`${path}.amount_paid: custom check failed`) + + if (typeof o.operation_id !== 'string') return new Error(`${path}.operation_id: is not a string`) + if (opts.operation_id_CustomCheck && !opts.operation_id_CustomCheck(o.operation_id)) return new Error(`${path}.operation_id: custom check failed`) + + if (typeof o.service_fee !== 'number') return new Error(`${path}.service_fee: is not a number`) + if (opts.service_fee_CustomCheck && !opts.service_fee_CustomCheck(o.service_fee)) return new Error(`${path}.service_fee: custom check failed`) + + if (typeof o.network_fee !== 'number') return new Error(`${path}.network_fee: is not a number`) + if (opts.network_fee_CustomCheck && !opts.network_fee_CustomCheck(o.network_fee)) return new Error(`${path}.network_fee: custom check failed`) + + return null +} + +export type 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 + allowsNostr: boolean + nostrPubkey: string +} +export const LnurlPayInfoResponseOptionalFields: [] = [] +export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + maxSendable_CustomCheck?: (v: number) => boolean + minSendable_CustomCheck?: (v: number) => boolean + metadata_CustomCheck?: (v: string) => boolean + allowsNostr_CustomCheck?: (v: boolean) => boolean + nostrPubkey_CustomCheck?: (v: string) => boolean +} +export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`) + if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`) + + if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`) + if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`) + + if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`) + if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`) + + if (typeof o.allowsNostr !== 'boolean') return new Error(`${path}.allowsNostr: is not a boolean`) + if (opts.allowsNostr_CustomCheck && !opts.allowsNostr_CustomCheck(o.allowsNostr)) return new Error(`${path}.allowsNostr: custom check failed`) + + if (typeof o.nostrPubkey !== 'string') return new Error(`${path}.nostrPubkey: is not a string`) + if (opts.nostrPubkey_CustomCheck && !opts.nostrPubkey_CustomCheck(o.nostrPubkey)) return new Error(`${path}.nostrPubkey: custom check failed`) + + return null +} + +export type Application = { + name: string + id: string + balance: number + npub: string +} +export const ApplicationOptionalFields: [] = [] +export type ApplicationOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + id_CustomCheck?: (v: string) => boolean + balance_CustomCheck?: (v: number) => boolean + npub_CustomCheck?: (v: string) => boolean +} +export const ApplicationValidate = (o?: Application, opts: ApplicationOptions = {}, path: string = 'Application::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.id !== 'string') return new Error(`${path}.id: is not a string`) + if (opts.id_CustomCheck && !opts.id_CustomCheck(o.id)) return new Error(`${path}.id: custom check failed`) + + if (typeof o.balance !== 'number') return new Error(`${path}.balance: is not a number`) + if (opts.balance_CustomCheck && !opts.balance_CustomCheck(o.balance)) return new Error(`${path}.balance: custom check failed`) + + if (typeof o.npub !== 'string') return new Error(`${path}.npub: is not a string`) + if (opts.npub_CustomCheck && !opts.npub_CustomCheck(o.npub)) return new Error(`${path}.npub: custom check failed`) + + return null +} + diff --git a/proto/service/methods.proto b/proto/service/methods.proto index 6197c7db..3fe8a10d 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -138,6 +138,11 @@ service LightningPub { option (http_route) = "/api/guest/lnurl_pay/handle"; option (query) = {items: ["k1", "amount", "nostr", "lnurl"]}; } + rpc HandleLnurlAddress(structs.Empty)returns (structs.LnurlPayInfoResponse) { + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/.well-known/lnurlp/:address_name"; + } // // diff --git a/src/services/main/paymentManager.ts b/src/services/main/paymentManager.ts index 5828101c..17089d0f 100644 --- a/src/services/main/paymentManager.ts +++ b/src/services/main/paymentManager.ts @@ -392,6 +392,14 @@ export default class { } } + async HandleLnurlAddress(ctx: Types.HandleLnurlAddress_Context): Promise { + const linkedUser = await this.storage.applicationStorage.FindNostrAppUser(ctx.address_name) + if (!linkedUser) { + throw new Error("this address is not linked to any user") + } + return this.GetLnurlPayInfoFromUser(linkedUser.user.user_id, linkedUser.application) + } + async OpenChannel(userId: string, req: Types.OpenChannelRequest): Promise { throw new Error("WIP") } mapOperations(operations: UserOperationInfo[], type: Types.UserOperationType, inbound: boolean): Types.UserOperations { diff --git a/src/services/serverMethods/index.ts b/src/services/serverMethods/index.ts index 914d8b0a..7b4e8403 100644 --- a/src/services/serverMethods/index.ts +++ b/src/services/serverMethods/index.ts @@ -73,6 +73,12 @@ export default (mainHandler: Main): Types.ServerMethods => { HandleLnurlPay: async (ctx) => { return mainHandler.paymentManager.HandleLnurlPay(ctx) }, + HandleLnurlAddress: async (ctx) => { + if (!ctx.address_name) { + throw new Error("invalid address_name to lnurl address") + } + return mainHandler.paymentManager.HandleLnurlAddress(ctx) + }, AddProduct: async (ctx, req) => { return mainHandler.productManager.AddProduct(ctx.user_id, req) }, diff --git a/src/services/storage/applicationStorage.ts b/src/services/storage/applicationStorage.ts index 2dcba293..b6c2f51f 100644 --- a/src/services/storage/applicationStorage.ts +++ b/src/services/storage/applicationStorage.ts @@ -88,7 +88,7 @@ export default class { if (!nostrPub) { throw new Error("no nostrPub provided") } - const user = await entityManager.getRepository(ApplicationUser).findOne({ where: { application: { serial_id: application.serial_id }, nostr_public_key: nostrPub } }) + const user = await entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } }) if (user) { return user } @@ -98,6 +98,10 @@ export default class { return this.AddApplicationUser(application, crypto.randomBytes(32).toString('hex'), 0, nostrPub) } + async FindNostrAppUser(nostrPub: string, entityManager = this.DB) { + return entityManager.getRepository(ApplicationUser).findOne({ where: { nostr_public_key: nostrPub } }) + } + async GetOrCreateApplicationUser(application: Application, userIdentifier: string, balance: number, entityManager = this.DB): Promise<{ user: ApplicationUser, created: boolean }> { const user = await this.GetApplicationUserIfExists(application, userIdentifier, entityManager) if (user) {