簡體   English   中英

如何使用基板 subxt 從 Rust 客戶端為我的 Polkadot 帳戶獲取“PairSigner”?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM