diff --git a/proto/autogenerated/client.md b/proto/autogenerated/client.md index c0eb3c82..a4116e6c 100644 --- a/proto/autogenerated/client.md +++ b/proto/autogenerated/client.md @@ -1394,7 +1394,7 @@ The nostr server will send back a message response, and inside the body there wi - __invoice__: _string_ ### OfferConfig - - __blind__: _boolean_ + - __blind__: _boolean_ *this field is optional - __callback_url__: _string_ - __createdAtUnix__: _number_ - __default_offer__: _boolean_ diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index 1f0e6524..239d0686 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -2824,7 +2824,7 @@ export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvo } export type OfferConfig = { - blind: boolean + blind?: boolean callback_url: string createdAtUnix: number default_offer: boolean @@ -2837,10 +2837,11 @@ export type OfferConfig = { token: string updatedAtUnix: number } -export const OfferConfigOptionalFields: [] = [] +export type OfferConfigOptionalField = 'blind' +export const OfferConfigOptionalFields: OfferConfigOptionalField[] = ['blind'] export type OfferConfigOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - blind_CustomCheck?: (v: boolean) => boolean + checkOptionalsAreSet?: OfferConfigOptionalField[] + blind_CustomCheck?: (v?: boolean) => boolean callback_url_CustomCheck?: (v: string) => boolean createdAtUnix_CustomCheck?: (v: number) => boolean default_offer_CustomCheck?: (v: boolean) => boolean @@ -2857,7 +2858,7 @@ export const OfferConfigValidate = (o?: OfferConfig, opts: OfferConfigOptions = 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.blind !== 'boolean') return new Error(`${path}.blind: is not a boolean`) + if ((o.blind || opts.allOptionalsAreSet || opts.checkOptionalsAreSet?.includes('blind')) && typeof o.blind !== 'boolean') return new Error(`${path}.blind: is not a boolean`) if (opts.blind_CustomCheck && !opts.blind_CustomCheck(o.blind)) return new Error(`${path}.blind: custom check failed`) if (typeof o.callback_url !== 'string') return new Error(`${path}.callback_url: is not a string`) diff --git a/proto/service/structs.proto b/proto/service/structs.proto index fa6a3505..201fd30b 100644 --- a/proto/service/structs.proto +++ b/proto/service/structs.proto @@ -786,7 +786,7 @@ message OfferConfig { bool rejectUnauthorized = 9; int64 createdAtUnix = 10; int64 updatedAtUnix = 11; - bool blind = 12; + optional bool blind = 12; } message UserOffers {