sdk-triggerx 0.1.4 → 0.1.6

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.
@@ -1 +0,0 @@
1
- export * from './TriggerXContract';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TriggerXContract"), exports);
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './client';
2
- export * from './config';
3
- export * from './types';
4
- export * from './api/tasks';
5
- export * from './api/jobs';
6
- export { createJobOnChain } from './contracts/JobRegistry';
7
- export * from './contracts';
8
- export * from './utils/errors';
package/dist/index.js DELETED
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.createJobOnChain = void 0;
18
- __exportStar(require("./client"), exports);
19
- __exportStar(require("./config"), exports);
20
- __exportStar(require("./types"), exports);
21
- __exportStar(require("./api/tasks"), exports);
22
- __exportStar(require("./api/jobs"), exports);
23
- var JobRegistry_1 = require("./contracts/JobRegistry");
24
- Object.defineProperty(exports, "createJobOnChain", { enumerable: true, get: function () { return JobRegistry_1.createJobOnChain; } });
25
- __exportStar(require("./contracts"), exports);
26
- __exportStar(require("./utils/errors"), exports);
@@ -1,4 +0,0 @@
1
- import { TriggerXClient } from '../client';
2
- import { Task, ApiResponse } from '../types';
3
- export declare function getTasks(client: TriggerXClient): Promise<ApiResponse<Task[]>>;
4
- export declare function createTask(client: TriggerXClient, task: Partial<Task>): Promise<ApiResponse<Task>>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTasks = getTasks;
4
- exports.createTask = createTask;
5
- async function getTasks(client) {
6
- // Placeholder implementation
7
- return client.get('/tasks');
8
- }
9
- async function createTask(client, task) {
10
- // Placeholder implementation
11
- // return client.post<ApiResponse<Task>>('/tasks', task);
12
- return { data: { id: '1', name: task.name || '', status: 'pending', createdAt: new Date().toISOString() } };
13
- }
package/dist/types.d.ts DELETED
@@ -1,134 +0,0 @@
1
- export interface Task {
2
- id: string;
3
- name: string;
4
- status: 'pending' | 'completed' | 'failed';
5
- createdAt: string;
6
- }
7
- export interface ApiResponse<T> {
8
- data: T;
9
- error?: string;
10
- }
11
- export declare enum JobType {
12
- Time = "time",
13
- Event = "event",
14
- Condition = "condition"
15
- }
16
- export declare enum ArgType {
17
- Static = "static",
18
- Dynamic = "dynamic"
19
- }
20
- export type CreateJobInput = (TimeBasedJobInput & {
21
- jobType: JobType.Time;
22
- argType: ArgType.Static | ArgType.Dynamic;
23
- }) | (EventBasedJobInput & {
24
- jobType: JobType.Event;
25
- argType: ArgType.Static | ArgType.Dynamic;
26
- }) | (ConditionBasedJobInput & {
27
- jobType: JobType.Condition;
28
- argType: ArgType.Static | ArgType.Dynamic;
29
- });
30
- export interface TimeBasedJobInput {
31
- userAddress: string;
32
- etherBalance: BigInt | number;
33
- tokenBalance: BigInt | number;
34
- jobTitle: string;
35
- timeFrame: number;
36
- scheduleType: 'cron' | 'specific' | 'interval';
37
- timeInterval?: number;
38
- cronExpression?: string;
39
- specificSchedule?: string;
40
- timezone: string;
41
- recurring?: boolean;
42
- jobCostPrediction: number;
43
- createdChainId: string;
44
- targetChainId: string;
45
- targetContractAddress: string;
46
- targetFunction: string;
47
- abi: string;
48
- isImua?: boolean;
49
- arguments?: string[];
50
- dynamicArgumentsScriptUrl?: string;
51
- }
52
- export interface EventBasedJobInput {
53
- userAddress: string;
54
- etherBalance: BigInt | number;
55
- tokenBalance: BigInt | number;
56
- jobTitle: string;
57
- timeFrame: number;
58
- triggerChainId: string;
59
- triggerContractAddress: string;
60
- triggerEvent: string;
61
- timezone: string;
62
- recurring?: boolean;
63
- jobCostPrediction: number;
64
- createdChainId: string;
65
- targetChainId: string;
66
- targetContractAddress: string;
67
- targetFunction: string;
68
- abi: string;
69
- isImua?: boolean;
70
- arguments?: string[];
71
- dynamicArgumentsScriptUrl?: string;
72
- }
73
- export interface ConditionBasedJobInput {
74
- userAddress: string;
75
- etherBalance: BigInt | number;
76
- tokenBalance: BigInt | number;
77
- jobTitle: string;
78
- timeFrame: number;
79
- conditionType: string;
80
- upperLimit: number;
81
- lowerLimit: number;
82
- valueSourceType: string;
83
- valueSourceUrl: string;
84
- timezone: string;
85
- recurring?: boolean;
86
- jobCostPrediction: number;
87
- createdChainId: string;
88
- targetChainId: string;
89
- targetContractAddress: string;
90
- targetFunction: string;
91
- abi: string;
92
- isImua?: boolean;
93
- arguments?: string[];
94
- dynamicArgumentsScriptUrl?: string;
95
- }
96
- export interface CreateJobData {
97
- job_id: string;
98
- user_address: string;
99
- ether_balance: BigInt | number;
100
- token_balance: BigInt | number;
101
- job_title: string;
102
- task_definition_id: number;
103
- custom: boolean;
104
- time_frame: number;
105
- recurring: boolean;
106
- job_cost_prediction: number;
107
- timezone: string;
108
- created_chain_id: string;
109
- schedule_type?: string;
110
- time_interval?: number;
111
- cron_expression?: string;
112
- specific_schedule?: string;
113
- trigger_chain_id?: string;
114
- trigger_contract_address?: string;
115
- trigger_event?: string;
116
- condition_type?: string;
117
- upper_limit?: number;
118
- lower_limit?: number;
119
- value_source_type?: string;
120
- value_source_url?: string;
121
- target_chain_id: string;
122
- target_contract_address: string;
123
- target_function: string;
124
- abi: string;
125
- arg_type: number;
126
- arguments?: string[];
127
- dynamic_arguments_script_url?: string;
128
- is_imua: boolean;
129
- }
130
- export interface JobResponse {
131
- success: boolean;
132
- data?: any;
133
- error?: string;
134
- }
package/dist/types.js DELETED
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ArgType = exports.JobType = void 0;
4
- // Enums for job type and argument type
5
- var JobType;
6
- (function (JobType) {
7
- JobType["Time"] = "time";
8
- JobType["Event"] = "event";
9
- JobType["Condition"] = "condition";
10
- })(JobType || (exports.JobType = JobType = {}));
11
- var ArgType;
12
- (function (ArgType) {
13
- ArgType["Static"] = "static";
14
- ArgType["Dynamic"] = "dynamic";
15
- })(ArgType || (exports.ArgType = ArgType = {}));
@@ -1,4 +0,0 @@
1
- export declare class TriggerXError extends Error {
2
- constructor(message: string);
3
- }
4
- export declare function wrapError(error: unknown): TriggerXError;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TriggerXError = void 0;
4
- exports.wrapError = wrapError;
5
- class TriggerXError extends Error {
6
- constructor(message) {
7
- super(message);
8
- this.name = 'TriggerXError';
9
- }
10
- }
11
- exports.TriggerXError = TriggerXError;
12
- function wrapError(error) {
13
- if (error instanceof Error) {
14
- return new TriggerXError(error.message);
15
- }
16
- return new TriggerXError('Unknown error');
17
- }