LtbLightning / bdk-rn

Bitcoin Development Kit - React Native Module
MIT License
50 stars 15 forks source link

java.lang.String cannot be cast to java.lang.Double #57

Closed robertclarkson closed 1 year ago

robertclarkson commented 1 year ago

using version 0.1.1

java.lang.String cannot be cast to java.lang.Double

seems to crash with the electrum config.

const config: BlockchainElectrumConfig = {
  url: 'ssl://electrum.blockstream.info:60002',
  retry: '5',
  timeout: '5',
  stopGap: '5',
};
robertclarkson commented 1 year ago

I should add I've tried changing the values from strings to doubles. No dice.

BitcoinZavior commented 1 year ago

@robertclarkson Please use the main branch, that should work fine.

robertclarkson commented 1 year ago

@BitcoinZavior Appologies, this error was actually from the main branch - I've tried both...

Czino commented 1 year ago

Hi @robertclarkson, use integers instead of strings, see the type of the BlockchainElectrumConfig:

export interface BlockchainElectrumConfig {
    url: string;
    sock5: string | null;
    retry: number;
    timeout: number;
    stopGap: number;
    validateDomain: boolean;
}

@BitcoinZavior I see the example in the README is misleading. Let me create a PR to fix it

robertclarkson commented 1 year ago

Nice one. That fixed it for me. Thank you @Czino !!