This commit is contained in:
boufni95 2023-12-14 17:19:00 +01:00
parent 46c863721b
commit 46b2d4377f
6 changed files with 2096 additions and 2095 deletions

View file

@ -105,9 +105,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
@ -407,124 +407,50 @@ 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
### GetAppUserLNURLInfoRequest
- __user_identifier__: _string_
- __base_url_override__: _string_
### PayInvoiceRequest
- __invoice__: _string_
- __amount__: _number_
### HandleLnurlPayResponse
- __pr__: _string_
- __routes__: ARRAY of: _[Empty](#Empty)_
### Product
- __id__: _string_
- __name__: _string_
- __price_sats__: _number_
### RelaysMigration
- __relays__: ARRAY of: _string_
### AppUser
- __identifier__: _string_
- __info__: _[UserInfo](#UserInfo)_
- __max_withdrawable__: _number_
### NewAddressRequest
- __addressType__: _[AddressType](#AddressType)_
### PayAddressRequest
- __address__: _string_
- __amoutSats__: _number_
- __satsPerVByte__: _number_
### DecodeInvoiceRequest
- __invoice__: _string_
### LnurlLinkResponse
- __lnurl__: _string_
- __k1__: _string_
### UserOperation
- __paidAtUnix__: _number_
- __type__: _[UserOperationType](#UserOperationType)_
- __inbound__: _boolean_
- __amount__: _number_
- __identifier__: _string_
- __operationId__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
- __confirmed__: _boolean_
### EncryptionExchangeRequest
- __publicKey__: _string_
- __deviceId__: _string_
### AuthAppRequest
- __name__: _string_
- __allow_user_creation__: _boolean_ *this field is optional
### NewInvoiceRequest
- __amountSats__: _number_
- __memo__: _string_
### GetProductBuyLinkResponse
- __link__: _string_
### LndGetInfoResponse
- __alias__: _string_
### GetAppUserRequest
- __user_identifier__: _string_
### NewInvoiceResponse
- __invoice__: _string_
### UserInfo
- __userId__: _string_
- __balance__: _number_
- __max_withdrawable__: _number_
### GetUserOperationsRequest
- __latestIncomingInvoice__: _number_
- __latestOutgoingInvoice__: _number_
- __latestIncomingTx__: _number_
- __latestOutgoingTx__: _number_
- __latestIncomingUserToUserPayment__: _number_
- __latestOutgoingUserToUserPayment__: _number_
### GetUserOperationsResponse
- __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_
- __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
- __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
### MigrationUpdate
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
### ClosureMigration
- __closes_at_unix__: _number_
### AddAppUserInvoiceRequest
- __receiver_identifier__: _string_
- __payer_identifier__: _string_
- __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### LndGetInfoRequest
- __nodeId__: _number_
### PayAppUserInvoiceRequest
- __user_identifier__: _string_
- __invoice__: _string_
- __amount__: _number_
### SetMockAppUserBalanceRequest
- __user_identifier__: _string_
- __amount__: _number_
### NewAddressRequest
- __addressType__: _[AddressType](#AddressType)_
### NewAddressResponse
- __address__: _string_
### PayAddressResponse
- __txId__: _string_
- __operation_id__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
### NewInvoiceRequest
- __amountSats__: _number_
- __memo__: _string_
### OpenChannelResponse
- __channelId__: _string_
### Empty
### AddAppRequest
- __name__: _string_
- __allow_user_creation__: _boolean_
### Application
- __name__: _string_
- __id__: _string_
- __balance__: _number_
- __npub__: _string_
### LnurlWithdrawInfoResponse
- __tag__: _string_
@ -545,38 +471,6 @@ The nostr server will send back a message response, and inside the body there wi
- __app__: _[Application](#Application)_
- __auth_token__: _string_
### Application
- __name__: _string_
- __id__: _string_
- __balance__: _number_
- __npub__: _string_
### AddAppUserRequest
- __identifier__: _string_
- __fail_if_exists__: _boolean_
- __balance__: _number_
### OpenChannelRequest
- __destination__: _string_
- __fundingAmount__: _number_
- __pushAmount__: _number_
- __closeAddress__: _string_
### Empty
### SetMockInvoiceAsPaidRequest
- __invoice__: _string_
- __amount__: _number_
### AddAppRequest
- __name__: _string_
- __allow_user_creation__: _boolean_
### AddAppInvoiceRequest
- __payer_identifier__: _string_
- __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### SendAppUserToAppUserPaymentRequest
- __from_user_identifier__: _string_
- __to_user_identifier__: _string_
@ -586,6 +480,121 @@ The nostr server will send back a message response, and inside the body there wi
- __from_user_identifier__: _string_
- __amount__: _number_
### GetAppUserLNURLInfoRequest
- __user_identifier__: _string_
- __base_url_override__: _string_
### RelaysMigration
- __relays__: ARRAY of: _string_
### AppUser
- __identifier__: _string_
- __info__: _[UserInfo](#UserInfo)_
- __max_withdrawable__: _number_
### SetMockAppBalanceRequest
- __amount__: _number_
### DecodeInvoiceResponse
- __amount__: _number_
### GetUserOperationsRequest
- __latestIncomingInvoice__: _number_
- __latestOutgoingInvoice__: _number_
- __latestIncomingTx__: _number_
- __latestOutgoingTx__: _number_
- __latestIncomingUserToUserPayment__: _number_
- __latestOutgoingUserToUserPayment__: _number_
### LnurlLinkResponse
- __lnurl__: _string_
- __k1__: _string_
### MigrationUpdate
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
### LndGetInfoResponse
- __alias__: _string_
### AuthAppRequest
- __name__: _string_
- __allow_user_creation__: _boolean_ *this field is optional
### AddAppUserInvoiceRequest
- __receiver_identifier__: _string_
- __payer_identifier__: _string_
- __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### DecodeInvoiceRequest
- __invoice__: _string_
### SetMockAppUserBalanceRequest
- __user_identifier__: _string_
- __amount__: _number_
### OpenChannelResponse
- __channelId__: _string_
### UserOperation
- __paidAtUnix__: _number_
- __type__: _[UserOperationType](#UserOperationType)_
- __inbound__: _boolean_
- __amount__: _number_
- __identifier__: _string_
- __operationId__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
- __confirmed__: _boolean_
### OpenChannelRequest
- __destination__: _string_
- __fundingAmount__: _number_
- __pushAmount__: _number_
- __closeAddress__: _string_
### GetProductBuyLinkResponse
- __link__: _string_
### LiveUserOperation
- __operation__: _[UserOperation](#UserOperation)_
### AddAppInvoiceRequest
- __payer_identifier__: _string_
- __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
### PayAddressResponse
- __txId__: _string_
- __operation_id__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
### NewInvoiceResponse
- __invoice__: _string_
### PayInvoiceRequest
- __invoice__: _string_
- __amount__: _number_
### PayAppUserInvoiceRequest
- __user_identifier__: _string_
- __invoice__: _string_
- __amount__: _number_
### PayAddressRequest
- __address__: _string_
- __amoutSats__: _number_
- __satsPerVByte__: _number_
### PayInvoiceResponse
- __preimage__: _string_
- __amount_paid__: _number_
- __operation_id__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
### LnurlPayInfoResponse
- __tag__: _string_
- __callback__: _string_
@ -595,39 +604,30 @@ The nostr server will send back a message response, and inside the body there wi
- __allowsNostr__: _boolean_
- __nostrPubkey__: _string_
### EncryptionExchangeRequest
- __publicKey__: _string_
- __deviceId__: _string_
### SetMockInvoiceAsPaidRequest
- __invoice__: _string_
- __amount__: _number_
### AddAppUserRequest
- __identifier__: _string_
- __fail_if_exists__: _boolean_
- __balance__: _number_
### GetAppUserRequest
- __user_identifier__: _string_
### AddProductRequest
- __name__: _string_
- __price_sats__: _number_
### LndGetInfoRequest
- __nodeId__: _number_
### LiveUserOperation
- __operation__: _[UserOperation](#UserOperation)_
### DecodeInvoiceResponse
- __amount__: _number_
### PayInvoiceResponse
- __preimage__: _string_
- __amount_paid__: _number_
- __operation_id__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
### GetUserOperationsResponse
- __latestOutgoingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_
- __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
- __latestIncomingUserToUserPayemnts__: _[UserOperations](#UserOperations)_
### ClosureMigration
- __closes_at_unix__: _number_
### SetMockAppBalanceRequest
- __amount__: _number_
### Product
- __id__: _string_
- __name__: _string_
- __price_sats__: _number_
## Enums
### The enumerators used in the messages

File diff suppressed because it is too large Load diff

View file

@ -494,7 +494,7 @@ export default (params: ClientParams) => ({
},
GetLiveUserOperations: async (cb: (v:ResultError | ({ status: 'OK' }& Types.LiveUserOperation)) => void): Promise<void> => { throw new Error('http streams are not supported')},
GetMigrationUpdate: async (cb: (v:ResultError | ({ status: 'OK' }& Types.MigrationUpdate)) => void): Promise<void> => { throw new Error('http streams are not supported')},
BatchUser: async (requests:Types.UserMethodInputs): Promise<ResultError | ({ status: 'OK', responses:Types.UserMethodOutputs })> => {
BatchUser: async (requests:Types.UserMethodInputs[]): Promise<ResultError | ({ status: 'OK', responses:( Types.UserMethodOutputs)[] })> => {
const auth = await params.retrieveUserAuth()
if (auth === null) throw new Error('retrieveUserAuth() returned null')
let finalRoute = '/api/user/batch'

View file

@ -230,7 +230,7 @@ export default (params: NostrClientParams, send: (to:string, message: NostrRequ
return cb({ status: 'ERROR', reason: 'invalid response' })
})
},
BatchUser: async (requests:Types.UserMethodInputs): Promise<ResultError | ({ status: 'OK', responses:Types.UserMethodOutputs })> => {
BatchUser: async (requests:Types.UserMethodInputs[]): Promise<ResultError | ({ status: 'OK', responses:(Types.UserMethodOutputs)[] })> => {
const auth = await params.retrieveNostrUserAuth()
if (auth === null) throw new Error('retrieveNostrUserAuth() returned null')
const nostrRequest: NostrRequest = {body:{requests}}

File diff suppressed because it is too large Load diff

Binary file not shown.