@reefclaw/connect 0.1.35 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -96,22 +96,40 @@ export async function hlProvisionAgentWalletTool(args, deps) {
|
|
|
96
96
|
const derived = await deriveAddressFromPrivateKey(existingKey);
|
|
97
97
|
if (derived.ok) {
|
|
98
98
|
const masterMatches = existingMaster != null && existingMaster.toLowerCase() === walletAddress.toLowerCase();
|
|
99
|
-
// ★
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
|
|
99
|
+
// ★ Re-ACTIVATE the venue on resume (E2E audit 2026-08-11 #6) and honour
|
|
100
|
+
// a CHANGED network in the same write.
|
|
101
|
+
//
|
|
102
|
+
// Venue: the resume path used to write NOTHING unless the network flag
|
|
103
|
+
// moved — so a box whose active venue was still binance (HL provisioned
|
|
104
|
+
// earlier and switched back, or a live-Binance box that just clicked
|
|
105
|
+
// through the confirm-switch dialog above) kept `venue:'binance'` on
|
|
106
|
+
// disk. hl_agent_wallet_status only reports configured when
|
|
107
|
+
// `exchange.venue==='hyperliquid'`, so the guided flow dead-ended
|
|
108
|
+
// polling configured:false forever, and the confirm dialog "switched"
|
|
109
|
+
// nothing. By this point the venue-switch confirm gate has already run,
|
|
110
|
+
// so the activation write is authorized. buildVenueExchangeConfig with
|
|
111
|
+
// empty fields activates the venue while keeping BOTH venues'
|
|
112
|
+
// credentials (the merge contract).
|
|
113
|
+
//
|
|
114
|
+
// Network: the same keypair is valid on both Hyperliquid networks, so
|
|
115
|
+
// mainnet<->testnet must not require regenerating — but the stored flag
|
|
116
|
+
// has to follow, or the box boots against the network the operator did
|
|
117
|
+
// NOT pick (observed live 2026-08-03: approval signed for Testnet while
|
|
118
|
+
// the operator believed mainnet).
|
|
119
|
+
const needsVenueActivation = fromVenue !== 'hyperliquid';
|
|
120
|
+
if (masterMatches && (needsVenueActivation || existingTestnet !== testnet)) {
|
|
108
121
|
try {
|
|
109
122
|
updatePluginConfig({ exchange: buildVenueExchangeConfig(existingExchange, 'hyperliquid', {}, testnet) }, deps.configPath);
|
|
123
|
+
if (needsVenueActivation) {
|
|
124
|
+
logger.info(TAG, 'venue re-activated: hyperliquid (existing agent wallet resumed)');
|
|
125
|
+
}
|
|
126
|
+
if (existingTestnet !== testnet) {
|
|
127
|
+
logger.info(TAG, `network switched to ${testnet ? 'TESTNET' : 'MAINNET'} (same agent wallet)`);
|
|
128
|
+
}
|
|
110
129
|
existingTestnet = testnet;
|
|
111
|
-
logger.info(TAG, `network switched to ${testnet ? 'TESTNET' : 'MAINNET'} (same agent wallet)`);
|
|
112
130
|
}
|
|
113
131
|
catch (err) {
|
|
114
|
-
logger.warn(TAG, `could not persist network change: ${err instanceof Error ? err.message : String(err)}`);
|
|
132
|
+
logger.warn(TAG, `could not persist venue/network change: ${err instanceof Error ? err.message : String(err)}`);
|
|
115
133
|
}
|
|
116
134
|
}
|
|
117
135
|
return {
|