Skip to content

Commit

Permalink
feat: new version and no more api key
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasDeco committed May 2, 2024
1 parent 818d7e2 commit 46efb04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
22 changes: 3 additions & 19 deletions lib/client/indexer/indexerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,16 @@ export class FutarchyIndexerClient implements FutarchyClient {
constructor(
rpcClient: FutarchyRPCClient,
indexerURL: string,
indexerWSURL: string,
indexerApiKey: string
indexerWSURL: string
) {
if (indexerURL === "" || indexerApiKey === "")
throw "missing url or api key for indexer client";

// TODO how can we batch these queries??
const options = {
url: indexerURL,
headers: {
// TODO this admin secret in the request... should not be deployed to staging probably
"x-hasura-admin-secret": indexerApiKey,
// TODO should we add user wallet address here for adding querying user-specific data?
},
};
const graphqlClient = createClient(options);

const wsOptions = {
url: indexerWSURL,
headers: { "x-hasura-admin-secret": indexerApiKey },
};

const wsClient = createWsClient(wsOptions);
Expand Down Expand Up @@ -70,14 +60,8 @@ export class FutarchyIndexerClient implements FutarchyClient {
static make(
rpcClient: FutarchyRPCClient,
indexerURL: string,
indexerWSURL: string,
indexerApiKey: string
indexerWSURL: string
) {
return new FutarchyIndexerClient(
rpcClient,
indexerURL,
indexerWSURL,
indexerApiKey
);
return new FutarchyIndexerClient(rpcClient, indexerURL, indexerWSURL);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metadaoproject/futarchy-sdk",
"version": "1.1.0-alpha.3",
"version": "1.1.0-alpha.4",
"main": "dist",
"scripts": {
"build": "tsc --project tsconfig.build.json && tscpaths -p tsconfig.json -s ./lib -o ./dist",
Expand Down

0 comments on commit 46efb04

Please sign in to comment.