player-map 1.0.9 → 1.0.11
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 +56884 -113463
- package/dist/index.umd.js +1899 -7267
- package/package.json +10 -9
- package/dist/types/GraphComponent.d.ts +0 -14
- package/dist/types/PlayerCreationProgress.d.ts +0 -27
- package/dist/types/PlayerMapGraph.d.ts +0 -7
- package/dist/types/PlayerMapHome.d.ts +0 -13
- package/dist/types/RegistrationForm.d.ts +0 -17
- package/dist/types/abi.d.ts +0 -25
- 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/useAtomCreation.d.ts +0 -23
- package/dist/types/hooks/useAtomData.d.ts +0 -11
- package/dist/types/hooks/useBatchCreateTriple.d.ts +0 -16
- 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/useTripleByCreator.d.ts +0 -39
- 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/index.d.ts +0 -37
- package/dist/types/pages/DirectPositionCheck.d.ts +0 -4
- package/dist/types/services/playerCreationService.d.ts +0 -14
- package/dist/types/types/vote.d.ts +0 -26
- package/dist/types/utils/auth.d.ts +0 -24
- package/dist/types/utils/config.d.ts +0 -7
- package/dist/types/utils/constants.d.ts +0 -33
- package/dist/types/utils/debugPosition.d.ts +0 -11
- package/dist/types/utils/ipfs-utils.d.ts +0 -4
- package/dist/types/utils/pinata.d.ts +0 -3
- package/dist/types/utils/voteConstants.d.ts +0 -2
- package/dist/types/utils/voteUtils.d.ts +0 -32
|
@@ -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 {};
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { default as PlayerMapHome } from './PlayerMapHome';
|
|
2
|
-
import { default as RegistrationForm } from './RegistrationForm';
|
|
3
|
-
import { default as PlayerMapGraph } from './PlayerMapGraph';
|
|
4
|
-
import { default as GraphComponent } from './GraphComponent';
|
|
5
|
-
import { ClaimVoting } from './components/vote/ClaimVoting';
|
|
6
|
-
import { useDepositTriple } from './hooks/useDepositTriple';
|
|
7
|
-
import { useCheckSpecificTriplePosition } from './hooks/useCheckSpecificTriplePosition';
|
|
8
|
-
import { useDisplayTriplesWithPosition } from './hooks/useDisplayTriplesWithPosition';
|
|
9
|
-
import { checkTriplePosition } from './utils/debugPosition';
|
|
10
|
-
import { setAuthToken, getAuthToken, isAuthenticated, clearAuthToken } from './utils/auth';
|
|
11
|
-
|
|
12
|
-
export interface PlayerMapConfigType {
|
|
13
|
-
apiUrl: string;
|
|
14
|
-
}
|
|
15
|
-
export { PlayerMapHome, RegistrationForm, PlayerMapGraph, GraphComponent, ClaimVoting, useDepositTriple, useCheckSpecificTriplePosition, useDisplayTriplesWithPosition, checkTriplePosition, setAuthToken, getAuthToken, isAuthenticated, clearAuthToken, };
|
|
16
|
-
export { VoteDirection, type Claim, type VoteItem, type DepositResponse } from './types/vote';
|
|
17
|
-
export { PREDEFINED_CLAIM_IDS, UNIT_VALUE } from './utils/voteConstants';
|
|
18
|
-
export declare const PlayerMapConfig: {
|
|
19
|
-
/**
|
|
20
|
-
* Initialise la configuration de la bibliothèque Player-map
|
|
21
|
-
* @param config Configuration contenant l'URL de l'API (obligatoire)
|
|
22
|
-
*/
|
|
23
|
-
init: (config: PlayerMapConfigType) => boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Récupère la configuration actuelle
|
|
26
|
-
* @throws Error si la configuration n'a pas été initialisée
|
|
27
|
-
*/
|
|
28
|
-
get: () => Readonly<import('./utils/config').IPlayerMapConfig>;
|
|
29
|
-
};
|
|
30
|
-
export declare const auth: {
|
|
31
|
-
setAuthToken: (token: string) => void;
|
|
32
|
-
getAuthToken: () => string | null;
|
|
33
|
-
isAuthenticated: () => boolean;
|
|
34
|
-
clearAuthToken: () => void;
|
|
35
|
-
initialize: (token: string) => boolean;
|
|
36
|
-
};
|
|
37
|
-
export default PlayerMapHome;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface PlayerData {
|
|
2
|
-
pseudo: string;
|
|
3
|
-
userId: string;
|
|
4
|
-
image?: string | undefined;
|
|
5
|
-
guildId?: bigint;
|
|
6
|
-
}
|
|
7
|
-
export declare const usePlayerCreationService: (walletConnected: any, walletAddress: string, publicClient?: any) => {
|
|
8
|
-
createPlayer: (playerData: PlayerData) => Promise<{
|
|
9
|
-
atomId: bigint;
|
|
10
|
-
ipfsHash: string;
|
|
11
|
-
tripleCreated: boolean;
|
|
12
|
-
transactionHash?: string;
|
|
13
|
-
}>;
|
|
14
|
-
};
|
|
@@ -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,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stocke le token d'authentification JWT
|
|
3
|
-
* @param token - Le token JWT à stocker
|
|
4
|
-
*/
|
|
5
|
-
export declare const setAuthToken: (token: string) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Récupère le token d'authentification JWT
|
|
8
|
-
* @returns Le token JWT ou null s'il n'existe pas
|
|
9
|
-
*/
|
|
10
|
-
export declare const getAuthToken: () => string | null;
|
|
11
|
-
/**
|
|
12
|
-
* Vérifie si l'utilisateur est connecté (a un token)
|
|
13
|
-
* @returns true si l'utilisateur est connecté, false sinon
|
|
14
|
-
*/
|
|
15
|
-
export declare const isAuthenticated: () => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Supprime le token d'authentification JWT (déconnexion)
|
|
18
|
-
*/
|
|
19
|
-
export declare const clearAuthToken: () => void;
|
|
20
|
-
/**
|
|
21
|
-
* Formate le token pour l'utiliser dans les headers HTTP
|
|
22
|
-
* @returns Le token formaté ou une chaîne vide
|
|
23
|
-
*/
|
|
24
|
-
export declare const getAuthHeader: () => string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const PLAYER_TRIPLE_TYPES: {
|
|
2
|
-
IS_PLAYER_GAMES: {
|
|
3
|
-
predicateId: bigint;
|
|
4
|
-
objectId: bigint;
|
|
5
|
-
};
|
|
6
|
-
IS_FAIRPLAY: {
|
|
7
|
-
predicateId: bigint;
|
|
8
|
-
objectId: bigint;
|
|
9
|
-
};
|
|
10
|
-
IS_STRONG_BOSS: {
|
|
11
|
-
predicateId: bigint;
|
|
12
|
-
objectId: bigint;
|
|
13
|
-
};
|
|
14
|
-
IS_STRONG_FIGHTER: {
|
|
15
|
-
predicateId: bigint;
|
|
16
|
-
objectId: bigint;
|
|
17
|
-
};
|
|
18
|
-
IS_PLAYER_GUILD: {
|
|
19
|
-
predicateId: bigint;
|
|
20
|
-
objectId: null;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export declare const OFFICIAL_GUILDS: {
|
|
24
|
-
id: bigint;
|
|
25
|
-
name: string;
|
|
26
|
-
}[];
|
|
27
|
-
export declare const API_STATUS: {
|
|
28
|
-
SUCCESS: string;
|
|
29
|
-
ERROR: string;
|
|
30
|
-
};
|
|
31
|
-
export declare const TIMEOUT: {
|
|
32
|
-
MODAL_CLOSE: number;
|
|
33
|
-
};
|
|
@@ -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
|
-
}>;
|
|
@@ -1,32 +0,0 @@
|
|
|
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[];
|