& { body: { query: string } };
-/**
- * The fallback URL works for classic databases,for more information about regions see:
- * https://docs.fauna.com/fauna/current/learn/understanding/region_groups
- */
export const requestGraphQlJson = (config: RequestGraphQlJsonConfig) =>
- requestJson(process.env.FAUNADB_URL || "https://graphql.fauna.com/graphql", {
+ requestJson(process.env.DGRAPH_URL || "", {
...config,
- headers: { Authorization: `Bearer ${process.env.FAUNADB_SECRET}`, ...config.headers },
+ headers: process.env.DGRAPH_SECRET
+ ? { "X-Auth-Token": process.env.DGRAPH_SECRET, ...config.headers }
+ : config.headers,
});
diff --git a/package-lock.json b/package-lock.json
index d27bcd22..98323da1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -64,7 +64,6 @@
"eslint": "8.48.0",
"eslint-config-next": "13.4.19",
"eslint-config-prettier": "^9.0.0",
- "faunadb": "^4.8.0",
"jest": "^29.6.4",
"jest-environment-jsdom": "^29.6.4",
"lucide-react": "^0.274.0",
@@ -4390,14 +4389,6 @@
"url": "https://github.com/sponsors/epoberezkin"
}
},
- "node_modules/ansi-align": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz",
- "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==",
- "dependencies": {
- "string-width": "^4.1.0"
- }
- },
"node_modules/ansi-escapes": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz",
@@ -4869,38 +4860,6 @@
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz",
"integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ=="
},
- "node_modules/boxen": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz",
- "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==",
- "dependencies": {
- "ansi-align": "^3.0.0",
- "camelcase": "^6.2.0",
- "chalk": "^4.1.0",
- "cli-boxes": "^2.2.1",
- "string-width": "^4.2.2",
- "type-fest": "^0.20.2",
- "widest-line": "^3.1.0",
- "wrap-ansi": "^7.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/boxen/node_modules/camelcase": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
- "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -4965,11 +4924,6 @@
"node-int64": "^0.4.0"
}
},
- "node_modules/btoa-lite": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz",
- "integrity": "sha512-gvW7InbIyF8AicrqWoptdW08pUxuhq8BEgowNajy9RhiE86fmGAGl+bLKo6oB8QP0CkqHLowfN0oJdKC/J6LbA=="
- },
"node_modules/buffer-from": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
@@ -5136,17 +5090,6 @@
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz",
"integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw=="
},
- "node_modules/cli-boxes": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz",
- "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==",
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/client-only": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
@@ -5531,14 +5474,6 @@
"resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.9.0.tgz",
"integrity": "sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ=="
},
- "node_modules/cross-fetch": {
- "version": "3.1.8",
- "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz",
- "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==",
- "dependencies": {
- "node-fetch": "^2.6.12"
- }
- },
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -5943,14 +5878,6 @@
"node": ">=12"
}
},
- "node_modules/dotenv": {
- "version": "8.6.0",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz",
- "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==",
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/electron-to-chromium": {
"version": "1.4.510",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.510.tgz",
@@ -6729,24 +6656,6 @@
"reusify": "^1.0.4"
}
},
- "node_modules/faunadb": {
- "version": "4.8.0",
- "resolved": "https://registry.npmjs.org/faunadb/-/faunadb-4.8.0.tgz",
- "integrity": "sha512-pjl5WUYQ8GqM4ESk3mv0RXfxtQMHWb92XWkxjf3nWiAkf2HVtsENfTbyGPunzw4zDbdhn9aQSSxbwahaLLDR7Q==",
- "hasInstallScript": true,
- "dependencies": {
- "base64-js": "^1.2.0",
- "boxen": "^5.0.1",
- "btoa-lite": "^1.0.0",
- "chalk": "^4.1.1",
- "cross-fetch": "^3.1.5",
- "dotenv": "^8.2.0",
- "fn-annotate": "^1.1.3",
- "node-abort-controller": "^3.0.1",
- "object-assign": "^4.1.0",
- "util-deprecate": "^1.0.2"
- }
- },
"node_modules/fb-watchman": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz",
@@ -6815,14 +6724,6 @@
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
},
- "node_modules/fn-annotate": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/fn-annotate/-/fn-annotate-1.2.0.tgz",
- "integrity": "sha512-j2gv2wkRhQgkJNf1ygdca8ynP3tK+a87bowc+RG81iWTye3yKIOeAkrKYv0Kqyh8yCeSyljOk3ZFelfXUFpirA==",
- "engines": {
- "node": ">=0.10.0"
- }
- },
"node_modules/follow-redirects": {
"version": "1.15.3",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
@@ -8969,49 +8870,6 @@
"url": "https://github.com/sponsors/colinhacks"
}
},
- "node_modules/node-abort-controller": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz",
- "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ=="
- },
- "node_modules/node-fetch": {
- "version": "2.7.0",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
- "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
- "dependencies": {
- "whatwg-url": "^5.0.0"
- },
- "engines": {
- "node": "4.x || >=6.0.0"
- },
- "peerDependencies": {
- "encoding": "^0.1.0"
- },
- "peerDependenciesMeta": {
- "encoding": {
- "optional": true
- }
- }
- },
- "node_modules/node-fetch/node_modules/tr46": {
- "version": "0.0.3",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
- },
- "node_modules/node-fetch/node_modules/webidl-conversions": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
- },
- "node_modules/node-fetch/node_modules/whatwg-url": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
- "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
- "dependencies": {
- "tr46": "~0.0.3",
- "webidl-conversions": "^3.0.0"
- }
- },
"node_modules/node-int64": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
@@ -11406,17 +11264,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/widest-line": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz",
- "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==",
- "dependencies": {
- "string-width": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
"node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
diff --git a/package.json b/package.json
index f39b7fce..6eac7ed5 100644
--- a/package.json
+++ b/package.json
@@ -69,7 +69,6 @@
"eslint": "8.48.0",
"eslint-config-next": "13.4.19",
"eslint-config-prettier": "^9.0.0",
- "faunadb": "^4.8.0",
"jest": "^29.6.4",
"jest-environment-jsdom": "^29.6.4",
"lucide-react": "^0.274.0",
diff --git a/pages/[chainName]/[address]/transaction/[transactionID].tsx b/pages/[chainName]/[address]/transaction/[transactionID].tsx
index f35a23da..f6052129 100644
--- a/pages/[chainName]/[address]/transaction/[transactionID].tsx
+++ b/pages/[chainName]/[address]/transaction/[transactionID].tsx
@@ -40,9 +40,9 @@ export const getServerSideProps: GetServerSideProps = async (context): Promise
-
diff --git a/pages/api/chain/[chainId]/multisig/[multisigAddress]/index.ts b/pages/api/chain/[chainId]/multisig/[multisigAddress]/index.ts
index fb1bb76e..0c782b75 100644
--- a/pages/api/chain/[chainId]/multisig/[multisigAddress]/index.ts
+++ b/pages/api/chain/[chainId]/multisig/[multisigAddress]/index.ts
@@ -8,13 +8,13 @@ export default async function multisigAddressApi(req: NextApiRequest, res: NextA
const multisigAddress = req.query.multisigAddress?.toString() || "";
const chainId = req.query.chainId?.toString() || "";
console.log("Function `getMultisig` invoked", multisigAddress, chainId);
- const getRes = await getMultisig(multisigAddress, chainId);
- if (!getRes.data.getMultisig) {
+ const multisig = await getMultisig(multisigAddress, chainId);
+ if (!multisig) {
res.status(404).send("Multisig not found");
return;
}
- console.log("success", getRes.data.getMultisig);
- res.status(200).send(getRes.data.getMultisig);
+ console.log("success", multisig);
+ res.status(200).send(multisig);
return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
diff --git a/pages/api/chain/[chainId]/multisig/index.ts b/pages/api/chain/[chainId]/multisig/index.ts
index 3121cdec..f56654c8 100644
--- a/pages/api/chain/[chainId]/multisig/index.ts
+++ b/pages/api/chain/[chainId]/multisig/index.ts
@@ -8,8 +8,8 @@ export default async function multisigApi(req: NextApiRequest, res: NextApiRespo
const data = req.body;
console.log("Function `createMultisig` invoked", data);
const saveRes = await createMultisig(data);
- console.log("success", saveRes.data);
- res.status(200).send(saveRes.data.createMultisig);
+ console.log("success", saveRes);
+ res.status(200).send(saveRes.data.addMultisig.multisig[0]);
return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
diff --git a/pages/api/transaction/[transactionID]/index.ts b/pages/api/transaction/[transactionID]/index.ts
index 0c077c89..44470d04 100644
--- a/pages/api/transaction/[transactionID]/index.ts
+++ b/pages/api/transaction/[transactionID]/index.ts
@@ -10,7 +10,7 @@ export default async function transactionIDApi(req: NextApiRequest, res: NextApi
console.log("Function `updateTransaction` invoked", txHash);
const saveRes = await updateTxHash(transactionID, txHash);
console.log("success", saveRes.data);
- res.status(200).send(saveRes.data.updateTransaction);
+ res.status(200).send(saveRes.data.updateTransaction.transaction[0]);
return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
diff --git a/pages/api/transaction/[transactionID]/signature.ts b/pages/api/transaction/[transactionID]/signature.ts
index e9919d62..e5678db4 100644
--- a/pages/api/transaction/[transactionID]/signature.ts
+++ b/pages/api/transaction/[transactionID]/signature.ts
@@ -10,7 +10,7 @@ export default async function transactionIDApi(req: NextApiRequest, res: NextApi
console.log("Function `createSignature` invoked", data);
const saveRes = await createSignature(data, transactionID);
console.log("success", saveRes.data);
- res.status(200).send(saveRes.data.createSignature);
+ res.status(200).send(saveRes.data.addSignature.signature[0]);
return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
diff --git a/pages/api/transaction/index.ts b/pages/api/transaction/index.ts
index a691afa1..e0294cfe 100644
--- a/pages/api/transaction/index.ts
+++ b/pages/api/transaction/index.ts
@@ -9,7 +9,9 @@ export default async function transactionApi(req: NextApiRequest, res: NextApiRe
console.log("Function `createTransaction` invoked", data);
const createTransactionResult = await createTransaction(data.dataJSON);
console.log("createTransactionResult:", createTransactionResult);
- res.status(200).send({ transactionID: createTransactionResult.data.createTransaction._id });
+ res
+ .status(200)
+ .send({ transactionID: createTransactionResult.data.addTransaction.transaction[0].id });
return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {