trustwallet/wallet-core

Cannot find 'BitcoinFee' in scope

benben2019 opened this issue · 3 comments

when i update this repo from v4.0.34 to v4.1.15, i got this error:Cannot find 'BitcoinFee' in scope

my code:

BitcoinFee.calculateFee(data: output.encoded, satVb: "\(byteFee)")

How can I modify the code to adapt to the latest version? Thank you!

Hi @benben2019, BitcoinFee module was deprecated and removed. Please consider using AnySigner.plan() instead. It selects UTXOs required to send the requested amounts, pay the fee, and returns the exact transaction size.
Please also use BitcoinV2 API, here's an example:
Swift (BRC20 example): https://github.com/trustwallet/wallet-core/blob/master/swift/Tests/Blockchains/BitcoinTests.swift#L13-L82
JS (P2TR example): https://github.com/trustwallet/wallet-core/blob/master/wasm/tests/Blockchain/Bitcoin.test.ts#L16-L93

Hi @benben2019, BitcoinFee module was deprecated and removed. Please consider using AnySigner.plan() instead. It selects UTXOs required to send the requested amounts, pay the fee, and returns the exact transaction size. Please also use BitcoinV2 API, here's an example: Swift (BRC20 example): https://github.com/trustwallet/wallet-core/blob/master/swift/Tests/Blockchains/BitcoinTests.swift#L13-L82 JS (P2TR example): https://github.com/trustwallet/wallet-core/blob/master/wasm/tests/Blockchain/Bitcoin.test.ts#L16-L93

thank you !