2024-02-28 21:49:44 +05:00
|
|
|
import * as ActionTypes from '../actionTypes'
|
|
|
|
import {
|
|
|
|
AuthState,
|
|
|
|
Keys,
|
|
|
|
LoginMethods,
|
|
|
|
SetAuthState,
|
|
|
|
UpdateKeyPair,
|
|
|
|
UpdateLoginMethod,
|
2024-04-08 17:45:51 +05:00
|
|
|
UpdateNsecBunkerPubkey,
|
2024-10-04 11:37:20 +02:00
|
|
|
UpdateNsecBunkerRelays,
|
|
|
|
NostrLoginAuthMethod,
|
|
|
|
UpdateNostrLoginAuthMethod
|
2024-02-28 21:49:44 +05:00
|
|
|
} from './types'
|
|
|
|
|
|
|
|
export const setAuthState = (payload: AuthState): SetAuthState => ({
|
|
|
|
type: ActionTypes.SET_AUTH_STATE,
|
|
|
|
payload
|
|
|
|
})
|
|
|
|
|
|
|
|
export const updateLoginMethod = (
|
|
|
|
payload: LoginMethods | undefined
|
|
|
|
): UpdateLoginMethod => ({
|
|
|
|
type: ActionTypes.UPDATE_LOGIN_METHOD,
|
|
|
|
payload
|
|
|
|
})
|
|
|
|
|
2024-10-04 11:37:20 +02:00
|
|
|
export const updateNostrLoginAuthMethod = (
|
|
|
|
payload: NostrLoginAuthMethod | undefined
|
|
|
|
): UpdateNostrLoginAuthMethod => ({
|
|
|
|
type: ActionTypes.UPDATE_NOSTR_LOGIN_AUTH_METHOD,
|
|
|
|
payload
|
|
|
|
})
|
|
|
|
|
2024-02-28 21:49:44 +05:00
|
|
|
export const updateKeyPair = (payload: Keys | undefined): UpdateKeyPair => ({
|
|
|
|
type: ActionTypes.UPDATE_KEYPAIR,
|
|
|
|
payload
|
|
|
|
})
|
|
|
|
|
|
|
|
export const updateNsecbunkerPubkey = (
|
|
|
|
payload: string | undefined
|
|
|
|
): UpdateNsecBunkerPubkey => ({
|
|
|
|
type: ActionTypes.UPDATE_NSECBUNKER_PUBKEY,
|
|
|
|
payload
|
|
|
|
})
|
2024-04-08 17:45:51 +05:00
|
|
|
|
|
|
|
export const updateNsecbunkerRelays = (
|
|
|
|
payload: string[] | undefined
|
|
|
|
): UpdateNsecBunkerRelays => ({
|
|
|
|
type: ActionTypes.UPDATE_NSECBUNKER_RELAYS,
|
|
|
|
payload
|
|
|
|
})
|