@avaprotocol/sdk-js 2.0.1 → 2.0.3
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.
- package/CHANGELOG.md +14 -0
- package/dist/index.js +37 -7
- package/dist/index.mjs +37 -7
- package/dist/models/step.d.ts +3 -3
- package/dist/models/step.d.ts.map +1 -1
- package/dist/models/step.js +23 -14
- package/dist/models/trigger/event.d.ts.map +1 -1
- package/dist/models/trigger/event.js +9 -1
- package/dist/models/trigger/factory.d.ts.map +1 -1
- package/dist/models/trigger/factory.js +9 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @avaprotocol/sdk-js
|
|
2
2
|
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3bbdc95: Updated runTrigger with EventTrigger output
|
|
8
|
+
|
|
9
|
+
## 2.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 8e09a20: Fix the request type of SimulateWorkflow and RunTriggerReq
|
|
14
|
+
- Updated dependencies [8e09a20]
|
|
15
|
+
- @avaprotocol/types@2.0.2
|
|
16
|
+
|
|
3
17
|
## 2.0.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -88,6 +88,7 @@ var require_avs_pb = __commonJS({
|
|
|
88
88
|
goog.exportSymbol("proto.aggregator.EventTrigger.Config", null, global);
|
|
89
89
|
goog.exportSymbol("proto.aggregator.EventTrigger.Matcher", null, global);
|
|
90
90
|
goog.exportSymbol("proto.aggregator.EventTrigger.Output", null, global);
|
|
91
|
+
goog.exportSymbol("proto.aggregator.EventTrigger.Output.OutputTypeCase", null, global);
|
|
91
92
|
goog.exportSymbol("proto.aggregator.EventTrigger.TransferLogOutput", null, global);
|
|
92
93
|
goog.exportSymbol("proto.aggregator.Evm", null, global);
|
|
93
94
|
goog.exportSymbol("proto.aggregator.Evm.Log", null, global);
|
|
@@ -281,7 +282,7 @@ var require_avs_pb = __commonJS({
|
|
|
281
282
|
proto.aggregator.EventTrigger.Config.displayName = "proto.aggregator.EventTrigger.Config";
|
|
282
283
|
}
|
|
283
284
|
proto.aggregator.EventTrigger.Output = function(opt_data) {
|
|
284
|
-
jspb.Message.initialize(this, opt_data, 0, -1, null,
|
|
285
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.aggregator.EventTrigger.Output.oneofGroups_);
|
|
285
286
|
};
|
|
286
287
|
goog.inherits(proto.aggregator.EventTrigger.Output, jspb.Message);
|
|
287
288
|
if (goog.DEBUG && !COMPILED) {
|
|
@@ -2281,6 +2282,18 @@ var require_avs_pb = __commonJS({
|
|
|
2281
2282
|
proto.aggregator.EventTrigger.Config.prototype.setExpression = function(value) {
|
|
2282
2283
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
2283
2284
|
};
|
|
2285
|
+
proto.aggregator.EventTrigger.Output.oneofGroups_ = [[1, 2]];
|
|
2286
|
+
proto.aggregator.EventTrigger.Output.OutputTypeCase = {
|
|
2287
|
+
OUTPUT_TYPE_NOT_SET: 0,
|
|
2288
|
+
EVM_LOG: 1,
|
|
2289
|
+
TRANSFER_LOG: 2
|
|
2290
|
+
};
|
|
2291
|
+
proto.aggregator.EventTrigger.Output.prototype.getOutputTypeCase = function() {
|
|
2292
|
+
return (
|
|
2293
|
+
/** @type {proto.aggregator.EventTrigger.Output.OutputTypeCase} */
|
|
2294
|
+
jspb.Message.computeOneofCase(this, proto.aggregator.EventTrigger.Output.oneofGroups_[0])
|
|
2295
|
+
);
|
|
2296
|
+
};
|
|
2284
2297
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
2285
2298
|
proto.aggregator.EventTrigger.Output.prototype.toObject = function(opt_includeInstance) {
|
|
2286
2299
|
return proto.aggregator.EventTrigger.Output.toObject(opt_includeInstance, this);
|
|
@@ -2356,7 +2369,7 @@ var require_avs_pb = __commonJS({
|
|
|
2356
2369
|
);
|
|
2357
2370
|
};
|
|
2358
2371
|
proto.aggregator.EventTrigger.Output.prototype.setEvmLog = function(value) {
|
|
2359
|
-
return jspb.Message.
|
|
2372
|
+
return jspb.Message.setOneofWrapperField(this, 1, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
|
|
2360
2373
|
};
|
|
2361
2374
|
proto.aggregator.EventTrigger.Output.prototype.clearEvmLog = function() {
|
|
2362
2375
|
return this.setEvmLog(void 0);
|
|
@@ -2371,7 +2384,7 @@ var require_avs_pb = __commonJS({
|
|
|
2371
2384
|
);
|
|
2372
2385
|
};
|
|
2373
2386
|
proto.aggregator.EventTrigger.Output.prototype.setTransferLog = function(value) {
|
|
2374
|
-
return jspb.Message.
|
|
2387
|
+
return jspb.Message.setOneofWrapperField(this, 2, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
|
|
2375
2388
|
};
|
|
2376
2389
|
proto.aggregator.EventTrigger.Output.prototype.clearTransferLog = function() {
|
|
2377
2390
|
return this.setTransferLog(void 0);
|
|
@@ -14670,7 +14683,14 @@ var EventTrigger2 = class _EventTrigger extends interface_default {
|
|
|
14670
14683
|
*/
|
|
14671
14684
|
static fromOutputData(outputData) {
|
|
14672
14685
|
const eventOutput = outputData.getEventTrigger();
|
|
14673
|
-
|
|
14686
|
+
if (eventOutput) {
|
|
14687
|
+
if (eventOutput.hasEvmLog()) {
|
|
14688
|
+
return eventOutput.getEvmLog()?.toObject();
|
|
14689
|
+
} else if (eventOutput.hasTransferLog()) {
|
|
14690
|
+
return eventOutput.getTransferLog()?.toObject();
|
|
14691
|
+
}
|
|
14692
|
+
}
|
|
14693
|
+
return null;
|
|
14674
14694
|
}
|
|
14675
14695
|
};
|
|
14676
14696
|
var event_default = EventTrigger2;
|
|
@@ -14984,7 +15004,14 @@ var TriggerFactory = class {
|
|
|
14984
15004
|
break;
|
|
14985
15005
|
case avs_pb7.RunTriggerResp.OutputDataCase.EVENT_TRIGGER:
|
|
14986
15006
|
triggerOutput = outputData.getEventTrigger();
|
|
14987
|
-
|
|
15007
|
+
if (triggerOutput) {
|
|
15008
|
+
if (triggerOutput.hasEvmLog()) {
|
|
15009
|
+
return triggerOutput.getEvmLog()?.toObject();
|
|
15010
|
+
} else if (triggerOutput.hasTransferLog()) {
|
|
15011
|
+
return triggerOutput.getTransferLog()?.toObject();
|
|
15012
|
+
}
|
|
15013
|
+
}
|
|
15014
|
+
return null;
|
|
14988
15015
|
case avs_pb7.RunTriggerResp.OutputDataCase.MANUAL_TRIGGER:
|
|
14989
15016
|
triggerOutput = outputData.getManualTrigger();
|
|
14990
15017
|
break;
|
|
@@ -15713,7 +15740,7 @@ var Step = class _Step {
|
|
|
15713
15740
|
let nodeOutputMessage;
|
|
15714
15741
|
switch (outputDataType) {
|
|
15715
15742
|
case avs_pb20.Execution.Step.OutputDataCase.OUTPUT_DATA_NOT_SET:
|
|
15716
|
-
return
|
|
15743
|
+
return void 0;
|
|
15717
15744
|
// Trigger outputs
|
|
15718
15745
|
case avs_pb20.Execution.Step.OutputDataCase.BLOCK_TRIGGER:
|
|
15719
15746
|
const blockOutput = step.getBlockTrigger()?.toObject();
|
|
@@ -15745,7 +15772,10 @@ var Step = class _Step {
|
|
|
15745
15772
|
return manualOutput || void 0;
|
|
15746
15773
|
// Node outputs
|
|
15747
15774
|
case avs_pb20.Execution.Step.OutputDataCase.ETH_TRANSFER:
|
|
15748
|
-
|
|
15775
|
+
const ethTransferOutput = step.getEthTransfer()?.toObject();
|
|
15776
|
+
return ethTransferOutput ? {
|
|
15777
|
+
transactionHash: ethTransferOutput.transactionHash
|
|
15778
|
+
} : void 0;
|
|
15749
15779
|
case avs_pb20.Execution.Step.OutputDataCase.GRAPHQL:
|
|
15750
15780
|
nodeOutputMessage = step.getGraphql();
|
|
15751
15781
|
return nodeOutputMessage && nodeOutputMessage.hasData() ? nodeOutputMessage.getData() : void 0;
|
package/dist/index.mjs
CHANGED
|
@@ -88,6 +88,7 @@ var require_avs_pb = __commonJS({
|
|
|
88
88
|
goog.exportSymbol("proto.aggregator.EventTrigger.Config", null, global);
|
|
89
89
|
goog.exportSymbol("proto.aggregator.EventTrigger.Matcher", null, global);
|
|
90
90
|
goog.exportSymbol("proto.aggregator.EventTrigger.Output", null, global);
|
|
91
|
+
goog.exportSymbol("proto.aggregator.EventTrigger.Output.OutputTypeCase", null, global);
|
|
91
92
|
goog.exportSymbol("proto.aggregator.EventTrigger.TransferLogOutput", null, global);
|
|
92
93
|
goog.exportSymbol("proto.aggregator.Evm", null, global);
|
|
93
94
|
goog.exportSymbol("proto.aggregator.Evm.Log", null, global);
|
|
@@ -281,7 +282,7 @@ var require_avs_pb = __commonJS({
|
|
|
281
282
|
proto.aggregator.EventTrigger.Config.displayName = "proto.aggregator.EventTrigger.Config";
|
|
282
283
|
}
|
|
283
284
|
proto.aggregator.EventTrigger.Output = function(opt_data) {
|
|
284
|
-
jspb.Message.initialize(this, opt_data, 0, -1, null,
|
|
285
|
+
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.aggregator.EventTrigger.Output.oneofGroups_);
|
|
285
286
|
};
|
|
286
287
|
goog.inherits(proto.aggregator.EventTrigger.Output, jspb.Message);
|
|
287
288
|
if (goog.DEBUG && !COMPILED) {
|
|
@@ -2281,6 +2282,18 @@ var require_avs_pb = __commonJS({
|
|
|
2281
2282
|
proto.aggregator.EventTrigger.Config.prototype.setExpression = function(value) {
|
|
2282
2283
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
2283
2284
|
};
|
|
2285
|
+
proto.aggregator.EventTrigger.Output.oneofGroups_ = [[1, 2]];
|
|
2286
|
+
proto.aggregator.EventTrigger.Output.OutputTypeCase = {
|
|
2287
|
+
OUTPUT_TYPE_NOT_SET: 0,
|
|
2288
|
+
EVM_LOG: 1,
|
|
2289
|
+
TRANSFER_LOG: 2
|
|
2290
|
+
};
|
|
2291
|
+
proto.aggregator.EventTrigger.Output.prototype.getOutputTypeCase = function() {
|
|
2292
|
+
return (
|
|
2293
|
+
/** @type {proto.aggregator.EventTrigger.Output.OutputTypeCase} */
|
|
2294
|
+
jspb.Message.computeOneofCase(this, proto.aggregator.EventTrigger.Output.oneofGroups_[0])
|
|
2295
|
+
);
|
|
2296
|
+
};
|
|
2284
2297
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
2285
2298
|
proto.aggregator.EventTrigger.Output.prototype.toObject = function(opt_includeInstance) {
|
|
2286
2299
|
return proto.aggregator.EventTrigger.Output.toObject(opt_includeInstance, this);
|
|
@@ -2356,7 +2369,7 @@ var require_avs_pb = __commonJS({
|
|
|
2356
2369
|
);
|
|
2357
2370
|
};
|
|
2358
2371
|
proto.aggregator.EventTrigger.Output.prototype.setEvmLog = function(value) {
|
|
2359
|
-
return jspb.Message.
|
|
2372
|
+
return jspb.Message.setOneofWrapperField(this, 1, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
|
|
2360
2373
|
};
|
|
2361
2374
|
proto.aggregator.EventTrigger.Output.prototype.clearEvmLog = function() {
|
|
2362
2375
|
return this.setEvmLog(void 0);
|
|
@@ -2371,7 +2384,7 @@ var require_avs_pb = __commonJS({
|
|
|
2371
2384
|
);
|
|
2372
2385
|
};
|
|
2373
2386
|
proto.aggregator.EventTrigger.Output.prototype.setTransferLog = function(value) {
|
|
2374
|
-
return jspb.Message.
|
|
2387
|
+
return jspb.Message.setOneofWrapperField(this, 2, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
|
|
2375
2388
|
};
|
|
2376
2389
|
proto.aggregator.EventTrigger.Output.prototype.clearTransferLog = function() {
|
|
2377
2390
|
return this.setTransferLog(void 0);
|
|
@@ -14641,7 +14654,14 @@ var EventTrigger2 = class _EventTrigger extends interface_default {
|
|
|
14641
14654
|
*/
|
|
14642
14655
|
static fromOutputData(outputData) {
|
|
14643
14656
|
const eventOutput = outputData.getEventTrigger();
|
|
14644
|
-
|
|
14657
|
+
if (eventOutput) {
|
|
14658
|
+
if (eventOutput.hasEvmLog()) {
|
|
14659
|
+
return eventOutput.getEvmLog()?.toObject();
|
|
14660
|
+
} else if (eventOutput.hasTransferLog()) {
|
|
14661
|
+
return eventOutput.getTransferLog()?.toObject();
|
|
14662
|
+
}
|
|
14663
|
+
}
|
|
14664
|
+
return null;
|
|
14645
14665
|
}
|
|
14646
14666
|
};
|
|
14647
14667
|
var event_default = EventTrigger2;
|
|
@@ -14961,7 +14981,14 @@ var TriggerFactory = class {
|
|
|
14961
14981
|
break;
|
|
14962
14982
|
case avs_pb7.RunTriggerResp.OutputDataCase.EVENT_TRIGGER:
|
|
14963
14983
|
triggerOutput = outputData.getEventTrigger();
|
|
14964
|
-
|
|
14984
|
+
if (triggerOutput) {
|
|
14985
|
+
if (triggerOutput.hasEvmLog()) {
|
|
14986
|
+
return triggerOutput.getEvmLog()?.toObject();
|
|
14987
|
+
} else if (triggerOutput.hasTransferLog()) {
|
|
14988
|
+
return triggerOutput.getTransferLog()?.toObject();
|
|
14989
|
+
}
|
|
14990
|
+
}
|
|
14991
|
+
return null;
|
|
14965
14992
|
case avs_pb7.RunTriggerResp.OutputDataCase.MANUAL_TRIGGER:
|
|
14966
14993
|
triggerOutput = outputData.getManualTrigger();
|
|
14967
14994
|
break;
|
|
@@ -15695,7 +15722,7 @@ var Step = class _Step {
|
|
|
15695
15722
|
let nodeOutputMessage;
|
|
15696
15723
|
switch (outputDataType) {
|
|
15697
15724
|
case avs_pb20.Execution.Step.OutputDataCase.OUTPUT_DATA_NOT_SET:
|
|
15698
|
-
return
|
|
15725
|
+
return void 0;
|
|
15699
15726
|
// Trigger outputs
|
|
15700
15727
|
case avs_pb20.Execution.Step.OutputDataCase.BLOCK_TRIGGER:
|
|
15701
15728
|
const blockOutput = step.getBlockTrigger()?.toObject();
|
|
@@ -15727,7 +15754,10 @@ var Step = class _Step {
|
|
|
15727
15754
|
return manualOutput || void 0;
|
|
15728
15755
|
// Node outputs
|
|
15729
15756
|
case avs_pb20.Execution.Step.OutputDataCase.ETH_TRANSFER:
|
|
15730
|
-
|
|
15757
|
+
const ethTransferOutput = step.getEthTransfer()?.toObject();
|
|
15758
|
+
return ethTransferOutput ? {
|
|
15759
|
+
transactionHash: ethTransferOutput.transactionHash
|
|
15760
|
+
} : void 0;
|
|
15731
15761
|
case avs_pb20.Execution.Step.OutputDataCase.GRAPHQL:
|
|
15732
15762
|
nodeOutputMessage = step.getGraphql();
|
|
15733
15763
|
return nodeOutputMessage && nodeOutputMessage.hasData() ? nodeOutputMessage.getData() : void 0;
|
package/dist/models/step.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
-
import { StepProps } from "@avaprotocol/types";
|
|
2
|
+
import { StepProps, OutputDataProps } from "@avaprotocol/types";
|
|
3
3
|
declare class Step implements StepProps {
|
|
4
4
|
id: string;
|
|
5
5
|
type: string;
|
|
@@ -8,11 +8,11 @@ declare class Step implements StepProps {
|
|
|
8
8
|
error: string;
|
|
9
9
|
log: string;
|
|
10
10
|
inputsList: string[];
|
|
11
|
-
output:
|
|
11
|
+
output: OutputDataProps;
|
|
12
12
|
startAt: number;
|
|
13
13
|
endAt: number;
|
|
14
14
|
constructor(props: StepProps);
|
|
15
|
-
static getOutput(step: avs_pb.Execution.Step):
|
|
15
|
+
static getOutput(step: avs_pb.Execution.Step): OutputDataProps;
|
|
16
16
|
static fromResponse(step: avs_pb.Execution.Step): Step;
|
|
17
17
|
}
|
|
18
18
|
export default Step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,SAAS;IAa5B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe;IA8F9D,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CAgBvD;AAED,eAAe,IAAI,CAAC"}
|
package/dist/models/step.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
-
import { convertProtobufValueToJs, convertProtobufStepTypeToSdk } from "../utils";
|
|
3
|
-
// OutputDataProps is no longer a union of AsObject, it will be the converted JS type via 'output'
|
|
4
|
-
// export type OutputDataProps = ... (removed)
|
|
2
|
+
import { convertProtobufValueToJs, convertProtobufStepTypeToSdk, } from "../utils";
|
|
5
3
|
class Step {
|
|
6
4
|
constructor(props) {
|
|
7
5
|
this.id = props.id;
|
|
@@ -20,23 +18,29 @@ class Step {
|
|
|
20
18
|
let nodeOutputMessage;
|
|
21
19
|
switch (outputDataType) {
|
|
22
20
|
case avs_pb.Execution.Step.OutputDataCase.OUTPUT_DATA_NOT_SET:
|
|
23
|
-
return
|
|
21
|
+
return undefined;
|
|
24
22
|
// Trigger outputs
|
|
25
23
|
case avs_pb.Execution.Step.OutputDataCase.BLOCK_TRIGGER:
|
|
26
24
|
const blockOutput = step.getBlockTrigger()?.toObject();
|
|
27
|
-
return blockOutput
|
|
25
|
+
return blockOutput
|
|
26
|
+
? { blockNumber: blockOutput.blockNumber }
|
|
27
|
+
: undefined;
|
|
28
28
|
case avs_pb.Execution.Step.OutputDataCase.FIXED_TIME_TRIGGER:
|
|
29
29
|
const fixedTimeOutput = step.getFixedTimeTrigger()?.toObject();
|
|
30
|
-
return fixedTimeOutput
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return fixedTimeOutput
|
|
31
|
+
? {
|
|
32
|
+
timestamp: fixedTimeOutput.timestamp,
|
|
33
|
+
timestampIso: fixedTimeOutput.timestampIso,
|
|
34
|
+
}
|
|
35
|
+
: undefined;
|
|
34
36
|
case avs_pb.Execution.Step.OutputDataCase.CRON_TRIGGER:
|
|
35
37
|
const cronOutput = step.getCronTrigger()?.toObject();
|
|
36
|
-
return cronOutput
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
return cronOutput
|
|
39
|
+
? {
|
|
40
|
+
timestamp: cronOutput.timestamp,
|
|
41
|
+
timestampIso: cronOutput.timestampIso,
|
|
42
|
+
}
|
|
43
|
+
: undefined;
|
|
40
44
|
case avs_pb.Execution.Step.OutputDataCase.EVENT_TRIGGER:
|
|
41
45
|
const eventTrigger = step.getEventTrigger();
|
|
42
46
|
if (eventTrigger) {
|
|
@@ -53,7 +57,12 @@ class Step {
|
|
|
53
57
|
return manualOutput || undefined;
|
|
54
58
|
// Node outputs
|
|
55
59
|
case avs_pb.Execution.Step.OutputDataCase.ETH_TRANSFER:
|
|
56
|
-
|
|
60
|
+
const ethTransferOutput = step.getEthTransfer()?.toObject();
|
|
61
|
+
return ethTransferOutput
|
|
62
|
+
? {
|
|
63
|
+
transactionHash: ethTransferOutput.transactionHash,
|
|
64
|
+
}
|
|
65
|
+
: undefined;
|
|
57
66
|
case avs_pb.Execution.Step.OutputDataCase.GRAPHQL:
|
|
58
67
|
nodeOutputMessage = step.getGraphql();
|
|
59
68
|
return nodeOutputMessage && nodeOutputMessage.hasData()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,EAAqC,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,oBAAoB,CAAC;AAwB5H,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAyC/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAiC1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,EAAqC,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,oBAAoB,CAAC;AAwB5H,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAyC/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAiC1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAW9D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -97,7 +97,15 @@ class EventTrigger extends Trigger {
|
|
|
97
97
|
*/
|
|
98
98
|
static fromOutputData(outputData) {
|
|
99
99
|
const eventOutput = outputData.getEventTrigger();
|
|
100
|
-
|
|
100
|
+
if (eventOutput) {
|
|
101
|
+
if (eventOutput.hasEvmLog()) {
|
|
102
|
+
return eventOutput.getEvmLog()?.toObject();
|
|
103
|
+
}
|
|
104
|
+
else if (eventOutput.hasTransferLog()) {
|
|
105
|
+
return eventOutput.getTransferLog()?.toObject();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
101
109
|
}
|
|
102
110
|
}
|
|
103
111
|
export default EventTrigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAEL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,cAAM,cAAc;IAClB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAkB3C;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO;IAiBrD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAEL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,cAAM,cAAc;IAClB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAkB3C;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO;IAiBrD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAsD9D;AAED,eAAe,cAAc,CAAC;AAG9B,OAAO,EACL,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,CAAC;AAGF,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,CAAC"}
|
|
@@ -68,7 +68,15 @@ class TriggerFactory {
|
|
|
68
68
|
break;
|
|
69
69
|
case avs_pb.RunTriggerResp.OutputDataCase.EVENT_TRIGGER:
|
|
70
70
|
triggerOutput = outputData.getEventTrigger();
|
|
71
|
-
|
|
71
|
+
if (triggerOutput) {
|
|
72
|
+
if (triggerOutput.hasEvmLog()) {
|
|
73
|
+
return triggerOutput.getEvmLog()?.toObject();
|
|
74
|
+
}
|
|
75
|
+
else if (triggerOutput.hasTransferLog()) {
|
|
76
|
+
return triggerOutput.getTransferLog()?.toObject();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
72
80
|
case avs_pb.RunTriggerResp.OutputDataCase.MANUAL_TRIGGER:
|
|
73
81
|
triggerOutput = outputData.getManualTrigger();
|
|
74
82
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "A JavaScript/TypeScript SDK designed to simplify integration with Ava Protocol's AVS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"clean": "rm -rf node_modules dist tsconfig.tsbuildinfo"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@avaprotocol/types": "2.0.
|
|
33
|
+
"@avaprotocol/types": "2.0.2",
|
|
34
34
|
"@grpc/grpc-js": "^1.11.3",
|
|
35
35
|
"@grpc/proto-loader": "^0.7.13",
|
|
36
36
|
"dotenv": "^16.4.5",
|