* Add auth dapp * Add initial auth wallet * Remove unusused files * Refactor code * Switched both to NPM, use npm package
42 lines
574 B
TypeScript
42 lines
574 B
TypeScript
import { SessionTypes, SignClientTypes } from '@walletconnect/types'
|
|
import { proxy } from 'valtio'
|
|
|
|
/**
|
|
* Types
|
|
*/
|
|
interface ModalData {
|
|
authenticationRequest: any
|
|
}
|
|
|
|
interface State {
|
|
open: boolean
|
|
view?: 'AuthenticationRequest'
|
|
data?: ModalData
|
|
}
|
|
|
|
/**
|
|
* State
|
|
*/
|
|
const state = proxy<State>({
|
|
open: false
|
|
})
|
|
|
|
/**
|
|
* Store / Actions
|
|
*/
|
|
const ModalStore = {
|
|
state,
|
|
|
|
open(view: State['view'], data: State['data']) {
|
|
state.view = view
|
|
state.data = data
|
|
state.open = true
|
|
},
|
|
|
|
close() {
|
|
state.open = false
|
|
}
|
|
}
|
|
|
|
export default ModalStore
|