@avaprotocol/sdk-js 1.3.2 → 1.3.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/dist/index.d.mts +77 -7
- package/dist/index.d.ts +77 -7
- package/dist/index.js +327 -23
- package/dist/index.mjs +327 -23
- package/package.json +1 -1
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:
|
|
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
|
-
|
|
1150
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -1512,6 +1563,7 @@ type TriggerProps = Omit<TaskTrigger.AsObject, "manual" | "fixedTime" | "cron" |
|
|
|
1512
1563
|
data: TriggerData;
|
|
1513
1564
|
};
|
|
1514
1565
|
declare class Trigger implements TriggerProps {
|
|
1566
|
+
id: string;
|
|
1515
1567
|
name: string;
|
|
1516
1568
|
type: TriggerType;
|
|
1517
1569
|
data: TriggerData;
|
|
@@ -1728,7 +1780,13 @@ declare class CronTrigger extends Trigger {
|
|
|
1728
1780
|
static fromResponse(raw: TaskTrigger): CronTrigger;
|
|
1729
1781
|
}
|
|
1730
1782
|
|
|
1731
|
-
|
|
1783
|
+
interface EventMatcher {
|
|
1784
|
+
type: string;
|
|
1785
|
+
value: string[];
|
|
1786
|
+
}
|
|
1787
|
+
type EventTriggerDataType = EventCondition.AsObject & {
|
|
1788
|
+
matcher?: EventMatcher[];
|
|
1789
|
+
};
|
|
1732
1790
|
type EventTriggerProps = TriggerProps & {
|
|
1733
1791
|
data: EventTriggerDataType;
|
|
1734
1792
|
};
|
|
@@ -1783,7 +1841,13 @@ declare class BaseClient {
|
|
|
1783
1841
|
* @param expiredAtEpoch - The expiration epoch
|
|
1784
1842
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
1785
1843
|
*/
|
|
1786
|
-
authWithAPIKey(address
|
|
1844
|
+
authWithAPIKey({ chainId, address, issuedAt, expiredAt, apiKey, }: {
|
|
1845
|
+
chainId: number;
|
|
1846
|
+
address: string;
|
|
1847
|
+
issuedAt: Date;
|
|
1848
|
+
expiredAt: Date;
|
|
1849
|
+
apiKey: string;
|
|
1850
|
+
}): Promise<GetKeyResponse>;
|
|
1787
1851
|
/**
|
|
1788
1852
|
* Getting an authKey from the server by verifying the signature of an EOA wallet
|
|
1789
1853
|
* @param address - The address of the EOA wallet
|
|
@@ -1791,7 +1855,13 @@ declare class BaseClient {
|
|
|
1791
1855
|
* @param expiredAtEpoch - The expiration epoch
|
|
1792
1856
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
1793
1857
|
*/
|
|
1794
|
-
authWithSignature(address
|
|
1858
|
+
authWithSignature({ chainId, address, issuedAt, expiredAt, signature, }: {
|
|
1859
|
+
chainId: number;
|
|
1860
|
+
address: string;
|
|
1861
|
+
issuedAt: Date;
|
|
1862
|
+
expiredAt: Date;
|
|
1863
|
+
signature: string;
|
|
1864
|
+
}): Promise<GetKeyResponse>;
|
|
1795
1865
|
/**
|
|
1796
1866
|
* The client could choose to store the authKey and use it for all requests; setting it to undefined will unset the authKey
|
|
1797
1867
|
* 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:
|
|
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
|
-
|
|
1150
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -1512,6 +1563,7 @@ type TriggerProps = Omit<TaskTrigger.AsObject, "manual" | "fixedTime" | "cron" |
|
|
|
1512
1563
|
data: TriggerData;
|
|
1513
1564
|
};
|
|
1514
1565
|
declare class Trigger implements TriggerProps {
|
|
1566
|
+
id: string;
|
|
1515
1567
|
name: string;
|
|
1516
1568
|
type: TriggerType;
|
|
1517
1569
|
data: TriggerData;
|
|
@@ -1728,7 +1780,13 @@ declare class CronTrigger extends Trigger {
|
|
|
1728
1780
|
static fromResponse(raw: TaskTrigger): CronTrigger;
|
|
1729
1781
|
}
|
|
1730
1782
|
|
|
1731
|
-
|
|
1783
|
+
interface EventMatcher {
|
|
1784
|
+
type: string;
|
|
1785
|
+
value: string[];
|
|
1786
|
+
}
|
|
1787
|
+
type EventTriggerDataType = EventCondition.AsObject & {
|
|
1788
|
+
matcher?: EventMatcher[];
|
|
1789
|
+
};
|
|
1732
1790
|
type EventTriggerProps = TriggerProps & {
|
|
1733
1791
|
data: EventTriggerDataType;
|
|
1734
1792
|
};
|
|
@@ -1783,7 +1841,13 @@ declare class BaseClient {
|
|
|
1783
1841
|
* @param expiredAtEpoch - The expiration epoch
|
|
1784
1842
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
1785
1843
|
*/
|
|
1786
|
-
authWithAPIKey(address
|
|
1844
|
+
authWithAPIKey({ chainId, address, issuedAt, expiredAt, apiKey, }: {
|
|
1845
|
+
chainId: number;
|
|
1846
|
+
address: string;
|
|
1847
|
+
issuedAt: Date;
|
|
1848
|
+
expiredAt: Date;
|
|
1849
|
+
apiKey: string;
|
|
1850
|
+
}): Promise<GetKeyResponse>;
|
|
1787
1851
|
/**
|
|
1788
1852
|
* Getting an authKey from the server by verifying the signature of an EOA wallet
|
|
1789
1853
|
* @param address - The address of the EOA wallet
|
|
@@ -1791,7 +1855,13 @@ declare class BaseClient {
|
|
|
1791
1855
|
* @param expiredAtEpoch - The expiration epoch
|
|
1792
1856
|
* @returns {Promise<GetKeyResponse>} - The response from the auth call
|
|
1793
1857
|
*/
|
|
1794
|
-
authWithSignature(address
|
|
1858
|
+
authWithSignature({ chainId, address, issuedAt, expiredAt, signature, }: {
|
|
1859
|
+
chainId: number;
|
|
1860
|
+
address: string;
|
|
1861
|
+
issuedAt: Date;
|
|
1862
|
+
expiredAt: Date;
|
|
1863
|
+
signature: string;
|
|
1864
|
+
}): Promise<GetKeyResponse>;
|
|
1795
1865
|
/**
|
|
1796
1866
|
* The client could choose to store the authKey and use it for all requests; setting it to undefined will unset the authKey
|
|
1797
1867
|
* The authKey can be overridden at the request level by request options
|