我正在尝试将Trust钱包与react-native应用程序结合使用。当我尝试调用SignMessage或SignTransaction时,它会重定向到信任的钱包,但我只能看到空白的空白屏幕。
const wallet = new TrustWallet('<myAppScheme>://')
export default class Home extends React.Component {
signMsg() {
console.log('work')
const payload = new MessagePayload('hello trust');
console.log("HELLO", payload)
wallet.signMessage(payload).then((result) => {
console.log('Message Signed '+ result);
}).catch((error) => {
console.log('Error '+ error);
});
}
signTrnx() {
const payload = new TransactionPayload('0xe47494379c1d48ee73454c251a6395fdd4f9eb43', '1', 'hello trust');
wallet.signTransaction(payload).then((result) => {
console.log('Transaction Signed '+ result);
})
.catch((error) => {
console.log('Error '+ error);
});
}
render() {
return(
<View>
<Button onPress={() => this.signMsg() } />
</View>
)
}
我使用了此插件:https://www.npmjs.com/package/react-native-trust-sdk
遇到此错误,创建了供参考的GIF:https://drive.google.com/open?id=1ahtbFfyeTyZuBrMEq_ih6VPA0oCQugIY