| 61 | if (!result.success || !result.output) return null; |
| 62 | |
| 63 | try { |
| 64 | const data = JSON.parse(result.output); |
| 65 | if (data.private_key && data.v6) { |
| 66 | return { privateKey: data.private_key, address6: data.v6 }; |
| 67 | } |
| 68 | } catch {} |
| 69 | return null; |
| 70 | } |
| 71 | |
| 72 | private static async register(): Promise<{ privateKey: string; address6: string }> { |
| 73 | try { |
| 74 | const response = await axios.get("https://warp.cloudflare.now.cc/?run=register", { timeout: 8000 }); |
| 75 | const dataStr = typeof response.data === "string" ? response.data : JSON.stringify(response.data); |
| 76 | |
| 77 | const pkMatch = dataStr.match(/"private_key"\s*:\s*"([A-Za-z0-9+/=]{20,})"/); |