![](/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.