@avaprotocol/sdk-js 2.11.1 → 2.12.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.
- package/CHANGELOG.md +6 -0
- package/dist/index.js +35 -1
- package/dist/index.mjs +47 -11
- package/dist/models/execution.d.ts +2 -1
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/execution.js +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -7562,6 +7562,7 @@ var require_avs_pb = __commonJS({
|
|
|
7562
7562
|
error: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
|
7563
7563
|
index: jspb.Message.getFieldWithDefault(msg, 6, 0),
|
|
7564
7564
|
totalGasCost: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
|
7565
|
+
automationFee: (f = msg.getAutomationFee()) && proto.aggregator.FeeAmount.toObject(includeInstance, f),
|
|
7565
7566
|
stepsList: jspb.Message.toObjectList(
|
|
7566
7567
|
msg.getStepsList(),
|
|
7567
7568
|
proto.aggregator.Execution.Step.toObject,
|
|
@@ -7635,6 +7636,11 @@ var require_avs_pb = __commonJS({
|
|
|
7635
7636
|
);
|
|
7636
7637
|
msg.setTotalGasCost(value);
|
|
7637
7638
|
break;
|
|
7639
|
+
case 9:
|
|
7640
|
+
var value = new proto.aggregator.FeeAmount();
|
|
7641
|
+
reader.readMessage(value, proto.aggregator.FeeAmount.deserializeBinaryFromReader);
|
|
7642
|
+
msg.setAutomationFee(value);
|
|
7643
|
+
break;
|
|
7638
7644
|
case 8:
|
|
7639
7645
|
var value = new proto.aggregator.Execution.Step();
|
|
7640
7646
|
reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
|
|
@@ -7703,6 +7709,14 @@ var require_avs_pb = __commonJS({
|
|
|
7703
7709
|
f
|
|
7704
7710
|
);
|
|
7705
7711
|
}
|
|
7712
|
+
f = message.getAutomationFee();
|
|
7713
|
+
if (f != null) {
|
|
7714
|
+
writer.writeMessage(
|
|
7715
|
+
9,
|
|
7716
|
+
f,
|
|
7717
|
+
proto.aggregator.FeeAmount.serializeBinaryToWriter
|
|
7718
|
+
);
|
|
7719
|
+
}
|
|
7706
7720
|
f = message.getStepsList();
|
|
7707
7721
|
if (f.length > 0) {
|
|
7708
7722
|
writer.writeRepeatedMessage(
|
|
@@ -8681,6 +8695,21 @@ var require_avs_pb = __commonJS({
|
|
|
8681
8695
|
proto.aggregator.Execution.prototype.setTotalGasCost = function(value) {
|
|
8682
8696
|
return jspb.Message.setProto3StringField(this, 7, value);
|
|
8683
8697
|
};
|
|
8698
|
+
proto.aggregator.Execution.prototype.getAutomationFee = function() {
|
|
8699
|
+
return (
|
|
8700
|
+
/** @type{?proto.aggregator.FeeAmount} */
|
|
8701
|
+
jspb.Message.getWrapperField(this, proto.aggregator.FeeAmount, 9)
|
|
8702
|
+
);
|
|
8703
|
+
};
|
|
8704
|
+
proto.aggregator.Execution.prototype.setAutomationFee = function(value) {
|
|
8705
|
+
return jspb.Message.setWrapperField(this, 9, value);
|
|
8706
|
+
};
|
|
8707
|
+
proto.aggregator.Execution.prototype.clearAutomationFee = function() {
|
|
8708
|
+
return this.setAutomationFee(void 0);
|
|
8709
|
+
};
|
|
8710
|
+
proto.aggregator.Execution.prototype.hasAutomationFee = function() {
|
|
8711
|
+
return jspb.Message.getField(this, 9) != null;
|
|
8712
|
+
};
|
|
8684
8713
|
proto.aggregator.Execution.prototype.getStepsList = function() {
|
|
8685
8714
|
return (
|
|
8686
8715
|
/** @type{!Array<!proto.aggregator.Execution.Step>} */
|
|
@@ -21066,6 +21095,7 @@ var Execution2 = class _Execution {
|
|
|
21066
21095
|
this.index = props.index;
|
|
21067
21096
|
this.steps = props.steps.map((s) => new step_default(s));
|
|
21068
21097
|
this.totalGasCost = props.totalGasCost;
|
|
21098
|
+
this.automationFee = props.automationFee;
|
|
21069
21099
|
}
|
|
21070
21100
|
/**
|
|
21071
21101
|
* Convert Execution instance to plain object (ExecutionProps)
|
|
@@ -21080,10 +21110,13 @@ var Execution2 = class _Execution {
|
|
|
21080
21110
|
error: this.error,
|
|
21081
21111
|
index: this.index,
|
|
21082
21112
|
steps: this.steps.map((step) => step.toJson()),
|
|
21083
|
-
...this.totalGasCost && { totalGasCost: this.totalGasCost }
|
|
21113
|
+
...this.totalGasCost && { totalGasCost: this.totalGasCost },
|
|
21114
|
+
...this.automationFee && { automationFee: this.automationFee }
|
|
21084
21115
|
};
|
|
21085
21116
|
}
|
|
21086
21117
|
static fromResponse(execution) {
|
|
21118
|
+
const automationFeePb = execution.getAutomationFee();
|
|
21119
|
+
const automationFee = automationFeePb ? automationFeePb.toObject() : void 0;
|
|
21087
21120
|
return new _Execution({
|
|
21088
21121
|
id: execution.getId(),
|
|
21089
21122
|
startAt: execution.getStartAt(),
|
|
@@ -21092,6 +21125,7 @@ var Execution2 = class _Execution {
|
|
|
21092
21125
|
error: execution.getError(),
|
|
21093
21126
|
index: execution.getIndex(),
|
|
21094
21127
|
totalGasCost: execution.getTotalGasCost() || void 0,
|
|
21128
|
+
automationFee,
|
|
21095
21129
|
steps: execution.getStepsList().map((step) => step_default.fromResponse(step))
|
|
21096
21130
|
});
|
|
21097
21131
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -7562,6 +7562,7 @@ var require_avs_pb = __commonJS({
|
|
|
7562
7562
|
error: jspb.Message.getFieldWithDefault(msg, 5, ""),
|
|
7563
7563
|
index: jspb.Message.getFieldWithDefault(msg, 6, 0),
|
|
7564
7564
|
totalGasCost: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
|
7565
|
+
automationFee: (f = msg.getAutomationFee()) && proto.aggregator.FeeAmount.toObject(includeInstance, f),
|
|
7565
7566
|
stepsList: jspb.Message.toObjectList(
|
|
7566
7567
|
msg.getStepsList(),
|
|
7567
7568
|
proto.aggregator.Execution.Step.toObject,
|
|
@@ -7635,6 +7636,11 @@ var require_avs_pb = __commonJS({
|
|
|
7635
7636
|
);
|
|
7636
7637
|
msg.setTotalGasCost(value);
|
|
7637
7638
|
break;
|
|
7639
|
+
case 9:
|
|
7640
|
+
var value = new proto.aggregator.FeeAmount();
|
|
7641
|
+
reader.readMessage(value, proto.aggregator.FeeAmount.deserializeBinaryFromReader);
|
|
7642
|
+
msg.setAutomationFee(value);
|
|
7643
|
+
break;
|
|
7638
7644
|
case 8:
|
|
7639
7645
|
var value = new proto.aggregator.Execution.Step();
|
|
7640
7646
|
reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
|
|
@@ -7703,6 +7709,14 @@ var require_avs_pb = __commonJS({
|
|
|
7703
7709
|
f
|
|
7704
7710
|
);
|
|
7705
7711
|
}
|
|
7712
|
+
f = message.getAutomationFee();
|
|
7713
|
+
if (f != null) {
|
|
7714
|
+
writer.writeMessage(
|
|
7715
|
+
9,
|
|
7716
|
+
f,
|
|
7717
|
+
proto.aggregator.FeeAmount.serializeBinaryToWriter
|
|
7718
|
+
);
|
|
7719
|
+
}
|
|
7706
7720
|
f = message.getStepsList();
|
|
7707
7721
|
if (f.length > 0) {
|
|
7708
7722
|
writer.writeRepeatedMessage(
|
|
@@ -8681,6 +8695,21 @@ var require_avs_pb = __commonJS({
|
|
|
8681
8695
|
proto.aggregator.Execution.prototype.setTotalGasCost = function(value) {
|
|
8682
8696
|
return jspb.Message.setProto3StringField(this, 7, value);
|
|
8683
8697
|
};
|
|
8698
|
+
proto.aggregator.Execution.prototype.getAutomationFee = function() {
|
|
8699
|
+
return (
|
|
8700
|
+
/** @type{?proto.aggregator.FeeAmount} */
|
|
8701
|
+
jspb.Message.getWrapperField(this, proto.aggregator.FeeAmount, 9)
|
|
8702
|
+
);
|
|
8703
|
+
};
|
|
8704
|
+
proto.aggregator.Execution.prototype.setAutomationFee = function(value) {
|
|
8705
|
+
return jspb.Message.setWrapperField(this, 9, value);
|
|
8706
|
+
};
|
|
8707
|
+
proto.aggregator.Execution.prototype.clearAutomationFee = function() {
|
|
8708
|
+
return this.setAutomationFee(void 0);
|
|
8709
|
+
};
|
|
8710
|
+
proto.aggregator.Execution.prototype.hasAutomationFee = function() {
|
|
8711
|
+
return jspb.Message.getField(this, 9) != null;
|
|
8712
|
+
};
|
|
8684
8713
|
proto.aggregator.Execution.prototype.getStepsList = function() {
|
|
8685
8714
|
return (
|
|
8686
8715
|
/** @type{!Array<!proto.aggregator.Execution.Step>} */
|
|
@@ -20835,7 +20864,9 @@ var workflow_default = Workflow;
|
|
|
20835
20864
|
|
|
20836
20865
|
// src/models/execution.ts
|
|
20837
20866
|
var avs_pb22 = __toESM(require_avs_pb());
|
|
20838
|
-
import {
|
|
20867
|
+
import {
|
|
20868
|
+
ExecutionStatus as ExecutionStatus2
|
|
20869
|
+
} from "@avaprotocol/types";
|
|
20839
20870
|
|
|
20840
20871
|
// src/models/step.ts
|
|
20841
20872
|
var avs_pb21 = __toESM(require_avs_pb());
|
|
@@ -21077,6 +21108,7 @@ var Execution2 = class _Execution {
|
|
|
21077
21108
|
this.index = props.index;
|
|
21078
21109
|
this.steps = props.steps.map((s) => new step_default(s));
|
|
21079
21110
|
this.totalGasCost = props.totalGasCost;
|
|
21111
|
+
this.automationFee = props.automationFee;
|
|
21080
21112
|
}
|
|
21081
21113
|
/**
|
|
21082
21114
|
* Convert Execution instance to plain object (ExecutionProps)
|
|
@@ -21091,10 +21123,13 @@ var Execution2 = class _Execution {
|
|
|
21091
21123
|
error: this.error,
|
|
21092
21124
|
index: this.index,
|
|
21093
21125
|
steps: this.steps.map((step) => step.toJson()),
|
|
21094
|
-
...this.totalGasCost && { totalGasCost: this.totalGasCost }
|
|
21126
|
+
...this.totalGasCost && { totalGasCost: this.totalGasCost },
|
|
21127
|
+
...this.automationFee && { automationFee: this.automationFee }
|
|
21095
21128
|
};
|
|
21096
21129
|
}
|
|
21097
21130
|
static fromResponse(execution) {
|
|
21131
|
+
const automationFeePb = execution.getAutomationFee();
|
|
21132
|
+
const automationFee = automationFeePb ? automationFeePb.toObject() : void 0;
|
|
21098
21133
|
return new _Execution({
|
|
21099
21134
|
id: execution.getId(),
|
|
21100
21135
|
startAt: execution.getStartAt(),
|
|
@@ -21103,6 +21138,7 @@ var Execution2 = class _Execution {
|
|
|
21103
21138
|
error: execution.getError(),
|
|
21104
21139
|
index: execution.getIndex(),
|
|
21105
21140
|
totalGasCost: execution.getTotalGasCost() || void 0,
|
|
21141
|
+
automationFee,
|
|
21106
21142
|
steps: execution.getStepsList().map((step) => step_default.fromResponse(step))
|
|
21107
21143
|
});
|
|
21108
21144
|
}
|
|
@@ -21143,8 +21179,8 @@ var secret_default = Secret;
|
|
|
21143
21179
|
// src/index.ts
|
|
21144
21180
|
var import_avs_pb = __toESM(require_avs_pb());
|
|
21145
21181
|
import {
|
|
21146
|
-
TriggerType as
|
|
21147
|
-
TriggerTypeConverter
|
|
21182
|
+
TriggerType as TriggerType13,
|
|
21183
|
+
TriggerTypeConverter,
|
|
21148
21184
|
AUTH_KEY_HEADER,
|
|
21149
21185
|
DEFAULT_LIMIT,
|
|
21150
21186
|
ErrorCode,
|
|
@@ -21730,7 +21766,7 @@ var Client = class extends BaseClient {
|
|
|
21730
21766
|
}, options) {
|
|
21731
21767
|
const request = new avs_pb24.TriggerTaskReq();
|
|
21732
21768
|
request.setTaskId(id);
|
|
21733
|
-
request.setTriggerType(
|
|
21769
|
+
request.setTriggerType(TriggerTypeConverter.toProtobuf(triggerData.type));
|
|
21734
21770
|
request.setIsBlocking(isBlocking);
|
|
21735
21771
|
if (triggerData.inputVariables) {
|
|
21736
21772
|
const triggerInputMap = request.getTriggerInputMap();
|
|
@@ -21739,7 +21775,7 @@ var Client = class extends BaseClient {
|
|
|
21739
21775
|
}
|
|
21740
21776
|
}
|
|
21741
21777
|
switch (triggerData.type) {
|
|
21742
|
-
case
|
|
21778
|
+
case TriggerType13.FixedTime: {
|
|
21743
21779
|
const fixedTimeData = triggerData;
|
|
21744
21780
|
const fixedTimeOutput = new avs_pb24.FixedTimeTrigger.Output();
|
|
21745
21781
|
const triggerOutputData = {
|
|
@@ -21751,7 +21787,7 @@ var Client = class extends BaseClient {
|
|
|
21751
21787
|
request.setFixedTimeTrigger(fixedTimeOutput);
|
|
21752
21788
|
break;
|
|
21753
21789
|
}
|
|
21754
|
-
case
|
|
21790
|
+
case TriggerType13.Cron: {
|
|
21755
21791
|
const cronData = triggerData;
|
|
21756
21792
|
const cronOutput = new avs_pb24.CronTrigger.Output();
|
|
21757
21793
|
const triggerOutputData = {
|
|
@@ -21763,7 +21799,7 @@ var Client = class extends BaseClient {
|
|
|
21763
21799
|
request.setCronTrigger(cronOutput);
|
|
21764
21800
|
break;
|
|
21765
21801
|
}
|
|
21766
|
-
case
|
|
21802
|
+
case TriggerType13.Block: {
|
|
21767
21803
|
const blockData = triggerData;
|
|
21768
21804
|
const blockOutput = new avs_pb24.BlockTrigger.Output();
|
|
21769
21805
|
const triggerOutputData = {
|
|
@@ -21780,7 +21816,7 @@ var Client = class extends BaseClient {
|
|
|
21780
21816
|
request.setBlockTrigger(blockOutput);
|
|
21781
21817
|
break;
|
|
21782
21818
|
}
|
|
21783
|
-
case
|
|
21819
|
+
case TriggerType13.Event: {
|
|
21784
21820
|
const eventData = triggerData;
|
|
21785
21821
|
const eventOutput = new avs_pb24.EventTrigger.Output();
|
|
21786
21822
|
if (eventData.data) {
|
|
@@ -21790,7 +21826,7 @@ var Client = class extends BaseClient {
|
|
|
21790
21826
|
request.setEventTrigger(eventOutput);
|
|
21791
21827
|
break;
|
|
21792
21828
|
}
|
|
21793
|
-
case
|
|
21829
|
+
case TriggerType13.Manual: {
|
|
21794
21830
|
const manualData = triggerData;
|
|
21795
21831
|
const manualOutput = new avs_pb24.ManualTrigger.Output();
|
|
21796
21832
|
if (manualData.data) {
|
|
@@ -21800,7 +21836,7 @@ var Client = class extends BaseClient {
|
|
|
21800
21836
|
request.setManualTrigger(manualOutput);
|
|
21801
21837
|
break;
|
|
21802
21838
|
}
|
|
21803
|
-
case
|
|
21839
|
+
case TriggerType13.Unspecified:
|
|
21804
21840
|
break;
|
|
21805
21841
|
default:
|
|
21806
21842
|
throw new Error(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
-
import { ExecutionProps, ExecutionStatus } from "@avaprotocol/types";
|
|
2
|
+
import { ExecutionProps, ExecutionStatus, type FeeAmount } from "@avaprotocol/types";
|
|
3
3
|
import Step from "./step";
|
|
4
4
|
declare class Execution implements ExecutionProps {
|
|
5
5
|
id: string;
|
|
@@ -10,6 +10,7 @@ declare class Execution implements ExecutionProps {
|
|
|
10
10
|
index: number;
|
|
11
11
|
steps: Step[];
|
|
12
12
|
totalGasCost?: string;
|
|
13
|
+
automationFee?: FeeAmount;
|
|
13
14
|
constructor(props: ExecutionProps);
|
|
14
15
|
/**
|
|
15
16
|
* Convert Execution instance to plain object (ExecutionProps)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/models/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/models/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,cAAc,EAEd,eAAe,EACf,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,IAAI,MAAM,QAAQ,CAAC;AAuB1B,cAAM,SAAU,YAAW,cAAc;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,SAAS,CAAC;gBAEd,KAAK,EAAE,cAAc;IAajC;;;OAGG;IACH,MAAM,IAAI,cAAc;IAcxB,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CAsB5D;AAED,eAAe,SAAS,CAAC"}
|
package/dist/models/execution.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
-
import { ExecutionStatus } from "@avaprotocol/types";
|
|
2
|
+
import { ExecutionStatus, } from "@avaprotocol/types";
|
|
3
3
|
import Step from "./step";
|
|
4
4
|
/**
|
|
5
5
|
* Convert protobuf ExecutionStatus to types ExecutionStatus
|
|
@@ -29,6 +29,7 @@ class Execution {
|
|
|
29
29
|
this.index = props.index;
|
|
30
30
|
this.steps = props.steps.map(s => new Step(s));
|
|
31
31
|
this.totalGasCost = props.totalGasCost;
|
|
32
|
+
this.automationFee = props.automationFee;
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* Convert Execution instance to plain object (ExecutionProps)
|
|
@@ -44,9 +45,14 @@ class Execution {
|
|
|
44
45
|
index: this.index,
|
|
45
46
|
steps: this.steps.map(step => step.toJson()),
|
|
46
47
|
...(this.totalGasCost && { totalGasCost: this.totalGasCost }),
|
|
48
|
+
...(this.automationFee && { automationFee: this.automationFee }),
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
static fromResponse(execution) {
|
|
52
|
+
const automationFeePb = execution.getAutomationFee();
|
|
53
|
+
const automationFee = automationFeePb
|
|
54
|
+
? automationFeePb.toObject()
|
|
55
|
+
: undefined;
|
|
50
56
|
return new Execution({
|
|
51
57
|
id: execution.getId(),
|
|
52
58
|
startAt: execution.getStartAt(),
|
|
@@ -55,6 +61,7 @@ class Execution {
|
|
|
55
61
|
error: execution.getError(),
|
|
56
62
|
index: execution.getIndex(),
|
|
57
63
|
totalGasCost: execution.getTotalGasCost() || undefined,
|
|
64
|
+
automationFee,
|
|
58
65
|
steps: execution
|
|
59
66
|
.getStepsList()
|
|
60
67
|
.map((step) => Step.fromResponse(step)),
|
package/package.json
CHANGED