你可以在 V2EX 设置中绑定 Solana 地址,然后就可以用 Phantom / Glow 登录 V2EX。
Get V2EX Coin9raUVuzeWUk53co63M4WXLWPWE4Xc6Lpn7RS9dnkpump
GitHub: https://github.com/LedgerHQ/ledger-live/issues/11239
从很久就是已知问题了,但官方目前只能保证交易签名是稳定的。这就导致 Ledger 用户无法在 V 站绑定
import {
Connection,
PublicKey,
Transaction,
SystemProgram,
} from '@solana/web3.js';
import { WalletNotConnectedError } from '@solana/wallet-adapter-base';
import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
import { MemoProgram } from '@solana/spl-memo';
async function signMessageWithMemo(wallet, message) {
if (!wallet.publicKey) throw new WalletNotConnectedError();
const connection = new Connection('https://api.mainnet-beta.solana.com');
// 构造交易:0 SOL 自转账 + Memo
const transaction = new Transaction().add(
SystemProgram.transfer({
fromPubkey: wallet.publicKey,
toPubkey: wallet.publicKey,
lamports: 0,
}),
MemoProgram.memo({ memo: message }) // 将你的消息放入 Memo
);
// 请求用户签名
const signedTransaction = await wallet.signTransaction(transaction);
// 序列化为 base64 或 hex ,发送给后端
const serialized = signedTransaction.serialize().toString('base64');
return serialized;
}
站长是否考虑一下?要不然 Ledger 用户就只能干等了
3
renfei OP |