{"version":3,"file":"chain.mjs","sourceRoot":"","sources":["../../src/store/chain.ts"],"names":[],"mappings":";;AAUA;;GAEG;AACH,MAAM,aAAa,GAAe;IAChC,OAAO,EAAE,KAAK;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;IACpC,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC,KAAK,EAAE,MAA0B,EAAE,EAAE;YAC9C,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QACjC,CAAC;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC","sourcesContent":["import type { Hex } from '@metamask/utils';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { ApplicationState } from './store';\n\nexport type ChainState = {\n  chainId: Hex;\n};\n\n/**\n * The initial chain state.\n */\nconst INITIAL_STATE: ChainState = {\n  chainId: '0x1',\n};\n\nexport const chainSlice = createSlice({\n  name: 'chain',\n  initialState: INITIAL_STATE,\n  reducers: {\n    setChain: (state, action: PayloadAction<Hex>) => {\n      state.chainId = action.payload;\n    },\n  },\n});\n\nexport const { setChain } = chainSlice.actions;\n\n/**\n * Get the chain ID from the state.\n *\n * @param state - The application state.\n * @returns The chain ID.\n */\nexport const getChainId = (state: ApplicationState) => state.chain.chainId;\n"]}