New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ar-gql

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ar-gql - npm Package Compare versions

Comparing version 0.0.6 to 0.0.10

5

dist/index.d.ts
import GQLResultInterface, { GQLEdgeInterface, GQLNodeInterface } from "./faces";
export declare const run: (query: string, variables?: Record<string, unknown> | undefined) => Promise<GQLResultInterface>;
export declare const all: (query: string, variables?: Record<string, unknown> | undefined) => Promise<GQLEdgeInterface[]>;
export declare const setEndpointUrl: (full_GQL_Url: string) => string;
export declare const run: (query: string, variables?: Record<string, unknown>) => Promise<GQLResultInterface>;
export declare const all: (query: string, variables?: Record<string, unknown>) => Promise<GQLEdgeInterface[]>;
export declare const tx: (id: string) => Promise<GQLNodeInterface>;
export declare const fetchTxTag: (id: string, name: string) => Promise<string | undefined>;

13

dist/index.js

@@ -50,5 +50,8 @@ "use strict";

exports.__esModule = true;
exports.fetchTxTag = exports.tx = exports.all = exports.run = void 0;
exports.fetchTxTag = exports.tx = exports.all = exports.run = exports.setEndpointUrl = void 0;
var axios_1 = require("axios");
var tx_1 = require("./queries/tx");
var GQL_ENDPOINT = "https://arweave.net/graphql"; //default
var setEndpointUrl = function (full_GQL_Url) { return GQL_ENDPOINT = full_GQL_Url; };
exports.setEndpointUrl = setEndpointUrl;
var run = function (query, variables) { return __awaiter(void 0, void 0, void 0, function () {

@@ -63,3 +66,3 @@ var graphql, res;

});
return [4 /*yield*/, axios_1["default"].post("https://arweave.net/graphql", graphql, {
return [4 /*yield*/, axios_1["default"].post(GQL_ENDPOINT, graphql, {
headers: {

@@ -87,3 +90,3 @@ "content-type": "application/json"

if (!hasNextPage) return [3 /*break*/, 3];
return [4 /*yield*/, exports.run(query, __assign(__assign({}, variables), { cursor: cursor }))];
return [4 /*yield*/, (0, exports.run)(query, __assign(__assign({}, variables), { cursor: cursor }))];
case 2:

@@ -113,3 +116,3 @@ res = (_a.sent()).data.transactions;

}
return [4 /*yield*/, exports.run(tx_1["default"], { id: id })];
return [4 /*yield*/, (0, exports.run)(tx_1["default"], { id: id })];
case 1:

@@ -131,3 +134,3 @@ res = _a.sent();

switch (_a.label) {
case 0: return [4 /*yield*/, exports.tx(id)];
case 0: return [4 /*yield*/, (0, exports.tx)(id)];
case 1:

@@ -134,0 +137,0 @@ res = _a.sent();

{
"name": "ar-gql",
"version": "0.0.6",
"version": "0.0.10",
"author": "John Letey <johnletey@gmail.com>",
"repository": "https://github.com/johnletey/arGQL",
"contributors": [
"Ros McMahon <rosmcmahon@gmail.com>",
"John Letey <johnletey@gmail.com>"
],
"repository": "https://github.com/johnletey/arGql",
"license": "MIT",
"scripts": {
"build": "tsc",
"build": "npx rimraf dist && tsc",
"postversion": "git push && git push --tags && npm run build && npm publish",
"fmt": "prettier --write ."

@@ -14,3 +19,3 @@ },

"dependencies": {
"axios": "^0.21.1"
"axios": "^0.27.2"
},

@@ -17,0 +22,0 @@ "devDependencies": {

@@ -1,2 +0,2 @@

# `arGQL`
# `ar-gql`

@@ -11,3 +11,3 @@ [![Version](https://img.shields.io/npm/v/ar-gql?style=flat&colorA=000000&colorB=000000)](https://www.npmjs.com/package/ar-gql)

# npm
npm install ar-gql
npm i ar-gql
# yarn

@@ -36,4 +36,7 @@ yarn add ar-gql

transactions(
# your query parameters
# your query parameters
# standard template below
after: $cursor
first: 100
) {

@@ -45,3 +48,6 @@ pageInfo {

cursor
# whatever else you want to query for
node {
# what tx data you want to query for:
}
}

@@ -54,8 +60,10 @@ }

The `tx` function recieves as an input a valid Arweave transaction id. The function will then return all information about the transaction that the GraphQL endpoint supports.
The `tx` function recieves as an input a valid Arweave transaction id. The function will then return all metadata information about the transaction that the GraphQL endpoint supports.
Note that this function does not return the transaction data.
### `fetchTxTag(id, name)`
This function will fetch all tags for the supplied transaction. Then, if it finds a tag with the name provided, it will return the tag value. Else, it will return `undefined`.
### `setEndpointUrl(GQL_URL)`
Set the GQL endpoint. Defaults to `https://arweave.net/graphql`.

@@ -8,2 +8,5 @@ import GQLResultInterface, {

let GQL_ENDPOINT = "https://arweave.net/graphql" //default
export const setEndpointUrl = (full_GQL_Url: string) => GQL_ENDPOINT = full_GQL_Url
export const run = async (

@@ -19,3 +22,3 @@ query: string,

const { data: res } = await axios.post(
"https://arweave.net/graphql",
GQL_ENDPOINT,
graphql,

@@ -22,0 +25,0 @@ {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc