player-map 1.0.9 → 1.0.10
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.
- package/dist/index.es.js +7071 -7040
- package/dist/index.umd.js +480 -485
- package/package.json +1 -1
- package/dist/types/components/modals/ConnectWalletModal.d.ts +0 -8
- package/dist/types/components/modals/CreatePlayerModal.d.ts +0 -9
- package/dist/types/components/modals/index.d.ts +0 -2
- package/dist/types/components/vote/ClaimItem.d.ts +0 -13
- package/dist/types/components/vote/ClaimList.d.ts +0 -14
- package/dist/types/components/vote/ClaimVoting.d.ts +0 -16
- package/dist/types/components/vote/SubmitButton.d.ts +0 -11
- package/dist/types/components/vote/TransactionInfo.d.ts +0 -9
- package/dist/types/components/vote/TransactionStatus.d.ts +0 -11
- package/dist/types/components/vote/VotingHeader.d.ts +0 -7
- package/dist/types/hooks/useCheckSpecificTriplePosition.d.ts +0 -14
- package/dist/types/hooks/useDepositTriple.d.ts +0 -14
- package/dist/types/hooks/useDisplayTriplesWithPosition.d.ts +0 -5
- package/dist/types/hooks/useFetchTripleDetails.d.ts +0 -27
- package/dist/types/hooks/useSubmitVotes.d.ts +0 -22
- package/dist/types/hooks/useVoteItemsManagement.d.ts +0 -21
- package/dist/types/hooks.old.local/useAccountAtom.d.ts +0 -19
- package/dist/types/hooks.old.local/useAtomCreation.d.ts +0 -23
- package/dist/types/hooks.old.local/useAtomData.d.ts +0 -61
- package/dist/types/hooks.old.local/useAtomTriples.d.ts +0 -22
- package/dist/types/hooks.old.local/useAtomsByCreator.d.ts +0 -14
- package/dist/types/hooks.old.local/useBatchCreateTriple.d.ts +0 -16
- package/dist/types/hooks.old.local/useCreateSingleTriple.d.ts +0 -10
- package/dist/types/hooks.old.local/useDepositTriple.d.ts +0 -14
- package/dist/types/hooks.old.local/useDisplayTriplesWithPosition.d.ts +0 -5
- package/dist/types/hooks.old.local/useFetchTripleDetails.d.ts +0 -27
- package/dist/types/hooks.old.local/useMainnetAtomData.d.ts +0 -20
- package/dist/types/hooks.old.local/useSubmitVotes.d.ts +0 -22
- package/dist/types/hooks.old.local/useTestnetAtomData.d.ts +0 -20
- package/dist/types/hooks.old.local/useTripleByCreator.d.ts +0 -39
- package/dist/types/hooks.old.local/useVoteItemsManagement.d.ts +0 -18
- package/dist/types/pages/DirectPositionCheck.d.ts +0 -4
- package/dist/types/types/vote.d.ts +0 -26
- package/dist/types/utils/debugPosition.d.ts +0 -11
- package/dist/types/utils/voteConstants.d.ts +0 -2
- package/dist/types/utils/voteUtils.d.ts +0 -32
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,16 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,11 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,11 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,27 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,22 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,21 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,19 +0,0 @@
|
|
|
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;
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
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;
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,16 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,10 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,27 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}>;
|