@certik/skynet 0.21.0 → 0.22.1

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 (86) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/abi.ts +2 -4
  3. package/api.ts +7 -7
  4. package/app.ts +6 -12
  5. package/const.ts +1 -1
  6. package/date.ts +1 -1
  7. package/deploy.ts +4 -4
  8. package/dist/abi.d.ts +112 -0
  9. package/dist/abi.d.ts.map +1 -0
  10. package/dist/abi.js +565 -0
  11. package/dist/address.d.ts +3 -0
  12. package/dist/address.d.ts.map +1 -0
  13. package/dist/address.js +23 -0
  14. package/dist/api.d.ts +32 -0
  15. package/dist/api.d.ts.map +1 -0
  16. package/dist/api.js +146 -0
  17. package/dist/app.d.ts +102 -0
  18. package/dist/app.d.ts.map +1 -0
  19. package/dist/app.js +328 -0
  20. package/dist/availability.d.ts +24 -0
  21. package/dist/availability.d.ts.map +1 -0
  22. package/dist/availability.js +63 -0
  23. package/dist/cli.d.ts +6 -0
  24. package/dist/cli.d.ts.map +1 -0
  25. package/dist/cli.js +37 -0
  26. package/dist/const.d.ts +35 -0
  27. package/dist/const.d.ts.map +1 -0
  28. package/dist/const.js +141 -0
  29. package/dist/databricks.d.ts +4 -0
  30. package/dist/databricks.d.ts.map +1 -0
  31. package/dist/databricks.js +68 -0
  32. package/dist/date.d.ts +6 -0
  33. package/dist/date.d.ts.map +1 -0
  34. package/dist/date.js +29 -0
  35. package/dist/deploy.d.ts +76 -0
  36. package/dist/deploy.d.ts.map +1 -0
  37. package/dist/deploy.js +454 -0
  38. package/dist/dynamodb.d.ts +17 -0
  39. package/dist/dynamodb.d.ts.map +1 -0
  40. package/dist/dynamodb.js +328 -0
  41. package/dist/env.d.ts +7 -0
  42. package/dist/env.d.ts.map +1 -0
  43. package/dist/env.js +19 -0
  44. package/dist/graphql.d.ts +6 -0
  45. package/dist/graphql.d.ts.map +1 -0
  46. package/dist/graphql.js +25 -0
  47. package/dist/indexer.d.ts +70 -0
  48. package/dist/indexer.d.ts.map +1 -0
  49. package/dist/indexer.js +492 -0
  50. package/dist/log.d.ts +14 -0
  51. package/dist/log.d.ts.map +1 -0
  52. package/dist/log.js +62 -0
  53. package/dist/object-hash.d.ts +2 -0
  54. package/dist/object-hash.d.ts.map +1 -0
  55. package/dist/object-hash.js +71 -0
  56. package/dist/opsgenie.d.ts +21 -0
  57. package/dist/opsgenie.d.ts.map +1 -0
  58. package/dist/opsgenie.js +38 -0
  59. package/dist/por.d.ts +38 -0
  60. package/dist/por.d.ts.map +1 -0
  61. package/dist/por.js +130 -0
  62. package/dist/s3.d.ts +21 -0
  63. package/dist/s3.d.ts.map +1 -0
  64. package/dist/s3.js +110 -0
  65. package/dist/search.d.ts +6 -0
  66. package/dist/search.d.ts.map +1 -0
  67. package/dist/search.js +30 -0
  68. package/dist/selector.d.ts +18 -0
  69. package/dist/selector.d.ts.map +1 -0
  70. package/dist/selector.js +48 -0
  71. package/dist/slack.d.ts +9 -0
  72. package/dist/slack.d.ts.map +1 -0
  73. package/dist/slack.js +26 -0
  74. package/dist/util.d.ts +5 -0
  75. package/dist/util.d.ts.map +1 -0
  76. package/dist/util.js +26 -0
  77. package/examples/api.ts +1 -1
  78. package/examples/indexer.ts +1 -1
  79. package/examples/mode-indexer.ts +1 -1
  80. package/indexer.ts +11 -11
  81. package/package.json +99 -4
  82. package/por.ts +181 -0
  83. package/search.ts +2 -2
  84. package/tsconfig.build.json +23 -0
  85. package/tsconfig.json +5 -5
  86. package/.vscode/settings.json +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.1
4
+
5
+ - Use tsc to build js files
6
+
7
+ ## 0.22.0
8
+
9
+ - Added TypeScript build system using Bun for fast compilation
10
+ - Added individual module exports for all library components
11
+ - Users can now import specific modules: `import { util } from '@certik/skynet/util'`
12
+ - Added TypeScript declaration files generation
13
+ - Enhanced package.json exports for better ESM support
14
+ - Added .gitignore for build artifacts
15
+
3
16
  ## 0.21.0
4
17
 
5
18
  - BREAKING: Remove support for web3.js.
package/abi.ts CHANGED
@@ -1,6 +1,4 @@
1
- import type { AbiFunctionFragment } from "web3";
2
-
3
- export const ERC20: AbiFunctionFragment[] = [
1
+ export const ERC20 = [
4
2
  {
5
3
  constant: true,
6
4
  inputs: [],
@@ -222,7 +220,7 @@ export const ERC20: AbiFunctionFragment[] = [
222
220
  },
223
221
  ];
224
222
 
225
- export const ERC721: AbiFunctionFragment[] = [
223
+ export const ERC721 = [
226
224
  {
227
225
  inputs: [
228
226
  {
package/api.ts CHANGED
@@ -2,10 +2,10 @@ import osModule from "os";
2
2
  import express from "express";
3
3
  import type { Request, Response, NextFunction } from "express";
4
4
  import meow from "meow";
5
- import { getSelectorDesc, getSelectorFlags } from "./selector.ts";
6
- import { isProduction } from "./env.ts";
7
- import { inline } from "./log.ts";
8
- import type { Selector } from "./selector.ts";
5
+ import { getSelectorDesc, getSelectorFlags } from "./selector";
6
+ import { isProduction } from "./env";
7
+ import { inline } from "./log";
8
+ import type { Selector } from "./selector";
9
9
 
10
10
  export type Middleware = (req: Request, res: Response, next: NextFunction) => Promise<void>;
11
11
 
@@ -23,7 +23,7 @@ type Serve = {
23
23
  apiKey?: string | Record<string, string>;
24
24
  };
25
25
 
26
- async function logStartMiddleware(req: Request, res: Response, next: NextFunction) {
26
+ async function logStartMiddleware(_: Request, res: Response, next: NextFunction) {
27
27
  const start = new Date();
28
28
 
29
29
  res.set("x-requested-at", start.toISOString());
@@ -31,7 +31,7 @@ async function logStartMiddleware(req: Request, res: Response, next: NextFunctio
31
31
  next();
32
32
  }
33
33
 
34
- async function contextMiddleware(req: Request, res: Response, next: NextFunction) {
34
+ async function contextMiddleware(_: Request, res: Response, next: NextFunction) {
35
35
  res.set("x-instance-id", osModule.hostname());
36
36
 
37
37
  next();
@@ -213,7 +213,7 @@ ${getSelectorDesc(selector)}
213
213
 
214
214
  if (!routes.some((r) => r.path === "/" && r.method?.toUpperCase() === "GET")) {
215
215
  // for health check
216
- app.get("/", (req, res) => {
216
+ app.get("/", (_, res) => {
217
217
  res.send("ok");
218
218
  });
219
219
  }
package/app.ts CHANGED
@@ -1,18 +1,12 @@
1
1
  import { EOL } from "os";
2
- import { createIndexerApp, createModeIndexerApp } from "./indexer.ts";
3
- import type {
4
- IndexerStateValue,
5
- State,
6
- ModeBuildFunction,
7
- StatelessBuildFunction,
8
- ValidateFunction,
9
- } from "./indexer.ts";
10
- import { createDeploy, createModeDeploy } from "./deploy.ts";
11
- import type { Env } from "./deploy.ts";
2
+ import { createIndexerApp, createModeIndexerApp } from "./indexer";
3
+ import type { IndexerStateValue, State, ModeBuildFunction, StatelessBuildFunction, ValidateFunction } from "./indexer";
4
+ import { createDeploy, createModeDeploy } from "./deploy";
5
+ import type { Env } from "./deploy";
12
6
  import { startApiApp } from "./api.js";
13
- import type { Middleware } from "./api.ts";
7
+ import type { Middleware } from "./api";
14
8
  import { getBinaryName, detectBin, detectWorkingDirectory } from "./cli.js";
15
- import type { Selector } from "./selector.ts";
9
+ import type { Selector } from "./selector";
16
10
  import type { Request, Response, Application } from "express";
17
11
 
18
12
  type RouteDefinition = {
package/const.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ensureAndGet } from "./env.ts";
1
+ import { ensureAndGet } from "./env";
2
2
 
3
3
  type Protocol = {
4
4
  nativeTokenName: string;
package/date.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { arrayGroup } from "./util.ts";
1
+ import { arrayGroup } from "./util";
2
2
 
3
3
  const MS_IN_A_DAY = 3600 * 24 * 1000;
4
4
 
package/deploy.ts CHANGED
@@ -4,10 +4,10 @@ import { execa } from "execa";
4
4
  import meow from "meow";
5
5
  import chalk from "chalk";
6
6
  import which from "which";
7
- import { getJobName, getSelectorDesc, getSelectorFlags } from "./selector.ts";
8
- import type { Selector } from "./selector.ts";
9
- import { getEnvOrThrow } from "./env.ts";
10
- import { getBinaryName, detectSkynetDirectory } from "./cli.ts";
7
+ import { getJobName, getSelectorDesc, getSelectorFlags } from "./selector";
8
+ import type { Selector } from "./selector";
9
+ import { getEnvOrThrow } from "./env";
10
+ import { getBinaryName, detectSkynetDirectory } from "./cli";
11
11
  import type { Writable } from "stream";
12
12
 
13
13
  export type Env = {
package/dist/abi.d.ts ADDED
@@ -0,0 +1,112 @@
1
+ export declare const ERC20: ({
2
+ constant: boolean;
3
+ inputs: {
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ name: string;
8
+ outputs: {
9
+ name: string;
10
+ type: string;
11
+ }[];
12
+ payable: boolean;
13
+ stateMutability: string;
14
+ type: string;
15
+ } | {
16
+ name: string;
17
+ payable: boolean;
18
+ stateMutability: string;
19
+ type: string;
20
+ constant?: undefined;
21
+ inputs?: undefined;
22
+ outputs?: undefined;
23
+ } | {
24
+ inputs: {
25
+ indexed: boolean;
26
+ name: string;
27
+ type: string;
28
+ }[];
29
+ name: string;
30
+ type: string;
31
+ constant?: undefined;
32
+ outputs?: undefined;
33
+ payable?: undefined;
34
+ stateMutability?: undefined;
35
+ })[];
36
+ export declare const ERC721: ({
37
+ inputs: {
38
+ indexed: boolean;
39
+ internalType: string;
40
+ name: string;
41
+ type: string;
42
+ }[];
43
+ name: string;
44
+ type: string;
45
+ constant?: undefined;
46
+ outputs?: undefined;
47
+ payable?: undefined;
48
+ stateMutability?: undefined;
49
+ } | {
50
+ constant: boolean;
51
+ inputs: any[];
52
+ name: string;
53
+ outputs: {
54
+ name: string;
55
+ type: string;
56
+ }[];
57
+ payable: boolean;
58
+ stateMutability: string;
59
+ type: string;
60
+ } | {
61
+ inputs: {
62
+ internalType: string;
63
+ name: string;
64
+ type: string;
65
+ }[];
66
+ name: string;
67
+ outputs: {
68
+ internalType: string;
69
+ name: string;
70
+ type: string;
71
+ }[];
72
+ stateMutability: string;
73
+ type: string;
74
+ constant?: undefined;
75
+ payable?: undefined;
76
+ })[];
77
+ export declare const BEP20: ({
78
+ constant: boolean;
79
+ inputs: {
80
+ name: string;
81
+ type: string;
82
+ }[];
83
+ name: string;
84
+ outputs: {
85
+ name: string;
86
+ type: string;
87
+ }[];
88
+ payable: boolean;
89
+ stateMutability: string;
90
+ type: string;
91
+ } | {
92
+ name: string;
93
+ payable: boolean;
94
+ stateMutability: string;
95
+ type: string;
96
+ constant?: undefined;
97
+ inputs?: undefined;
98
+ outputs?: undefined;
99
+ } | {
100
+ inputs: {
101
+ indexed: boolean;
102
+ name: string;
103
+ type: string;
104
+ }[];
105
+ name: string;
106
+ type: string;
107
+ constant?: undefined;
108
+ outputs?: undefined;
109
+ payable?: undefined;
110
+ stateMutability?: undefined;
111
+ })[];
112
+ //# sourceMappingURL=abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../abi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4NjB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsVlB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAQ,CAAC"}