diff --git a/packages/dart/lib/src/frb_generated.dart b/packages/dart/lib/src/frb_generated.dart index 5f552edef..a02364a5e 100644 --- a/packages/dart/lib/src/frb_generated.dart +++ b/packages/dart/lib/src/frb_generated.dart @@ -1699,7 +1699,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { Config dco_decode_config(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 12) throw Exception('unexpected arr length: expect 12 but see ${arr.length}'); + if (arr.length != 13) throw Exception('unexpected arr length: expect 13 but see ${arr.length}'); return Config( liquidElectrumUrl: dco_decode_String(arr[0]), bitcoinElectrumUrl: dco_decode_String(arr[1]), @@ -1709,10 +1709,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { network: dco_decode_liquid_network(arr[5]), paymentTimeoutSec: dco_decode_u_64(arr[6]), zeroConfMinFeeRateMsat: dco_decode_u_32(arr[7]), - zeroConfMaxAmountSat: dco_decode_opt_box_autoadd_u_64(arr[8]), - breezApiKey: dco_decode_opt_String(arr[9]), - externalInputParsers: dco_decode_opt_list_external_input_parser(arr[10]), - useDefaultExternalInputParsers: dco_decode_bool(arr[11]), + syncServiceUrl: dco_decode_String(arr[8]), + zeroConfMaxAmountSat: dco_decode_opt_box_autoadd_u_64(arr[9]), + breezApiKey: dco_decode_opt_String(arr[10]), + externalInputParsers: dco_decode_opt_list_external_input_parser(arr[11]), + useDefaultExternalInputParsers: dco_decode_bool(arr[12]), ); } @@ -1963,6 +1964,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } } + @protected + List dco_decode_list_payment_state(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return (raw as List).map(dco_decode_payment_state).toList(); + } + @protected List dco_decode_list_payment_type(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1973,14 +1980,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ListPaymentsRequest dco_decode_list_payments_request(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs final arr = raw as List; - if (arr.length != 6) throw Exception('unexpected arr length: expect 6 but see ${arr.length}'); + if (arr.length != 7) throw Exception('unexpected arr length: expect 7 but see ${arr.length}'); return ListPaymentsRequest( filters: dco_decode_opt_list_payment_type(arr[0]), - fromTimestamp: dco_decode_opt_box_autoadd_i_64(arr[1]), - toTimestamp: dco_decode_opt_box_autoadd_i_64(arr[2]), - offset: dco_decode_opt_box_autoadd_u_32(arr[3]), - limit: dco_decode_opt_box_autoadd_u_32(arr[4]), - details: dco_decode_opt_box_autoadd_list_payment_details(arr[5]), + states: dco_decode_opt_list_payment_state(arr[1]), + fromTimestamp: dco_decode_opt_box_autoadd_i_64(arr[2]), + toTimestamp: dco_decode_opt_box_autoadd_i_64(arr[3]), + offset: dco_decode_opt_box_autoadd_u_32(arr[4]), + limit: dco_decode_opt_box_autoadd_u_32(arr[5]), + details: dco_decode_opt_box_autoadd_list_payment_details(arr[6]), ); } @@ -2504,6 +2512,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return raw == null ? null : dco_decode_list_external_input_parser(raw); } + @protected + List? dco_decode_opt_list_payment_state(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw == null ? null : dco_decode_list_payment_state(raw); + } + @protected List? dco_decode_opt_list_payment_type(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -3650,6 +3664,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_network = sse_decode_liquid_network(deserializer); var var_paymentTimeoutSec = sse_decode_u_64(deserializer); var var_zeroConfMinFeeRateMsat = sse_decode_u_32(deserializer); + var var_syncServiceUrl = sse_decode_String(deserializer); var var_zeroConfMaxAmountSat = sse_decode_opt_box_autoadd_u_64(deserializer); var var_breezApiKey = sse_decode_opt_String(deserializer); var var_externalInputParsers = sse_decode_opt_list_external_input_parser(deserializer); @@ -3663,6 +3678,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { network: var_network, paymentTimeoutSec: var_paymentTimeoutSec, zeroConfMinFeeRateMsat: var_zeroConfMinFeeRateMsat, + syncServiceUrl: var_syncServiceUrl, zeroConfMaxAmountSat: var_zeroConfMaxAmountSat, breezApiKey: var_breezApiKey, externalInputParsers: var_externalInputParsers, @@ -3947,6 +3963,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } } + @protected + List sse_decode_list_payment_state(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var len_ = sse_decode_i_32(deserializer); + var ans_ = []; + for (var idx_ = 0; idx_ < len_; ++idx_) { + ans_.add(sse_decode_payment_state(deserializer)); + } + return ans_; + } + @protected List sse_decode_list_payment_type(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3963,6 +3991,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ListPaymentsRequest sse_decode_list_payments_request(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var var_filters = sse_decode_opt_list_payment_type(deserializer); + var var_states = sse_decode_opt_list_payment_state(deserializer); var var_fromTimestamp = sse_decode_opt_box_autoadd_i_64(deserializer); var var_toTimestamp = sse_decode_opt_box_autoadd_i_64(deserializer); var var_offset = sse_decode_opt_box_autoadd_u_32(deserializer); @@ -3970,6 +3999,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_details = sse_decode_opt_box_autoadd_list_payment_details(deserializer); return ListPaymentsRequest( filters: var_filters, + states: var_states, fromTimestamp: var_fromTimestamp, toTimestamp: var_toTimestamp, offset: var_offset, @@ -4570,6 +4600,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } } + @protected + List? sse_decode_opt_list_payment_state(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + if (sse_decode_bool(deserializer)) { + return (sse_decode_list_payment_state(deserializer)); + } else { + return null; + } + } + @protected List? sse_decode_opt_list_payment_type(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5777,6 +5818,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_liquid_network(self.network, serializer); sse_encode_u_64(self.paymentTimeoutSec, serializer); sse_encode_u_32(self.zeroConfMinFeeRateMsat, serializer); + sse_encode_String(self.syncServiceUrl, serializer); sse_encode_opt_box_autoadd_u_64(self.zeroConfMaxAmountSat, serializer); sse_encode_opt_String(self.breezApiKey, serializer); sse_encode_opt_list_external_input_parser(self.externalInputParsers, serializer); @@ -6007,6 +6049,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } } + @protected + void sse_encode_list_payment_state(List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + for (final item in self) { + sse_encode_payment_state(item, serializer); + } + } + @protected void sse_encode_list_payment_type(List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -6020,6 +6071,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { void sse_encode_list_payments_request(ListPaymentsRequest self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_opt_list_payment_type(self.filters, serializer); + sse_encode_opt_list_payment_state(self.states, serializer); sse_encode_opt_box_autoadd_i_64(self.fromTimestamp, serializer); sse_encode_opt_box_autoadd_i_64(self.toTimestamp, serializer); sse_encode_opt_box_autoadd_u_32(self.offset, serializer); @@ -6523,6 +6575,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } } + @protected + void sse_encode_opt_list_payment_state(List? self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + sse_encode_bool(self != null, serializer); + if (self != null) { + sse_encode_list_payment_state(self, serializer); + } + } + @protected void sse_encode_opt_list_payment_type(List? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs diff --git a/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt b/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt index c994af789..3cfb3c54e 100644 --- a/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt +++ b/packages/react-native/android/src/main/java/com/breezsdkliquid/BreezSDKLiquidMapper.kt @@ -248,8 +248,8 @@ fun asConfig(config: ReadableMap): Config? { "network", "paymentTimeoutSec", "zeroConfMinFeeRateMsat", - "useDefaultExternalInputParsers", "syncServiceUrl", + "useDefaultExternalInputParsers", ), ) ) { diff --git a/packages/react-native/ios/BreezSDKLiquidMapper.swift b/packages/react-native/ios/BreezSDKLiquidMapper.swift index f877fda03..3e3bb72e6 100644 --- a/packages/react-native/ios/BreezSDKLiquidMapper.swift +++ b/packages/react-native/ios/BreezSDKLiquidMapper.swift @@ -307,6 +307,9 @@ enum BreezSDKLiquidMapper { guard let zeroConfMinFeeRateMsat = config["zeroConfMinFeeRateMsat"] as? UInt32 else { throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "zeroConfMinFeeRateMsat", typeName: "Config")) } + guard let syncServiceUrl = config["syncServiceUrl"] as? String else { + throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "syncServiceUrl", typeName: "Config")) + } var breezApiKey: String? if hasNonNilKey(data: config, key: "breezApiKey") { guard let breezApiKeyTmp = config["breezApiKey"] as? String else { @@ -336,7 +339,7 @@ enum BreezSDKLiquidMapper { externalInputParsers = try asExternalInputParserList(arr: externalInputParsersTmp) } - return Config(liquidElectrumUrl: liquidElectrumUrl, bitcoinElectrumUrl: bitcoinElectrumUrl, mempoolspaceUrl: mempoolspaceUrl, workingDir: workingDir, network: network, paymentTimeoutSec: paymentTimeoutSec, zeroConfMinFeeRateMsat: zeroConfMinFeeRateMsat, breezApiKey: breezApiKey, cacheDir: cacheDir, zeroConfMaxAmountSat: zeroConfMaxAmountSat, useDefaultExternalInputParsers: useDefaultExternalInputParsers, externalInputParsers: externalInputParsers) + return Config(liquidElectrumUrl: liquidElectrumUrl, bitcoinElectrumUrl: bitcoinElectrumUrl, mempoolspaceUrl: mempoolspaceUrl, workingDir: workingDir, network: network, paymentTimeoutSec: paymentTimeoutSec, zeroConfMinFeeRateMsat: zeroConfMinFeeRateMsat, syncServiceUrl: syncServiceUrl, breezApiKey: breezApiKey, cacheDir: cacheDir, zeroConfMaxAmountSat: zeroConfMaxAmountSat, useDefaultExternalInputParsers: useDefaultExternalInputParsers, externalInputParsers: externalInputParsers) } static func dictionaryOf(config: Config) -> [String: Any?] { @@ -348,6 +351,7 @@ enum BreezSDKLiquidMapper { "network": valueOf(liquidNetwork: config.network), "paymentTimeoutSec": config.paymentTimeoutSec, "zeroConfMinFeeRateMsat": config.zeroConfMinFeeRateMsat, + "syncServiceUrl": config.syncServiceUrl, "breezApiKey": config.breezApiKey == nil ? nil : config.breezApiKey, "cacheDir": config.cacheDir == nil ? nil : config.cacheDir, "zeroConfMaxAmountSat": config.zeroConfMaxAmountSat == nil ? nil : config.zeroConfMaxAmountSat,