![](/img/trans.png)
[英]How can I query contract info with the latest polkadot-js and substrate contracts node?
[英]How can I get a `PairSigner` for my Polkadot account from a Rust client using substrate-subxt?
我有一个 Rust CLI,我使用此代码https://github.com/paritytech/substrate-subxt/blob/master/examples/submit_and_watch.rs将余额从一个帐户转移到另一个帐户。
PairSigner
是通过let signer = PairSigner::new(AccountKeyring::Alice.pair());
. 我如何使用我的个人 Polkadot 钱包账户来签署交易,而不是使用 Alic 的这个测试钥匙串?
使用sp-core ,可以使用Phase::from_phrase
来实现这一点。
let pair = Pair::from_phrase(&"menumonic".to_string(), Some("password"))?;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.