breez-sdk-spark 0.3.2__cp311-cp311-win32.whl → 0.3.4__cp311-cp311-win32.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.
- breez_sdk_spark/breez_sdk_common.py +129 -313
- breez_sdk_spark/breez_sdk_spark.py +806 -36
- breez_sdk_spark/breez_sdk_spark_bindings.dll +0 -0
- {breez_sdk_spark-0.3.2.dist-info → breez_sdk_spark-0.3.4.dist-info}/METADATA +1 -1
- breez_sdk_spark-0.3.4.dist-info/RECORD +11 -0
- breez_sdk_spark-0.3.2.dist-info/RECORD +0 -11
- {breez_sdk_spark-0.3.2.dist-info → breez_sdk_spark-0.3.4.dist-info}/WHEEL +0 -0
- {breez_sdk_spark-0.3.2.dist-info → breez_sdk_spark-0.3.4.dist-info}/top_level.txt +0 -0
|
@@ -3114,35 +3114,6 @@ class _UniffiConverterTypeRestResponse(_UniffiConverterRustBuffer):
|
|
|
3114
3114
|
_UniffiConverterString.write(value.body, buf)
|
|
3115
3115
|
|
|
3116
3116
|
|
|
3117
|
-
class SatsPaymentDetails:
|
|
3118
|
-
amount: "typing.Optional[int]"
|
|
3119
|
-
def __init__(self, *, amount: "typing.Optional[int]"):
|
|
3120
|
-
self.amount = amount
|
|
3121
|
-
|
|
3122
|
-
def __str__(self):
|
|
3123
|
-
return "SatsPaymentDetails(amount={})".format(self.amount)
|
|
3124
|
-
|
|
3125
|
-
def __eq__(self, other):
|
|
3126
|
-
if self.amount != other.amount:
|
|
3127
|
-
return False
|
|
3128
|
-
return True
|
|
3129
|
-
|
|
3130
|
-
class _UniffiConverterTypeSatsPaymentDetails(_UniffiConverterRustBuffer):
|
|
3131
|
-
@staticmethod
|
|
3132
|
-
def read(buf):
|
|
3133
|
-
return SatsPaymentDetails(
|
|
3134
|
-
amount=_UniffiConverterOptionalUInt64.read(buf),
|
|
3135
|
-
)
|
|
3136
|
-
|
|
3137
|
-
@staticmethod
|
|
3138
|
-
def check_lower(value):
|
|
3139
|
-
_UniffiConverterOptionalUInt64.check_lower(value.amount)
|
|
3140
|
-
|
|
3141
|
-
@staticmethod
|
|
3142
|
-
def write(value, buf):
|
|
3143
|
-
_UniffiConverterOptionalUInt64.write(value.amount, buf)
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
3117
|
class SilentPaymentAddressDetails:
|
|
3147
3118
|
address: "str"
|
|
3148
3119
|
network: "BitcoinNetwork"
|
|
@@ -3186,161 +3157,168 @@ class _UniffiConverterTypeSilentPaymentAddressDetails(_UniffiConverterRustBuffer
|
|
|
3186
3157
|
_UniffiConverterTypePaymentRequestSource.write(value.source, buf)
|
|
3187
3158
|
|
|
3188
3159
|
|
|
3189
|
-
class
|
|
3160
|
+
class SparkAddressDetails:
|
|
3161
|
+
address: "str"
|
|
3162
|
+
"""
|
|
3163
|
+
The raw address string
|
|
3164
|
+
"""
|
|
3165
|
+
|
|
3190
3166
|
identity_public_key: "str"
|
|
3167
|
+
"""
|
|
3168
|
+
The identity public key of the address owner
|
|
3169
|
+
"""
|
|
3170
|
+
|
|
3191
3171
|
network: "BitcoinNetwork"
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3172
|
+
source: "PaymentRequestSource"
|
|
3173
|
+
def __init__(self, *, address: "str", identity_public_key: "str", network: "BitcoinNetwork", source: "PaymentRequestSource"):
|
|
3174
|
+
self.address = address
|
|
3195
3175
|
self.identity_public_key = identity_public_key
|
|
3196
3176
|
self.network = network
|
|
3197
|
-
self.
|
|
3198
|
-
self.signature = signature
|
|
3177
|
+
self.source = source
|
|
3199
3178
|
|
|
3200
3179
|
def __str__(self):
|
|
3201
|
-
return "
|
|
3180
|
+
return "SparkAddressDetails(address={}, identity_public_key={}, network={}, source={})".format(self.address, self.identity_public_key, self.network, self.source)
|
|
3202
3181
|
|
|
3203
3182
|
def __eq__(self, other):
|
|
3183
|
+
if self.address != other.address:
|
|
3184
|
+
return False
|
|
3204
3185
|
if self.identity_public_key != other.identity_public_key:
|
|
3205
3186
|
return False
|
|
3206
3187
|
if self.network != other.network:
|
|
3207
3188
|
return False
|
|
3208
|
-
if self.
|
|
3209
|
-
return False
|
|
3210
|
-
if self.signature != other.signature:
|
|
3189
|
+
if self.source != other.source:
|
|
3211
3190
|
return False
|
|
3212
3191
|
return True
|
|
3213
3192
|
|
|
3214
|
-
class
|
|
3193
|
+
class _UniffiConverterTypeSparkAddressDetails(_UniffiConverterRustBuffer):
|
|
3215
3194
|
@staticmethod
|
|
3216
3195
|
def read(buf):
|
|
3217
|
-
return
|
|
3196
|
+
return SparkAddressDetails(
|
|
3197
|
+
address=_UniffiConverterString.read(buf),
|
|
3218
3198
|
identity_public_key=_UniffiConverterString.read(buf),
|
|
3219
3199
|
network=_UniffiConverterTypeBitcoinNetwork.read(buf),
|
|
3220
|
-
|
|
3221
|
-
signature=_UniffiConverterOptionalString.read(buf),
|
|
3200
|
+
source=_UniffiConverterTypePaymentRequestSource.read(buf),
|
|
3222
3201
|
)
|
|
3223
3202
|
|
|
3224
3203
|
@staticmethod
|
|
3225
3204
|
def check_lower(value):
|
|
3205
|
+
_UniffiConverterString.check_lower(value.address)
|
|
3226
3206
|
_UniffiConverterString.check_lower(value.identity_public_key)
|
|
3227
3207
|
_UniffiConverterTypeBitcoinNetwork.check_lower(value.network)
|
|
3228
|
-
|
|
3229
|
-
_UniffiConverterOptionalString.check_lower(value.signature)
|
|
3208
|
+
_UniffiConverterTypePaymentRequestSource.check_lower(value.source)
|
|
3230
3209
|
|
|
3231
3210
|
@staticmethod
|
|
3232
3211
|
def write(value, buf):
|
|
3212
|
+
_UniffiConverterString.write(value.address, buf)
|
|
3233
3213
|
_UniffiConverterString.write(value.identity_public_key, buf)
|
|
3234
3214
|
_UniffiConverterTypeBitcoinNetwork.write(value.network, buf)
|
|
3235
|
-
|
|
3236
|
-
_UniffiConverterOptionalString.write(value.signature, buf)
|
|
3215
|
+
_UniffiConverterTypePaymentRequestSource.write(value.source, buf)
|
|
3237
3216
|
|
|
3238
3217
|
|
|
3239
|
-
class
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
self.address = address
|
|
3245
|
-
self.decoded_address = decoded_address
|
|
3246
|
-
self.source = source
|
|
3247
|
-
|
|
3248
|
-
def __str__(self):
|
|
3249
|
-
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
|
+
"""
|
|
3250
3223
|
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
return False
|
|
3256
|
-
if self.source != other.source:
|
|
3257
|
-
return False
|
|
3258
|
-
return True
|
|
3224
|
+
identity_public_key: "str"
|
|
3225
|
+
"""
|
|
3226
|
+
The identity public key of the invoice issuer
|
|
3227
|
+
"""
|
|
3259
3228
|
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
decoded_address=_UniffiConverterTypeSparkAddress.read(buf),
|
|
3266
|
-
source=_UniffiConverterTypePaymentRequestSource.read(buf),
|
|
3267
|
-
)
|
|
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
|
+
"""
|
|
3268
3234
|
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
_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
|
+
"""
|
|
3274
3239
|
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
_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
|
+
"""
|
|
3280
3244
|
|
|
3245
|
+
description: "typing.Optional[str]"
|
|
3246
|
+
"""
|
|
3247
|
+
Optional description.
|
|
3248
|
+
"""
|
|
3281
3249
|
|
|
3282
|
-
class SparkInvoiceFields:
|
|
3283
|
-
id: "str"
|
|
3284
|
-
version: "int"
|
|
3285
|
-
memo: "typing.Optional[str]"
|
|
3286
3250
|
sender_public_key: "typing.Optional[str]"
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
self.
|
|
3293
|
-
self.
|
|
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
|
|
3294
3261
|
self.expiry_time = expiry_time
|
|
3295
|
-
self.
|
|
3262
|
+
self.description = description
|
|
3263
|
+
self.sender_public_key = sender_public_key
|
|
3296
3264
|
|
|
3297
3265
|
def __str__(self):
|
|
3298
|
-
return "
|
|
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)
|
|
3299
3267
|
|
|
3300
3268
|
def __eq__(self, other):
|
|
3301
|
-
if self.
|
|
3269
|
+
if self.invoice != other.invoice:
|
|
3302
3270
|
return False
|
|
3303
|
-
if self.
|
|
3271
|
+
if self.identity_public_key != other.identity_public_key:
|
|
3304
3272
|
return False
|
|
3305
|
-
if self.
|
|
3273
|
+
if self.network != other.network:
|
|
3306
3274
|
return False
|
|
3307
|
-
if self.
|
|
3275
|
+
if self.amount != other.amount:
|
|
3276
|
+
return False
|
|
3277
|
+
if self.token_identifier != other.token_identifier:
|
|
3308
3278
|
return False
|
|
3309
3279
|
if self.expiry_time != other.expiry_time:
|
|
3310
3280
|
return False
|
|
3311
|
-
if self.
|
|
3281
|
+
if self.description != other.description:
|
|
3282
|
+
return False
|
|
3283
|
+
if self.sender_public_key != other.sender_public_key:
|
|
3312
3284
|
return False
|
|
3313
3285
|
return True
|
|
3314
3286
|
|
|
3315
|
-
class
|
|
3287
|
+
class _UniffiConverterTypeSparkInvoiceDetails(_UniffiConverterRustBuffer):
|
|
3316
3288
|
@staticmethod
|
|
3317
3289
|
def read(buf):
|
|
3318
|
-
return
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
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),
|
|
3323
3296
|
expiry_time=_UniffiConverterOptionalUInt64.read(buf),
|
|
3324
|
-
|
|
3297
|
+
description=_UniffiConverterOptionalString.read(buf),
|
|
3298
|
+
sender_public_key=_UniffiConverterOptionalString.read(buf),
|
|
3325
3299
|
)
|
|
3326
3300
|
|
|
3327
3301
|
@staticmethod
|
|
3328
3302
|
def check_lower(value):
|
|
3329
|
-
_UniffiConverterString.check_lower(value.
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
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)
|
|
3333
3308
|
_UniffiConverterOptionalUInt64.check_lower(value.expiry_time)
|
|
3334
|
-
|
|
3309
|
+
_UniffiConverterOptionalString.check_lower(value.description)
|
|
3310
|
+
_UniffiConverterOptionalString.check_lower(value.sender_public_key)
|
|
3335
3311
|
|
|
3336
3312
|
@staticmethod
|
|
3337
3313
|
def write(value, buf):
|
|
3338
|
-
_UniffiConverterString.write(value.
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
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)
|
|
3342
3319
|
_UniffiConverterOptionalUInt64.write(value.expiry_time, buf)
|
|
3343
|
-
|
|
3320
|
+
_UniffiConverterOptionalString.write(value.description, buf)
|
|
3321
|
+
_UniffiConverterOptionalString.write(value.sender_public_key, buf)
|
|
3344
3322
|
|
|
3345
3323
|
|
|
3346
3324
|
class Symbol:
|
|
@@ -3397,42 +3375,6 @@ class _UniffiConverterTypeSymbol(_UniffiConverterRustBuffer):
|
|
|
3397
3375
|
_UniffiConverterOptionalUInt32.write(value.position, buf)
|
|
3398
3376
|
|
|
3399
3377
|
|
|
3400
|
-
class TokensPaymentDetails:
|
|
3401
|
-
token_identifier: "typing.Optional[str]"
|
|
3402
|
-
amount: "typing.Optional[CommonU128]"
|
|
3403
|
-
def __init__(self, *, token_identifier: "typing.Optional[str]", amount: "typing.Optional[CommonU128]"):
|
|
3404
|
-
self.token_identifier = token_identifier
|
|
3405
|
-
self.amount = amount
|
|
3406
|
-
|
|
3407
|
-
def __str__(self):
|
|
3408
|
-
return "TokensPaymentDetails(token_identifier={}, amount={})".format(self.token_identifier, self.amount)
|
|
3409
|
-
|
|
3410
|
-
def __eq__(self, other):
|
|
3411
|
-
if self.token_identifier != other.token_identifier:
|
|
3412
|
-
return False
|
|
3413
|
-
if self.amount != other.amount:
|
|
3414
|
-
return False
|
|
3415
|
-
return True
|
|
3416
|
-
|
|
3417
|
-
class _UniffiConverterTypeTokensPaymentDetails(_UniffiConverterRustBuffer):
|
|
3418
|
-
@staticmethod
|
|
3419
|
-
def read(buf):
|
|
3420
|
-
return TokensPaymentDetails(
|
|
3421
|
-
token_identifier=_UniffiConverterOptionalString.read(buf),
|
|
3422
|
-
amount=_UniffiConverterOptionalTypeCommonU128.read(buf),
|
|
3423
|
-
)
|
|
3424
|
-
|
|
3425
|
-
@staticmethod
|
|
3426
|
-
def check_lower(value):
|
|
3427
|
-
_UniffiConverterOptionalString.check_lower(value.token_identifier)
|
|
3428
|
-
_UniffiConverterOptionalTypeCommonU128.check_lower(value.amount)
|
|
3429
|
-
|
|
3430
|
-
@staticmethod
|
|
3431
|
-
def write(value, buf):
|
|
3432
|
-
_UniffiConverterOptionalString.write(value.token_identifier, buf)
|
|
3433
|
-
_UniffiConverterOptionalTypeCommonU128.write(value.amount, buf)
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
3378
|
class UrlSuccessActionData:
|
|
3437
3379
|
description: "str"
|
|
3438
3380
|
"""
|
|
@@ -4011,6 +3953,24 @@ class InputType:
|
|
|
4011
3953
|
if not other.is_spark_address():
|
|
4012
3954
|
return False
|
|
4013
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
|
|
4014
3974
|
|
|
4015
3975
|
|
|
4016
3976
|
# For each variant, we have an `is_NAME` method for easily checking
|
|
@@ -4041,6 +4001,8 @@ class InputType:
|
|
|
4041
4001
|
return isinstance(self, InputType.LNURL_WITHDRAW)
|
|
4042
4002
|
def is_spark_address(self) -> bool:
|
|
4043
4003
|
return isinstance(self, InputType.SPARK_ADDRESS)
|
|
4004
|
+
def is_spark_invoice(self) -> bool:
|
|
4005
|
+
return isinstance(self, InputType.SPARK_INVOICE)
|
|
4044
4006
|
|
|
4045
4007
|
|
|
4046
4008
|
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
@@ -4059,6 +4021,7 @@ InputType.BIP21 = type("InputType.BIP21", (InputType.BIP21, InputType,), {}) #
|
|
|
4059
4021
|
InputType.BOLT12_INVOICE_REQUEST = type("InputType.BOLT12_INVOICE_REQUEST", (InputType.BOLT12_INVOICE_REQUEST, InputType,), {}) # type: ignore
|
|
4060
4022
|
InputType.LNURL_WITHDRAW = type("InputType.LNURL_WITHDRAW", (InputType.LNURL_WITHDRAW, InputType,), {}) # type: ignore
|
|
4061
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
|
|
4062
4025
|
|
|
4063
4026
|
|
|
4064
4027
|
|
|
@@ -4119,6 +4082,10 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
|
|
|
4119
4082
|
return InputType.SPARK_ADDRESS(
|
|
4120
4083
|
_UniffiConverterTypeSparkAddressDetails.read(buf),
|
|
4121
4084
|
)
|
|
4085
|
+
if variant == 14:
|
|
4086
|
+
return InputType.SPARK_INVOICE(
|
|
4087
|
+
_UniffiConverterTypeSparkInvoiceDetails.read(buf),
|
|
4088
|
+
)
|
|
4122
4089
|
raise InternalError("Raw enum value doesn't match any cases")
|
|
4123
4090
|
|
|
4124
4091
|
@staticmethod
|
|
@@ -4162,6 +4129,9 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
|
|
|
4162
4129
|
if value.is_spark_address():
|
|
4163
4130
|
_UniffiConverterTypeSparkAddressDetails.check_lower(value._values[0])
|
|
4164
4131
|
return
|
|
4132
|
+
if value.is_spark_invoice():
|
|
4133
|
+
_UniffiConverterTypeSparkInvoiceDetails.check_lower(value._values[0])
|
|
4134
|
+
return
|
|
4165
4135
|
raise ValueError(value)
|
|
4166
4136
|
|
|
4167
4137
|
@staticmethod
|
|
@@ -4205,6 +4175,9 @@ class _UniffiConverterTypeInputType(_UniffiConverterRustBuffer):
|
|
|
4205
4175
|
if value.is_spark_address():
|
|
4206
4176
|
buf.write_i32(13)
|
|
4207
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)
|
|
4208
4181
|
|
|
4209
4182
|
|
|
4210
4183
|
|
|
@@ -4601,105 +4574,6 @@ class _UniffiConverterTypeServiceConnectivityError(_UniffiConverterRustBuffer):
|
|
|
4601
4574
|
|
|
4602
4575
|
|
|
4603
4576
|
|
|
4604
|
-
class SparkAddressPaymentType:
|
|
4605
|
-
def __init__(self):
|
|
4606
|
-
raise RuntimeError("SparkAddressPaymentType cannot be instantiated directly")
|
|
4607
|
-
|
|
4608
|
-
# Each enum variant is a nested class of the enum itself.
|
|
4609
|
-
class TOKENS_PAYMENT:
|
|
4610
|
-
def __init__(self, *values):
|
|
4611
|
-
if len(values) != 1:
|
|
4612
|
-
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
4613
|
-
if not isinstance(values[0], TokensPaymentDetails):
|
|
4614
|
-
raise TypeError(f"unexpected type for tuple element 0 - expected 'TokensPaymentDetails', got '{type(values[0])}'")
|
|
4615
|
-
self._values = values
|
|
4616
|
-
|
|
4617
|
-
def __getitem__(self, index):
|
|
4618
|
-
return self._values[index]
|
|
4619
|
-
|
|
4620
|
-
def __str__(self):
|
|
4621
|
-
return f"SparkAddressPaymentType.TOKENS_PAYMENT{self._values!r}"
|
|
4622
|
-
|
|
4623
|
-
def __eq__(self, other):
|
|
4624
|
-
if not other.is_tokens_payment():
|
|
4625
|
-
return False
|
|
4626
|
-
return self._values == other._values
|
|
4627
|
-
class SATS_PAYMENT:
|
|
4628
|
-
def __init__(self, *values):
|
|
4629
|
-
if len(values) != 1:
|
|
4630
|
-
raise TypeError(f"Expected 1 arguments, found {len(values)}")
|
|
4631
|
-
if not isinstance(values[0], SatsPaymentDetails):
|
|
4632
|
-
raise TypeError(f"unexpected type for tuple element 0 - expected 'SatsPaymentDetails', got '{type(values[0])}'")
|
|
4633
|
-
self._values = values
|
|
4634
|
-
|
|
4635
|
-
def __getitem__(self, index):
|
|
4636
|
-
return self._values[index]
|
|
4637
|
-
|
|
4638
|
-
def __str__(self):
|
|
4639
|
-
return f"SparkAddressPaymentType.SATS_PAYMENT{self._values!r}"
|
|
4640
|
-
|
|
4641
|
-
def __eq__(self, other):
|
|
4642
|
-
if not other.is_sats_payment():
|
|
4643
|
-
return False
|
|
4644
|
-
return self._values == other._values
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
# For each variant, we have an `is_NAME` method for easily checking
|
|
4648
|
-
# whether an instance is that variant.
|
|
4649
|
-
def is_tokens_payment(self) -> bool:
|
|
4650
|
-
return isinstance(self, SparkAddressPaymentType.TOKENS_PAYMENT)
|
|
4651
|
-
def is_sats_payment(self) -> bool:
|
|
4652
|
-
return isinstance(self, SparkAddressPaymentType.SATS_PAYMENT)
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
# Now, a little trick - we make each nested variant class be a subclass of the main
|
|
4656
|
-
# enum class, so that method calls and instance checks etc will work intuitively.
|
|
4657
|
-
# We might be able to do this a little more neatly with a metaclass, but this'll do.
|
|
4658
|
-
SparkAddressPaymentType.TOKENS_PAYMENT = type("SparkAddressPaymentType.TOKENS_PAYMENT", (SparkAddressPaymentType.TOKENS_PAYMENT, SparkAddressPaymentType,), {}) # type: ignore
|
|
4659
|
-
SparkAddressPaymentType.SATS_PAYMENT = type("SparkAddressPaymentType.SATS_PAYMENT", (SparkAddressPaymentType.SATS_PAYMENT, SparkAddressPaymentType,), {}) # type: ignore
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
class _UniffiConverterTypeSparkAddressPaymentType(_UniffiConverterRustBuffer):
|
|
4665
|
-
@staticmethod
|
|
4666
|
-
def read(buf):
|
|
4667
|
-
variant = buf.read_i32()
|
|
4668
|
-
if variant == 1:
|
|
4669
|
-
return SparkAddressPaymentType.TOKENS_PAYMENT(
|
|
4670
|
-
_UniffiConverterTypeTokensPaymentDetails.read(buf),
|
|
4671
|
-
)
|
|
4672
|
-
if variant == 2:
|
|
4673
|
-
return SparkAddressPaymentType.SATS_PAYMENT(
|
|
4674
|
-
_UniffiConverterTypeSatsPaymentDetails.read(buf),
|
|
4675
|
-
)
|
|
4676
|
-
raise InternalError("Raw enum value doesn't match any cases")
|
|
4677
|
-
|
|
4678
|
-
@staticmethod
|
|
4679
|
-
def check_lower(value):
|
|
4680
|
-
if value.is_tokens_payment():
|
|
4681
|
-
_UniffiConverterTypeTokensPaymentDetails.check_lower(value._values[0])
|
|
4682
|
-
return
|
|
4683
|
-
if value.is_sats_payment():
|
|
4684
|
-
_UniffiConverterTypeSatsPaymentDetails.check_lower(value._values[0])
|
|
4685
|
-
return
|
|
4686
|
-
raise ValueError(value)
|
|
4687
|
-
|
|
4688
|
-
@staticmethod
|
|
4689
|
-
def write(value, buf):
|
|
4690
|
-
if value.is_tokens_payment():
|
|
4691
|
-
buf.write_i32(1)
|
|
4692
|
-
_UniffiConverterTypeTokensPaymentDetails.write(value._values[0], buf)
|
|
4693
|
-
if value.is_sats_payment():
|
|
4694
|
-
buf.write_i32(2)
|
|
4695
|
-
_UniffiConverterTypeSatsPaymentDetails.write(value._values[0], buf)
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
4577
|
class SuccessAction:
|
|
4704
4578
|
"""
|
|
4705
4579
|
Supported success action types
|
|
@@ -5093,33 +4967,6 @@ class _UniffiConverterOptionalString(_UniffiConverterRustBuffer):
|
|
|
5093
4967
|
|
|
5094
4968
|
|
|
5095
4969
|
|
|
5096
|
-
class _UniffiConverterOptionalTypeSparkInvoiceFields(_UniffiConverterRustBuffer):
|
|
5097
|
-
@classmethod
|
|
5098
|
-
def check_lower(cls, value):
|
|
5099
|
-
if value is not None:
|
|
5100
|
-
_UniffiConverterTypeSparkInvoiceFields.check_lower(value)
|
|
5101
|
-
|
|
5102
|
-
@classmethod
|
|
5103
|
-
def write(cls, value, buf):
|
|
5104
|
-
if value is None:
|
|
5105
|
-
buf.write_u8(0)
|
|
5106
|
-
return
|
|
5107
|
-
|
|
5108
|
-
buf.write_u8(1)
|
|
5109
|
-
_UniffiConverterTypeSparkInvoiceFields.write(value, buf)
|
|
5110
|
-
|
|
5111
|
-
@classmethod
|
|
5112
|
-
def read(cls, buf):
|
|
5113
|
-
flag = buf.read_u8()
|
|
5114
|
-
if flag == 0:
|
|
5115
|
-
return None
|
|
5116
|
-
elif flag == 1:
|
|
5117
|
-
return _UniffiConverterTypeSparkInvoiceFields.read(buf)
|
|
5118
|
-
else:
|
|
5119
|
-
raise InternalError("Unexpected flag byte for optional type")
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
4970
|
class _UniffiConverterOptionalTypeSymbol(_UniffiConverterRustBuffer):
|
|
5124
4971
|
@classmethod
|
|
5125
4972
|
def check_lower(cls, value):
|
|
@@ -5174,33 +5021,6 @@ class _UniffiConverterOptionalTypeAmount(_UniffiConverterRustBuffer):
|
|
|
5174
5021
|
|
|
5175
5022
|
|
|
5176
5023
|
|
|
5177
|
-
class _UniffiConverterOptionalTypeSparkAddressPaymentType(_UniffiConverterRustBuffer):
|
|
5178
|
-
@classmethod
|
|
5179
|
-
def check_lower(cls, value):
|
|
5180
|
-
if value is not None:
|
|
5181
|
-
_UniffiConverterTypeSparkAddressPaymentType.check_lower(value)
|
|
5182
|
-
|
|
5183
|
-
@classmethod
|
|
5184
|
-
def write(cls, value, buf):
|
|
5185
|
-
if value is None:
|
|
5186
|
-
buf.write_u8(0)
|
|
5187
|
-
return
|
|
5188
|
-
|
|
5189
|
-
buf.write_u8(1)
|
|
5190
|
-
_UniffiConverterTypeSparkAddressPaymentType.write(value, buf)
|
|
5191
|
-
|
|
5192
|
-
@classmethod
|
|
5193
|
-
def read(cls, buf):
|
|
5194
|
-
flag = buf.read_u8()
|
|
5195
|
-
if flag == 0:
|
|
5196
|
-
return None
|
|
5197
|
-
elif flag == 1:
|
|
5198
|
-
return _UniffiConverterTypeSparkAddressPaymentType.read(buf)
|
|
5199
|
-
else:
|
|
5200
|
-
raise InternalError("Unexpected flag byte for optional type")
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
5024
|
class _UniffiConverterOptionalMapStringString(_UniffiConverterRustBuffer):
|
|
5205
5025
|
@classmethod
|
|
5206
5026
|
def check_lower(cls, value):
|
|
@@ -5684,7 +5504,6 @@ __all__ = [
|
|
|
5684
5504
|
"InputType",
|
|
5685
5505
|
"LnurlCallbackStatus",
|
|
5686
5506
|
"ServiceConnectivityError",
|
|
5687
|
-
"SparkAddressPaymentType",
|
|
5688
5507
|
"SuccessAction",
|
|
5689
5508
|
"SuccessActionProcessed",
|
|
5690
5509
|
"AesSuccessActionData",
|
|
@@ -5716,13 +5535,10 @@ __all__ = [
|
|
|
5716
5535
|
"PaymentRequestSource",
|
|
5717
5536
|
"Rate",
|
|
5718
5537
|
"RestResponse",
|
|
5719
|
-
"SatsPaymentDetails",
|
|
5720
5538
|
"SilentPaymentAddressDetails",
|
|
5721
|
-
"SparkAddress",
|
|
5722
5539
|
"SparkAddressDetails",
|
|
5723
|
-
"
|
|
5540
|
+
"SparkInvoiceDetails",
|
|
5724
5541
|
"Symbol",
|
|
5725
|
-
"TokensPaymentDetails",
|
|
5726
5542
|
"UrlSuccessActionData",
|
|
5727
5543
|
"FiatService",
|
|
5728
5544
|
"RestClient",
|