@@ -4,7 +4,7 @@ import type { NetworkConfig } from "./models";
44import { Processor } from "./processor" ;
55import { D1Storage } from "./storage" ;
66import { logError , logger } from "@gonative-cc/lib/logger" ;
7- import { getMnemonic } from "@gonative-cc/lib/secrets" ;
7+ import { getSecret } from "@gonative-cc/lib/secrets" ;
88import { RedeemService } from "./redeem-service" ;
99import { createSuiClients , type SuiClient } from "./redeem-sui-client" ;
1010import type { Service } from "@cloudflare/workers-types" ;
@@ -27,8 +27,7 @@ export default {
2727 const storage = new D1Storage ( env . DB ) ;
2828 const activeNetworks = await storage . getActiveNetworks ( ) ;
2929
30- const mnemonic = await getMnemonic ( env . NBTC_MINTING_SIGNER_MNEMONIC ) ;
31- if ( ! mnemonic ) return ;
30+ const mnemonic = await getSecret ( env . NBTC_MINTING_SIGNER_MNEMONIC ) ;
3231 const suiClients = await createSuiClients ( activeNetworks , mnemonic ) ;
3332
3433 // Run both indexer and redeem solver tasks in parallel
@@ -88,8 +87,12 @@ async function poolAndProcessEvents(
8887 storage : D1Storage ,
8988 suiClients : Map < SuiNet , SuiClient > ,
9089) {
91- const client = new SuiGraphQLClient ( netCfg . url ) ;
9290 const suiClient = suiClients . get ( netCfg . name ) ;
91+ if ( ! suiClient ) {
92+ logger . warn ( { msg : "No SuiClient for network, skipping" , network : netCfg . name } ) ;
93+ return ;
94+ }
95+ const client = new SuiGraphQLClient ( netCfg . url ) ;
9396 const p = new Processor ( netCfg , storage , client , suiClient ) ;
9497
9598 const nbtcPkgs = await storage . getActiveNbtcPkgs ( netCfg . name ) ;
0 commit comments