@snapshot-labs/snapshot.js 0.12.4 → 0.12.5
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/snapshot.cjs.js +4 -1
- package/dist/snapshot.esm.js +4 -1
- package/dist/snapshot.min.js +1 -1
- package/package.json +1 -1
- package/src/utils.ts +3 -1
package/dist/snapshot.cjs.js
CHANGED
|
@@ -3850,10 +3850,13 @@ function multicall(network, provider, abi$1, calls, options) {
|
|
|
3850
3850
|
}
|
|
3851
3851
|
function subgraphRequest(url_1, query_1) {
|
|
3852
3852
|
return __awaiter(this, arguments, void 0, function* (url, query, options = {}) {
|
|
3853
|
+
const body = { query: jsonToGraphqlQuery.jsonToGraphQLQuery({ query }) };
|
|
3854
|
+
if (options.variables)
|
|
3855
|
+
body.variables = options.variables;
|
|
3853
3856
|
const res = yield fetch__default['default'](url, {
|
|
3854
3857
|
method: 'POST',
|
|
3855
3858
|
headers: Object.assign({ Accept: 'application/json', 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers),
|
|
3856
|
-
body: JSON.stringify(
|
|
3859
|
+
body: JSON.stringify(body)
|
|
3857
3860
|
});
|
|
3858
3861
|
let responseData = yield res.text();
|
|
3859
3862
|
try {
|
package/dist/snapshot.esm.js
CHANGED
|
@@ -3840,10 +3840,13 @@ function multicall(network, provider, abi, calls, options) {
|
|
|
3840
3840
|
}
|
|
3841
3841
|
function subgraphRequest(url_1, query_1) {
|
|
3842
3842
|
return __awaiter(this, arguments, void 0, function* (url, query, options = {}) {
|
|
3843
|
+
const body = { query: jsonToGraphQLQuery({ query }) };
|
|
3844
|
+
if (options.variables)
|
|
3845
|
+
body.variables = options.variables;
|
|
3843
3846
|
const res = yield fetch(url, {
|
|
3844
3847
|
method: 'POST',
|
|
3845
3848
|
headers: Object.assign({ Accept: 'application/json', 'Content-Type': 'application/json' }, options === null || options === void 0 ? void 0 : options.headers),
|
|
3846
|
-
body: JSON.stringify(
|
|
3849
|
+
body: JSON.stringify(body)
|
|
3847
3850
|
});
|
|
3848
3851
|
let responseData = yield res.text();
|
|
3849
3852
|
try {
|