@bananapus/nana-sdk-react 8.0.0 → 9.0.0
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.js
CHANGED
|
@@ -390,8 +390,9 @@ import { debug as debug9 } from "@bananapus/nana-sdk-core";
|
|
|
390
390
|
var ProjectDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "Project" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "projectId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "chainId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "version" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Float" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "project" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "projectId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "projectId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "chainId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "chainId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "version" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "version" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "projectId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "metadataUri" } }, { "kind": "Field", "name": { "kind": "Name", "value": "handle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "logoUri" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "version" } }, { "kind": "Field", "name": { "kind": "Name", "value": "suckerGroupId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "suckerGroup" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "projects" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "items" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "chainId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "balance" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tokenSupply" } }, { "kind": "Field", "name": { "kind": "Name", "value": "projectId" } }] } }] } }] } }] } }] } }] };
|
|
391
391
|
|
|
392
392
|
// src/lib/bendystraw/useBendystrawQuery.ts
|
|
393
|
+
import { requestBendystraw } from "@bananapus/nana-sdk-core";
|
|
393
394
|
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
394
|
-
import
|
|
395
|
+
import { analyzeDocument } from "graphql-request";
|
|
395
396
|
|
|
396
397
|
// src/lib/bendystraw/getBendystrawUrl.ts
|
|
397
398
|
import { arbitrum, base, mainnet as mainnet2, optimism } from "viem/chains";
|
|
@@ -665,12 +666,16 @@ function useBendystrawQuery(document, ...[variables, options]) {
|
|
|
665
666
|
url,
|
|
666
667
|
variables
|
|
667
668
|
],
|
|
668
|
-
queryFn: async () =>
|
|
669
|
+
queryFn: async () => requestBendystraw(
|
|
670
|
+
`${url}/graphql`,
|
|
671
|
+
analyzeDocument(document).expression,
|
|
672
|
+
variables
|
|
673
|
+
),
|
|
669
674
|
enabled: options?.enabled !== false && !!chainId && !!url,
|
|
670
675
|
refetchInterval: options?.pollInterval,
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
676
|
+
// requestBendystraw owns bounded transient retries. Retrying again here
|
|
677
|
+
// would multiply requests and make timeout behavior inconsistent.
|
|
678
|
+
retry: false,
|
|
674
679
|
staleTime: options?.staleTime ?? 3e4,
|
|
675
680
|
// Consider data stale after 30 seconds by default
|
|
676
681
|
gcTime: 5 * 60 * 1e3
|
|
@@ -4144,8 +4149,8 @@ function useGetRelayrTxQuote() {
|
|
|
4144
4149
|
async function getRelayrTxQuote(data) {
|
|
4145
4150
|
if (!data?.length) throw new Error("There are no Relayr calls to quote");
|
|
4146
4151
|
const seenSigners = /* @__PURE__ */ new Set();
|
|
4147
|
-
for (const
|
|
4148
|
-
const key = `${
|
|
4152
|
+
for (const request of data) {
|
|
4153
|
+
const key = `${request.chainId}:${request.data.from.toLowerCase()}`;
|
|
4149
4154
|
if (seenSigners.has(key)) {
|
|
4150
4155
|
throw new Error(
|
|
4151
4156
|
"Relayr supports only one forward request per account and chain"
|