breez-sdk-spark 0.3.1__cp38-cp38-manylinux_2_31_x86_64.whl → 0.3.3__cp38-cp38-manylinux_2_31_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of breez-sdk-spark might be problematic. Click here for more details.

@@ -2440,6 +2440,66 @@ class _UniffiConverterTypeCurrencyInfo(_UniffiConverterRustBuffer):
2440
2440
  _UniffiConverterSequenceTypeLocaleOverrides.write(value.locale_overrides, buf)
2441
2441
 
2442
2442
 
2443
+ class ExternalInputParser:
2444
+ """
2445
+ Configuration for an external input parser
2446
+ """
2447
+
2448
+ provider_id: "str"
2449
+ """
2450
+ An arbitrary parser provider id
2451
+ """
2452
+
2453
+ input_regex: "str"
2454
+ """
2455
+ The external parser will be used when an input conforms to this regex
2456
+ """
2457
+
2458
+ parser_url: "str"
2459
+ """
2460
+ The URL of the parser containing a placeholder `<input>` that will be replaced with the
2461
+ input to be parsed. The input is sanitized using percent encoding.
2462
+ """
2463
+
2464
+ def __init__(self, *, provider_id: "str", input_regex: "str", parser_url: "str"):
2465
+ self.provider_id = provider_id
2466
+ self.input_regex = input_regex
2467
+ self.parser_url = parser_url
2468
+
2469
+ def __str__(self):
2470
+ return "ExternalInputParser(provider_id={}, input_regex={}, parser_url={})".format(self.provider_id, self.input_regex, self.parser_url)
2471
+
2472
+ def __eq__(self, other):
2473
+ if self.provider_id != other.provider_id:
2474
+ return False
2475
+ if self.input_regex != other.input_regex:
2476
+ return False
2477
+ if self.parser_url != other.parser_url:
2478
+ return False
2479
+ return True
2480
+
2481
+ class _UniffiConverterTypeExternalInputParser(_UniffiConverterRustBuffer):
2482
+ @staticmethod
2483
+ def read(buf):
2484
+ return ExternalInputParser(
2485
+ provider_id=_UniffiConverterString.read(buf),
2486
+ input_regex=_UniffiConverterString.read(buf),
2487
+ parser_url=_UniffiConverterString.read(buf),
2488
+ )
2489
+
2490
+ @staticmethod
2491
+ def check_lower(value):
2492
+ _UniffiConverterString.check_lower(value.provider_id)
2493
+ _UniffiConverterString.check_lower(value.input_regex)
2494
+ _UniffiConverterString.check_lower(value.parser_url)
2495
+
2496
+ @staticmethod
2497
+ def write(value, buf):
2498
+ _UniffiConverterString.write(value.provider_id, buf)
2499
+ _UniffiConverterString.write(value.input_regex, buf)
2500
+ _UniffiConverterString.write(value.parser_url, buf)
2501
+
2502
+
2443
2503
  class FiatCurrency:
2444
2504
  """
2445
2505
  Wrapper around the [`CurrencyInfo`] of a fiat currency
@@ -3054,35 +3114,6 @@ class _UniffiConverterTypeRestResponse(_UniffiConverterRustBuffer):
3054
3114
  _UniffiConverterString.write(value.body, buf)
3055
3115
 
3056
3116
 
3057
- class SatsPaymentDetails:
3058
- amount: "typing.Optional[int]"
3059
- def __init__(self, *, amount: "typing.Optional[int]"):
3060
- self.amount = amount
3061
-
3062
- def __str__(self):
3063
- return "SatsPaymentDetails(amount={})".format(self.amount)
3064
-
3065
- def __eq__(self, other):
3066
- if self.amount != other.amount:
3067
- return False
3068
- return True
3069
-
3070
- class _UniffiConverterTypeSatsPaymentDetails(_UniffiConverterRustBuffer):
3071
- @staticmethod
3072
- def read(buf):
3073
- return SatsPaymentDetails(
3074
- amount=_UniffiConverterOptionalUInt64.read(buf),
3075
- )
3076
-
3077
- @staticmethod
3078
- def check_lower(value):
3079
- _UniffiConverterOptionalUInt64.check_lower(value.amount)
3080
-
3081
- @staticmethod
3082
- def write(value, buf):
3083
- _UniffiConverterOptionalUInt64.write(value.amount, buf)
3084
-
3085
-
3086
3117
  class SilentPaymentAddressDetails:
3087
3118
  address: "str"
3088
3119
  network: "BitcoinNetwork"
@@ -3126,161 +3157,168 @@ class _UniffiConverterTypeSilentPaymentAddressDetails(_UniffiConverterRustBuffer
3126
3157
  _UniffiConverterTypePaymentRequestSource.write(value.source, buf)
3127
3158
 
3128
3159
 
3129
- class SparkAddress:
3160
+ class SparkAddressDetails:
3161
+ address: "str"
3162
+ """
3163
+ The raw address string
3164
+ """
3165
+
3130
3166
  identity_public_key: "str"
3167
+ """
3168
+ The identity public key of the address owner
3169
+ """
3170
+
3131
3171
  network: "BitcoinNetwork"
3132
- spark_invoice_fields: "typing.Optional[SparkInvoiceFields]"
3133
- signature: "typing.Optional[str]"
3134
- def __init__(self, *, identity_public_key: "str", network: "BitcoinNetwork", spark_invoice_fields: "typing.Optional[SparkInvoiceFields]", signature: "typing.Optional[str]"):
3172
+ source: "PaymentRequestSource"
3173
+ def __init__(self, *, address: "str", identity_public_key: "str", network: "BitcoinNetwork", source: "PaymentRequestSource"):
3174
+ self.address = address
3135
3175
  self.identity_public_key = identity_public_key
3136
3176
  self.network = network
3137
- self.spark_invoice_fields = spark_invoice_fields
3138
- self.signature = signature
3177
+ self.source = source
3139
3178
 
3140
3179
  def __str__(self):
3141
- return "SparkAddress(identity_public_key={}, network={}, spark_invoice_fields={}, signature={})".format(self.identity_public_key, self.network, self.spark_invoice_fields, self.signature)
3180
+ return "SparkAddressDetails(address={}, identity_public_key={}, network={}, source={})".format(self.address, self.identity_public_key, self.network, self.source)
3142
3181
 
3143
3182
  def __eq__(self, other):
3183
+ if self.address != other.address:
3184
+ return False
3144
3185
  if self.identity_public_key != other.identity_public_key:
3145
3186
  return False
3146
3187
  if self.network != other.network:
3147
3188
  return False
3148
- if self.spark_invoice_fields != other.spark_invoice_fields:
3149
- return False
3150
- if self.signature != other.signature:
3189
+ if self.source != other.source:
3151
3190
  return False
3152
3191
  return True
3153
3192
 
3154
- class _UniffiConverterTypeSparkAddress(_UniffiConverterRustBuffer):
3193
+ class _UniffiConverterTypeSparkAddressDetails(_UniffiConverterRustBuffer):
3155
3194
  @staticmethod
3156
3195
  def read(buf):
3157
- return SparkAddress(
3196
+ return SparkAddressDetails(
3197
+ address=_UniffiConverterString.read(buf),
3158
3198
  identity_public_key=_UniffiConverterString.read(buf),
3159
3199
  network=_UniffiConverterTypeBitcoinNetwork.read(buf),
3160
- spark_invoice_fields=_UniffiConverterOptionalTypeSparkInvoiceFields.read(buf),
3161
- signature=_UniffiConverterOptionalString.read(buf),
3200
+ source=_UniffiConverterTypePaymentRequestSource.read(buf),
3162
3201
  )
3163
3202
 
3164
3203
  @staticmethod
3165
3204
  def check_lower(value):
3205
+ _UniffiConverterString.check_lower(value.address)
3166
3206
  _UniffiConverterString.check_lower(value.identity_public_key)
3167
3207
  _UniffiConverterTypeBitcoinNetwork.check_lower(value.network)
3168
- _UniffiConverterOptionalTypeSparkInvoiceFields.check_lower(value.spark_invoice_fields)
3169
- _UniffiConverterOptionalString.check_lower(value.signature)
3208
+ _UniffiConverterTypePaymentRequestSource.check_lower(value.source)
3170
3209
 
3171
3210
  @staticmethod
3172
3211
  def write(value, buf):
3212
+ _UniffiConverterString.write(value.address, buf)
3173
3213
  _UniffiConverterString.write(value.identity_public_key, buf)
3174
3214
  _UniffiConverterTypeBitcoinNetwork.write(value.network, buf)
3175
- _UniffiConverterOptionalTypeSparkInvoiceFields.write(value.spark_invoice_fields, buf)
3176
- _UniffiConverterOptionalString.write(value.signature, buf)
3177
-
3215
+ _UniffiConverterTypePaymentRequestSource.write(value.source, buf)
3178
3216
 
3179
- class SparkAddressDetails:
3180
- address: "str"
3181
- decoded_address: "SparkAddress"
3182
- source: "PaymentRequestSource"
3183
- def __init__(self, *, address: "str", decoded_address: "SparkAddress", source: "PaymentRequestSource"):
3184
- self.address = address
3185
- self.decoded_address = decoded_address
3186
- self.source = source
3187
3217
 
3188
- def __str__(self):
3189
- return "SparkAddressDetails(address={}, decoded_address={}, source={})".format(self.address, self.decoded_address, self.source)
3218
+ class SparkInvoiceDetails:
3219
+ invoice: "str"
3220
+ """
3221
+ The raw invoice string
3222
+ """
3190
3223
 
3191
- def __eq__(self, other):
3192
- if self.address != other.address:
3193
- return False
3194
- if self.decoded_address != other.decoded_address:
3195
- return False
3196
- if self.source != other.source:
3197
- return False
3198
- return True
3224
+ identity_public_key: "str"
3225
+ """
3226
+ The identity public key of the invoice issuer
3227
+ """
3199
3228
 
3200
- class _UniffiConverterTypeSparkAddressDetails(_UniffiConverterRustBuffer):
3201
- @staticmethod
3202
- def read(buf):
3203
- return SparkAddressDetails(
3204
- address=_UniffiConverterString.read(buf),
3205
- decoded_address=_UniffiConverterTypeSparkAddress.read(buf),
3206
- source=_UniffiConverterTypePaymentRequestSource.read(buf),
3207
- )
3229
+ network: "BitcoinNetwork"
3230
+ amount: "typing.Optional[CommonU128]"
3231
+ """
3232
+ Optional amount denominated in sats if `token_identifier` is absent, otherwise in the token base units
3233
+ """
3208
3234
 
3209
- @staticmethod
3210
- def check_lower(value):
3211
- _UniffiConverterString.check_lower(value.address)
3212
- _UniffiConverterTypeSparkAddress.check_lower(value.decoded_address)
3213
- _UniffiConverterTypePaymentRequestSource.check_lower(value.source)
3235
+ token_identifier: "typing.Optional[str]"
3236
+ """
3237
+ The token identifier of the token payment. Absence indicates a Bitcoin payment.
3238
+ """
3214
3239
 
3215
- @staticmethod
3216
- def write(value, buf):
3217
- _UniffiConverterString.write(value.address, buf)
3218
- _UniffiConverterTypeSparkAddress.write(value.decoded_address, buf)
3219
- _UniffiConverterTypePaymentRequestSource.write(value.source, buf)
3240
+ expiry_time: "typing.Optional[int]"
3241
+ """
3242
+ Optional expiry time. If not provided, the invoice will never expire.
3243
+ """
3220
3244
 
3245
+ description: "typing.Optional[str]"
3246
+ """
3247
+ Optional description.
3248
+ """
3221
3249
 
3222
- class SparkInvoiceFields:
3223
- id: "str"
3224
- version: "int"
3225
- memo: "typing.Optional[str]"
3226
3250
  sender_public_key: "typing.Optional[str]"
3227
- expiry_time: "typing.Optional[int]"
3228
- payment_type: "typing.Optional[SparkAddressPaymentType]"
3229
- def __init__(self, *, id: "str", version: "int", memo: "typing.Optional[str]", sender_public_key: "typing.Optional[str]", expiry_time: "typing.Optional[int]", payment_type: "typing.Optional[SparkAddressPaymentType]"):
3230
- self.id = id
3231
- self.version = version
3232
- self.memo = memo
3233
- self.sender_public_key = sender_public_key
3251
+ """
3252
+ If set, the invoice may only be fulfilled by a payer with this public key.
3253
+ """
3254
+
3255
+ def __init__(self, *, invoice: "str", identity_public_key: "str", network: "BitcoinNetwork", amount: "typing.Optional[CommonU128]", token_identifier: "typing.Optional[str]", expiry_time: "typing.Optional[int]", description: "typing.Optional[str]", sender_public_key: "typing.Optional[str]"):
3256
+ self.invoice = invoice
3257
+ self.identity_public_key = identity_public_key
3258
+ self.network = network
3259
+ self.amount = amount
3260
+ self.token_identifier = token_identifier
3234
3261
  self.expiry_time = expiry_time
3235
- self.payment_type = payment_type
3262
+ self.description = description
3263
+ self.sender_public_key = sender_public_key
3236
3264
 
3237
3265
  def __str__(self):
3238
- return "SparkInvoiceFields(id={}, version={}, memo={}, sender_public_key={}, expiry_time={}, payment_type={})".format(self.id, self.version, self.memo, self.sender_public_key, self.expiry_time, self.payment_type)
3266
+ return "SparkInvoiceDetails(invoice={}, identity_public_key={}, network={}, amount={}, token_identifier={}, expiry_time={}, description={}, sender_public_key={})".format(self.invoice, self.identity_public_key, self.network, self.amount, self.token_identifier, self.expiry_time, self.description, self.sender_public_key)
3239
3267
 
3240
3268
  def __eq__(self, other):
3241
- if self.id != other.id:
3269
+ if self.invoice != other.invoice:
3242
3270
  return False
3243
- if self.version != other.version:
3271
+ if self.identity_public_key != other.identity_public_key:
3244
3272
  return False
3245
- if self.memo != other.memo:
3273
+ if self.network != other.network:
3246
3274
  return False
3247
- if self.sender_public_key != other.sender_public_key:
3275
+ if self.amount != other.amount:
3276
+ return False
3277
+ if self.token_identifier != other.token_identifier:
3248
3278
  return False
3249
3279
  if self.expiry_time != other.expiry_time:
3250
3280
  return False
3251
- if self.payment_type != other.payment_type:
3281
+ if self.description != other.description:
3282
+ return False
3283
+ if self.sender_public_key != other.sender_public_key:
3252
3284
  return False
3253
3285
  return True
3254
3286
 
3255
- class _UniffiConverterTypeSparkInvoiceFields(_UniffiConverterRustBuffer):
3287
+ class _UniffiConverterTypeSparkInvoiceDetails(_UniffiConverterRustBuffer):
3256
3288
  @staticmethod
3257
3289
  def read(buf):
3258
- return SparkInvoiceFields(
3259
- id=_UniffiConverterString.read(buf),
3260
- version=_UniffiConverterUInt32.read(buf),
3261
- memo=_UniffiConverterOptionalString.read(buf),
3262
- sender_public_key=_UniffiConverterOptionalString.read(buf),
3290
+ return SparkInvoiceDetails(
3291
+ invoice=_UniffiConverterString.read(buf),
3292
+ identity_public_key=_UniffiConverterString.read(buf),
3293
+ network=_UniffiConverterTypeBitcoinNetwork.read(buf),
3294
+ amount=_UniffiConverterOptionalTypeCommonU128.read(buf),
3295
+ token_identifier=_UniffiConverterOptionalString.read(buf),
3263
3296
  expiry_time=_UniffiConverterOptionalUInt64.read(buf),
3264
- payment_type=_UniffiConverterOptionalTypeSparkAddressPaymentType.read(buf),
3297
+ description=_UniffiConverterOptionalString.read(buf),
3298
+ sender_public_key=_UniffiConverterOptionalString.read(buf),
3265
3299
  )
3266
3300
 
3267
3301
  @staticmethod
3268
3302
  def check_lower(value):
3269
- _UniffiConverterString.check_lower(value.id)
3270
- _UniffiConverterUInt32.check_lower(value.version)
3271
- _UniffiConverterOptionalString.check_lower(value.memo)
3272
- _UniffiConverterOptionalString.check_lower(value.sender_public_key)
3303
+ _UniffiConverterString.check_lower(value.invoice)
3304
+ _UniffiConverterString.check_lower(value.identity_public_key)
3305
+ _UniffiConverterTypeBitcoinNetwork.check_lower(value.network)
3306
+ _UniffiConverterOptionalTypeCommonU128.check_lower(value.amount)
3307
+ _UniffiConverterOptionalString.check_lower(value.token_identifier)
3273
3308
  _UniffiConverterOptionalUInt64.check_lower(value.expiry_time)
3274
- _UniffiConverterOptionalTypeSparkAddressPaymentType.check_lower(value.payment_type)
3309
+ _UniffiConverterOptionalString.check_lower(value.description)
3310
+ _UniffiConverterOptionalString.check_lower(value.sender_public_key)
3275
3311
 
3276
3312
  @staticmethod
3277
3313
  def write(value, buf):
3278
- _UniffiConverterString.write(value.id, buf)
3279
- _UniffiConverterUInt32.write(value.version, buf)
3280
- _UniffiConverterOptionalString.write(value.memo, buf)
3281
- _UniffiConverterOptionalString.write(value.sender_public_key, buf)
3314
+ _UniffiConverterString.write(value.invoice, buf)
3315
+ _UniffiConverterString.write(value.identity_public_key, buf)
3316
+ _UniffiConverterTypeBitcoinNetwork.write(value.network, buf)
3317
+ _UniffiConverterOptionalTypeCommonU128.write(value.amount, buf)
3318
+ _UniffiConverterOptionalString.write(value.token_identifier, buf)
3282
3319
  _UniffiConverterOptionalUInt64.write(value.expiry_time, buf)
3283
- _UniffiConverterOptionalTypeSparkAddressPaymentType.write(value.payment_type, buf)
3320
+ _UniffiConverterOptionalString.write(value.description, buf)
3321
+ _UniffiConverterOptionalString.write(value.sender_public_key, buf)
3284
3322
 
3285
3323
 
3286
3324
  class Symbol:
@@ -3337,42 +3375,6 @@ class _UniffiConverterTypeSymbol(_UniffiConverterRustBuffer):
3337
3375
  _UniffiConverterOptionalUInt32.write(value.position, buf)
3338
3376
 
3339
3377
 
3340
- class TokensPaymentDetails:
3341
- token_identifier: "typing.Optional[str]"
3342
- amount: "typing.Optional[CommonU128]"
3343
- def __init__(self, *, token_identifier: "typing.Optional[str]", amount: "typing.Optional[CommonU128]"):
3344
- self.token_identifier = token_identifier
3345
- self.amount = amount
3346
-
3347
- def __str__(self):
3348
- return "TokensPaymentDetails(token_identifier={}, amount={})".format(self.token_identifier, self.amount)
3349
-
3350
- def __eq__(self, other):
3351
- if self.token_identifier != other.token_identifier:
3352
- return False
3353
- if self.amount != other.amount:
3354
- return False
3355
- return True
3356
-
3357
- class _UniffiConverterTypeTokensPaymentDetails(_UniffiConverterRustBuffer):
3358
- @staticmethod
3359
- def read(buf):
3360
- return TokensPaymentDetails(
3361
- token_identifier=_UniffiConverterOptionalString.read(buf),
3362
- amount=_UniffiConverterOptionalTypeCommonU128.read(buf),
3363
- )
3364
-
3365
- @staticmethod
3366
- def check_lower(value):
3367
- _UniffiConverterOptionalString.check_lower(value.token_identifier)
3368
- _UniffiConverterOptionalTypeCommonU128.check_lower(value.amount)
3369
-
3370
- @staticmethod
3371
- def write(value, buf):
3372
- _UniffiConverterOptionalString.write(value.token_identifier, buf)
3373
- _UniffiConverterOptionalTypeCommonU128.write(value.amount, buf)
3374
-
3375
-
3376
3378
  class UrlSuccessActionData:
3377
3379
  description: "str"
3378
3380
  """
@@ -3951,6 +3953,24 @@ class InputType:
3951
3953
  if not other.is_spark_address():
3952
3954
  return False
3953
3955
  return self._values == other._values
3956
+ class SPARK_INVOICE:
3957
+ def __init__(self, *values):
3958
+ if len(values) != 1:
3959
+ raise TypeError(f"Expected 1 arguments, found {len(values)}")
3960
+ if not isinstance(values[0], SparkInvoiceDetails):
3961
+ raise TypeError(f"unexpected type for tuple element 0 - expected 'SparkInvoiceDetails', got '{type(values[0])}'")
3962
+ self._values = values
3963
+
3964
+ def __getitem__(self, index):
3965
+ return self._values[index]
3966
+
3967
+ def __str__(self):
3968
+ return f"InputType.SPARK_INVOICE{self._values!r}"
3969
+
3970
+ def __eq__(self, other):
3971
+ if not other.is_spark_invoice():
3972
+ return False
3973
+ return self._values == other._values
3954
3974
 
3955
3975
 
3956
3976
  # For each variant, we have an `is_NAME` method for easily checking
@@ -3981,6 +4001,8 @@ class InputType:
3981
4001
  return isinstance(self, InputType.LNURL_WITHDRAW)
3982
4002
  def is_spark_address(self) -> bool:
3983
4003
  return isinstance(self, InputType.SPARK_ADDRESS)
4004
+ def is_spark_invoice(self) -> bool:
4005
+ return isinstance(self, InputType.SPARK_INVOICE)
3984
4006
 
3985
4007
 
3986
4008
  # Now, a little trick - we make each nested variant class be a subclass of the main
@@ -3999,6 +4021,7 @@ InputType.BIP21 = type("InputType.BIP21", (InputType.BIP21, InputType,), {}) #
3999
4021
  InputType.BOLT12_INVOICE_REQUEST = type("InputType.BOLT12_INVOICE_REQUEST", (InputType.BOLT12_INVOICE_REQUEST, InputType,), {}) # type: ignore
4000
4022
  InputType.LNURL_WITHDRAW = type("InputType.LNURL_WITHDRAW", (InputType.LNURL_WITHDRAW, InputType,), {}) # type: ignore
4001
4023
  InputType.SPARK_ADDRESS = type("InputType.SPARK_ADDRESS", (InputType.SPARK_ADDRESS, InputType,), {}) # type: ignore
4024
+ InputType.SPARK_INVOICE = type("InputType.SPARK_INVOICE", (InputType.SPARK_INVOICE, InputType,), {}) # type: ignore
4002
4025
 
4003
4026
 
4004
4027
 
@@ -4059,6 +4082,10 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
4059
4082
  return InputType.SPARK_ADDRESS(
4060
4083
  _UniffiConverterTypeSparkAddressDetails.read(buf),
4061
4084
  )
4085
+ if variant == 14:
4086
+ return InputType.SPARK_INVOICE(
4087
+ _UniffiConverterTypeSparkInvoiceDetails.read(buf),
4088
+ )
4062
4089
  raise InternalError("Raw enum value doesn't match any cases")
4063
4090
 
4064
4091
  @staticmethod
@@ -4102,6 +4129,9 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
4102
4129
  if value.is_spark_address():
4103
4130
  _UniffiConverterTypeSparkAddressDetails.check_lower(value._values[0])
4104
4131
  return
4132
+ if value.is_spark_invoice():
4133
+ _UniffiConverterTypeSparkInvoiceDetails.check_lower(value._values[0])
4134
+ return
4105
4135
  raise ValueError(value)
4106
4136
 
4107
4137
  @staticmethod
@@ -4145,6 +4175,9 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
4145
4175
  if value.is_spark_address():
4146
4176
  buf.write_i32(13)
4147
4177
  _UniffiConverterTypeSparkAddressDetails.write(value._values[0], buf)
4178
+ if value.is_spark_invoice():
4179
+ buf.write_i32(14)
4180
+ _UniffiConverterTypeSparkInvoiceDetails.write(value._values[0], buf)
4148
4181
 
4149
4182
 
4150
4183
 
@@ -4541,105 +4574,6 @@ class _UniffiConverterTypeServiceConnectivityError(_UniffiConverterRustBuffer):
4541
4574
 
4542
4575
 
4543
4576
 
4544
- class SparkAddressPaymentType:
4545
- def __init__(self):
4546
- raise RuntimeError("SparkAddressPaymentType cannot be instantiated directly")
4547
-
4548
- # Each enum variant is a nested class of the enum itself.
4549
- class TOKENS_PAYMENT:
4550
- def __init__(self, *values):
4551
- if len(values) != 1:
4552
- raise TypeError(f"Expected 1 arguments, found {len(values)}")
4553
- if not isinstance(values[0], TokensPaymentDetails):
4554
- raise TypeError(f"unexpected type for tuple element 0 - expected 'TokensPaymentDetails', got '{type(values[0])}'")
4555
- self._values = values
4556
-
4557
- def __getitem__(self, index):
4558
- return self._values[index]
4559
-
4560
- def __str__(self):
4561
- return f"SparkAddressPaymentType.TOKENS_PAYMENT{self._values!r}"
4562
-
4563
- def __eq__(self, other):
4564
- if not other.is_tokens_payment():
4565
- return False
4566
- return self._values == other._values
4567
- class SATS_PAYMENT:
4568
- def __init__(self, *values):
4569
- if len(values) != 1:
4570
- raise TypeError(f"Expected 1 arguments, found {len(values)}")
4571
- if not isinstance(values[0], SatsPaymentDetails):
4572
- raise TypeError(f"unexpected type for tuple element 0 - expected 'SatsPaymentDetails', got '{type(values[0])}'")
4573
- self._values = values
4574
-
4575
- def __getitem__(self, index):
4576
- return self._values[index]
4577
-
4578
- def __str__(self):
4579
- return f"SparkAddressPaymentType.SATS_PAYMENT{self._values!r}"
4580
-
4581
- def __eq__(self, other):
4582
- if not other.is_sats_payment():
4583
- return False
4584
- return self._values == other._values
4585
-
4586
-
4587
- # For each variant, we have an `is_NAME` method for easily checking
4588
- # whether an instance is that variant.
4589
- def is_tokens_payment(self) -> bool:
4590
- return isinstance(self, SparkAddressPaymentType.TOKENS_PAYMENT)
4591
- def is_sats_payment(self) -> bool:
4592
- return isinstance(self, SparkAddressPaymentType.SATS_PAYMENT)
4593
-
4594
-
4595
- # Now, a little trick - we make each nested variant class be a subclass of the main
4596
- # enum class, so that method calls and instance checks etc will work intuitively.
4597
- # We might be able to do this a little more neatly with a metaclass, but this'll do.
4598
- SparkAddressPaymentType.TOKENS_PAYMENT = type("SparkAddressPaymentType.TOKENS_PAYMENT", (SparkAddressPaymentType.TOKENS_PAYMENT, SparkAddressPaymentType,), {}) # type: ignore
4599
- SparkAddressPaymentType.SATS_PAYMENT = type("SparkAddressPaymentType.SATS_PAYMENT", (SparkAddressPaymentType.SATS_PAYMENT, SparkAddressPaymentType,), {}) # type: ignore
4600
-
4601
-
4602
-
4603
-
4604
- class _UniffiConverterTypeSparkAddressPaymentType(_UniffiConverterRustBuffer):
4605
- @staticmethod
4606
- def read(buf):
4607
- variant = buf.read_i32()
4608
- if variant == 1:
4609
- return SparkAddressPaymentType.TOKENS_PAYMENT(
4610
- _UniffiConverterTypeTokensPaymentDetails.read(buf),
4611
- )
4612
- if variant == 2:
4613
- return SparkAddressPaymentType.SATS_PAYMENT(
4614
- _UniffiConverterTypeSatsPaymentDetails.read(buf),
4615
- )
4616
- raise InternalError("Raw enum value doesn't match any cases")
4617
-
4618
- @staticmethod
4619
- def check_lower(value):
4620
- if value.is_tokens_payment():
4621
- _UniffiConverterTypeTokensPaymentDetails.check_lower(value._values[0])
4622
- return
4623
- if value.is_sats_payment():
4624
- _UniffiConverterTypeSatsPaymentDetails.check_lower(value._values[0])
4625
- return
4626
- raise ValueError(value)
4627
-
4628
- @staticmethod
4629
- def write(value, buf):
4630
- if value.is_tokens_payment():
4631
- buf.write_i32(1)
4632
- _UniffiConverterTypeTokensPaymentDetails.write(value._values[0], buf)
4633
- if value.is_sats_payment():
4634
- buf.write_i32(2)
4635
- _UniffiConverterTypeSatsPaymentDetails.write(value._values[0], buf)
4636
-
4637
-
4638
-
4639
-
4640
-
4641
-
4642
-
4643
4577
  class SuccessAction:
4644
4578
  """
4645
4579
  Supported success action types
@@ -5033,33 +4967,6 @@ class _UniffiConverterOptionalString(_UniffiConverterRustBuffer):
5033
4967
 
5034
4968
 
5035
4969
 
5036
- class _UniffiConverterOptionalTypeSparkInvoiceFields(_UniffiConverterRustBuffer):
5037
- @classmethod
5038
- def check_lower(cls, value):
5039
- if value is not None:
5040
- _UniffiConverterTypeSparkInvoiceFields.check_lower(value)
5041
-
5042
- @classmethod
5043
- def write(cls, value, buf):
5044
- if value is None:
5045
- buf.write_u8(0)
5046
- return
5047
-
5048
- buf.write_u8(1)
5049
- _UniffiConverterTypeSparkInvoiceFields.write(value, buf)
5050
-
5051
- @classmethod
5052
- def read(cls, buf):
5053
- flag = buf.read_u8()
5054
- if flag == 0:
5055
- return None
5056
- elif flag == 1:
5057
- return _UniffiConverterTypeSparkInvoiceFields.read(buf)
5058
- else:
5059
- raise InternalError("Unexpected flag byte for optional type")
5060
-
5061
-
5062
-
5063
4970
  class _UniffiConverterOptionalTypeSymbol(_UniffiConverterRustBuffer):
5064
4971
  @classmethod
5065
4972
  def check_lower(cls, value):
@@ -5114,33 +5021,6 @@ class _UniffiConverterOptionalTypeAmount(_UniffiConverterRustBuffer):
5114
5021
 
5115
5022
 
5116
5023
 
5117
- class _UniffiConverterOptionalTypeSparkAddressPaymentType(_UniffiConverterRustBuffer):
5118
- @classmethod
5119
- def check_lower(cls, value):
5120
- if value is not None:
5121
- _UniffiConverterTypeSparkAddressPaymentType.check_lower(value)
5122
-
5123
- @classmethod
5124
- def write(cls, value, buf):
5125
- if value is None:
5126
- buf.write_u8(0)
5127
- return
5128
-
5129
- buf.write_u8(1)
5130
- _UniffiConverterTypeSparkAddressPaymentType.write(value, buf)
5131
-
5132
- @classmethod
5133
- def read(cls, buf):
5134
- flag = buf.read_u8()
5135
- if flag == 0:
5136
- return None
5137
- elif flag == 1:
5138
- return _UniffiConverterTypeSparkAddressPaymentType.read(buf)
5139
- else:
5140
- raise InternalError("Unexpected flag byte for optional type")
5141
-
5142
-
5143
-
5144
5024
  class _UniffiConverterOptionalMapStringString(_UniffiConverterRustBuffer):
5145
5025
  @classmethod
5146
5026
  def check_lower(cls, value):
@@ -5624,7 +5504,6 @@ __all__ = [
5624
5504
  "InputType",
5625
5505
  "LnurlCallbackStatus",
5626
5506
  "ServiceConnectivityError",
5627
- "SparkAddressPaymentType",
5628
5507
  "SuccessAction",
5629
5508
  "SuccessActionProcessed",
5630
5509
  "AesSuccessActionData",
@@ -5643,6 +5522,7 @@ __all__ = [
5643
5522
  "Bolt12OfferBlindedPath",
5644
5523
  "Bolt12OfferDetails",
5645
5524
  "CurrencyInfo",
5525
+ "ExternalInputParser",
5646
5526
  "FiatCurrency",
5647
5527
  "LightningAddressDetails",
5648
5528
  "LnurlAuthRequestDetails",
@@ -5655,13 +5535,10 @@ __all__ = [
5655
5535
  "PaymentRequestSource",
5656
5536
  "Rate",
5657
5537
  "RestResponse",
5658
- "SatsPaymentDetails",
5659
5538
  "SilentPaymentAddressDetails",
5660
- "SparkAddress",
5661
5539
  "SparkAddressDetails",
5662
- "SparkInvoiceFields",
5540
+ "SparkInvoiceDetails",
5663
5541
  "Symbol",
5664
- "TokensPaymentDetails",
5665
5542
  "UrlSuccessActionData",
5666
5543
  "FiatService",
5667
5544
  "RestClient",