player-map 1.0.10 → 1.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "player-map",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -20,9 +20,11 @@
20
20
  "test": ""
21
21
  },
22
22
  "dependencies": {
23
- "@0xintuition/graphql": "^0.8.0",
23
+ "@0xintuition/graphql": "1.0.0-alpha.1",
24
+ "@tanstack/react-query": "^5.87.1",
24
25
  "axios": "^1.9.0",
25
- "playermap_graph": "^0.1.4"
26
+ "playermap_graph": "0.1.6",
27
+ "react-icons": "^5.5.0"
26
28
  },
27
29
  "devDependencies": {
28
30
  "@types/react": "^18.2.0",
@@ -39,4 +41,4 @@
39
41
  "wagmi": "^2.15.2"
40
42
  },
41
43
  "packageManager": "pnpm@9.12.3+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
42
- }
44
+ }
@@ -1,14 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- interface GraphComponentProps {
4
- walletConnected?: boolean;
5
- walletAddress?: string;
6
- wagmiConfig?: any;
7
- walletHooks?: any;
8
- isOpen?: boolean;
9
- onClose?: () => void;
10
- onCreatePlayer?: () => void;
11
- onConnectWallet?: () => void;
12
- }
13
- declare const GraphComponent: React.FC<GraphComponentProps>;
14
- export default GraphComponent;
@@ -1,27 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- interface PlayerCreationProgressProps {
4
- step: number;
5
- isCreatingAtom: boolean;
6
- isCreatingTriples: boolean;
7
- creationSuccess: boolean;
8
- atomId: string | null;
9
- tripleCreated: boolean;
10
- walletAddress?: string;
11
- hasExistingAtom: boolean;
12
- formData: {
13
- pseudo: string;
14
- userId: string;
15
- image: string;
16
- guildId?: string;
17
- };
18
- handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
19
- handleSelectChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
20
- handleFileUpload: (e: React.ChangeEvent<HTMLInputElement>) => void;
21
- handleSubmit: () => void;
22
- isLoading: boolean;
23
- isUploading: boolean;
24
- fileInputRef: React.RefObject<HTMLInputElement>;
25
- }
26
- declare const PlayerCreationProgress: React.FC<PlayerCreationProgressProps>;
27
- export default PlayerCreationProgress;
@@ -1,7 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- interface PlayerMapGraphProps {
4
- walletAddress?: string;
5
- }
6
- declare const PlayerMapGraph: React.FC<PlayerMapGraphProps>;
7
- export default PlayerMapGraph;
@@ -1,13 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- interface PlayerMapHomeProps {
4
- walletConnected?: any;
5
- walletAddress?: string;
6
- wagmiConfig?: any;
7
- walletHooks?: any;
8
- onClose?: () => void;
9
- isOpen?: boolean;
10
- onCreatePlayer?: () => void;
11
- }
12
- declare const PlayerMapHome: React.FC<PlayerMapHomeProps>;
13
- export default PlayerMapHome;
@@ -1,17 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- interface RegistrationFormProps {
4
- isOpen: boolean;
5
- onClose: () => void;
6
- walletConnected?: any;
7
- walletAddress?: string;
8
- wagmiConfig?: any;
9
- walletHooks?: {
10
- useAccount?: any;
11
- useConnect?: any;
12
- useWalletClient?: any;
13
- usePublicClient?: any;
14
- };
15
- }
16
- declare const RegistrationForm: React.FC<RegistrationFormProps>;
17
- export default RegistrationForm;
@@ -1,25 +0,0 @@
1
- export declare const ATOM_CONTRACT_ADDRESS: string;
2
- export declare const ATOM_CONTRACT_CHAIN_ID: number;
3
- export declare const VALUE_PER_ATOM: bigint;
4
- export declare const VALUE_PER_TRIPLE: bigint;
5
- export declare const atomABI: ({
6
- type: string;
7
- name: string;
8
- inputs: {
9
- name: string;
10
- type: string;
11
- internalType: string;
12
- }[];
13
- outputs: {
14
- name: string;
15
- type: string;
16
- internalType: string;
17
- }[];
18
- stateMutability: string;
19
- } | {
20
- type: string;
21
- stateMutability: string;
22
- name?: undefined;
23
- inputs?: undefined;
24
- outputs?: undefined;
25
- })[];
@@ -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,11 +0,0 @@
1
- import { createServerClient } from '@0xintuition/graphql';
2
-
3
- export declare enum Network {
4
- MAINNET = "mainnet",
5
- TESTNET = "testnet"
6
- }
7
- export declare const API_URLS: {
8
- mainnet: string;
9
- testnet: string;
10
- };
11
- export declare const createClient: (network?: Network) => ReturnType<typeof createServerClient>;
@@ -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,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,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,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,7 +0,0 @@
1
- export interface IPlayerMapConfig {
2
- apiUrl: string;
3
- }
4
- export declare const getConfig: () => Readonly<IPlayerMapConfig>;
5
- export declare const initConfig: (config: {
6
- apiUrl: string;
7
- }) => void;
@@ -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,4 +0,0 @@
1
- export declare const hashDataToIPFS: (data: any) => Promise<{
2
- ipfsHash: string;
3
- httpUrl: string;
4
- }>;
@@ -1,3 +0,0 @@
1
- export declare const uploadToPinata: (file: File) => Promise<string>;
2
- export declare const isIpfsUrl: (url: string | undefined) => boolean;
3
- export declare const ipfsToHttpUrl: (ipfsUrl: string) => Promise<string>;