particle-network / particle-react-native Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
class ParticleWalletPlugin(reactContext: ReactApplicationContext) :
ReactContextBaseJavaModule(reactContext) {
@@ -71,8 +74,20 @@ class ParticleWalletPlugin(reactContext: ReactApplicationContext) :
@ReactMethod
fun init() {
isUIInit = try {
- ParticleWallet.init(reactApplicationContext, null)
- true
+ val success = AtomicBoolean(false)
+ val latch = CountDownLatch(1)
+ runOnUiThread {
+ try {
+ ParticleWallet.init(reactApplicationContext, null)
+ success.set(true)
+ } catch (e: Exception) {
+ // 可以在这里处理异常,比如打印日志
+ } finally {
+ latch.countDown()
+ }
+ }
+ latch.await()
+ success.get()
} catch (e: Exception) {
false
}
web3_wallet_switchEthereumChain = async () => {
try {
const chainId = "0x" + EvmService.currentChainInfo.chain_id.toString(16);
const result = await web3.currentProvider.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId }]
})
console.log('web3 wallet_switchEthereumChain', result);
} catch (error) {
console.log('web3 wallet_switchEthereumChain', error);
}
}
web3_wallet_addEthereumChain = async () => {
try {
const chainId = "0x" + EvmService.currentChainInfo.chain_id.toString(16);
const result = await web3.currentProvider.request({
method: 'wallet_addEthereumChain',
params: [{ chainId }]
})
console.log('web3 wallet_addEthereumChain', result);
} catch (error) {
console.log('web3 wallet_addEthereumChain', error);
}
}
{
"code": 4200,
"message": "The Provider does not support the requested method"
}
Hello,
I hope this message finds you well. I am currently facing some build errors in my Expo bare workflow project after integrating Particle React Native. I encounter the following errors during the build process:
^ underlying Objective-C module 'EXDevMenuInterface' not found
^ failed to verify module interface of 'EXDevMenuInterface' due to the errors above; the textual interface may be broken by project issues or a compiler bug
^ underlying Objective-C module 'EXDevMenuInterface' not found
^ failed to verify module interface of 'EXDevMenuInterface' due to the errors above; the textual interface may be broken by project issues or a compiler bug
Upon investigating further, I noticed that these errors seem to be related to a change in the Podfile. The problematic code snippet in question is as follows:
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
It appears that the Expo Dev Client may not be compatible with building for distribution, which could be causing this issue. Interestingly, removing these lines of code results in similar errors involving modules like "cryptoswift."
I would greatly appreciate any assistance in resolving this problem. If there are any alternative solutions or workarounds, I would be eager to try them out. Thank you very much for your time and support.
Best regards,
Jan
Do versions prior to react native 0.68 support installation?
{"avatar": "**c", "created_at": "2024-04-15T14:25:31.000Z", "google_email": "[email protected]", "google_id": "116779180351951502819", "name": "Md. Majedur Rahman 212-15-14708", "security_account": {"has_set_master_password": false, "has_set_payment_password": false}, "thirdparty_user_info": {"provider": "google", "user_info": {"email": "]()", "id": "116779180351951502819", "name": "Md. Majedur Rahman 212-15-14708", "picture": "rAG1TWEBlTw0=s96-c"}}, "token": "523b8075-157e-4805-a025-63374916822d", "updated_at": "2024-04-15T14:25:31.000Z", "uuid": "e815e7da-4b13-4fa2-a330-f613a28bbdd5", "wallets": [{"chain_name": "solana", "public_address": "", "uuid": "c88ed615-fdc0-4fed-8f13-c7649c54b00a"}, {"chain_name": "evm_chain", "public_address": "", "uuid": "4a26aea0-30ba-48d3-a4bb-53ef2e"}]}
LOG is enable true
LOG request body = {"id":"1713205766068","jsonrpc":"2.0","method":"particle_aa_getSmartAccount","params":[{"name":"BICONOMY","version":"1.0.0","ownerAddress":"0x5aED9Eb****"2DC86d647a"}],"chainId":421614}
LOG response result = undefined
LOG result {"data": {"code": 0, "data": "System error"}, "status": 0}
LOG smartAccountAddress undefined in particle-aa project
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.