-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path8009.bandle.js
1 lines (1 loc) · 2.09 KB
/
8009.bandle.js
1
"use strict";(self.webpackChunkhedge=self.webpackChunkhedge||[]).push([[8009],{98009:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "exampleController": () => (/* binding */ exampleController),\n/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46441);\n\nconst exampleController = {\n namespaced: true,\n state() {\n // console.log("Example state building...")\n return {\n test: null,\n balance: null,\n };\n },\n getters: {\n testValue(state, _, _1, rootGetters) {\n // console.log("Example: recounted")\n return state.balance && ethers__WEBPACK_IMPORTED_MODULE_0__/* .formatUnits */ .bM(state.balance);\n },\n },\n mutations: {\n setValue(state, value) {\n state.test = value;\n },\n setBalance(state, value) {\n state.balance = value;\n },\n reset(state) {\n // console.log("Example: reset")\n state.test = null;\n state.balance = null;\n },\n },\n actions: {\n async init({ commit, rootState, rootGetters }) {\n // console.log("Example: init start")\n if (rootGetters["connection/state"] != "connected")\n return;\n // const {address, provider} = await (rootState as any).connection.connection\n // .wait\n const address = rootState.connection.address;\n // console.log("Example: account", address)\n const value = await rootGetters["connection/provider"].getBalance();\n commit("setValue", address);\n commit("setBalance", value);\n },\n },\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (exampleController);\n\n\n//# sourceURL=webpack://hedge/./src/store/modules/exampleController.ts?')}}]);