antelopeql 1.1.0 → 1.1.2

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.
@@ -85,33 +85,35 @@ export default function build_graphql_fields_from_abis(abi_list) {
85
85
  name
86
86
  );
87
87
 
88
- contract_query_fields[name] = {
89
- name,
90
- type: new GraphQLObjectType({
91
- name: name + "_query",
92
- fields: query_fields
93
- }),
94
- resolve(__, _, { network: { rpc_url, fetch } = {} }, { fieldName }) {
95
- if (!fetch)
96
- throw new GraphQLError(
97
- "No fetch argument found on the context of the GraphQL.execute."
98
- );
88
+ if (Object.keys(query_fields).length)
89
+ contract_query_fields[name] = {
90
+ name,
91
+ type: new GraphQLObjectType({
92
+ name: name + "_query",
93
+ fields: query_fields
94
+ }),
95
+ resolve(__, _, { network: { rpc_url, fetch } = {} }, { fieldName }) {
96
+ if (!fetch)
97
+ throw new GraphQLError(
98
+ "No fetch argument found on the context of the GraphQL.execute."
99
+ );
99
100
 
100
- if (!rpc_url)
101
- throw new GraphQLError(
102
- "No rpc_url argument found on the context of the GraphQL.execute."
103
- );
101
+ if (!rpc_url)
102
+ throw new GraphQLError(
103
+ "No rpc_url argument found on the context of the GraphQL.execute."
104
+ );
104
105
 
105
- return { code: fieldName.replace(/_/gmu, ".") };
106
- }
107
- };
106
+ return { code: fieldName.replace(/_/gmu, ".") };
107
+ }
108
+ };
108
109
 
109
- contract_mutation_fields[name] = {
110
- type: new GraphQLInputObjectType({
111
- name,
112
- fields: mutation_fields
113
- })
114
- };
110
+ if (Object.keys(mutation_fields).length)
111
+ contract_mutation_fields[name] = {
112
+ type: new GraphQLInputObjectType({
113
+ name,
114
+ fields: mutation_fields
115
+ })
116
+ };
115
117
  }
116
118
 
117
119
  return {
@@ -1,5 +1,5 @@
1
- import legacy_to_public_key from "eosio-ecc/legacy_to_public_key.mjs";
2
- import validate_public_key from "eosio-ecc/validate_public_key.mjs";
1
+ import legacy_to_public_key from "antelope-ecc/legacy_to_public_key.mjs";
2
+ import validate_public_key from "antelope-ecc/validate_public_key.mjs";
3
3
  import { GraphQLScalarType } from "graphql";
4
4
 
5
5
  const public_key_type = new GraphQLScalarType({
@@ -17,8 +17,12 @@ const public_key_type = new GraphQLScalarType({
17
17
  async parseValue(public_key) {
18
18
  if (public_key == "") return "";
19
19
 
20
- const { valid, message } = await validate_public_key(public_key);
21
- if (!valid) throw new RangeError(message);
20
+ try {
21
+ await validate_public_key(public_key);
22
+ } catch (err) {
23
+ throw new RangeError(err.message);
24
+ }
25
+
22
26
  return public_key;
23
27
  }
24
28
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antelopeql",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "A GraphQL implementation for interacting with Antelope based blockchains.",
5
5
  "repository": "github:pur3miish/antelopeql",
6
6
  "bugs": "https://github.com/pur3miish/antelopeql/issues",
@@ -91,8 +91,8 @@
91
91
  "graphql": "^16.6.0"
92
92
  },
93
93
  "dependencies": {
94
+ "antelope-ecc": "^1.0.0",
94
95
  "base58-js": "^2.0.0",
95
- "eosio-ecc": "^1.0.1",
96
96
  "eosio-wasm-js": "^4.0.1",
97
97
  "ripemd160-js": "*"
98
98
  }
@@ -1,6 +1,6 @@
1
- import private_key_to_legacy from "eosio-ecc/private_key_to_legacy.mjs";
2
- import get_public_key from "eosio-ecc/public_key_from_private.mjs";
3
- import sign_packed_txn from "eosio-ecc/sign_packed_txn.mjs";
1
+ import private_key_to_legacy from "antelope-ecc/private_key_to_legacy.mjs";
2
+ import get_public_key from "antelope-ecc/public_key_from_private.mjs";
3
+ import sign_packed_txn from "antelope-ecc/sign_packed_txn.mjs";
4
4
  import { GraphQLError, GraphQLNonNull } from "graphql";
5
5
 
6
6
  import configuration_type from "./graphql_input_types/configuration.mjs";
package/readme.md CHANGED
@@ -36,7 +36,7 @@ For [Deno.js](https://deno.land), to install [`AntelopeQL`](https://deno.land/x/
36
36
  "isomorphic-secp256k1-js/": "https://deno.land/x/secp256k1js/",
37
37
  "ripemd160-js/": "https://deno.land/x/ripemd160js@v2.0.3/",
38
38
  "eosio-wasm-js/": "https://deno.land/x/eosio_wasm_js/",
39
- "eosio-ecc/": "https://deno.land/x/eosio_ecc/",
39
+ "antelope-ecc/": "https://deno.land/x/eosio_ecc/",
40
40
  "graphql": "https://cdn.skypack.dev/graphql"
41
41
  }
42
42
  }