player-map 1.0.6 → 1.0.7
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 +37117 -32947
- package/dist/index.umd.js +1129 -539
- package/dist/types/hooks/useAtomData.d.ts +0 -50
- package/dist/types/index.d.ts +9 -1
- package/package.json +2 -2
- package/dist/types/hooks/useAccountAtom.d.ts +0 -19
- package/dist/types/hooks/useAtomTriples.d.ts +0 -22
- package/dist/types/hooks/useAtomsByCreator.d.ts +0 -14
- package/dist/types/hooks/useCreateSingleTriple.d.ts +0 -10
- package/dist/types/hooks/useMainnetAtomData.d.ts +0 -20
- package/dist/types/hooks/useTestnetAtomData.d.ts +0 -20
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
import { createServerClient } from '@0xintuition/graphql';
|
|
2
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
3
|
export declare enum Network {
|
|
26
4
|
MAINNET = "mainnet",
|
|
27
5
|
TESTNET = "testnet"
|
|
@@ -31,31 +9,3 @@ export declare const API_URLS: {
|
|
|
31
9
|
testnet: string;
|
|
32
10
|
};
|
|
33
11
|
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
|
-
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,11 +2,19 @@ import { default as PlayerMapHome } from './PlayerMapHome';
|
|
|
2
2
|
import { default as RegistrationForm } from './RegistrationForm';
|
|
3
3
|
import { default as PlayerMapGraph } from './PlayerMapGraph';
|
|
4
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';
|
|
5
11
|
|
|
6
12
|
export interface PlayerMapConfigType {
|
|
7
13
|
apiUrl: string;
|
|
8
14
|
}
|
|
9
|
-
export { PlayerMapHome, RegistrationForm, PlayerMapGraph, GraphComponent, };
|
|
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';
|
|
10
18
|
export declare const PlayerMapConfig: {
|
|
11
19
|
/**
|
|
12
20
|
* Initialise la configuration de la bibliothèque Player-map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "player-map",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@0xintuition/graphql": "^0.8.0",
|
|
24
24
|
"axios": "^1.9.0",
|
|
25
|
-
"playermap_graph": "^0.1.
|
|
25
|
+
"playermap_graph": "^0.1.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react": "^18.2.0",
|
|
@@ -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,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,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,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,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
|
-
};
|