1import create from 'zustand';
2import { L2Point, PendingTransaction } from '@urbit/roller-api/build';
4import { HOUR } from 'lib/utils/roller';
5import { Invite } from 'types/Invite';
7export interface RollerStore {
10 pendingTransactions: PendingTransaction[];
11 currentPoint: L2Point | null;
14 setNextBatchTime: (nextBatchTime: number) => void;
15 setNextRoll: (nextRoll: string) => void;
16 setPendingTransactions: (pendingTransactions: PendingTransaction[]) => void;
17 setCurrentPoint: (currentPoint: L2Point) => void;
18 setInvites: (invites: Invite[]) => void;
21export const useRollerStore = create<RollerStore>(set => ({
22 nextBatchTime: new Date().getTime() + HOUR,
23 nextRoll: '0h 00m 00s',
24 pendingTransactions: [],
28 setNextBatchTime: (nextBatchTime: number) => set(() => ({ nextBatchTime })),
29 setNextRoll: (nextRoll: string) => set(() => ({ nextRoll })),
30 setPendingTransactions: (pendingTransactions: PendingTransaction[]) =>
31 set(() => ({ pendingTransactions })),
32 setCurrentPoint: (currentPoint: L2Point) =>
36 currentPoint?.dominion === 'l2' || currentPoint?.dominion === 'spawn',
38 setInvites: (invites: Invite[]) => set(() => ({ invites })),
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list