diff --git a/android/src/main/java/io/ltbl/bdkrn/BdkRnModule.kt b/android/src/main/java/io/ltbl/bdkrn/BdkRnModule.kt index fc735ee..ab8954e 100644 --- a/android/src/main/java/io/ltbl/bdkrn/BdkRnModule.kt +++ b/android/src/main/java/io/ltbl/bdkrn/BdkRnModule.kt @@ -395,7 +395,7 @@ class BdkRnModule(reactContext: ReactApplicationContext) : resolvedIndex = (addressIndex as Dynamic).asDouble() ?: "new" } else -> { - result.reject("Invalid address index type", "Address index must be a String or an Int") + resolvedIndex = setAddressIndex("new") } } val addressInfo = getWalletById(id).getAddress(setAddressIndex(resolvedIndex)) @@ -425,7 +425,7 @@ class BdkRnModule(reactContext: ReactApplicationContext) : resolvedIndex = (addressIndex as Dynamic).asDouble() ?: "new" } else -> { - result.reject("Invalid address index type", "Address index must be a String or an Int") + resolvedIndex = setAddressIndex("new") } } val addressInfo = getWalletById(id).getInternalAddress(setAddressIndex(resolvedIndex)) diff --git a/ios/BdkRnModule.swift b/ios/BdkRnModule.swift index c6d6edd..e9ddcd2 100644 --- a/ios/BdkRnModule.swift +++ b/ios/BdkRnModule.swift @@ -501,8 +501,7 @@ class BdkRnModule: NSObject { } else if let indexInt = addressIndex as? Int { resolvedIndex = setAddressIndex(addressIndex: indexInt) } else { - reject("Invalid address index type", "Address index must be a String or an Int", nil) - return + resolvedIndex = setAddressIndex(addressIndex: "new") } let addressInfo = try getWalletById(id: id).getAddress( @@ -530,8 +529,7 @@ class BdkRnModule: NSObject { } else if let indexInt = addressIndex as? Int { resolvedIndex = setAddressIndex(addressIndex: indexInt) } else { - reject("Invalid address index type", "Address index must be a String or an Int", nil) - return + resolvedIndex = setAddressIndex(addressIndex: "new") } let addressInfo = try getWalletById(id: id).getInternalAddress( addressIndex: resolvedIndex