antelopeql 1.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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/antelopeql.mjs +159 -0
  3. package/blockchain/deserialize_action_data.mjs +41 -0
  4. package/blockchain/get_abi.mjs +172 -0
  5. package/blockchain/get_account.mjs +233 -0
  6. package/blockchain/get_accounts_by_authorizers.mjs +79 -0
  7. package/blockchain/get_block.mjs +238 -0
  8. package/blockchain/get_currency_balance.mjs +48 -0
  9. package/blockchain/get_currency_stats.mjs +60 -0
  10. package/blockchain/get_info.mjs +96 -0
  11. package/blockchain/get_producers.mjs +104 -0
  12. package/blockchain/get_ram_price.mjs +57 -0
  13. package/blockchain/get_table_by_scope.mjs +96 -0
  14. package/blockchain_query_field.mjs +44 -0
  15. package/build_graphql_fields_from_abis.mjs +122 -0
  16. package/eosio_abi_to_graphql_ast.mjs +222 -0
  17. package/eosio_types/asset_type.mjs +35 -0
  18. package/eosio_types/block_timestamp_type.mjs +14 -0
  19. package/eosio_types/boolean_type.mjs +10 -0
  20. package/eosio_types/bytes_type.mjs +17 -0
  21. package/eosio_types/eosio_key_type.mjs +13 -0
  22. package/eosio_types/extended_asset_type.mjs +19 -0
  23. package/eosio_types/generate_checksum_type.mjs +20 -0
  24. package/eosio_types/generate_float_type.mjs +16 -0
  25. package/eosio_types/generate_int_type.mjs +28 -0
  26. package/eosio_types/generate_uint_type.mjs +27 -0
  27. package/eosio_types/name_type.mjs +29 -0
  28. package/eosio_types/public_key_type.mjs +26 -0
  29. package/eosio_types/signature_type.mjs +19 -0
  30. package/eosio_types/symbol_code_type.mjs +13 -0
  31. package/eosio_types/symbol_type.mjs +33 -0
  32. package/eosio_types/time_point_sec_type.mjs +12 -0
  33. package/eosio_types/time_point_type.mjs +12 -0
  34. package/eosio_types/varint32_type.mjs +13 -0
  35. package/eosio_types/varuint32_type.mjs +12 -0
  36. package/eosio_types.mjs +59 -0
  37. package/graphql_input_types/actions.mjs +15 -0
  38. package/graphql_input_types/authorization.mjs +30 -0
  39. package/graphql_input_types/configuration.mjs +55 -0
  40. package/graphql_input_types/query_argument_fields.mjs +82 -0
  41. package/graphql_object_types/authorization.mjs +15 -0
  42. package/graphql_object_types/authorizing_account_type.mjs +15 -0
  43. package/graphql_object_types/packed_transaction.mjs +32 -0
  44. package/graphql_object_types/transaction_receipt.mjs +159 -0
  45. package/mutation_resolver.mjs +234 -0
  46. package/package.json +97 -0
  47. package/push_serialized_transaction.mjs +24 -0
  48. package/push_transaction.mjs +75 -0
  49. package/push_transaction_rpc.mjs +37 -0
  50. package/query_resolver.mjs +43 -0
  51. package/readme.md +164 -0
  52. package/serialize_transaction.mjs +23 -0
  53. package/types.mjs +64 -0
@@ -0,0 +1,23 @@
1
+ import { GraphQLNonNull } from "graphql";
2
+
3
+ import configuration_type from "./graphql_input_types/configuration.mjs";
4
+ import packed_transaction_type from "./graphql_object_types/packed_transaction.mjs";
5
+ import mutation_resolver from "./mutation_resolver.mjs";
6
+
7
+ const serialize_transaction = (actions, ast_list) => ({
8
+ description: "Serialize a list of actions into an atomic binary instruction.",
9
+ type: new GraphQLNonNull(packed_transaction_type),
10
+ args: {
11
+ actions: {
12
+ type: actions
13
+ },
14
+ configuration: {
15
+ type: configuration_type
16
+ }
17
+ },
18
+ resolve(_, args, { network }) {
19
+ return mutation_resolver(args, network, ast_list);
20
+ }
21
+ });
22
+
23
+ export default serialize_transaction;
package/types.mjs ADDED
@@ -0,0 +1,64 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * The Application Binary Interface (ABI) is a JSON-based description on how to convert user actions between their JSON and Binary representations.
5
+ * @typedef {Object} ABI
6
+ * @property {Array<Types>} types List of types.
7
+ * @property {Array<Struct>} structs List of contract structs.
8
+ * @property {Array<Action>} actions List of contract actions.
9
+ * @property {Array<Table>} tables List of contract tables.
10
+ */
11
+
12
+ /**
13
+ * @typedef {Object} Types
14
+ * @property {String} new_type_name
15
+ * @property {String} type
16
+ */
17
+
18
+ /**
19
+ * A contract action is a description of what argument a contract function may take, its graphql representation is called a mutation.
20
+ * @typedef {Object} Action
21
+ * @property {String} name Contract action name as defined in the smart contract.
22
+ * @property {String} type The name of the implicit struct as described in the ABI.
23
+ * @property {String} [ricardian_contract] Describing the actions intended functionality.
24
+ */
25
+
26
+ /**
27
+ * Struct can be thought of as a user defined data structures, that a contract will utilise in its actions or table types.
28
+ * @typedef {Object} Struct
29
+ * @property {String} name The name of the struct.
30
+ * @property {String} base Inheritance, parent struct.
31
+ * @property {Array<Field>} fields List of fields describing the struct.
32
+ */
33
+
34
+ /**
35
+ * Struct can be thought of as a user defined data structure that that contract will utilise in its actions or table.
36
+ * @typedef Field
37
+ * @property {String} name The name of the struct.
38
+ * @property {String} type The type of struct either a native data type or user defeind struct.
39
+ */
40
+
41
+ /**
42
+ * Tables are user defined database structures that hold data. GraphQL as queries.
43
+ * @typedef Table
44
+ * @property {String} name The name of the database.
45
+ * @property {String} index_type The type of primary index of this table
46
+ * @property {String} type Corresponding struct.
47
+ */
48
+
49
+ /**
50
+ * Abstract syntax tree of a contract ABI.
51
+ * @typedef AST
52
+ * @property {String} name The name of the AST item.
53
+ * @property {String} type AST type.
54
+ * @property {Array<AST_INFO>} $info List of meta info regarding AST.
55
+ */
56
+
57
+ /**
58
+ * @typedef AST_INFO
59
+ * @property {Boolean} object
60
+ * @property {Boolean} optional
61
+ * @property {Boolean} list
62
+ * @property {Boolean} binary_ex
63
+ * @property {Boolean} variant
64
+ */