@avaprotocol/sdk-js 1.3.2 → 1.3.4-dev.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/dist/index.d.mts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as grpc from '@grpc/grpc-js';
2
2
  import { Metadata } from '@grpc/grpc-js';
3
3
  import * as jspb from 'google-protobuf';
4
+ import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
4
5
  import * as google_protobuf_wrappers_pb from 'google-protobuf/google/protobuf/wrappers_pb';
5
6
  import { NodeType } from '@avaprotocol/types';
6
7
 
7
- declare const getKeyRequestMessage: (address: string, expiredAt: number) => string;
8
+ declare const getKeyRequestMessage: (chainId: number, address: string, issuedAt: Date, expiredAt: Date) => string;
8
9
 
9
10
  // package: aggregator
10
11
  // file: avs.proto
@@ -96,6 +97,10 @@ declare namespace BlockCondition {
96
97
  }
97
98
 
98
99
  declare class EventCondition extends jspb.Message {
100
+ clearMatcherList(): void;
101
+ getMatcherList(): Array<EventCondition.Matcher>;
102
+ setMatcherList(value: Array<EventCondition.Matcher>): EventCondition;
103
+ addMatcher(value?: EventCondition.Matcher, index?: number): EventCondition.Matcher;
99
104
  getExpression(): string;
100
105
  setExpression(value: string): EventCondition;
101
106
 
@@ -111,8 +116,36 @@ declare class EventCondition extends jspb.Message {
111
116
 
112
117
  declare namespace EventCondition {
113
118
  export type AsObject = {
119
+ matcherList: Array<EventCondition.Matcher.AsObject>,
114
120
  expression: string,
115
121
  }
122
+
123
+
124
+ export class Matcher extends jspb.Message {
125
+ getType(): string;
126
+ setType(value: string): Matcher;
127
+ clearValueList(): void;
128
+ getValueList(): Array<string>;
129
+ setValueList(value: Array<string>): Matcher;
130
+ addValue(value: string, index?: number): string;
131
+
132
+ serializeBinary(): Uint8Array;
133
+ toObject(includeInstance?: boolean): Matcher.AsObject;
134
+ static toObject(includeInstance: boolean, msg: Matcher): Matcher.AsObject;
135
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
136
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
137
+ static serializeBinaryToWriter(message: Matcher, writer: jspb.BinaryWriter): void;
138
+ static deserializeBinary(bytes: Uint8Array): Matcher;
139
+ static deserializeBinaryFromReader(message: Matcher, reader: jspb.BinaryReader): Matcher;
140
+ }
141
+
142
+ export namespace Matcher {
143
+ export type AsObject = {
144
+ type: string,
145
+ valueList: Array<string>,
146
+ }
147
+ }
148
+
116
149
  }
117
150
 
118
151
  declare class TaskTrigger extends jspb.Message {
@@ -143,6 +176,8 @@ declare class TaskTrigger extends jspb.Message {
143
176
  clearEvent(): void;
144
177
  getEvent(): EventCondition | undefined;
145
178
  setEvent(value?: EventCondition): TaskTrigger;
179
+ getId(): string;
180
+ setId(value: string): TaskTrigger;
146
181
 
147
182
  getTriggerTypeCase(): TaskTrigger.TriggerTypeCase;
148
183
 
@@ -164,6 +199,7 @@ declare namespace TaskTrigger {
164
199
  cron?: CronCondition.AsObject,
165
200
  block?: BlockCondition.AsObject,
166
201
  event?: EventCondition.AsObject,
202
+ id: string,
167
203
  }
168
204
 
169
205
  export enum TriggerTypeCase {
@@ -388,6 +424,8 @@ declare namespace BranchNode$1 {
388
424
  declare class FilterNode extends jspb.Message {
389
425
  getExpression(): string;
390
426
  setExpression(value: string): FilterNode;
427
+ getInput(): string;
428
+ setInput(value: string): FilterNode;
391
429
 
392
430
  serializeBinary(): Uint8Array;
393
431
  toObject(includeInstance?: boolean): FilterNode.AsObject;
@@ -402,6 +440,7 @@ declare class FilterNode extends jspb.Message {
402
440
  declare namespace FilterNode {
403
441
  export type AsObject = {
404
442
  expression: string,
443
+ input: string,
405
444
  }
406
445
  }
407
446
 
@@ -1146,8 +1185,18 @@ declare namespace ExecutionStatusResp {
1146
1185
  declare class GetKeyReq extends jspb.Message {
1147
1186
  getOwner(): string;
1148
1187
  setOwner(value: string): GetKeyReq;
1149
- getExpiredAt(): number;
1150
- setExpiredAt(value: number): GetKeyReq;
1188
+ getChainId(): number;
1189
+ setChainId(value: number): GetKeyReq;
1190
+
1191
+ hasIssuedAt(): boolean;
1192
+ clearIssuedAt(): void;
1193
+ getIssuedAt(): google_protobuf_timestamp_pb.Timestamp | undefined;
1194
+ setIssuedAt(value?: google_protobuf_timestamp_pb.Timestamp): GetKeyReq;
1195
+
1196
+ hasExpiredAt(): boolean;
1197
+ clearExpiredAt(): void;
1198
+ getExpiredAt(): google_protobuf_timestamp_pb.Timestamp | undefined;
1199
+ setExpiredAt(value?: google_protobuf_timestamp_pb.Timestamp): GetKeyReq;
1151
1200
  getSignature(): string;
1152
1201
  setSignature(value: string): GetKeyReq;
1153
1202
 
@@ -1164,7 +1213,9 @@ declare class GetKeyReq extends jspb.Message {
1164
1213
  declare namespace GetKeyReq {
1165
1214
  export type AsObject = {
1166
1215
  owner: string,
1167
- expiredAt: number,
1216
+ chainId: number,
1217
+ issuedAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
1218
+ expiredAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
1168
1219
  signature: string,
1169
1220
  }
1170
1221
  }
@@ -1451,6 +1502,7 @@ declare class Node implements NodeProps {
1451
1502
  data: NodeData;
1452
1503
  constructor(props: NodeProps);
1453
1504
  toRequest(): TaskNode;
1505
+ toJson(): Record<string, any>;
1454
1506
  }
1455
1507
 
1456
1508
  type EdgeProps = TaskEdge.AsObject;
@@ -1506,12 +1558,13 @@ declare enum TriggerType {
1506
1558
  type SmartWallet = SmartWallet$1.AsObject;
1507
1559
  declare const ExecutionStatus: typeof ExecutionStatus$1;
1508
1560
 
1509
- type TriggerData = FixedTimeCondition.AsObject | CronCondition.AsObject | BlockCondition.AsObject | EventCondition.AsObject | null;
1561
+ type TriggerData = FixedTimeCondition.AsObject | CronCondition.AsObject | BlockCondition.AsObject | EventCondition.AsObject;
1510
1562
  type TriggerProps = Omit<TaskTrigger.AsObject, "manual" | "fixedTime" | "cron" | "block" | "event"> & {
1511
1563
  type: TriggerType;
1512
1564
  data: TriggerData;
1513
1565
  };
1514
1566
  declare class Trigger implements TriggerProps {
1567
+ id: string;
1515
1568
  name: string;
1516
1569
  type: TriggerType;
1517
1570
  data: TriggerData;
@@ -1521,6 +1574,7 @@ declare class Trigger implements TriggerProps {
1521
1574
  */
1522
1575
  constructor(props: TriggerProps);
1523
1576
  toRequest(): TaskTrigger;
1577
+ toJson(): Record<string, any>;
1524
1578
  }
1525
1579
 
1526
1580
  type WorkflowProps = Omit<Task.AsObject, "id" | "owner" | "completedAt" | "status" | "executionsList" | "name" | "trigger" | "nodesList" | "edgesList" | "totalExecution" | "lastRanAt"> & {
@@ -1728,7 +1782,13 @@ declare class CronTrigger extends Trigger {
1728
1782
  static fromResponse(raw: TaskTrigger): CronTrigger;
1729
1783
  }
1730
1784
 
1731
- type EventTriggerDataType = EventCondition.AsObject;
1785
+ interface EventMatcher {
1786
+ type: string;
1787
+ value: string[];
1788
+ }
1789
+ type EventTriggerDataType = EventCondition.AsObject & {
1790
+ matcher?: EventMatcher[];
1791
+ };
1732
1792
  type EventTriggerProps = TriggerProps & {
1733
1793
  data: EventTriggerDataType;
1734
1794
  };
@@ -1783,7 +1843,13 @@ declare class BaseClient {
1783
1843
  * @param expiredAtEpoch - The expiration epoch
1784
1844
  * @returns {Promise<GetKeyResponse>} - The response from the auth call
1785
1845
  */
1786
- authWithAPIKey(address: string, apiKey: string, expiredAtEpoch: number): Promise<GetKeyResponse>;
1846
+ authWithAPIKey({ chainId, address, issuedAt, expiredAt, apiKey, }: {
1847
+ chainId: number;
1848
+ address: string;
1849
+ issuedAt: Date;
1850
+ expiredAt: Date;
1851
+ apiKey: string;
1852
+ }): Promise<GetKeyResponse>;
1787
1853
  /**
1788
1854
  * Getting an authKey from the server by verifying the signature of an EOA wallet
1789
1855
  * @param address - The address of the EOA wallet
@@ -1791,7 +1857,13 @@ declare class BaseClient {
1791
1857
  * @param expiredAtEpoch - The expiration epoch
1792
1858
  * @returns {Promise<GetKeyResponse>} - The response from the auth call
1793
1859
  */
1794
- authWithSignature(address: string, signature: string, expiredAtEpoch: number): Promise<GetKeyResponse>;
1860
+ authWithSignature({ chainId, address, issuedAt, expiredAt, signature, }: {
1861
+ chainId: number;
1862
+ address: string;
1863
+ issuedAt: Date;
1864
+ expiredAt: Date;
1865
+ signature: string;
1866
+ }): Promise<GetKeyResponse>;
1795
1867
  /**
1796
1868
  * The client could choose to store the authKey and use it for all requests; setting it to undefined will unset the authKey
1797
1869
  * The authKey can be overridden at the request level by request options
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as grpc from '@grpc/grpc-js';
2
2
  import { Metadata } from '@grpc/grpc-js';
3
3
  import * as jspb from 'google-protobuf';
4
+ import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
4
5
  import * as google_protobuf_wrappers_pb from 'google-protobuf/google/protobuf/wrappers_pb';
5
6
  import { NodeType } from '@avaprotocol/types';
6
7
 
7
- declare const getKeyRequestMessage: (address: string, expiredAt: number) => string;
8
+ declare const getKeyRequestMessage: (chainId: number, address: string, issuedAt: Date, expiredAt: Date) => string;
8
9
 
9
10
  // package: aggregator
10
11
  // file: avs.proto
@@ -96,6 +97,10 @@ declare namespace BlockCondition {
96
97
  }
97
98
 
98
99
  declare class EventCondition extends jspb.Message {
100
+ clearMatcherList(): void;
101
+ getMatcherList(): Array<EventCondition.Matcher>;
102
+ setMatcherList(value: Array<EventCondition.Matcher>): EventCondition;
103
+ addMatcher(value?: EventCondition.Matcher, index?: number): EventCondition.Matcher;
99
104
  getExpression(): string;
100
105
  setExpression(value: string): EventCondition;
101
106
 
@@ -111,8 +116,36 @@ declare class EventCondition extends jspb.Message {
111
116
 
112
117
  declare namespace EventCondition {
113
118
  export type AsObject = {
119
+ matcherList: Array<EventCondition.Matcher.AsObject>,
114
120
  expression: string,
115
121
  }
122
+
123
+
124
+ export class Matcher extends jspb.Message {
125
+ getType(): string;
126
+ setType(value: string): Matcher;
127
+ clearValueList(): void;
128
+ getValueList(): Array<string>;
129
+ setValueList(value: Array<string>): Matcher;
130
+ addValue(value: string, index?: number): string;
131
+
132
+ serializeBinary(): Uint8Array;
133
+ toObject(includeInstance?: boolean): Matcher.AsObject;
134
+ static toObject(includeInstance: boolean, msg: Matcher): Matcher.AsObject;
135
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
136
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
137
+ static serializeBinaryToWriter(message: Matcher, writer: jspb.BinaryWriter): void;
138
+ static deserializeBinary(bytes: Uint8Array): Matcher;
139
+ static deserializeBinaryFromReader(message: Matcher, reader: jspb.BinaryReader): Matcher;
140
+ }
141
+
142
+ export namespace Matcher {
143
+ export type AsObject = {
144
+ type: string,
145
+ valueList: Array<string>,
146
+ }
147
+ }
148
+
116
149
  }
117
150
 
118
151
  declare class TaskTrigger extends jspb.Message {
@@ -143,6 +176,8 @@ declare class TaskTrigger extends jspb.Message {
143
176
  clearEvent(): void;
144
177
  getEvent(): EventCondition | undefined;
145
178
  setEvent(value?: EventCondition): TaskTrigger;
179
+ getId(): string;
180
+ setId(value: string): TaskTrigger;
146
181
 
147
182
  getTriggerTypeCase(): TaskTrigger.TriggerTypeCase;
148
183
 
@@ -164,6 +199,7 @@ declare namespace TaskTrigger {
164
199
  cron?: CronCondition.AsObject,
165
200
  block?: BlockCondition.AsObject,
166
201
  event?: EventCondition.AsObject,
202
+ id: string,
167
203
  }
168
204
 
169
205
  export enum TriggerTypeCase {
@@ -388,6 +424,8 @@ declare namespace BranchNode$1 {
388
424
  declare class FilterNode extends jspb.Message {
389
425
  getExpression(): string;
390
426
  setExpression(value: string): FilterNode;
427
+ getInput(): string;
428
+ setInput(value: string): FilterNode;
391
429
 
392
430
  serializeBinary(): Uint8Array;
393
431
  toObject(includeInstance?: boolean): FilterNode.AsObject;
@@ -402,6 +440,7 @@ declare class FilterNode extends jspb.Message {
402
440
  declare namespace FilterNode {
403
441
  export type AsObject = {
404
442
  expression: string,
443
+ input: string,
405
444
  }
406
445
  }
407
446
 
@@ -1146,8 +1185,18 @@ declare namespace ExecutionStatusResp {
1146
1185
  declare class GetKeyReq extends jspb.Message {
1147
1186
  getOwner(): string;
1148
1187
  setOwner(value: string): GetKeyReq;
1149
- getExpiredAt(): number;
1150
- setExpiredAt(value: number): GetKeyReq;
1188
+ getChainId(): number;
1189
+ setChainId(value: number): GetKeyReq;
1190
+
1191
+ hasIssuedAt(): boolean;
1192
+ clearIssuedAt(): void;
1193
+ getIssuedAt(): google_protobuf_timestamp_pb.Timestamp | undefined;
1194
+ setIssuedAt(value?: google_protobuf_timestamp_pb.Timestamp): GetKeyReq;
1195
+
1196
+ hasExpiredAt(): boolean;
1197
+ clearExpiredAt(): void;
1198
+ getExpiredAt(): google_protobuf_timestamp_pb.Timestamp | undefined;
1199
+ setExpiredAt(value?: google_protobuf_timestamp_pb.Timestamp): GetKeyReq;
1151
1200
  getSignature(): string;
1152
1201
  setSignature(value: string): GetKeyReq;
1153
1202
 
@@ -1164,7 +1213,9 @@ declare class GetKeyReq extends jspb.Message {
1164
1213
  declare namespace GetKeyReq {
1165
1214
  export type AsObject = {
1166
1215
  owner: string,
1167
- expiredAt: number,
1216
+ chainId: number,
1217
+ issuedAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
1218
+ expiredAt?: google_protobuf_timestamp_pb.Timestamp.AsObject,
1168
1219
  signature: string,
1169
1220
  }
1170
1221
  }
@@ -1451,6 +1502,7 @@ declare class Node implements NodeProps {
1451
1502
  data: NodeData;
1452
1503
  constructor(props: NodeProps);
1453
1504
  toRequest(): TaskNode;
1505
+ toJson(): Record<string, any>;
1454
1506
  }
1455
1507
 
1456
1508
  type EdgeProps = TaskEdge.AsObject;
@@ -1506,12 +1558,13 @@ declare enum TriggerType {
1506
1558
  type SmartWallet = SmartWallet$1.AsObject;
1507
1559
  declare const ExecutionStatus: typeof ExecutionStatus$1;
1508
1560
 
1509
- type TriggerData = FixedTimeCondition.AsObject | CronCondition.AsObject | BlockCondition.AsObject | EventCondition.AsObject | null;
1561
+ type TriggerData = FixedTimeCondition.AsObject | CronCondition.AsObject | BlockCondition.AsObject | EventCondition.AsObject;
1510
1562
  type TriggerProps = Omit<TaskTrigger.AsObject, "manual" | "fixedTime" | "cron" | "block" | "event"> & {
1511
1563
  type: TriggerType;
1512
1564
  data: TriggerData;
1513
1565
  };
1514
1566
  declare class Trigger implements TriggerProps {
1567
+ id: string;
1515
1568
  name: string;
1516
1569
  type: TriggerType;
1517
1570
  data: TriggerData;
@@ -1521,6 +1574,7 @@ declare class Trigger implements TriggerProps {
1521
1574
  */
1522
1575
  constructor(props: TriggerProps);
1523
1576
  toRequest(): TaskTrigger;
1577
+ toJson(): Record<string, any>;
1524
1578
  }
1525
1579
 
1526
1580
  type WorkflowProps = Omit<Task.AsObject, "id" | "owner" | "completedAt" | "status" | "executionsList" | "name" | "trigger" | "nodesList" | "edgesList" | "totalExecution" | "lastRanAt"> & {
@@ -1728,7 +1782,13 @@ declare class CronTrigger extends Trigger {
1728
1782
  static fromResponse(raw: TaskTrigger): CronTrigger;
1729
1783
  }
1730
1784
 
1731
- type EventTriggerDataType = EventCondition.AsObject;
1785
+ interface EventMatcher {
1786
+ type: string;
1787
+ value: string[];
1788
+ }
1789
+ type EventTriggerDataType = EventCondition.AsObject & {
1790
+ matcher?: EventMatcher[];
1791
+ };
1732
1792
  type EventTriggerProps = TriggerProps & {
1733
1793
  data: EventTriggerDataType;
1734
1794
  };
@@ -1783,7 +1843,13 @@ declare class BaseClient {
1783
1843
  * @param expiredAtEpoch - The expiration epoch
1784
1844
  * @returns {Promise<GetKeyResponse>} - The response from the auth call
1785
1845
  */
1786
- authWithAPIKey(address: string, apiKey: string, expiredAtEpoch: number): Promise<GetKeyResponse>;
1846
+ authWithAPIKey({ chainId, address, issuedAt, expiredAt, apiKey, }: {
1847
+ chainId: number;
1848
+ address: string;
1849
+ issuedAt: Date;
1850
+ expiredAt: Date;
1851
+ apiKey: string;
1852
+ }): Promise<GetKeyResponse>;
1787
1853
  /**
1788
1854
  * Getting an authKey from the server by verifying the signature of an EOA wallet
1789
1855
  * @param address - The address of the EOA wallet
@@ -1791,7 +1857,13 @@ declare class BaseClient {
1791
1857
  * @param expiredAtEpoch - The expiration epoch
1792
1858
  * @returns {Promise<GetKeyResponse>} - The response from the auth call
1793
1859
  */
1794
- authWithSignature(address: string, signature: string, expiredAtEpoch: number): Promise<GetKeyResponse>;
1860
+ authWithSignature({ chainId, address, issuedAt, expiredAt, signature, }: {
1861
+ chainId: number;
1862
+ address: string;
1863
+ issuedAt: Date;
1864
+ expiredAt: Date;
1865
+ signature: string;
1866
+ }): Promise<GetKeyResponse>;
1795
1867
  /**
1796
1868
  * The client could choose to store the authKey and use it for all requests; setting it to undefined will unset the authKey
1797
1869
  * The authKey can be overridden at the request level by request options