mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 16:58:08 +00:00
feat: 添加 Lighter 签名桥接和公钥派生脚本,支持新的签名库和环境检测功能
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { LighterPrivateKey } from "../src/exchanges/lighter/crypto/schnorr";
|
||||
import { bytesToHex } from "../src/exchanges/lighter/bytes";
|
||||
|
||||
function derive(keyHex: string): string {
|
||||
const normalized = keyHex.startsWith("0x") ? keyHex.slice(2) : keyHex;
|
||||
const key = LighterPrivateKey.fromHex(normalized);
|
||||
return bytesToHex(key.publicKey().toBytes());
|
||||
}
|
||||
|
||||
const input = process.argv[2];
|
||||
if (!input) {
|
||||
console.error("usage: bun run scripts/derive-public.ts <hex>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(derive(input));
|
||||
Reference in New Issue
Block a user