wip
This commit is contained in:
parent
4f550a937f
commit
f39025df53
39 changed files with 7571 additions and 1892 deletions
|
|
@ -1,5 +1,5 @@
|
|||
([]*main.Method) (len=11 cap=16) {
|
||||
(*main.Method)(0xc0002b6730)({
|
||||
(*main.Method)(0xc0002886e0)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=5) "Empty",
|
||||
hasZeroFields: (bool) true
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
name: (string) (len=5) "Empty",
|
||||
hasZeroFields: (bool) true
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2480)({
|
||||
authType: (*main.supportedAuth)(0xc0003c3dd0)({
|
||||
opts: (*main.methodOptions)(0xc0003cc420)({
|
||||
authType: (*main.supportedAuth)(0xc000379fb0)({
|
||||
id: (string) (len=5) "guest",
|
||||
name: (string) (len=5) "Guest",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6780)({
|
||||
(*main.Method)(0xc000288730)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=25) "EncryptionExchangeRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -35,8 +35,8 @@
|
|||
name: (string) (len=5) "Empty",
|
||||
hasZeroFields: (bool) true
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2600)({
|
||||
authType: (*main.supportedAuth)(0xc0003c3ec0)({
|
||||
opts: (*main.methodOptions)(0xc0003cc5a0)({
|
||||
authType: (*main.supportedAuth)(0xc0003d60c0)({
|
||||
id: (string) (len=5) "guest",
|
||||
name: (string) (len=5) "Guest",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b67d0)({
|
||||
(*main.Method)(0xc000288780)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=17) "LndGetInfoRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -61,8 +61,8 @@
|
|||
name: (string) (len=18) "LndGetInfoResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2780)({
|
||||
authType: (*main.supportedAuth)(0xc0003c3f80)({
|
||||
opts: (*main.methodOptions)(0xc0003cc720)({
|
||||
authType: (*main.supportedAuth)(0xc0003d6180)({
|
||||
id: (string) (len=5) "admin",
|
||||
name: (string) (len=5) "Admin",
|
||||
encrypted: (bool) true,
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6820)({
|
||||
(*main.Method)(0xc0002887d0)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=14) "AddUserRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -88,8 +88,8 @@
|
|||
name: (string) (len=15) "AddUserResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2900)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe060)({
|
||||
opts: (*main.methodOptions)(0xc0003cc8a0)({
|
||||
authType: (*main.supportedAuth)(0xc0003d6240)({
|
||||
id: (string) (len=5) "guest",
|
||||
name: (string) (len=5) "Guest",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6870)({
|
||||
(*main.Method)(0xc000288820)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=15) "AuthUserRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -114,8 +114,8 @@
|
|||
name: (string) (len=16) "AuthUserResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2a80)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe120)({
|
||||
opts: (*main.methodOptions)(0xc0003cca20)({
|
||||
authType: (*main.supportedAuth)(0xc0003d6300)({
|
||||
id: (string) (len=5) "guest",
|
||||
name: (string) (len=5) "Guest",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -130,18 +130,18 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6910)({
|
||||
(*main.Method)(0xc0002888c0)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=5) "Empty",
|
||||
hasZeroFields: (bool) true
|
||||
name: (string) (len=17) "NewAddressRequest",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
name: (string) (len=10) "NewAddress",
|
||||
out: (main.MethodMessage) {
|
||||
name: (string) (len=18) "NewAddressResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2c00)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe1e0)({
|
||||
opts: (*main.methodOptions)(0xc0003ccba0)({
|
||||
authType: (*main.supportedAuth)(0xc0003d63c0)({
|
||||
id: (string) (len=4) "user",
|
||||
name: (string) (len=4) "User",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b69b0)({
|
||||
(*main.Method)(0xc000288960)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=17) "PayAddressRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -167,8 +167,8 @@
|
|||
name: (string) (len=18) "PayAddressResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2d80)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe2a0)({
|
||||
opts: (*main.methodOptions)(0xc0003ccd20)({
|
||||
authType: (*main.supportedAuth)(0xc0003d6480)({
|
||||
id: (string) (len=4) "user",
|
||||
name: (string) (len=4) "User",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -184,7 +184,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6a50)({
|
||||
(*main.Method)(0xc000288a00)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=17) "NewInvoiceRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -194,8 +194,8 @@
|
|||
name: (string) (len=18) "NewInvoiceResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f2f00)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe360)({
|
||||
opts: (*main.methodOptions)(0xc0003ccea0)({
|
||||
authType: (*main.supportedAuth)(0xc0003d6540)({
|
||||
id: (string) (len=4) "user",
|
||||
name: (string) (len=4) "User",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -211,7 +211,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6af0)({
|
||||
(*main.Method)(0xc000288aa0)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=17) "PayInvoiceRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -221,8 +221,8 @@
|
|||
name: (string) (len=18) "PayInvoiceResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f3080)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe420)({
|
||||
opts: (*main.methodOptions)(0xc0003cd020)({
|
||||
authType: (*main.supportedAuth)(0xc0003d6600)({
|
||||
id: (string) (len=4) "user",
|
||||
name: (string) (len=4) "User",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -238,7 +238,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6b90)({
|
||||
(*main.Method)(0xc000288b40)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=18) "OpenChannelRequest",
|
||||
hasZeroFields: (bool) false
|
||||
|
|
@ -248,8 +248,8 @@
|
|||
name: (string) (len=19) "OpenChannelResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f3200)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe4e0)({
|
||||
opts: (*main.methodOptions)(0xc0003cd1a0)({
|
||||
authType: (*main.supportedAuth)(0xc0003d66c0)({
|
||||
id: (string) (len=4) "user",
|
||||
name: (string) (len=4) "User",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
query: ([]string) <nil>
|
||||
})
|
||||
}),
|
||||
(*main.Method)(0xc0002b6be0)({
|
||||
(*main.Method)(0xc000288b90)({
|
||||
in: (main.MethodMessage) {
|
||||
name: (string) (len=5) "Empty",
|
||||
hasZeroFields: (bool) true
|
||||
|
|
@ -275,8 +275,8 @@
|
|||
name: (string) (len=27) "GetOpenChannelLNURLResponse",
|
||||
hasZeroFields: (bool) false
|
||||
},
|
||||
opts: (*main.methodOptions)(0xc0003f3380)({
|
||||
authType: (*main.supportedAuth)(0xc0003fe5a0)({
|
||||
opts: (*main.methodOptions)(0xc0003cd320)({
|
||||
authType: (*main.supportedAuth)(0xc0003d6780)({
|
||||
id: (string) (len=4) "user",
|
||||
name: (string) (len=4) "User",
|
||||
encrypted: (bool) false,
|
||||
|
|
@ -294,83 +294,32 @@
|
|||
})
|
||||
}
|
||||
|
||||
([]*main.Enum) <nil>
|
||||
([]*main.Enum) (len=1 cap=1) {
|
||||
(*main.Enum)(0xc000379860)({
|
||||
name: (string) (len=11) "AddressType",
|
||||
values: ([]main.EnumValue) (len=3 cap=4) {
|
||||
(main.EnumValue) {
|
||||
number: (int64) 0,
|
||||
name: (string) (len=19) "WITNESS_PUBKEY_HASH"
|
||||
},
|
||||
(main.EnumValue) {
|
||||
number: (int64) 1,
|
||||
name: (string) (len=18) "NESTED_PUBKEY_HASH"
|
||||
},
|
||||
(main.EnumValue) {
|
||||
number: (int64) 2,
|
||||
name: (string) (len=14) "TAPROOT_PUBKEY"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
(map[string]*main.Message) (len=18) {
|
||||
(string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc0002470c0)({
|
||||
fullName: (string) (len=18) "LndGetInfoResponse",
|
||||
name: (string) (len=18) "LndGetInfoResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c3260)({
|
||||
name: (string) (len=5) "alias",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000247200)({
|
||||
fullName: (string) (len=18) "NewInvoiceResponse",
|
||||
name: (string) (len=18) "NewInvoiceResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c3380)({
|
||||
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=17) "PayInvoiceRequest": (*main.Message)(0xc000247240)({
|
||||
fullName: (string) (len=17) "PayInvoiceRequest",
|
||||
name: (string) (len=17) "PayInvoiceRequest",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c33b0)({
|
||||
name: (string) (len=6) "invoce",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000247040)({
|
||||
fullName: (string) (len=25) "EncryptionExchangeRequest",
|
||||
name: (string) (len=25) "EncryptionExchangeRequest",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003c31d0)({
|
||||
name: (string) (len=10) "public_key",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003c3200)({
|
||||
name: (string) (len=9) "device_id",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000247080)({
|
||||
(map[string]*main.Message) (len=19) {
|
||||
(string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000215140)({
|
||||
fullName: (string) (len=17) "LndGetInfoRequest",
|
||||
name: (string) (len=17) "LndGetInfoRequest",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c3230)({
|
||||
(*main.Field)(0xc000379320)({
|
||||
name: (string) (len=7) "node_id",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
|
|
@ -381,12 +330,12 @@
|
|||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=18) "NewAddressResponse": (*main.Message)(0xc000247100)({
|
||||
fullName: (string) (len=18) "NewAddressResponse",
|
||||
name: (string) (len=18) "NewAddressResponse",
|
||||
(string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000215180)({
|
||||
fullName: (string) (len=18) "LndGetInfoResponse",
|
||||
name: (string) (len=18) "LndGetInfoResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c3290)({
|
||||
name: (string) (len=7) "address",
|
||||
(*main.Field)(0xc000379350)({
|
||||
name: (string) (len=5) "alias",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
|
|
@ -396,11 +345,26 @@
|
|||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc0002471c0)({
|
||||
(string) (len=17) "NewAddressRequest": (*main.Message)(0xc0002151c0)({
|
||||
fullName: (string) (len=17) "NewAddressRequest",
|
||||
name: (string) (len=17) "NewAddressRequest",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc000379380)({
|
||||
name: (string) (len=12) "address_type",
|
||||
kind: (string) (len=11) "AddressType",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) true,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc0002152c0)({
|
||||
fullName: (string) (len=17) "NewInvoiceRequest",
|
||||
name: (string) (len=17) "NewInvoiceRequest",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c3350)({
|
||||
(*main.Field)(0xc000379470)({
|
||||
name: (string) (len=11) "amount_sats",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
|
|
@ -411,169 +375,11 @@
|
|||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0002472c0)({
|
||||
fullName: (string) (len=18) "OpenChannelRequest",
|
||||
name: (string) (len=18) "OpenChannelRequest",
|
||||
fields: ([]*main.Field) (len=3 cap=4) {
|
||||
(*main.Field)(0xc0003c3410)({
|
||||
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)(0xc0003c3440)({
|
||||
name: (string) (len=15) "channel_balance",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003c3470)({
|
||||
name: (string) (len=11) "push_amount",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=14) "AddUserRequest": (*main.Message)(0xc000247380)({
|
||||
fullName: (string) (len=14) "AddUserRequest",
|
||||
name: (string) (len=14) "AddUserRequest",
|
||||
fields: ([]*main.Field) (len=3 cap=4) {
|
||||
(*main.Field)(0xc0003c3500)({
|
||||
name: (string) (len=12) "callback_url",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003c3530)({
|
||||
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)(0xc0003c3560)({
|
||||
name: (string) (len=6) "secret",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=15) "AuthUserRequest": (*main.Message)(0xc000247400)({
|
||||
fullName: (string) (len=15) "AuthUserRequest",
|
||||
name: (string) (len=15) "AuthUserRequest",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003c35f0)({
|
||||
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)(0xc0003c3620)({
|
||||
name: (string) (len=6) "secret",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=17) "PayAddressRequest": (*main.Message)(0xc000247140)({
|
||||
fullName: (string) (len=17) "PayAddressRequest",
|
||||
name: (string) (len=17) "PayAddressRequest",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003c32c0)({
|
||||
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)(0xc0003c32f0)({
|
||||
name: (string) (len=10) "amout_sats",
|
||||
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)(0xc000247180)({
|
||||
fullName: (string) (len=18) "PayAddressResponse",
|
||||
name: (string) (len=18) "PayAddressResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c3320)({
|
||||
name: (string) (len=5) "tx_id",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=16) "AuthUserResponse": (*main.Message)(0xc000247440)({
|
||||
fullName: (string) (len=16) "AuthUserResponse",
|
||||
name: (string) (len=16) "AuthUserResponse",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003c3650)({
|
||||
name: (string) (len=7) "user_id",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003c3680)({
|
||||
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=5) "Empty": (*main.Message)(0xc000247000)({
|
||||
fullName: (string) (len=5) "Empty",
|
||||
name: (string) (len=5) "Empty",
|
||||
fields: ([]*main.Field) <nil>
|
||||
}),
|
||||
(string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc000247280)({
|
||||
(string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc000215380)({
|
||||
fullName: (string) (len=18) "PayInvoiceResponse",
|
||||
name: (string) (len=18) "PayInvoiceResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c33e0)({
|
||||
(*main.Field)(0xc000379530)({
|
||||
name: (string) (len=8) "preimage",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
|
|
@ -584,11 +390,11 @@
|
|||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000247300)({
|
||||
(string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000215400)({
|
||||
fullName: (string) (len=19) "OpenChannelResponse",
|
||||
name: (string) (len=19) "OpenChannelResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c34a0)({
|
||||
(*main.Field)(0xc000379620)({
|
||||
name: (string) (len=10) "channel_id",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
|
|
@ -599,11 +405,89 @@
|
|||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=27) "GetOpenChannelLNURLResponse": (*main.Message)(0xc000247340)({
|
||||
(string) (len=18) "PayAddressResponse": (*main.Message)(0xc000215280)({
|
||||
fullName: (string) (len=18) "PayAddressResponse",
|
||||
name: (string) (len=18) "PayAddressResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc000379440)({
|
||||
name: (string) (len=5) "tx_id",
|
||||
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)(0xc000215340)({
|
||||
fullName: (string) (len=17) "PayInvoiceRequest",
|
||||
name: (string) (len=17) "PayInvoiceRequest",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003794d0)({
|
||||
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)(0xc000379500)({
|
||||
name: (string) (len=6) "amount",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000215100)({
|
||||
fullName: (string) (len=25) "EncryptionExchangeRequest",
|
||||
name: (string) (len=25) "EncryptionExchangeRequest",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003792c0)({
|
||||
name: (string) (len=10) "public_key",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003792f0)({
|
||||
name: (string) (len=9) "device_id",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=18) "NewAddressResponse": (*main.Message)(0xc000215200)({
|
||||
fullName: (string) (len=18) "NewAddressResponse",
|
||||
name: (string) (len=18) "NewAddressResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003793b0)({
|
||||
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=27) "GetOpenChannelLNURLResponse": (*main.Message)(0xc000215440)({
|
||||
fullName: (string) (len=27) "GetOpenChannelLNURLResponse",
|
||||
name: (string) (len=27) "GetOpenChannelLNURLResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003c34d0)({
|
||||
(*main.Field)(0xc000379650)({
|
||||
name: (string) (len=5) "lnurl",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
|
|
@ -614,11 +498,44 @@
|
|||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=15) "AddUserResponse": (*main.Message)(0xc0002473c0)({
|
||||
(string) (len=14) "AddUserRequest": (*main.Message)(0xc000215480)({
|
||||
fullName: (string) (len=14) "AddUserRequest",
|
||||
name: (string) (len=14) "AddUserRequest",
|
||||
fields: ([]*main.Field) (len=3 cap=4) {
|
||||
(*main.Field)(0xc000379680)({
|
||||
name: (string) (len=12) "callback_url",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003796b0)({
|
||||
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)(0xc0003796e0)({
|
||||
name: (string) (len=6) "secret",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=15) "AddUserResponse": (*main.Message)(0xc0002154c0)({
|
||||
fullName: (string) (len=15) "AddUserResponse",
|
||||
name: (string) (len=15) "AddUserResponse",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003c3590)({
|
||||
(*main.Field)(0xc000379710)({
|
||||
name: (string) (len=7) "user_id",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
|
|
@ -627,7 +544,7 @@
|
|||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003c35c0)({
|
||||
(*main.Field)(0xc000379740)({
|
||||
name: (string) (len=10) "auth_token",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
|
|
@ -637,10 +554,144 @@
|
|||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=15) "AuthUserRequest": (*main.Message)(0xc000215500)({
|
||||
fullName: (string) (len=15) "AuthUserRequest",
|
||||
name: (string) (len=15) "AuthUserRequest",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc000379770)({
|
||||
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)(0xc0003797a0)({
|
||||
name: (string) (len=6) "secret",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=16) "AuthUserResponse": (*main.Message)(0xc000215540)({
|
||||
fullName: (string) (len=16) "AuthUserResponse",
|
||||
name: (string) (len=16) "AuthUserResponse",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003797d0)({
|
||||
name: (string) (len=7) "user_id",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc000379800)({
|
||||
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=5) "Empty": (*main.Message)(0xc0002150c0)({
|
||||
fullName: (string) (len=5) "Empty",
|
||||
name: (string) (len=5) "Empty",
|
||||
fields: ([]*main.Field) <nil>
|
||||
}),
|
||||
(string) (len=17) "PayAddressRequest": (*main.Message)(0xc000215240)({
|
||||
fullName: (string) (len=17) "PayAddressRequest",
|
||||
name: (string) (len=17) "PayAddressRequest",
|
||||
fields: ([]*main.Field) (len=2 cap=2) {
|
||||
(*main.Field)(0xc0003793e0)({
|
||||
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)(0xc000379410)({
|
||||
name: (string) (len=10) "amout_sats",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
}),
|
||||
(string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000215300)({
|
||||
fullName: (string) (len=18) "NewInvoiceResponse",
|
||||
name: (string) (len=18) "NewInvoiceResponse",
|
||||
fields: ([]*main.Field) (len=1 cap=1) {
|
||||
(*main.Field)(0xc0003794a0)({
|
||||
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) "OpenChannelRequest": (*main.Message)(0xc0002153c0)({
|
||||
fullName: (string) (len=18) "OpenChannelRequest",
|
||||
name: (string) (len=18) "OpenChannelRequest",
|
||||
fields: ([]*main.Field) (len=4 cap=4) {
|
||||
(*main.Field)(0xc000379560)({
|
||||
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)(0xc000379590)({
|
||||
name: (string) (len=14) "funding_amount",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003795c0)({
|
||||
name: (string) (len=11) "push_amount",
|
||||
kind: (string) (len=5) "int64",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
}),
|
||||
(*main.Field)(0xc0003795f0)({
|
||||
name: (string) (len=13) "close_address",
|
||||
kind: (string) (len=6) "string",
|
||||
isMap: (bool) false,
|
||||
isArray: (bool) false,
|
||||
isEnum: (bool) false,
|
||||
isMessage: (bool) false,
|
||||
isOptional: (bool) false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
parsing file: structs 18
|
||||
parsing file: structs 19
|
||||
parsing file: methods 2
|
||||
-> [{guest Guest false map[]} {user User false map[user_id:string]} {admin Admin true map[admin_id:string]}]
|
||||
|
||||
|
|
|
|||
|
|
@ -99,9 +99,12 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
|
|||
try {
|
||||
if (!methods.NewAddress) throw new Error('method: NewAddress is not implemented')
|
||||
const authContext = await opts.UserAuthGuard(req.headers['authorization'])
|
||||
const request = req.body
|
||||
const error = Types.NewAddressRequestValidate(request)
|
||||
if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger)
|
||||
const query = req.query
|
||||
const params = req.params
|
||||
const response = await methods.NewAddress({ ...authContext, ...query, ...params })
|
||||
const response = await methods.NewAddress({ ...authContext, ...query, ...params }, request)
|
||||
res.json({status: 'OK', result: response})
|
||||
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e }
|
||||
})
|
||||
|
|
|
|||
|
|
@ -74,11 +74,11 @@ export default (params: ClientParams) => ({
|
|||
}
|
||||
return { status: 'ERROR', reason: 'invalid response' }
|
||||
},
|
||||
NewAddress: async (): Promise<ResultError | { status: 'OK', result: Types.NewAddressResponse }> => {
|
||||
NewAddress: async (request: Types.NewAddressRequest): Promise<ResultError | { status: 'OK', result: Types.NewAddressResponse }> => {
|
||||
const auth = await params.retrieveUserAuth()
|
||||
if (auth === null) throw new Error('retrieveUserAuth() returned null')
|
||||
let finalRoute = '/api/user/chain/new'
|
||||
const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } })
|
||||
const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } })
|
||||
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
|
||||
if (data.status === 'OK') {
|
||||
const result = data.result
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export type ServerMethods = {
|
|||
LndGetInfo?: (ctx: LndGetInfo_Context, req: LndGetInfoRequest) => Promise<LndGetInfoResponse>
|
||||
AddUser?: (ctx: AddUser_Context, req: AddUserRequest) => Promise<AddUserResponse>
|
||||
AuthUser?: (ctx: AuthUser_Context, req: AuthUserRequest) => Promise<AuthUserResponse>
|
||||
NewAddress?: (ctx: NewAddress_Context) => Promise<NewAddressResponse>
|
||||
NewAddress?: (ctx: NewAddress_Context, req: NewAddressRequest) => Promise<NewAddressResponse>
|
||||
PayAddress?: (ctx: PayAddress_Context, req: PayAddressRequest) => Promise<PayAddressResponse>
|
||||
NewInvoice?: (ctx: NewInvoice_Context, req: NewInvoiceRequest) => Promise<NewInvoiceResponse>
|
||||
PayInvoice?: (ctx: PayInvoice_Context, req: PayInvoiceRequest) => Promise<PayInvoiceResponse>
|
||||
|
|
@ -79,31 +79,30 @@ export type ServerMethods = {
|
|||
GetOpenChannelLNURL?: (ctx: GetOpenChannelLNURL_Context) => Promise<GetOpenChannelLNURLResponse>
|
||||
}
|
||||
|
||||
export enum AddressType {
|
||||
WITNESS_PUBKEY_HASH = 'WITNESS_PUBKEY_HASH',
|
||||
NESTED_PUBKEY_HASH = 'NESTED_PUBKEY_HASH',
|
||||
TAPROOT_PUBKEY = 'TAPROOT_PUBKEY',
|
||||
}
|
||||
const enumCheckAddressType = (e?: AddressType): boolean => {
|
||||
for (const v in AddressType) if (e === v) return true
|
||||
return false
|
||||
}
|
||||
|
||||
export type OptionsBaseMessage = {
|
||||
allOptionalsAreSet?: true
|
||||
}
|
||||
|
||||
export type AuthUserResponse = {
|
||||
user_id: string
|
||||
auth_token: string
|
||||
export type Empty = {
|
||||
}
|
||||
export const AuthUserResponseOptionalFields: [] = []
|
||||
export type AuthUserResponseOptions = OptionsBaseMessage & {
|
||||
export const EmptyOptionalFields: [] = []
|
||||
export type EmptyOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
user_id_CustomCheck?: (v: string) => boolean
|
||||
auth_token_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const AuthUserResponseValidate = (o?: AuthUserResponse, opts: AuthUserResponseOptions = {}, path: string = 'AuthUserResponse::root.'): Error | null => {
|
||||
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')
|
||||
|
||||
if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`)
|
||||
if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
|
@ -130,20 +129,53 @@ export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddres
|
|||
return null
|
||||
}
|
||||
|
||||
export type PayAddressResponse = {
|
||||
tx_id: string
|
||||
export type NewInvoiceResponse = {
|
||||
invoice: string
|
||||
}
|
||||
export const PayAddressResponseOptionalFields: [] = []
|
||||
export type PayAddressResponseOptions = OptionsBaseMessage & {
|
||||
export const NewInvoiceResponseOptionalFields: [] = []
|
||||
export type NewInvoiceResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
tx_id_CustomCheck?: (v: string) => boolean
|
||||
invoice_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => {
|
||||
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.tx_id !== 'string') return new Error(`${path}.tx_id: is not a string`)
|
||||
if (opts.tx_id_CustomCheck && !opts.tx_id_CustomCheck(o.tx_id)) return new Error(`${path}.tx_id: 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`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type OpenChannelRequest = {
|
||||
destination: string
|
||||
funding_amount: number
|
||||
push_amount: number
|
||||
close_address: string
|
||||
}
|
||||
export const OpenChannelRequestOptionalFields: [] = []
|
||||
export type OpenChannelRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
destination_CustomCheck?: (v: string) => boolean
|
||||
funding_amount_CustomCheck?: (v: number) => boolean
|
||||
push_amount_CustomCheck?: (v: number) => boolean
|
||||
close_address_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.funding_amount !== 'number') return new Error(`${path}.funding_amount: is not a number`)
|
||||
if (opts.funding_amount_CustomCheck && !opts.funding_amount_CustomCheck(o.funding_amount)) return new Error(`${path}.funding_amount: custom check failed`)
|
||||
|
||||
if (typeof o.push_amount !== 'number') return new Error(`${path}.push_amount: is not a number`)
|
||||
if (opts.push_amount_CustomCheck && !opts.push_amount_CustomCheck(o.push_amount)) return new Error(`${path}.push_amount: custom check failed`)
|
||||
|
||||
if (typeof o.close_address !== 'string') return new Error(`${path}.close_address: is not a string`)
|
||||
if (opts.close_address_CustomCheck && !opts.close_address_CustomCheck(o.close_address)) return new Error(`${path}.close_address: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
|
@ -166,92 +198,20 @@ export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenC
|
|||
return null
|
||||
}
|
||||
|
||||
export type GetOpenChannelLNURLResponse = {
|
||||
lnurl: string
|
||||
export type LndGetInfoRequest = {
|
||||
node_id: number
|
||||
}
|
||||
export const GetOpenChannelLNURLResponseOptionalFields: [] = []
|
||||
export type GetOpenChannelLNURLResponseOptions = OptionsBaseMessage & {
|
||||
export const LndGetInfoRequestOptionalFields: [] = []
|
||||
export type LndGetInfoRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
lnurl_CustomCheck?: (v: string) => boolean
|
||||
node_id_CustomCheck?: (v: number) => boolean
|
||||
}
|
||||
export const GetOpenChannelLNURLResponseValidate = (o?: GetOpenChannelLNURLResponse, opts: GetOpenChannelLNURLResponseOptions = {}, path: string = 'GetOpenChannelLNURLResponse::root.'): Error | null => {
|
||||
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.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`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type AddUserResponse = {
|
||||
user_id: string
|
||||
auth_token: string
|
||||
}
|
||||
export const AddUserResponseOptionalFields: [] = []
|
||||
export type AddUserResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
user_id_CustomCheck?: (v: string) => boolean
|
||||
auth_token_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`)
|
||||
if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`)
|
||||
|
||||
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 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 PayInvoiceResponse = {
|
||||
preimage: string
|
||||
}
|
||||
export const PayInvoiceResponseOptionalFields: [] = []
|
||||
export type PayInvoiceResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
preimage_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`)
|
||||
if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type PayInvoiceRequest = {
|
||||
invoce: string
|
||||
}
|
||||
export const PayInvoiceRequestOptionalFields: [] = []
|
||||
export type PayInvoiceRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
invoce_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.invoce !== 'string') return new Error(`${path}.invoce: is not a string`)
|
||||
if (opts.invoce_CustomCheck && !opts.invoce_CustomCheck(o.invoce)) return new Error(`${path}.invoce: custom check failed`)
|
||||
if (typeof o.node_id !== 'number') return new Error(`${path}.node_id: is not a number`)
|
||||
if (opts.node_id_CustomCheck && !opts.node_id_CustomCheck(o.node_id)) return new Error(`${path}.node_id: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
|
@ -274,38 +234,20 @@ export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetI
|
|||
return null
|
||||
}
|
||||
|
||||
export type NewInvoiceResponse = {
|
||||
invoice: string
|
||||
export type NewAddressRequest = {
|
||||
address_type: AddressType
|
||||
}
|
||||
export const NewInvoiceResponseOptionalFields: [] = []
|
||||
export type NewInvoiceResponseOptions = OptionsBaseMessage & {
|
||||
export const NewAddressRequestOptionalFields: [] = []
|
||||
export type NewAddressRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
invoice_CustomCheck?: (v: string) => boolean
|
||||
address_type_CustomCheck?: (v: AddressType) => boolean
|
||||
}
|
||||
export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => {
|
||||
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 (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`)
|
||||
if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type NewAddressResponse = {
|
||||
address: string
|
||||
}
|
||||
export const NewAddressResponseOptionalFields: [] = []
|
||||
export type NewAddressResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
address_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`)
|
||||
if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`)
|
||||
if (!enumCheckAddressType(o.address_type)) return new Error(`${path}.address_type: is not a valid AddressType`)
|
||||
if (opts.address_type_CustomCheck && !opts.address_type_CustomCheck(o.address_type)) return new Error(`${path}.address_type: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
|
@ -328,30 +270,166 @@ export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoic
|
|||
return null
|
||||
}
|
||||
|
||||
export type OpenChannelRequest = {
|
||||
destination: string
|
||||
channel_balance: number
|
||||
push_amount: number
|
||||
export type PayInvoiceResponse = {
|
||||
preimage: string
|
||||
}
|
||||
export const OpenChannelRequestOptionalFields: [] = []
|
||||
export type OpenChannelRequestOptions = OptionsBaseMessage & {
|
||||
export const PayInvoiceResponseOptionalFields: [] = []
|
||||
export type PayInvoiceResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
destination_CustomCheck?: (v: string) => boolean
|
||||
channel_balance_CustomCheck?: (v: number) => boolean
|
||||
push_amount_CustomCheck?: (v: number) => boolean
|
||||
preimage_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => {
|
||||
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.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.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.channel_balance !== 'number') return new Error(`${path}.channel_balance: is not a number`)
|
||||
if (opts.channel_balance_CustomCheck && !opts.channel_balance_CustomCheck(o.channel_balance)) return new Error(`${path}.channel_balance: custom check failed`)
|
||||
return null
|
||||
}
|
||||
|
||||
if (typeof o.push_amount !== 'number') return new Error(`${path}.push_amount: is not a number`)
|
||||
if (opts.push_amount_CustomCheck && !opts.push_amount_CustomCheck(o.push_amount)) return new Error(`${path}.push_amount: custom check failed`)
|
||||
export type PayAddressResponse = {
|
||||
tx_id: string
|
||||
}
|
||||
export const PayAddressResponseOptionalFields: [] = []
|
||||
export type PayAddressResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
tx_id_CustomCheck?: (v: string) => 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.tx_id !== 'string') return new Error(`${path}.tx_id: is not a string`)
|
||||
if (opts.tx_id_CustomCheck && !opts.tx_id_CustomCheck(o.tx_id)) return new Error(`${path}.tx_id: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type PayInvoiceRequest = {
|
||||
invoice: string
|
||||
amount: number
|
||||
}
|
||||
export const PayInvoiceRequestOptionalFields: [] = []
|
||||
export type PayInvoiceRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
invoice_CustomCheck?: (v: string) => boolean
|
||||
amount_CustomCheck?: (v: number) => boolean
|
||||
}
|
||||
export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`)
|
||||
if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`)
|
||||
|
||||
if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`)
|
||||
if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type AuthUserRequest = {
|
||||
name: string
|
||||
secret: string
|
||||
}
|
||||
export const AuthUserRequestOptionalFields: [] = []
|
||||
export type AuthUserRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
name_CustomCheck?: (v: string) => boolean
|
||||
secret_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserRequestOptions = {}, path: string = 'AuthUserRequest::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`)
|
||||
if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`)
|
||||
|
||||
if (typeof o.secret !== 'string') return new Error(`${path}.secret: is not a string`)
|
||||
if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type AuthUserResponse = {
|
||||
user_id: string
|
||||
auth_token: string
|
||||
}
|
||||
export const AuthUserResponseOptionalFields: [] = []
|
||||
export type AuthUserResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
user_id_CustomCheck?: (v: string) => boolean
|
||||
auth_token_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const AuthUserResponseValidate = (o?: AuthUserResponse, opts: AuthUserResponseOptions = {}, path: string = 'AuthUserResponse::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`)
|
||||
if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`)
|
||||
|
||||
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 EncryptionExchangeRequest = {
|
||||
public_key: string
|
||||
device_id: string
|
||||
}
|
||||
export const EncryptionExchangeRequestOptionalFields: [] = []
|
||||
export type EncryptionExchangeRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
public_key_CustomCheck?: (v: string) => boolean
|
||||
device_id_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.public_key !== 'string') return new Error(`${path}.public_key: is not a string`)
|
||||
if (opts.public_key_CustomCheck && !opts.public_key_CustomCheck(o.public_key)) return new Error(`${path}.public_key: custom check failed`)
|
||||
|
||||
if (typeof o.device_id !== 'string') return new Error(`${path}.device_id: is not a string`)
|
||||
if (opts.device_id_CustomCheck && !opts.device_id_CustomCheck(o.device_id)) return new Error(`${path}.device_id: 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 GetOpenChannelLNURLResponse = {
|
||||
lnurl: string
|
||||
}
|
||||
export const GetOpenChannelLNURLResponseOptionalFields: [] = []
|
||||
export type GetOpenChannelLNURLResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
lnurl_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const GetOpenChannelLNURLResponseValidate = (o?: GetOpenChannelLNURLResponse, opts: GetOpenChannelLNURLResponseOptions = {}, path: string = 'GetOpenChannelLNURLResponse::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`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
|
@ -384,66 +462,25 @@ export const AddUserRequestValidate = (o?: AddUserRequest, opts: AddUserRequestO
|
|||
return null
|
||||
}
|
||||
|
||||
export type AuthUserRequest = {
|
||||
name: string
|
||||
secret: string
|
||||
export type AddUserResponse = {
|
||||
user_id: string
|
||||
auth_token: string
|
||||
}
|
||||
export const AuthUserRequestOptionalFields: [] = []
|
||||
export type AuthUserRequestOptions = OptionsBaseMessage & {
|
||||
export const AddUserResponseOptionalFields: [] = []
|
||||
export type AddUserResponseOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
name_CustomCheck?: (v: string) => boolean
|
||||
secret_CustomCheck?: (v: string) => boolean
|
||||
user_id_CustomCheck?: (v: string) => boolean
|
||||
auth_token_CustomCheck?: (v: string) => boolean
|
||||
}
|
||||
export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserRequestOptions = {}, path: string = 'AuthUserRequest::root.'): Error | null => {
|
||||
export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::root.'): Error | null => {
|
||||
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
|
||||
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
|
||||
|
||||
if (typeof o.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.user_id !== 'string') return new Error(`${path}.user_id: is not a string`)
|
||||
if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`)
|
||||
|
||||
if (typeof o.secret !== 'string') return new Error(`${path}.secret: is not a string`)
|
||||
if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type EncryptionExchangeRequest = {
|
||||
public_key: string
|
||||
device_id: string
|
||||
}
|
||||
export const EncryptionExchangeRequestOptionalFields: [] = []
|
||||
export type EncryptionExchangeRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
public_key_CustomCheck?: (v: string) => boolean
|
||||
device_id_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.public_key !== 'string') return new Error(`${path}.public_key: is not a string`)
|
||||
if (opts.public_key_CustomCheck && !opts.public_key_CustomCheck(o.public_key)) return new Error(`${path}.public_key: custom check failed`)
|
||||
|
||||
if (typeof o.device_id !== 'string') return new Error(`${path}.device_id: is not a string`)
|
||||
if (opts.device_id_CustomCheck && !opts.device_id_CustomCheck(o.device_id)) return new Error(`${path}.device_id: custom check failed`)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
export type LndGetInfoRequest = {
|
||||
node_id: number
|
||||
}
|
||||
export const LndGetInfoRequestOptionalFields: [] = []
|
||||
export type LndGetInfoRequestOptions = OptionsBaseMessage & {
|
||||
checkOptionalsAreSet?: []
|
||||
node_id_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.node_id !== 'number') return new Error(`${path}.node_id: is not a number`)
|
||||
if (opts.node_id_CustomCheck && !opts.node_id_CustomCheck(o.node_id)) return new Error(`${path}.node_id: custom check failed`)
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue