@avaprotocol/sdk-js 1.4.0 → 1.6.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 (91) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/auth.d.ts +2 -0
  3. package/dist/auth.d.ts.map +1 -0
  4. package/dist/auth.js +10 -0
  5. package/dist/config.d.ts +9 -0
  6. package/dist/config.d.ts.map +1 -0
  7. package/dist/config.js +19 -0
  8. package/dist/grpc_codegen/custom_types.d.ts +45 -0
  9. package/dist/grpc_codegen/custom_types.d.ts.map +1 -0
  10. package/dist/grpc_codegen/custom_types.js +179 -0
  11. package/dist/index.d.ts +148 -2798
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +8901 -5466
  14. package/dist/index.mjs +8897 -5459
  15. package/dist/models/edge.d.ts +12 -0
  16. package/dist/models/edge.d.ts.map +1 -0
  17. package/dist/models/edge.js +19 -0
  18. package/dist/models/execution.d.ts +32 -0
  19. package/dist/models/execution.d.ts.map +1 -0
  20. package/dist/models/execution.js +65 -0
  21. package/dist/models/node/branch.d.ts +14 -0
  22. package/dist/models/node/branch.d.ts.map +1 -0
  23. package/dist/models/node/branch.js +39 -0
  24. package/dist/models/node/contractRead.d.ts +14 -0
  25. package/dist/models/node/contractRead.d.ts.map +1 -0
  26. package/dist/models/node/contractRead.js +33 -0
  27. package/dist/models/node/contractWrite.d.ts +14 -0
  28. package/dist/models/node/contractWrite.d.ts.map +1 -0
  29. package/dist/models/node/contractWrite.js +31 -0
  30. package/dist/models/node/customCode.d.ts +18 -0
  31. package/dist/models/node/customCode.d.ts.map +1 -0
  32. package/dist/models/node/customCode.js +36 -0
  33. package/dist/models/node/ethTransfer.d.ts +14 -0
  34. package/dist/models/node/ethTransfer.d.ts.map +1 -0
  35. package/dist/models/node/ethTransfer.js +30 -0
  36. package/dist/models/node/factory.d.ts +21 -0
  37. package/dist/models/node/factory.d.ts.map +1 -0
  38. package/dist/models/node/factory.js +70 -0
  39. package/dist/models/node/filter.d.ts +14 -0
  40. package/dist/models/node/filter.d.ts.map +1 -0
  41. package/dist/models/node/filter.js +32 -0
  42. package/dist/models/node/graphqlQuery.d.ts +14 -0
  43. package/dist/models/node/graphqlQuery.d.ts.map +1 -0
  44. package/dist/models/node/graphqlQuery.js +43 -0
  45. package/dist/models/node/interface.d.ts +18 -0
  46. package/dist/models/node/interface.d.ts.map +1 -0
  47. package/dist/models/node/interface.js +37 -0
  48. package/dist/models/node/loop.d.ts +13 -0
  49. package/dist/models/node/loop.d.ts.map +1 -0
  50. package/dist/models/node/loop.js +145 -0
  51. package/dist/models/node/restApi.d.ts +15 -0
  52. package/dist/models/node/restApi.d.ts.map +1 -0
  53. package/dist/models/node/restApi.js +40 -0
  54. package/dist/models/secret.d.ts +16 -0
  55. package/dist/models/secret.d.ts.map +1 -0
  56. package/dist/models/secret.js +28 -0
  57. package/dist/models/step.d.ts +19 -0
  58. package/dist/models/step.d.ts.map +1 -0
  59. package/dist/models/step.js +78 -0
  60. package/dist/models/trigger/block.d.ts +20 -0
  61. package/dist/models/trigger/block.d.ts.map +1 -0
  62. package/dist/models/trigger/block.js +49 -0
  63. package/dist/models/trigger/cron.d.ts +20 -0
  64. package/dist/models/trigger/cron.d.ts.map +1 -0
  65. package/dist/models/trigger/cron.js +49 -0
  66. package/dist/models/trigger/event.d.ts +20 -0
  67. package/dist/models/trigger/event.d.ts.map +1 -0
  68. package/dist/models/trigger/event.js +74 -0
  69. package/dist/models/trigger/factory.d.ts +25 -0
  70. package/dist/models/trigger/factory.d.ts.map +1 -0
  71. package/dist/models/trigger/factory.js +54 -0
  72. package/dist/models/trigger/fixedTime.d.ts +20 -0
  73. package/dist/models/trigger/fixedTime.d.ts.map +1 -0
  74. package/dist/models/trigger/fixedTime.js +49 -0
  75. package/dist/models/trigger/interface.d.ts +25 -0
  76. package/dist/models/trigger/interface.d.ts.map +1 -0
  77. package/dist/models/trigger/interface.js +20 -0
  78. package/dist/models/trigger/manual.d.ts +13 -0
  79. package/dist/models/trigger/manual.d.ts.map +1 -0
  80. package/dist/models/trigger/manual.js +27 -0
  81. package/dist/models/trigger/reason.d.ts +33 -0
  82. package/dist/models/trigger/reason.d.ts.map +1 -0
  83. package/dist/models/trigger/reason.js +96 -0
  84. package/dist/models/workflow.d.ts +54 -0
  85. package/dist/models/workflow.d.ts.map +1 -0
  86. package/dist/models/workflow.js +117 -0
  87. package/dist/utils.d.ts +3 -0
  88. package/dist/utils.d.ts.map +1 -0
  89. package/dist/utils.js +37 -0
  90. package/package.json +6 -4
  91. package/dist/index.d.mts +0 -2937
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @avaprotocol/sdk-js
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f6ba804: Added eventTrigger tests
8
+
9
+ ## 1.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - a38f8df: Consolidated pagination response and match protobuf of AVS v1.8.2
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [a38f8df]
18
+ - @avaprotocol/types@1.0.1
19
+
20
+ ## 1.5.0
21
+
22
+ ### Minor Changes
23
+
24
+ - cdecf79: Get sign message from server; added wallet isHidden
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [cdecf79]
29
+ - @avaprotocol/types@1.0.0
30
+
3
31
  ## 1.4.0
4
32
 
5
33
  ### Minor Changes
package/dist/auth.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const getKeyRequestMessage: (chainId: number, address: string, issuedAt: Date, expiredAt: Date) => string;
2
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,IAAI,EAAE,WAAW,IAAI,KAAG,MAUxG,CAAA"}
package/dist/auth.js ADDED
@@ -0,0 +1,10 @@
1
+ export const getKeyRequestMessage = (chainId, address, issuedAt, expiredAt) => {
2
+ return `Please sign the below text for ownership verification.
3
+
4
+ URI: https://app.avaprotocol.org
5
+ Chain ID: ${chainId}
6
+ Version: 1
7
+ Issued At: ${issuedAt.toISOString()}
8
+ Expire At: ${expiredAt.toISOString()}
9
+ Wallet: ${address}`;
10
+ };
@@ -0,0 +1,9 @@
1
+ import { Environment } from "@avaprotocol/types";
2
+ export declare const DEFAULT_JWT_EXPIRATION: number;
3
+ interface Config {
4
+ AVS_RPC_URL: string;
5
+ }
6
+ declare const configs: Record<Environment, Config>;
7
+ export declare function getRpcEndpoint(env: Environment): string;
8
+ export { configs };
9
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,eAAO,MAAM,sBAAsB,QAAe,CAAC;AACnD,UAAU,MAAM;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,QAAA,MAAM,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAUxC,CAAC;AAGF,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAEvD;AAGD,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,19 @@
1
+ export const DEFAULT_JWT_EXPIRATION = 24 * 60 * 60; // 24 hours
2
+ // Define the configs object with typed keys
3
+ const configs = {
4
+ development: {
5
+ AVS_RPC_URL: process.env.AVS_RPC_URL || "localhost:2206",
6
+ },
7
+ staging: {
8
+ AVS_RPC_URL: "aggregator-holesky.avaprotocol.org:2206",
9
+ },
10
+ production: {
11
+ AVS_RPC_URL: "aggregator.avaprotocol.org:2206",
12
+ },
13
+ };
14
+ // Function to get RPC endpoint with improved type safety
15
+ export function getRpcEndpoint(env) {
16
+ return configs[env].AVS_RPC_URL;
17
+ }
18
+ // Export the configs only
19
+ export { configs };
@@ -0,0 +1,45 @@
1
+ import * as jspb from "google-protobuf";
2
+ import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
3
+ /**
4
+ * Custom implementation of RunNodeWithInputsReq class
5
+ * This is needed because the class is not generated from the proto file
6
+ */
7
+ export declare class RunNodeWithInputsReq extends jspb.Message {
8
+ private nodeType_;
9
+ private nodeConfig_;
10
+ private inputVariables_;
11
+ constructor();
12
+ getNodeType(): string;
13
+ setNodeType(value: string): RunNodeWithInputsReq;
14
+ getNodeConfig(): google_protobuf_struct_pb.Struct | undefined;
15
+ setNodeConfig(value: google_protobuf_struct_pb.Struct | undefined): RunNodeWithInputsReq;
16
+ getInputVariables(): google_protobuf_struct_pb.Struct | undefined;
17
+ setInputVariables(value: google_protobuf_struct_pb.Struct | undefined): RunNodeWithInputsReq;
18
+ serializeBinary(): Uint8Array;
19
+ serializeBinaryToWriter(writer: jspb.BinaryWriter): void;
20
+ toObject(includeInstance?: boolean): object;
21
+ static deserializeBinary(bytes: Uint8Array): RunNodeWithInputsReq;
22
+ static deserializeBinaryFromReader(message: RunNodeWithInputsReq, reader: jspb.BinaryReader): RunNodeWithInputsReq;
23
+ }
24
+ /**
25
+ * Custom implementation of RunNodeWithInputsResp class
26
+ * This is needed because the class is not generated from the proto file
27
+ */
28
+ export declare class RunNodeWithInputsResp extends jspb.Message {
29
+ private success_;
30
+ private error_;
31
+ private result_;
32
+ constructor();
33
+ getSuccess(): boolean;
34
+ setSuccess(value: boolean): RunNodeWithInputsResp;
35
+ getError(): string;
36
+ setError(value: string): RunNodeWithInputsResp;
37
+ getResult(): google_protobuf_struct_pb.Struct | undefined;
38
+ setResult(value: google_protobuf_struct_pb.Struct | undefined): RunNodeWithInputsResp;
39
+ serializeBinary(): Uint8Array;
40
+ serializeBinaryToWriter(writer: jspb.BinaryWriter): void;
41
+ toObject(includeInstance?: boolean): object;
42
+ static deserializeBinary(bytes: Uint8Array): RunNodeWithInputsResp;
43
+ static deserializeBinaryFromReader(message: RunNodeWithInputsResp, reader: jspb.BinaryReader): RunNodeWithInputsResp;
44
+ }
45
+ //# sourceMappingURL=custom_types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom_types.d.ts","sourceRoot":"","sources":["../../src/grpc_codegen/custom_types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,yBAAyB,MAAM,2CAA2C,CAAC;AAEvF;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,IAAI,CAAC,OAAO;IACpD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAA+C;IAClE,OAAO,CAAC,eAAe,CAA+C;;IAStE,WAAW,IAAI,MAAM;IAIrB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB;IAKhD,aAAa,IAAI,yBAAyB,CAAC,MAAM,GAAG,SAAS;IAI7D,aAAa,CAAC,KAAK,EAAE,yBAAyB,CAAC,MAAM,GAAG,SAAS,GAAG,oBAAoB;IAKxF,iBAAiB,IAAI,yBAAyB,CAAC,MAAM,GAAG,SAAS;IAIjE,iBAAiB,CAAC,KAAK,EAAE,yBAAyB,CAAC,MAAM,GAAG,SAAS,GAAG,oBAAoB;IAK5F,eAAe,IAAI,UAAU;IAM7B,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,GAAG,IAAI;IAoBxD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM;IAU3C,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,oBAAoB;IAMjE,MAAM,CAAC,2BAA2B,CAChC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,IAAI,CAAC,YAAY,GACxB,oBAAoB;CAiCxB;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,IAAI,CAAC,OAAO;IACrD,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAA+C;;IAS9D,UAAU,IAAI,OAAO;IAIrB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB;IAKjD,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB;IAK9C,SAAS,IAAI,yBAAyB,CAAC,MAAM,GAAG,SAAS;IAIzD,SAAS,CAAC,KAAK,EAAE,yBAAyB,CAAC,MAAM,GAAG,SAAS,GAAG,qBAAqB;IAKrF,eAAe,IAAI,UAAU;IAM7B,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,GAAG,IAAI;IAgBxD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM;IAS3C,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,qBAAqB;IAMlE,MAAM,CAAC,2BAA2B,CAChC,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,GACxB,qBAAqB;CA4BzB"}
@@ -0,0 +1,179 @@
1
+ import * as jspb from "google-protobuf";
2
+ import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
3
+ /**
4
+ * Custom implementation of RunNodeWithInputsReq class
5
+ * This is needed because the class is not generated from the proto file
6
+ */
7
+ export class RunNodeWithInputsReq extends jspb.Message {
8
+ constructor() {
9
+ super();
10
+ this.nodeType_ = "";
11
+ this.nodeConfig_ = undefined;
12
+ this.inputVariables_ = undefined;
13
+ }
14
+ getNodeType() {
15
+ return this.nodeType_;
16
+ }
17
+ setNodeType(value) {
18
+ this.nodeType_ = value;
19
+ return this;
20
+ }
21
+ getNodeConfig() {
22
+ return this.nodeConfig_;
23
+ }
24
+ setNodeConfig(value) {
25
+ this.nodeConfig_ = value;
26
+ return this;
27
+ }
28
+ getInputVariables() {
29
+ return this.inputVariables_;
30
+ }
31
+ setInputVariables(value) {
32
+ this.inputVariables_ = value;
33
+ return this;
34
+ }
35
+ serializeBinary() {
36
+ const writer = new jspb.BinaryWriter();
37
+ this.serializeBinaryToWriter(writer);
38
+ return writer.getResultBuffer();
39
+ }
40
+ serializeBinaryToWriter(writer) {
41
+ if (this.nodeType_ !== "") {
42
+ writer.writeString(1, this.nodeType_);
43
+ }
44
+ if (this.nodeConfig_ !== undefined) {
45
+ writer.writeMessage(2, this.nodeConfig_, google_protobuf_struct_pb.Struct.serializeBinaryToWriter);
46
+ }
47
+ if (this.inputVariables_ !== undefined) {
48
+ writer.writeMessage(3, this.inputVariables_, google_protobuf_struct_pb.Struct.serializeBinaryToWriter);
49
+ }
50
+ }
51
+ toObject(includeInstance) {
52
+ return {
53
+ nodeType: this.nodeType_,
54
+ nodeConfig: this.nodeConfig_ ?
55
+ this.nodeConfig_.toObject(includeInstance) : undefined,
56
+ inputVariables: this.inputVariables_ ?
57
+ this.inputVariables_.toObject(includeInstance) : undefined
58
+ };
59
+ }
60
+ static deserializeBinary(bytes) {
61
+ const reader = new jspb.BinaryReader(bytes);
62
+ const message = new RunNodeWithInputsReq();
63
+ return RunNodeWithInputsReq.deserializeBinaryFromReader(message, reader);
64
+ }
65
+ static deserializeBinaryFromReader(message, reader) {
66
+ while (reader.nextField()) {
67
+ if (reader.isEndGroup()) {
68
+ break;
69
+ }
70
+ const field = reader.getFieldNumber();
71
+ switch (field) {
72
+ case 1:
73
+ message.setNodeType(reader.readString());
74
+ break;
75
+ case 2:
76
+ const nodeConfig = new google_protobuf_struct_pb.Struct();
77
+ reader.readMessage(nodeConfig, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
78
+ message.setNodeConfig(nodeConfig);
79
+ break;
80
+ case 3:
81
+ const inputVariables = new google_protobuf_struct_pb.Struct();
82
+ reader.readMessage(inputVariables, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
83
+ message.setInputVariables(inputVariables);
84
+ break;
85
+ default:
86
+ reader.skipField();
87
+ break;
88
+ }
89
+ }
90
+ return message;
91
+ }
92
+ }
93
+ /**
94
+ * Custom implementation of RunNodeWithInputsResp class
95
+ * This is needed because the class is not generated from the proto file
96
+ */
97
+ export class RunNodeWithInputsResp extends jspb.Message {
98
+ constructor() {
99
+ super();
100
+ this.success_ = false;
101
+ this.error_ = "";
102
+ this.result_ = undefined;
103
+ }
104
+ getSuccess() {
105
+ return this.success_;
106
+ }
107
+ setSuccess(value) {
108
+ this.success_ = value;
109
+ return this;
110
+ }
111
+ getError() {
112
+ return this.error_;
113
+ }
114
+ setError(value) {
115
+ this.error_ = value;
116
+ return this;
117
+ }
118
+ getResult() {
119
+ return this.result_;
120
+ }
121
+ setResult(value) {
122
+ this.result_ = value;
123
+ return this;
124
+ }
125
+ serializeBinary() {
126
+ const writer = new jspb.BinaryWriter();
127
+ this.serializeBinaryToWriter(writer);
128
+ return writer.getResultBuffer();
129
+ }
130
+ serializeBinaryToWriter(writer) {
131
+ if (this.success_ !== false) {
132
+ writer.writeBool(1, this.success_);
133
+ }
134
+ if (this.error_ !== "") {
135
+ writer.writeString(2, this.error_);
136
+ }
137
+ if (this.result_ !== undefined) {
138
+ writer.writeMessage(3, this.result_, google_protobuf_struct_pb.Struct.serializeBinaryToWriter);
139
+ }
140
+ }
141
+ toObject(includeInstance) {
142
+ return {
143
+ success: this.success_,
144
+ error: this.error_,
145
+ result: this.result_ ?
146
+ this.result_.toObject(includeInstance) : undefined
147
+ };
148
+ }
149
+ static deserializeBinary(bytes) {
150
+ const reader = new jspb.BinaryReader(bytes);
151
+ const message = new RunNodeWithInputsResp();
152
+ return RunNodeWithInputsResp.deserializeBinaryFromReader(message, reader);
153
+ }
154
+ static deserializeBinaryFromReader(message, reader) {
155
+ while (reader.nextField()) {
156
+ if (reader.isEndGroup()) {
157
+ break;
158
+ }
159
+ const field = reader.getFieldNumber();
160
+ switch (field) {
161
+ case 1:
162
+ message.setSuccess(reader.readBool());
163
+ break;
164
+ case 2:
165
+ message.setError(reader.readString());
166
+ break;
167
+ case 3:
168
+ const result = new google_protobuf_struct_pb.Struct();
169
+ reader.readMessage(result, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
170
+ message.setResult(result);
171
+ break;
172
+ default:
173
+ reader.skipField();
174
+ break;
175
+ }
176
+ }
177
+ return message;
178
+ }
179
+ }