@avaprotocol/sdk-js 0.7.2 → 0.7.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/README.md +2 -19
- package/dist/index.d.mts +84 -46
- package/dist/index.d.ts +84 -46
- package/dist/index.js +50 -20
- package/dist/index.mjs +50 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -81,23 +81,6 @@ To ensure the SDK is functioning correctly, we have a comprehensive test suite.
|
|
|
81
81
|
|
|
82
82
|
This will execute all unit and integration tests. Make sure all tests pass before submitting a pull request or deploying changes.
|
|
83
83
|
|
|
84
|
-
## Version Management
|
|
85
|
-
|
|
86
|
-
This project uses [Changesets](https://github.com/changesets/changesets) to manage versions and changelogs. To contribute changes:
|
|
87
|
-
|
|
88
|
-
1. Make your changes to the codebase.
|
|
89
|
-
2. Run `npm run changeset` to create a new changeset.
|
|
90
|
-
3. Follow the prompts to describe your changes.
|
|
91
|
-
4. Commit the generated changeset file along with your changes.
|
|
92
|
-
|
|
93
|
-
To release a new version:
|
|
94
|
-
|
|
95
|
-
1. Run `npm run version` to update package versions and changelogs.
|
|
96
|
-
2. Review and commit the changes.
|
|
97
|
-
3. Run `npm run release` to publish the new version to npm.
|
|
98
|
-
|
|
99
|
-
For more detailed information on using Changesets, refer to the [Changesets documentation](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md).
|
|
100
|
-
|
|
101
84
|
## Release Process
|
|
102
85
|
|
|
103
86
|
This repository uses a two-step workflow process for creating new releases:
|
|
@@ -120,10 +103,10 @@ This repository uses a two-step workflow process for creating new releases:
|
|
|
120
103
|
|
|
121
104
|
The NPM publishing of dev versions can be handled manually, since the test cases reference the dist folder and don’t require a new version on NPM. NPM publish on dev tag is only required for testing the new version in a web app.
|
|
122
105
|
|
|
123
|
-
1. Publish a dev version and test it in your local environment
|
|
106
|
+
1. Publish a dev version and test it in your local environment. The `npm publish` will use the version number in `package.json`, so run `npm version prerelease --preid=dev` first if you need a new version number.
|
|
124
107
|
|
|
125
108
|
```bash
|
|
126
|
-
#
|
|
109
|
+
# Optionally, update version with dev tag in package.json
|
|
127
110
|
npm version prerelease --preid=dev
|
|
128
111
|
|
|
129
112
|
# Publish to npm with dev tag
|
package/dist/index.d.mts
CHANGED
|
@@ -474,8 +474,8 @@ declare namespace BranchAction {
|
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
declare class TaskAction extends jspb.Message {
|
|
477
|
-
getTaskType(): TaskType;
|
|
478
|
-
setTaskType(value: TaskType): TaskAction;
|
|
477
|
+
getTaskType(): TaskType$1;
|
|
478
|
+
setTaskType(value: TaskType$1): TaskAction;
|
|
479
479
|
getId(): string;
|
|
480
480
|
setId(value: string): TaskAction;
|
|
481
481
|
getName(): string;
|
|
@@ -527,7 +527,7 @@ declare class TaskAction extends jspb.Message {
|
|
|
527
527
|
|
|
528
528
|
declare namespace TaskAction {
|
|
529
529
|
export type AsObject = {
|
|
530
|
-
taskType: TaskType,
|
|
530
|
+
taskType: TaskType$1,
|
|
531
531
|
id: string,
|
|
532
532
|
name: string,
|
|
533
533
|
nextList: Array<string>,
|
|
@@ -566,53 +566,53 @@ declare namespace Execution {
|
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
declare class Task
|
|
569
|
+
declare class Task extends jspb.Message {
|
|
570
570
|
|
|
571
571
|
hasId(): boolean;
|
|
572
572
|
clearId(): void;
|
|
573
573
|
getId(): UUID | undefined;
|
|
574
|
-
setId(value?: UUID): Task
|
|
574
|
+
setId(value?: UUID): Task;
|
|
575
575
|
getOwner(): string;
|
|
576
|
-
setOwner(value: string): Task
|
|
576
|
+
setOwner(value: string): Task;
|
|
577
577
|
getSmartAccountAddress(): string;
|
|
578
|
-
setSmartAccountAddress(value: string): Task
|
|
578
|
+
setSmartAccountAddress(value: string): Task;
|
|
579
579
|
|
|
580
580
|
hasTrigger(): boolean;
|
|
581
581
|
clearTrigger(): void;
|
|
582
582
|
getTrigger(): TaskTrigger | undefined;
|
|
583
|
-
setTrigger(value?: TaskTrigger): Task
|
|
583
|
+
setTrigger(value?: TaskTrigger): Task;
|
|
584
584
|
clearNodesList(): void;
|
|
585
585
|
getNodesList(): Array<TaskAction>;
|
|
586
|
-
setNodesList(value: Array<TaskAction>): Task
|
|
586
|
+
setNodesList(value: Array<TaskAction>): Task;
|
|
587
587
|
addNodes(value?: TaskAction, index?: number): TaskAction;
|
|
588
588
|
getStartAt(): number;
|
|
589
|
-
setStartAt(value: number): Task
|
|
589
|
+
setStartAt(value: number): Task;
|
|
590
590
|
getExpiredAt(): number;
|
|
591
|
-
setExpiredAt(value: number): Task
|
|
591
|
+
setExpiredAt(value: number): Task;
|
|
592
592
|
getMemo(): string;
|
|
593
|
-
setMemo(value: string): Task
|
|
593
|
+
setMemo(value: string): Task;
|
|
594
594
|
getCompletedAt(): number;
|
|
595
|
-
setCompletedAt(value: number): Task
|
|
595
|
+
setCompletedAt(value: number): Task;
|
|
596
596
|
getStatus(): TaskStatus;
|
|
597
|
-
setStatus(value: TaskStatus): Task
|
|
597
|
+
setStatus(value: TaskStatus): Task;
|
|
598
598
|
getRepeatable(): boolean;
|
|
599
|
-
setRepeatable(value: boolean): Task
|
|
599
|
+
setRepeatable(value: boolean): Task;
|
|
600
600
|
clearExecutionsList(): void;
|
|
601
601
|
getExecutionsList(): Array<Execution>;
|
|
602
|
-
setExecutionsList(value: Array<Execution>): Task
|
|
602
|
+
setExecutionsList(value: Array<Execution>): Task;
|
|
603
603
|
addExecutions(value?: Execution, index?: number): Execution;
|
|
604
604
|
|
|
605
605
|
serializeBinary(): Uint8Array;
|
|
606
|
-
toObject(includeInstance?: boolean): Task
|
|
607
|
-
static toObject(includeInstance: boolean, msg: Task
|
|
606
|
+
toObject(includeInstance?: boolean): Task.AsObject;
|
|
607
|
+
static toObject(includeInstance: boolean, msg: Task): Task.AsObject;
|
|
608
608
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
609
609
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
610
|
-
static serializeBinaryToWriter(message: Task
|
|
611
|
-
static deserializeBinary(bytes: Uint8Array): Task
|
|
612
|
-
static deserializeBinaryFromReader(message: Task
|
|
610
|
+
static serializeBinaryToWriter(message: Task, writer: jspb.BinaryWriter): void;
|
|
611
|
+
static deserializeBinary(bytes: Uint8Array): Task;
|
|
612
|
+
static deserializeBinaryFromReader(message: Task, reader: jspb.BinaryReader): Task;
|
|
613
613
|
}
|
|
614
614
|
|
|
615
|
-
declare namespace Task
|
|
615
|
+
declare namespace Task {
|
|
616
616
|
export type AsObject = {
|
|
617
617
|
id?: UUID.AsObject,
|
|
618
618
|
owner: string,
|
|
@@ -939,7 +939,7 @@ declare enum TriggerType {
|
|
|
939
939
|
EXPRESSIONTRIGGER = 2,
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
declare enum TaskType {
|
|
942
|
+
declare enum TaskType$1 {
|
|
943
943
|
ETHTRANSFERTASK = 0,
|
|
944
944
|
CONTRACTEXECUTIONTASK = 1,
|
|
945
945
|
GRAPHQLDATAQUERYTASK = 2,
|
|
@@ -1088,18 +1088,18 @@ interface IAggregatorClient {
|
|
|
1088
1088
|
): grpc.ClientUnaryCall;
|
|
1089
1089
|
getTask(
|
|
1090
1090
|
request: UUID,
|
|
1091
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1091
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1092
1092
|
): grpc.ClientUnaryCall;
|
|
1093
1093
|
getTask(
|
|
1094
1094
|
request: UUID,
|
|
1095
1095
|
metadata: grpc.Metadata,
|
|
1096
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1096
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1097
1097
|
): grpc.ClientUnaryCall;
|
|
1098
1098
|
getTask(
|
|
1099
1099
|
request: UUID,
|
|
1100
1100
|
metadata: grpc.Metadata,
|
|
1101
1101
|
options: Partial<grpc.CallOptions>,
|
|
1102
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1102
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1103
1103
|
): grpc.ClientUnaryCall;
|
|
1104
1104
|
cancelTask(
|
|
1105
1105
|
request: UUID,
|
|
@@ -1336,18 +1336,18 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
|
|
|
1336
1336
|
): grpc.ClientUnaryCall;
|
|
1337
1337
|
public getTask(
|
|
1338
1338
|
request: UUID,
|
|
1339
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1339
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1340
1340
|
): grpc.ClientUnaryCall;
|
|
1341
1341
|
public getTask(
|
|
1342
1342
|
request: UUID,
|
|
1343
1343
|
metadata: grpc.Metadata,
|
|
1344
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1344
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1345
1345
|
): grpc.ClientUnaryCall;
|
|
1346
1346
|
public getTask(
|
|
1347
1347
|
request: UUID,
|
|
1348
1348
|
metadata: grpc.Metadata,
|
|
1349
1349
|
options: Partial<grpc.CallOptions>,
|
|
1350
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1350
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1351
1351
|
): grpc.ClientUnaryCall;
|
|
1352
1352
|
public cancelTask(
|
|
1353
1353
|
request: UUID,
|
|
@@ -1466,30 +1466,58 @@ interface GetKeyResponse {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
interface ClientOption {
|
|
1468
1468
|
endpoint: string;
|
|
1469
|
-
jwtApiKey?: string;
|
|
1470
1469
|
}
|
|
1471
|
-
interface
|
|
1470
|
+
interface TaskType {
|
|
1472
1471
|
id: string;
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1472
|
+
owner: string;
|
|
1473
|
+
smartAccountAddress: string;
|
|
1474
|
+
trigger: {
|
|
1475
|
+
triggerType: number;
|
|
1476
|
+
schedule?: any;
|
|
1477
|
+
contractQuery?: any;
|
|
1478
|
+
expression: {
|
|
1479
|
+
expression: string;
|
|
1480
|
+
};
|
|
1481
|
+
};
|
|
1482
|
+
nodesList: Array<{
|
|
1483
|
+
taskType: number;
|
|
1484
|
+
id: string;
|
|
1485
|
+
name: string;
|
|
1486
|
+
nextList: any[];
|
|
1487
|
+
ethTransfer?: any;
|
|
1488
|
+
contractExecution: any;
|
|
1489
|
+
graphqlDataQuery?: any;
|
|
1490
|
+
httpDataQuery?: any;
|
|
1491
|
+
customCode?: any;
|
|
1492
|
+
branch?: any;
|
|
1493
|
+
}>;
|
|
1494
|
+
startAt: number;
|
|
1495
|
+
expiredAt: number;
|
|
1496
|
+
memo: string;
|
|
1497
|
+
completedAt: number;
|
|
1498
|
+
status: number;
|
|
1499
|
+
repeatable: boolean;
|
|
1500
|
+
executionsList: any[];
|
|
1476
1501
|
}
|
|
1477
1502
|
interface CreateTaskResponse {
|
|
1478
1503
|
id: string;
|
|
1479
1504
|
}
|
|
1480
1505
|
interface ListTasksResponse {
|
|
1481
|
-
tasks:
|
|
1506
|
+
tasks: {
|
|
1507
|
+
id: string;
|
|
1508
|
+
status: string;
|
|
1509
|
+
}[];
|
|
1510
|
+
}
|
|
1511
|
+
interface CancelTaskResponse {
|
|
1512
|
+
value: boolean;
|
|
1513
|
+
}
|
|
1514
|
+
interface DeleteTaskResponse {
|
|
1515
|
+
value: boolean;
|
|
1482
1516
|
}
|
|
1483
1517
|
interface GetAddressesResponse {
|
|
1484
1518
|
owner: string;
|
|
1485
1519
|
smart_account_address: string;
|
|
1486
1520
|
}
|
|
1487
|
-
interface TransactionResp {
|
|
1488
|
-
hash: string;
|
|
1489
|
-
}
|
|
1490
|
-
interface BalanceResp {
|
|
1491
|
-
balance: string;
|
|
1492
|
-
}
|
|
1493
1521
|
|
|
1494
1522
|
declare class BaseClient {
|
|
1495
1523
|
readonly endpoint: string;
|
|
@@ -1510,11 +1538,21 @@ declare class Client extends BaseClient {
|
|
|
1510
1538
|
address: string;
|
|
1511
1539
|
tokenContract: string;
|
|
1512
1540
|
oracleContract: string;
|
|
1541
|
+
}, { authKey }: {
|
|
1542
|
+
authKey: string;
|
|
1513
1543
|
}): Promise<CreateTaskResponse>;
|
|
1514
|
-
listTasks(address: string
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1544
|
+
listTasks(address: string, { authKey }: {
|
|
1545
|
+
authKey: string;
|
|
1546
|
+
}): Promise<ListTasksResponse>;
|
|
1547
|
+
getTask(id: string, { authKey }: {
|
|
1548
|
+
authKey: string;
|
|
1549
|
+
}): Promise<TaskType>;
|
|
1550
|
+
cancelTask(id: string, { authKey }: {
|
|
1551
|
+
authKey: string;
|
|
1552
|
+
}): Promise<CancelTaskResponse>;
|
|
1553
|
+
deleteTask(id: string, { authKey }: {
|
|
1554
|
+
authKey: string;
|
|
1555
|
+
}): Promise<DeleteTaskResponse>;
|
|
1518
1556
|
}
|
|
1519
1557
|
|
|
1520
|
-
export { AUTH_KEY_HEADER, type
|
|
1558
|
+
export { AUTH_KEY_HEADER, type CancelTaskResponse, type ClientOption, type CreateTaskResponse, type DeleteTaskResponse, type Environment, type GetAddressesResponse, type GetKeyResponse, type ListTasksResponse, type RequestOptions, type TaskType, Client as default, getKeyRequestMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -474,8 +474,8 @@ declare namespace BranchAction {
|
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
declare class TaskAction extends jspb.Message {
|
|
477
|
-
getTaskType(): TaskType;
|
|
478
|
-
setTaskType(value: TaskType): TaskAction;
|
|
477
|
+
getTaskType(): TaskType$1;
|
|
478
|
+
setTaskType(value: TaskType$1): TaskAction;
|
|
479
479
|
getId(): string;
|
|
480
480
|
setId(value: string): TaskAction;
|
|
481
481
|
getName(): string;
|
|
@@ -527,7 +527,7 @@ declare class TaskAction extends jspb.Message {
|
|
|
527
527
|
|
|
528
528
|
declare namespace TaskAction {
|
|
529
529
|
export type AsObject = {
|
|
530
|
-
taskType: TaskType,
|
|
530
|
+
taskType: TaskType$1,
|
|
531
531
|
id: string,
|
|
532
532
|
name: string,
|
|
533
533
|
nextList: Array<string>,
|
|
@@ -566,53 +566,53 @@ declare namespace Execution {
|
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
declare class Task
|
|
569
|
+
declare class Task extends jspb.Message {
|
|
570
570
|
|
|
571
571
|
hasId(): boolean;
|
|
572
572
|
clearId(): void;
|
|
573
573
|
getId(): UUID | undefined;
|
|
574
|
-
setId(value?: UUID): Task
|
|
574
|
+
setId(value?: UUID): Task;
|
|
575
575
|
getOwner(): string;
|
|
576
|
-
setOwner(value: string): Task
|
|
576
|
+
setOwner(value: string): Task;
|
|
577
577
|
getSmartAccountAddress(): string;
|
|
578
|
-
setSmartAccountAddress(value: string): Task
|
|
578
|
+
setSmartAccountAddress(value: string): Task;
|
|
579
579
|
|
|
580
580
|
hasTrigger(): boolean;
|
|
581
581
|
clearTrigger(): void;
|
|
582
582
|
getTrigger(): TaskTrigger | undefined;
|
|
583
|
-
setTrigger(value?: TaskTrigger): Task
|
|
583
|
+
setTrigger(value?: TaskTrigger): Task;
|
|
584
584
|
clearNodesList(): void;
|
|
585
585
|
getNodesList(): Array<TaskAction>;
|
|
586
|
-
setNodesList(value: Array<TaskAction>): Task
|
|
586
|
+
setNodesList(value: Array<TaskAction>): Task;
|
|
587
587
|
addNodes(value?: TaskAction, index?: number): TaskAction;
|
|
588
588
|
getStartAt(): number;
|
|
589
|
-
setStartAt(value: number): Task
|
|
589
|
+
setStartAt(value: number): Task;
|
|
590
590
|
getExpiredAt(): number;
|
|
591
|
-
setExpiredAt(value: number): Task
|
|
591
|
+
setExpiredAt(value: number): Task;
|
|
592
592
|
getMemo(): string;
|
|
593
|
-
setMemo(value: string): Task
|
|
593
|
+
setMemo(value: string): Task;
|
|
594
594
|
getCompletedAt(): number;
|
|
595
|
-
setCompletedAt(value: number): Task
|
|
595
|
+
setCompletedAt(value: number): Task;
|
|
596
596
|
getStatus(): TaskStatus;
|
|
597
|
-
setStatus(value: TaskStatus): Task
|
|
597
|
+
setStatus(value: TaskStatus): Task;
|
|
598
598
|
getRepeatable(): boolean;
|
|
599
|
-
setRepeatable(value: boolean): Task
|
|
599
|
+
setRepeatable(value: boolean): Task;
|
|
600
600
|
clearExecutionsList(): void;
|
|
601
601
|
getExecutionsList(): Array<Execution>;
|
|
602
|
-
setExecutionsList(value: Array<Execution>): Task
|
|
602
|
+
setExecutionsList(value: Array<Execution>): Task;
|
|
603
603
|
addExecutions(value?: Execution, index?: number): Execution;
|
|
604
604
|
|
|
605
605
|
serializeBinary(): Uint8Array;
|
|
606
|
-
toObject(includeInstance?: boolean): Task
|
|
607
|
-
static toObject(includeInstance: boolean, msg: Task
|
|
606
|
+
toObject(includeInstance?: boolean): Task.AsObject;
|
|
607
|
+
static toObject(includeInstance: boolean, msg: Task): Task.AsObject;
|
|
608
608
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
609
609
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
610
|
-
static serializeBinaryToWriter(message: Task
|
|
611
|
-
static deserializeBinary(bytes: Uint8Array): Task
|
|
612
|
-
static deserializeBinaryFromReader(message: Task
|
|
610
|
+
static serializeBinaryToWriter(message: Task, writer: jspb.BinaryWriter): void;
|
|
611
|
+
static deserializeBinary(bytes: Uint8Array): Task;
|
|
612
|
+
static deserializeBinaryFromReader(message: Task, reader: jspb.BinaryReader): Task;
|
|
613
613
|
}
|
|
614
614
|
|
|
615
|
-
declare namespace Task
|
|
615
|
+
declare namespace Task {
|
|
616
616
|
export type AsObject = {
|
|
617
617
|
id?: UUID.AsObject,
|
|
618
618
|
owner: string,
|
|
@@ -939,7 +939,7 @@ declare enum TriggerType {
|
|
|
939
939
|
EXPRESSIONTRIGGER = 2,
|
|
940
940
|
}
|
|
941
941
|
|
|
942
|
-
declare enum TaskType {
|
|
942
|
+
declare enum TaskType$1 {
|
|
943
943
|
ETHTRANSFERTASK = 0,
|
|
944
944
|
CONTRACTEXECUTIONTASK = 1,
|
|
945
945
|
GRAPHQLDATAQUERYTASK = 2,
|
|
@@ -1088,18 +1088,18 @@ interface IAggregatorClient {
|
|
|
1088
1088
|
): grpc.ClientUnaryCall;
|
|
1089
1089
|
getTask(
|
|
1090
1090
|
request: UUID,
|
|
1091
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1091
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1092
1092
|
): grpc.ClientUnaryCall;
|
|
1093
1093
|
getTask(
|
|
1094
1094
|
request: UUID,
|
|
1095
1095
|
metadata: grpc.Metadata,
|
|
1096
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1096
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1097
1097
|
): grpc.ClientUnaryCall;
|
|
1098
1098
|
getTask(
|
|
1099
1099
|
request: UUID,
|
|
1100
1100
|
metadata: grpc.Metadata,
|
|
1101
1101
|
options: Partial<grpc.CallOptions>,
|
|
1102
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1102
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1103
1103
|
): grpc.ClientUnaryCall;
|
|
1104
1104
|
cancelTask(
|
|
1105
1105
|
request: UUID,
|
|
@@ -1336,18 +1336,18 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
|
|
|
1336
1336
|
): grpc.ClientUnaryCall;
|
|
1337
1337
|
public getTask(
|
|
1338
1338
|
request: UUID,
|
|
1339
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1339
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1340
1340
|
): grpc.ClientUnaryCall;
|
|
1341
1341
|
public getTask(
|
|
1342
1342
|
request: UUID,
|
|
1343
1343
|
metadata: grpc.Metadata,
|
|
1344
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1344
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1345
1345
|
): grpc.ClientUnaryCall;
|
|
1346
1346
|
public getTask(
|
|
1347
1347
|
request: UUID,
|
|
1348
1348
|
metadata: grpc.Metadata,
|
|
1349
1349
|
options: Partial<grpc.CallOptions>,
|
|
1350
|
-
callback: (error: grpc.ServiceError | null, response: Task
|
|
1350
|
+
callback: (error: grpc.ServiceError | null, response: Task) => void
|
|
1351
1351
|
): grpc.ClientUnaryCall;
|
|
1352
1352
|
public cancelTask(
|
|
1353
1353
|
request: UUID,
|
|
@@ -1466,30 +1466,58 @@ interface GetKeyResponse {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
interface ClientOption {
|
|
1468
1468
|
endpoint: string;
|
|
1469
|
-
jwtApiKey?: string;
|
|
1470
1469
|
}
|
|
1471
|
-
interface
|
|
1470
|
+
interface TaskType {
|
|
1472
1471
|
id: string;
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1472
|
+
owner: string;
|
|
1473
|
+
smartAccountAddress: string;
|
|
1474
|
+
trigger: {
|
|
1475
|
+
triggerType: number;
|
|
1476
|
+
schedule?: any;
|
|
1477
|
+
contractQuery?: any;
|
|
1478
|
+
expression: {
|
|
1479
|
+
expression: string;
|
|
1480
|
+
};
|
|
1481
|
+
};
|
|
1482
|
+
nodesList: Array<{
|
|
1483
|
+
taskType: number;
|
|
1484
|
+
id: string;
|
|
1485
|
+
name: string;
|
|
1486
|
+
nextList: any[];
|
|
1487
|
+
ethTransfer?: any;
|
|
1488
|
+
contractExecution: any;
|
|
1489
|
+
graphqlDataQuery?: any;
|
|
1490
|
+
httpDataQuery?: any;
|
|
1491
|
+
customCode?: any;
|
|
1492
|
+
branch?: any;
|
|
1493
|
+
}>;
|
|
1494
|
+
startAt: number;
|
|
1495
|
+
expiredAt: number;
|
|
1496
|
+
memo: string;
|
|
1497
|
+
completedAt: number;
|
|
1498
|
+
status: number;
|
|
1499
|
+
repeatable: boolean;
|
|
1500
|
+
executionsList: any[];
|
|
1476
1501
|
}
|
|
1477
1502
|
interface CreateTaskResponse {
|
|
1478
1503
|
id: string;
|
|
1479
1504
|
}
|
|
1480
1505
|
interface ListTasksResponse {
|
|
1481
|
-
tasks:
|
|
1506
|
+
tasks: {
|
|
1507
|
+
id: string;
|
|
1508
|
+
status: string;
|
|
1509
|
+
}[];
|
|
1510
|
+
}
|
|
1511
|
+
interface CancelTaskResponse {
|
|
1512
|
+
value: boolean;
|
|
1513
|
+
}
|
|
1514
|
+
interface DeleteTaskResponse {
|
|
1515
|
+
value: boolean;
|
|
1482
1516
|
}
|
|
1483
1517
|
interface GetAddressesResponse {
|
|
1484
1518
|
owner: string;
|
|
1485
1519
|
smart_account_address: string;
|
|
1486
1520
|
}
|
|
1487
|
-
interface TransactionResp {
|
|
1488
|
-
hash: string;
|
|
1489
|
-
}
|
|
1490
|
-
interface BalanceResp {
|
|
1491
|
-
balance: string;
|
|
1492
|
-
}
|
|
1493
1521
|
|
|
1494
1522
|
declare class BaseClient {
|
|
1495
1523
|
readonly endpoint: string;
|
|
@@ -1510,11 +1538,21 @@ declare class Client extends BaseClient {
|
|
|
1510
1538
|
address: string;
|
|
1511
1539
|
tokenContract: string;
|
|
1512
1540
|
oracleContract: string;
|
|
1541
|
+
}, { authKey }: {
|
|
1542
|
+
authKey: string;
|
|
1513
1543
|
}): Promise<CreateTaskResponse>;
|
|
1514
|
-
listTasks(address: string
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1544
|
+
listTasks(address: string, { authKey }: {
|
|
1545
|
+
authKey: string;
|
|
1546
|
+
}): Promise<ListTasksResponse>;
|
|
1547
|
+
getTask(id: string, { authKey }: {
|
|
1548
|
+
authKey: string;
|
|
1549
|
+
}): Promise<TaskType>;
|
|
1550
|
+
cancelTask(id: string, { authKey }: {
|
|
1551
|
+
authKey: string;
|
|
1552
|
+
}): Promise<CancelTaskResponse>;
|
|
1553
|
+
deleteTask(id: string, { authKey }: {
|
|
1554
|
+
authKey: string;
|
|
1555
|
+
}): Promise<DeleteTaskResponse>;
|
|
1518
1556
|
}
|
|
1519
1557
|
|
|
1520
|
-
export { AUTH_KEY_HEADER, type
|
|
1558
|
+
export { AUTH_KEY_HEADER, type CancelTaskResponse, type ClientOption, type CreateTaskResponse, type DeleteTaskResponse, type Environment, type GetAddressesResponse, type GetKeyResponse, type ListTasksResponse, type RequestOptions, type TaskType, Client as default, getKeyRequestMessage };
|
package/dist/index.js
CHANGED
|
@@ -4505,20 +4505,37 @@ var AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
|
|
|
4505
4505
|
// src/index.ts
|
|
4506
4506
|
init_avs_pb();
|
|
4507
4507
|
|
|
4508
|
+
// src/types.ts
|
|
4509
|
+
var AUTH_KEY_HEADER = "authKey";
|
|
4510
|
+
|
|
4508
4511
|
// src/task.ts
|
|
4509
4512
|
var Task2 = class {
|
|
4510
|
-
//
|
|
4511
|
-
// error?: string;
|
|
4513
|
+
// Add other missing properties here
|
|
4512
4514
|
constructor(task) {
|
|
4513
|
-
this.id = task.getId();
|
|
4515
|
+
this.id = task.getId()?.toString() || "";
|
|
4514
4516
|
this.status = task.getStatus().toString();
|
|
4517
|
+
this.owner = task.getOwner();
|
|
4518
|
+
this.smartAccountAddress = task.getSmartAccountAddress();
|
|
4519
|
+
this.trigger = {
|
|
4520
|
+
triggerType: task.getTrigger()?.getTriggerType() || 0,
|
|
4521
|
+
schedule: task.getTrigger()?.getSchedule()?.toObject(),
|
|
4522
|
+
contractQuery: task.getTrigger()?.getContractQuery()?.toObject(),
|
|
4523
|
+
expression: task.getTrigger()?.getExpression()?.toObject() || {
|
|
4524
|
+
expression: ""
|
|
4525
|
+
}
|
|
4526
|
+
};
|
|
4527
|
+
this.nodesList = task.getNodesList();
|
|
4528
|
+
this.startAt = task.getStartAt();
|
|
4529
|
+
this.expiredAt = task.getExpiredAt();
|
|
4530
|
+
this.memo = task.getMemo();
|
|
4531
|
+
this.completedAt = task.getCompletedAt();
|
|
4532
|
+
this.status = task.getStatus();
|
|
4533
|
+
this.repeatable = task.getRepeatable();
|
|
4534
|
+
this.executionsList = task.getExecutionsList();
|
|
4515
4535
|
}
|
|
4516
4536
|
};
|
|
4517
4537
|
var task_default = Task2;
|
|
4518
4538
|
|
|
4519
|
-
// src/types.ts
|
|
4520
|
-
var AUTH_KEY_HEADER = "authKey";
|
|
4521
|
-
|
|
4522
4539
|
// src/index.ts
|
|
4523
4540
|
var BaseClient = class {
|
|
4524
4541
|
constructor(opts) {
|
|
@@ -4594,7 +4611,7 @@ var Client = class extends BaseClient {
|
|
|
4594
4611
|
address,
|
|
4595
4612
|
oracleContract,
|
|
4596
4613
|
tokenContract
|
|
4597
|
-
}) {
|
|
4614
|
+
}, { authKey }) {
|
|
4598
4615
|
const trigger = new TaskTrigger();
|
|
4599
4616
|
trigger.setTriggerType(TriggerType.EXPRESSIONTRIGGER);
|
|
4600
4617
|
trigger.setExpression(
|
|
@@ -4619,17 +4636,22 @@ var Client = class extends BaseClient {
|
|
|
4619
4636
|
execution.setCallData(callData);
|
|
4620
4637
|
action.setContractExecution(execution);
|
|
4621
4638
|
const request = new CreateTaskReq().setTrigger(trigger).setActionsList([action]).setExpiredAt(Math.floor(Date.now() / 1e3) + 1e6);
|
|
4622
|
-
const result = await this._callRPC("createTask", request);
|
|
4639
|
+
const result = await this._callRPC("createTask", request, { authKey });
|
|
4623
4640
|
return {
|
|
4624
4641
|
id: result.getId()
|
|
4625
4642
|
};
|
|
4626
4643
|
}
|
|
4627
|
-
async listTasks(address) {
|
|
4644
|
+
async listTasks(address, { authKey }) {
|
|
4628
4645
|
const request = new ListTasksReq();
|
|
4629
|
-
const result = await this._callRPC("listTasks", request);
|
|
4646
|
+
const result = await this._callRPC("listTasks", request, { authKey });
|
|
4630
4647
|
const tasks = import_lodash.default.map(
|
|
4631
4648
|
result.getTasksList(),
|
|
4632
|
-
(obj) =>
|
|
4649
|
+
(obj) => {
|
|
4650
|
+
return {
|
|
4651
|
+
id: obj.getId(),
|
|
4652
|
+
status: import_lodash.default.capitalize(obj.getStatus().toString())
|
|
4653
|
+
};
|
|
4654
|
+
}
|
|
4633
4655
|
);
|
|
4634
4656
|
return {
|
|
4635
4657
|
tasks
|
|
@@ -4637,32 +4659,40 @@ var Client = class extends BaseClient {
|
|
|
4637
4659
|
}
|
|
4638
4660
|
// TODO: specify the return type to match client’s requirements
|
|
4639
4661
|
// Right now we simply return the original object from the server
|
|
4640
|
-
async getTask(id) {
|
|
4662
|
+
async getTask(id, { authKey }) {
|
|
4641
4663
|
const request = new UUID();
|
|
4642
4664
|
request.setBytes(id);
|
|
4665
|
+
``;
|
|
4643
4666
|
const result = await this._callRPC(
|
|
4644
4667
|
"getTask",
|
|
4645
|
-
request
|
|
4668
|
+
request,
|
|
4669
|
+
{ authKey }
|
|
4646
4670
|
);
|
|
4647
|
-
return result
|
|
4671
|
+
return new task_default(result);
|
|
4648
4672
|
}
|
|
4649
|
-
async cancelTask(id) {
|
|
4673
|
+
async cancelTask(id, { authKey }) {
|
|
4650
4674
|
const request = new UUID();
|
|
4651
4675
|
request.setBytes(id);
|
|
4652
4676
|
const result = await this._callRPC(
|
|
4653
4677
|
"cancelTask",
|
|
4654
|
-
request
|
|
4678
|
+
request,
|
|
4679
|
+
{ authKey }
|
|
4655
4680
|
);
|
|
4656
|
-
return
|
|
4681
|
+
return {
|
|
4682
|
+
value: result.getValue()
|
|
4683
|
+
};
|
|
4657
4684
|
}
|
|
4658
|
-
async deleteTask(id) {
|
|
4685
|
+
async deleteTask(id, { authKey }) {
|
|
4659
4686
|
const request = new UUID();
|
|
4660
4687
|
request.setBytes(id);
|
|
4661
4688
|
const result = await this._callRPC(
|
|
4662
4689
|
"deleteTask",
|
|
4663
|
-
request
|
|
4690
|
+
request,
|
|
4691
|
+
{ authKey }
|
|
4664
4692
|
);
|
|
4665
|
-
return
|
|
4693
|
+
return {
|
|
4694
|
+
value: result.getValue()
|
|
4695
|
+
};
|
|
4666
4696
|
}
|
|
4667
4697
|
};
|
|
4668
4698
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -4493,20 +4493,37 @@ var AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
|
|
|
4493
4493
|
// src/index.ts
|
|
4494
4494
|
init_avs_pb();
|
|
4495
4495
|
|
|
4496
|
+
// src/types.ts
|
|
4497
|
+
var AUTH_KEY_HEADER = "authKey";
|
|
4498
|
+
|
|
4496
4499
|
// src/task.ts
|
|
4497
4500
|
var Task2 = class {
|
|
4498
|
-
//
|
|
4499
|
-
// error?: string;
|
|
4501
|
+
// Add other missing properties here
|
|
4500
4502
|
constructor(task) {
|
|
4501
|
-
this.id = task.getId();
|
|
4503
|
+
this.id = task.getId()?.toString() || "";
|
|
4502
4504
|
this.status = task.getStatus().toString();
|
|
4505
|
+
this.owner = task.getOwner();
|
|
4506
|
+
this.smartAccountAddress = task.getSmartAccountAddress();
|
|
4507
|
+
this.trigger = {
|
|
4508
|
+
triggerType: task.getTrigger()?.getTriggerType() || 0,
|
|
4509
|
+
schedule: task.getTrigger()?.getSchedule()?.toObject(),
|
|
4510
|
+
contractQuery: task.getTrigger()?.getContractQuery()?.toObject(),
|
|
4511
|
+
expression: task.getTrigger()?.getExpression()?.toObject() || {
|
|
4512
|
+
expression: ""
|
|
4513
|
+
}
|
|
4514
|
+
};
|
|
4515
|
+
this.nodesList = task.getNodesList();
|
|
4516
|
+
this.startAt = task.getStartAt();
|
|
4517
|
+
this.expiredAt = task.getExpiredAt();
|
|
4518
|
+
this.memo = task.getMemo();
|
|
4519
|
+
this.completedAt = task.getCompletedAt();
|
|
4520
|
+
this.status = task.getStatus();
|
|
4521
|
+
this.repeatable = task.getRepeatable();
|
|
4522
|
+
this.executionsList = task.getExecutionsList();
|
|
4503
4523
|
}
|
|
4504
4524
|
};
|
|
4505
4525
|
var task_default = Task2;
|
|
4506
4526
|
|
|
4507
|
-
// src/types.ts
|
|
4508
|
-
var AUTH_KEY_HEADER = "authKey";
|
|
4509
|
-
|
|
4510
4527
|
// src/index.ts
|
|
4511
4528
|
var BaseClient = class {
|
|
4512
4529
|
constructor(opts) {
|
|
@@ -4582,7 +4599,7 @@ var Client = class extends BaseClient {
|
|
|
4582
4599
|
address,
|
|
4583
4600
|
oracleContract,
|
|
4584
4601
|
tokenContract
|
|
4585
|
-
}) {
|
|
4602
|
+
}, { authKey }) {
|
|
4586
4603
|
const trigger = new TaskTrigger();
|
|
4587
4604
|
trigger.setTriggerType(TriggerType.EXPRESSIONTRIGGER);
|
|
4588
4605
|
trigger.setExpression(
|
|
@@ -4607,17 +4624,22 @@ var Client = class extends BaseClient {
|
|
|
4607
4624
|
execution.setCallData(callData);
|
|
4608
4625
|
action.setContractExecution(execution);
|
|
4609
4626
|
const request = new CreateTaskReq().setTrigger(trigger).setActionsList([action]).setExpiredAt(Math.floor(Date.now() / 1e3) + 1e6);
|
|
4610
|
-
const result = await this._callRPC("createTask", request);
|
|
4627
|
+
const result = await this._callRPC("createTask", request, { authKey });
|
|
4611
4628
|
return {
|
|
4612
4629
|
id: result.getId()
|
|
4613
4630
|
};
|
|
4614
4631
|
}
|
|
4615
|
-
async listTasks(address) {
|
|
4632
|
+
async listTasks(address, { authKey }) {
|
|
4616
4633
|
const request = new ListTasksReq();
|
|
4617
|
-
const result = await this._callRPC("listTasks", request);
|
|
4634
|
+
const result = await this._callRPC("listTasks", request, { authKey });
|
|
4618
4635
|
const tasks = _.map(
|
|
4619
4636
|
result.getTasksList(),
|
|
4620
|
-
(obj) =>
|
|
4637
|
+
(obj) => {
|
|
4638
|
+
return {
|
|
4639
|
+
id: obj.getId(),
|
|
4640
|
+
status: _.capitalize(obj.getStatus().toString())
|
|
4641
|
+
};
|
|
4642
|
+
}
|
|
4621
4643
|
);
|
|
4622
4644
|
return {
|
|
4623
4645
|
tasks
|
|
@@ -4625,32 +4647,40 @@ var Client = class extends BaseClient {
|
|
|
4625
4647
|
}
|
|
4626
4648
|
// TODO: specify the return type to match client’s requirements
|
|
4627
4649
|
// Right now we simply return the original object from the server
|
|
4628
|
-
async getTask(id) {
|
|
4650
|
+
async getTask(id, { authKey }) {
|
|
4629
4651
|
const request = new UUID();
|
|
4630
4652
|
request.setBytes(id);
|
|
4653
|
+
``;
|
|
4631
4654
|
const result = await this._callRPC(
|
|
4632
4655
|
"getTask",
|
|
4633
|
-
request
|
|
4656
|
+
request,
|
|
4657
|
+
{ authKey }
|
|
4634
4658
|
);
|
|
4635
|
-
return result
|
|
4659
|
+
return new task_default(result);
|
|
4636
4660
|
}
|
|
4637
|
-
async cancelTask(id) {
|
|
4661
|
+
async cancelTask(id, { authKey }) {
|
|
4638
4662
|
const request = new UUID();
|
|
4639
4663
|
request.setBytes(id);
|
|
4640
4664
|
const result = await this._callRPC(
|
|
4641
4665
|
"cancelTask",
|
|
4642
|
-
request
|
|
4666
|
+
request,
|
|
4667
|
+
{ authKey }
|
|
4643
4668
|
);
|
|
4644
|
-
return
|
|
4669
|
+
return {
|
|
4670
|
+
value: result.getValue()
|
|
4671
|
+
};
|
|
4645
4672
|
}
|
|
4646
|
-
async deleteTask(id) {
|
|
4673
|
+
async deleteTask(id, { authKey }) {
|
|
4647
4674
|
const request = new UUID();
|
|
4648
4675
|
request.setBytes(id);
|
|
4649
4676
|
const result = await this._callRPC(
|
|
4650
4677
|
"deleteTask",
|
|
4651
|
-
request
|
|
4678
|
+
request,
|
|
4679
|
+
{ authKey }
|
|
4652
4680
|
);
|
|
4653
|
-
return
|
|
4681
|
+
return {
|
|
4682
|
+
value: result.getValue()
|
|
4683
|
+
};
|
|
4654
4684
|
}
|
|
4655
4685
|
};
|
|
4656
4686
|
export {
|
package/package.json
CHANGED