player-map 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/index.es.js +27408 -28646
  2. package/dist/index.umd.js +525 -535
  3. package/dist/types/components/modals/ConnectWalletModal.d.ts +8 -0
  4. package/dist/types/components/modals/CreatePlayerModal.d.ts +9 -0
  5. package/dist/types/components/modals/index.d.ts +2 -0
  6. package/dist/types/components/vote/ClaimItem.d.ts +13 -0
  7. package/dist/types/components/vote/ClaimList.d.ts +14 -0
  8. package/dist/types/components/vote/ClaimVoting.d.ts +16 -0
  9. package/dist/types/components/vote/SubmitButton.d.ts +11 -0
  10. package/dist/types/components/vote/TransactionInfo.d.ts +9 -0
  11. package/dist/types/components/vote/TransactionStatus.d.ts +11 -0
  12. package/dist/types/components/vote/VotingHeader.d.ts +7 -0
  13. package/dist/types/hooks/useCheckSpecificTriplePosition.d.ts +14 -0
  14. package/dist/types/hooks/useDepositTriple.d.ts +14 -0
  15. package/dist/types/hooks/useDisplayTriplesWithPosition.d.ts +5 -0
  16. package/dist/types/hooks/useFetchTripleDetails.d.ts +27 -0
  17. package/dist/types/hooks/useSubmitVotes.d.ts +22 -0
  18. package/dist/types/hooks/useVoteItemsManagement.d.ts +21 -0
  19. package/dist/types/hooks.old.local/useAccountAtom.d.ts +19 -0
  20. package/dist/types/hooks.old.local/useAtomCreation.d.ts +23 -0
  21. package/dist/types/hooks.old.local/useAtomData.d.ts +61 -0
  22. package/dist/types/hooks.old.local/useAtomTriples.d.ts +22 -0
  23. package/dist/types/hooks.old.local/useAtomsByCreator.d.ts +14 -0
  24. package/dist/types/hooks.old.local/useBatchCreateTriple.d.ts +16 -0
  25. package/dist/types/hooks.old.local/useCreateSingleTriple.d.ts +10 -0
  26. package/dist/types/hooks.old.local/useDepositTriple.d.ts +14 -0
  27. package/dist/types/hooks.old.local/useDisplayTriplesWithPosition.d.ts +5 -0
  28. package/dist/types/hooks.old.local/useFetchTripleDetails.d.ts +27 -0
  29. package/dist/types/hooks.old.local/useMainnetAtomData.d.ts +20 -0
  30. package/dist/types/hooks.old.local/useSubmitVotes.d.ts +22 -0
  31. package/dist/types/hooks.old.local/useTestnetAtomData.d.ts +20 -0
  32. package/dist/types/hooks.old.local/useTripleByCreator.d.ts +39 -0
  33. package/dist/types/hooks.old.local/useVoteItemsManagement.d.ts +18 -0
  34. package/dist/types/pages/DirectPositionCheck.d.ts +4 -0
  35. package/dist/types/types/vote.d.ts +26 -0
  36. package/dist/types/utils/debugPosition.d.ts +11 -0
  37. package/dist/types/utils/voteConstants.d.ts +2 -0
  38. package/dist/types/utils/voteUtils.d.ts +32 -0
  39. package/package.json +2 -2
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface ConnectWalletModalProps {
4
+ isOpen: boolean;
5
+ onConnectWallet: () => void;
6
+ }
7
+ export declare const ConnectWalletModal: React.FC<ConnectWalletModalProps>;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface CreatePlayerModalProps {
4
+ isOpen: boolean;
5
+ onCreatePlayer: () => void;
6
+ onClose?: () => void;
7
+ }
8
+ export declare const CreatePlayerModal: React.FC<CreatePlayerModalProps>;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export { ConnectWalletModal } from './ConnectWalletModal';
2
+ export { CreatePlayerModal } from './CreatePlayerModal';
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { VoteItem, VoteDirection } from '../../types/vote';
3
+ import { Network } from '../../hooks/useAtomData';
4
+
5
+ interface ClaimItemProps {
6
+ voteItem: VoteItem;
7
+ onChangeUnits: (id: bigint, direction: VoteDirection, units: number) => void;
8
+ isVoteDirectionAllowed?: (tripleId: bigint, direction: VoteDirection) => boolean;
9
+ walletAddress?: string;
10
+ network?: Network;
11
+ }
12
+ export declare const ClaimItem: React.FC<ClaimItemProps>;
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { VoteItem, VoteDirection } from '../../types/vote';
3
+ import { Network } from '../../hooks/useAtomData';
4
+
5
+ interface ClaimListProps {
6
+ isLoading: boolean;
7
+ voteItems: VoteItem[];
8
+ onChangeUnits: (id: bigint, direction: VoteDirection, units: number) => void;
9
+ isVoteDirectionAllowed?: (tripleId: bigint, direction: VoteDirection) => boolean;
10
+ walletAddress?: string;
11
+ network?: Network;
12
+ }
13
+ export declare const ClaimList: React.FC<ClaimListProps>;
14
+ export {};
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { Network } from '../../hooks/useAtomData';
3
+
4
+ interface ClaimVotingProps {
5
+ walletConnected?: any;
6
+ walletAddress?: string;
7
+ publicClient?: any;
8
+ onClose?: () => void;
9
+ network?: Network;
10
+ onConnectWallet?: () => void;
11
+ onCreatePlayer?: () => void;
12
+ wagmiConfig?: any;
13
+ walletHooks?: any;
14
+ }
15
+ export declare const ClaimVoting: React.FC<ClaimVotingProps>;
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface SubmitButtonProps {
4
+ onSubmit: () => void;
5
+ isSubmitting: boolean;
6
+ isDepositLoading: boolean;
7
+ totalUnits: number;
8
+ numberOfTransactions: number;
9
+ }
10
+ export declare const SubmitButton: React.FC<SubmitButtonProps>;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface TransactionInfoProps {
4
+ numberOfTransactions: number;
5
+ totalUnits: number;
6
+ onResetAll: () => void;
7
+ }
8
+ export declare const TransactionInfo: React.FC<TransactionInfoProps>;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ type TransactionStatusType = {
4
+ status: "idle" | "pending" | "success" | "error" | "approval_pending" | "whitelist_error";
5
+ message: string;
6
+ };
7
+ interface TransactionStatusDisplayProps {
8
+ transactionStatus: TransactionStatusType;
9
+ }
10
+ export declare const TransactionStatusDisplay: React.FC<TransactionStatusDisplayProps>;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface VotingHeaderProps {
4
+ onClose?: () => void;
5
+ }
6
+ export declare const VotingHeader: React.FC<VotingHeaderProps>;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Network } from './useAtomData';
2
+
3
+ interface UseCheckSpecificTriplePositionProps {
4
+ walletAddress: string;
5
+ tripleId: string | number;
6
+ network?: Network;
7
+ }
8
+ export declare const useCheckSpecificTriplePosition: ({ walletAddress, tripleId, network }: UseCheckSpecificTriplePositionProps) => {
9
+ hasPosition: boolean;
10
+ isFor: boolean | null;
11
+ loading: boolean;
12
+ error: Error | null;
13
+ };
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import { VoteDirection, DepositResponse } from '../types/vote';
2
+ import { Network } from './useAtomData';
3
+
4
+ interface UseDepositTripleProps {
5
+ walletConnected?: any;
6
+ walletAddress?: string;
7
+ publicClient?: any;
8
+ network?: Network;
9
+ }
10
+ export declare const useDepositTriple: ({ walletConnected, walletAddress, publicClient, network, }: UseDepositTripleProps) => {
11
+ depositTriple: (claimId: bigint, units: number, direction: VoteDirection) => Promise<DepositResponse>;
12
+ isLoading: boolean;
13
+ };
14
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const useDisplayTriplesWithPosition: (walletAddress: string) => {
2
+ data: any;
3
+ loading: boolean;
4
+ error: Error | null;
5
+ };
@@ -0,0 +1,27 @@
1
+ import { Network } from './useAtomData';
2
+
3
+ export interface TripleDetails {
4
+ id: string;
5
+ subject?: {
6
+ label: string;
7
+ };
8
+ predicate?: {
9
+ label: string;
10
+ };
11
+ object?: {
12
+ label: string;
13
+ };
14
+ vault_id?: string;
15
+ vault_position_count?: number;
16
+ counter_vault_id?: string;
17
+ counter_vault_position_count?: number;
18
+ }
19
+ interface UseFetchTripleDetailsProps {
20
+ network?: Network;
21
+ onError?: (message: string) => void;
22
+ }
23
+ export declare const useFetchTripleDetails: ({ network, onError }?: UseFetchTripleDetailsProps) => {
24
+ fetchTripleDetails: (tripleId: bigint) => Promise<TripleDetails | null>;
25
+ isLoading: boolean;
26
+ };
27
+ export {};
@@ -0,0 +1,22 @@
1
+ import { VoteItem, DepositResponse } from '../types/vote';
2
+ import { Network } from './useAtomData';
3
+
4
+ type TransactionStatus = {
5
+ status: "idle" | "pending" | "success" | "error" | "approval_pending" | "whitelist_error";
6
+ message: string;
7
+ };
8
+ interface UseSubmitVotesProps {
9
+ walletConnected?: any;
10
+ walletAddress?: string;
11
+ publicClient?: any;
12
+ network?: Network;
13
+ onSuccess?: () => void;
14
+ }
15
+ export declare const useSubmitVotes: ({ walletConnected, walletAddress, publicClient, network, onSuccess }: UseSubmitVotesProps) => {
16
+ submitVotes: (voteItems: VoteItem[]) => Promise<DepositResponse | null>;
17
+ isSubmitting: boolean;
18
+ isDepositLoading: boolean;
19
+ transactionStatus: TransactionStatus;
20
+ setTransactionStatus: import('react').Dispatch<import('react').SetStateAction<TransactionStatus>>;
21
+ };
22
+ export {};
@@ -0,0 +1,21 @@
1
+ import { VoteItem, VoteDirection } from '../types/vote';
2
+ import { Network } from './useAtomData';
3
+
4
+ interface UseVoteItemsManagementProps {
5
+ network?: Network;
6
+ walletAddress?: string;
7
+ onError?: (message: string) => void;
8
+ }
9
+ export declare const useVoteItemsManagement: ({ network, walletAddress, onError }: UseVoteItemsManagementProps) => {
10
+ voteItems: VoteItem[];
11
+ setVoteItems: import('react').Dispatch<import('react').SetStateAction<VoteItem[]>>;
12
+ isLoading: boolean;
13
+ totalUnits: number;
14
+ numberOfTransactions: number;
15
+ handleChangeUnits: (id: bigint, direction: VoteDirection, units: number) => void;
16
+ resetAllVotes: () => void;
17
+ loadTripleDetails: () => Promise<void>;
18
+ isVoteDirectionAllowed: (tripleId: bigint, direction: VoteDirection) => boolean;
19
+ userPositions: Record<string, VoteDirection>;
20
+ };
21
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Network } from './useAtomData';
2
+
3
+ export interface AccountAtomResponse {
4
+ account: {
5
+ atom: {
6
+ id: string;
7
+ } | null;
8
+ } | null;
9
+ }
10
+ export declare const fetchAccountAtom: (accountId: string, network?: Network) => Promise<AccountAtomResponse>;
11
+ export declare const useAccountAtom: (accountId: string, network?: Network) => {
12
+ loading: boolean;
13
+ error: Error | null;
14
+ hasAccountAtom: boolean;
15
+ accountAtomId: string | null;
16
+ network: Network;
17
+ rawData: AccountAtomResponse | null;
18
+ };
19
+ export default useAccountAtom;
@@ -0,0 +1,23 @@
1
+ export type IpfsAtom = {
2
+ '@context': string;
3
+ '@type': string;
4
+ name: string;
5
+ description?: string;
6
+ image?: string;
7
+ };
8
+ export type IpfsAtomInput = {
9
+ name: string;
10
+ description?: string;
11
+ image?: string | undefined;
12
+ };
13
+ export interface UseAtomCreationProps {
14
+ walletConnected?: any;
15
+ walletAddress?: string;
16
+ publicClient?: any;
17
+ }
18
+ export declare const useAtomCreation: ({ walletConnected, walletAddress, publicClient }: UseAtomCreationProps) => {
19
+ createAtom: (input: IpfsAtomInput) => Promise<{
20
+ atomId: bigint;
21
+ ipfsHash: string;
22
+ }>;
23
+ };
@@ -0,0 +1,61 @@
1
+ import { createServerClient } from '@0xintuition/graphql';
2
+
3
+ export interface AtomData {
4
+ id: number;
5
+ label: string;
6
+ type: string;
7
+ data: string | null;
8
+ emoji: string | null;
9
+ image: string | null;
10
+ creator_id: string;
11
+ creator: {
12
+ id: string;
13
+ label: string;
14
+ };
15
+ value: {
16
+ id: number;
17
+ } | null;
18
+ block_number: number;
19
+ block_timestamp: string;
20
+ transaction_hash: string;
21
+ }
22
+ export interface AtomResponse {
23
+ atom: AtomData;
24
+ }
25
+ export declare enum Network {
26
+ MAINNET = "mainnet",
27
+ TESTNET = "testnet"
28
+ }
29
+ export declare const API_URLS: {
30
+ mainnet: string;
31
+ testnet: string;
32
+ };
33
+ export declare const createClient: (network?: Network) => ReturnType<typeof createServerClient>;
34
+ export declare const fetchAtomById: (id: number, network?: Network) => Promise<AtomResponse>;
35
+ export declare const fetchAtomByLabel: (label: string, network?: Network) => Promise<{
36
+ atoms: AtomData[];
37
+ }>;
38
+ export interface AtomByIdHook {
39
+ data: AtomResponse | null;
40
+ loading: boolean;
41
+ error: string | null;
42
+ network: Network;
43
+ }
44
+ export interface AtomByLabelHook {
45
+ data: AtomData | null;
46
+ loading: boolean;
47
+ error: string | null;
48
+ network: Network;
49
+ }
50
+ export { useMainnetAtomById, useMainnetAtomByLabel } from './useMainnetAtomData';
51
+ export { useTestnetAtomById, useTestnetAtomByLabel } from './useTestnetAtomData';
52
+ export declare const useAtomById: (id: number, network?: Network) => {
53
+ data: AtomResponse | null;
54
+ loading: boolean;
55
+ error: string | null;
56
+ };
57
+ export declare const useAtomByLabel: (label: string, network?: Network) => {
58
+ data: AtomData | null;
59
+ loading: boolean;
60
+ error: string | null;
61
+ };
@@ -0,0 +1,22 @@
1
+ import { Network } from './useAtomData';
2
+
3
+ export interface Triple {
4
+ subject_id: string;
5
+ predicate_id: string;
6
+ object_id: string;
7
+ }
8
+ export interface AtomTriplesResponse {
9
+ atom: {
10
+ as_subject_triples: Triple[];
11
+ } | null;
12
+ }
13
+ export declare const fetchAtomTriples: (atomId: number, network?: Network) => Promise<AtomTriplesResponse>;
14
+ export declare const useAtomTriples: (atomId: string | null, network?: Network) => {
15
+ loading: boolean;
16
+ error: Error | null;
17
+ triples: Triple[];
18
+ hasTriple: (predicateId: string, objectId: string) => boolean;
19
+ network: Network;
20
+ rawData: AtomTriplesResponse | null;
21
+ };
22
+ export default useAtomTriples;
@@ -0,0 +1,14 @@
1
+ import { Network, AtomData } from './useAtomData';
2
+
3
+ export interface AtomsByCreatorResponse {
4
+ atoms: AtomData[];
5
+ }
6
+ export declare const fetchAtomsByCreator: (creatorId: string, network?: Network) => Promise<AtomsByCreatorResponse>;
7
+ export declare const useAtomsByCreator: (creatorId: string, network?: Network) => {
8
+ loading: boolean;
9
+ error: Error | null;
10
+ atoms: AtomData[];
11
+ network: Network;
12
+ rawData: AtomsByCreatorResponse | null;
13
+ };
14
+ export default useAtomsByCreator;
@@ -0,0 +1,16 @@
1
+ export interface TripleToCreate {
2
+ subjectId: bigint;
3
+ predicateId: bigint;
4
+ objectId: bigint;
5
+ }
6
+ interface UseBatchCreateTripleProps {
7
+ walletConnected?: any;
8
+ walletAddress?: string;
9
+ publicClient?: any;
10
+ }
11
+ export declare const useBatchCreateTriple: ({ walletConnected, walletAddress, publicClient }: UseBatchCreateTripleProps) => {
12
+ checkTripleExists: (subjectId: bigint, predicateId: bigint, objectId: bigint) => Promise<boolean>;
13
+ batchCreateTriple: (triples: TripleToCreate[]) => Promise<any>;
14
+ createPlayerTriples: (playerAtomId: bigint) => Promise<any>;
15
+ };
16
+ export {};
@@ -0,0 +1,10 @@
1
+ interface UseCreateSingleTripleProps {
2
+ walletConnected?: any;
3
+ walletAddress?: string;
4
+ publicClient?: any;
5
+ }
6
+ export declare const useCreateSingleTriple: ({ walletConnected, walletAddress, publicClient }: UseCreateSingleTripleProps) => {
7
+ checkTripleExists: (subjectId: bigint, predicateId: bigint, objectId: bigint) => Promise<boolean>;
8
+ createSingleTriple: (subjectId: bigint, predicateId: bigint, objectId: bigint) => Promise<bigint>;
9
+ };
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { VoteDirection, DepositResponse } from '../types/vote';
2
+ import { Network } from './useAtomData';
3
+
4
+ interface UseDepositTripleProps {
5
+ walletConnected?: any;
6
+ walletAddress?: string;
7
+ publicClient?: any;
8
+ network?: Network;
9
+ }
10
+ export declare const useDepositTriple: ({ walletConnected, walletAddress, publicClient, network, }: UseDepositTripleProps) => {
11
+ depositTriple: (claimId: bigint, units: number, direction: VoteDirection) => Promise<DepositResponse>;
12
+ isLoading: boolean;
13
+ };
14
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const useDisplayTriplesWithPosition: (walletAddress: string) => {
2
+ data: any;
3
+ loading: boolean;
4
+ error: Error | null;
5
+ };
@@ -0,0 +1,27 @@
1
+ import { Network } from './useAtomData';
2
+
3
+ export interface TripleDetails {
4
+ id: string;
5
+ subject?: {
6
+ label: string;
7
+ };
8
+ predicate?: {
9
+ label: string;
10
+ };
11
+ object?: {
12
+ label: string;
13
+ };
14
+ vault_id?: string;
15
+ vault_position_count?: number;
16
+ counter_vault_id?: string;
17
+ counter_vault_position_count?: number;
18
+ }
19
+ interface UseFetchTripleDetailsProps {
20
+ network?: Network;
21
+ onError?: (message: string) => void;
22
+ }
23
+ export declare const useFetchTripleDetails: ({ network, onError }?: UseFetchTripleDetailsProps) => {
24
+ fetchTripleDetails: (tripleId: bigint) => Promise<TripleDetails | null>;
25
+ isLoading: boolean;
26
+ };
27
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Network, AtomResponse, AtomData } from './useAtomData';
2
+
3
+ /**
4
+ * Hook pour récupérer un atome par ID sur le mainnet
5
+ */
6
+ export declare const useMainnetAtomById: (id: number) => {
7
+ data: AtomResponse | null;
8
+ loading: boolean;
9
+ error: string | null;
10
+ network: Network;
11
+ };
12
+ /**
13
+ * Hook pour récupérer un atome par label sur le mainnet
14
+ */
15
+ export declare const useMainnetAtomByLabel: (label: string) => {
16
+ data: AtomData | null;
17
+ loading: boolean;
18
+ error: string | null;
19
+ network: Network;
20
+ };
@@ -0,0 +1,22 @@
1
+ import { VoteItem, DepositResponse } from '../types/vote';
2
+ import { Network } from './useAtomData';
3
+
4
+ type TransactionStatus = {
5
+ status: "idle" | "pending" | "success" | "error" | "approval_pending" | "whitelist_error";
6
+ message: string;
7
+ };
8
+ interface UseSubmitVotesProps {
9
+ walletConnected?: any;
10
+ walletAddress?: string;
11
+ publicClient?: any;
12
+ network?: Network;
13
+ onSuccess?: () => void;
14
+ }
15
+ export declare const useSubmitVotes: ({ walletConnected, walletAddress, publicClient, network, onSuccess }: UseSubmitVotesProps) => {
16
+ submitVotes: (voteItems: VoteItem[]) => Promise<DepositResponse | null>;
17
+ isSubmitting: boolean;
18
+ isDepositLoading: boolean;
19
+ transactionStatus: TransactionStatus;
20
+ setTransactionStatus: import('react').Dispatch<import('react').SetStateAction<TransactionStatus>>;
21
+ };
22
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Network, AtomResponse, AtomData } from './useAtomData';
2
+
3
+ /**
4
+ * Hook pour récupérer un atome par ID sur le testnet
5
+ */
6
+ export declare const useTestnetAtomById: (id: number) => {
7
+ data: AtomResponse | null;
8
+ loading: boolean;
9
+ error: string | null;
10
+ network: Network;
11
+ };
12
+ /**
13
+ * Hook pour récupérer un atome par label sur le testnet
14
+ */
15
+ export declare const useTestnetAtomByLabel: (label: string) => {
16
+ data: AtomData | null;
17
+ loading: boolean;
18
+ error: string | null;
19
+ network: Network;
20
+ };
@@ -0,0 +1,39 @@
1
+ import { Network } from './useAtomData';
2
+
3
+ export interface Triple {
4
+ id: string;
5
+ subject_id: string;
6
+ predicate_id: string;
7
+ object_id: string;
8
+ subject: {
9
+ id: string;
10
+ label: string;
11
+ type: string;
12
+ creator_id: string;
13
+ };
14
+ predicate: {
15
+ id: string;
16
+ label: string;
17
+ type: string;
18
+ };
19
+ object: {
20
+ id: string;
21
+ label: string;
22
+ type: string;
23
+ };
24
+ block_number: number;
25
+ block_timestamp: string;
26
+ transaction_hash: string;
27
+ }
28
+ export interface TriplesByCreatorResponse {
29
+ triples: Triple[];
30
+ }
31
+ export declare const fetchTriplesByCreator: (creatorId: string, predicateId?: number, objectId?: number, network?: Network) => Promise<TriplesByCreatorResponse>;
32
+ export declare const useTripleByCreator: (creatorId: string, predicateId?: number, objectId?: number, network?: Network) => {
33
+ loading: boolean;
34
+ error: Error | null;
35
+ triples: Triple[];
36
+ network: Network;
37
+ rawData: TriplesByCreatorResponse | null;
38
+ };
39
+ export default useTripleByCreator;
@@ -0,0 +1,18 @@
1
+ import { VoteItem, VoteDirection } from '../types/vote';
2
+ import { Network } from './useAtomData';
3
+
4
+ interface UseVoteItemsManagementProps {
5
+ network?: Network;
6
+ onError?: (message: string) => void;
7
+ }
8
+ export declare const useVoteItemsManagement: ({ network, onError }: UseVoteItemsManagementProps) => {
9
+ voteItems: VoteItem[];
10
+ setVoteItems: import('react').Dispatch<import('react').SetStateAction<VoteItem[]>>;
11
+ isLoading: boolean;
12
+ totalUnits: number;
13
+ numberOfTransactions: number;
14
+ handleChangeUnits: (id: bigint, direction: VoteDirection, units: number) => void;
15
+ resetAllVotes: () => void;
16
+ loadTripleDetails: () => Promise<void>;
17
+ };
18
+ export {};
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare const DirectPositionCheck: React.FC;
4
+ export default DirectPositionCheck;
@@ -0,0 +1,26 @@
1
+ export declare enum VoteDirection {
2
+ For = "FOR",
3
+ Against = "AGAINST",
4
+ None = "NONE"
5
+ }
6
+ export interface Claim {
7
+ id: bigint;
8
+ subject: string;
9
+ predicate: string;
10
+ object: string;
11
+ }
12
+ export interface VoteItem extends Claim {
13
+ units: number;
14
+ direction: VoteDirection;
15
+ vault_id?: string;
16
+ vault_position_count?: number;
17
+ counter_vault_id?: string;
18
+ counter_vault_position_count?: number;
19
+ userHasPosition?: boolean;
20
+ userPositionDirection?: VoteDirection;
21
+ }
22
+ export interface DepositResponse {
23
+ success: boolean;
24
+ hash?: string;
25
+ error?: string;
26
+ }
@@ -0,0 +1,11 @@
1
+ import { Network } from '../hooks/useAtomData';
2
+
3
+ /**
4
+ * Function to directly check a user's position on a specific triple
5
+ * This can be helpful for debugging position-related issues
6
+ */
7
+ export declare const checkTriplePosition: (walletAddress: string, tripleId: string | number, network?: Network) => Promise<{
8
+ hasPosition: boolean;
9
+ isFor: boolean | null;
10
+ result: any;
11
+ }>;
@@ -0,0 +1,2 @@
1
+ export declare const UNIT_VALUE = 1000000000000000n;
2
+ export declare const PREDEFINED_CLAIM_IDS: bigint[];
@@ -0,0 +1,32 @@
1
+ import { VoteItem } from '../types/vote';
2
+
3
+ /**
4
+ * Calculates the total number of transactions needed for the current vote selection
5
+ * @param voteItems Array of vote items
6
+ * @returns Number of transactions
7
+ */
8
+ export declare const calculateNumberOfTransactions: (voteItems: VoteItem[]) => number;
9
+ /**
10
+ * Calculates the total units selected across all vote items
11
+ * @param voteItems Array of vote items
12
+ * @returns Total units
13
+ */
14
+ export declare const calculateTotalUnits: (voteItems: VoteItem[]) => number;
15
+ /**
16
+ * Calculates the total ETH cost based on number of units
17
+ * @param units Number of units
18
+ * @returns Total ETH cost as a string with 3 decimal places
19
+ */
20
+ export declare const calculateEthCost: (units: number) => string;
21
+ /**
22
+ * Calculates the estimated gas cost for a set of transactions
23
+ * @param transactionCount Number of transactions
24
+ * @returns Estimated gas cost as a string with 4 decimal places
25
+ */
26
+ export declare const calculateGasCost: (transactionCount: number) => string;
27
+ /**
28
+ * Reset all vote items to zero units and no direction
29
+ * @param voteItems Array of vote items
30
+ * @returns New array with reset vote items
31
+ */
32
+ export declare const resetVoteItems: (voteItems: VoteItem[]) => VoteItem[];