sdk-triggerx 0.1.3 → 0.1.4
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/package.json +1 -1
- package/src/client.ts +1 -1
- package/test/createJobExample.ts +17 -1
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -9,7 +9,7 @@ export class TriggerXClient {
|
|
|
9
9
|
this.apiKey = apiKey; // Initialize the apiKey
|
|
10
10
|
const baseConfig = getConfig();
|
|
11
11
|
this.client = axios.create({
|
|
12
|
-
baseURL: config?.baseURL || baseConfig.apiUrl || '
|
|
12
|
+
baseURL: config?.baseURL || baseConfig.apiUrl || 'https://data.triggerx.network', //http://localhost:9002 , https://data.triggerx.network
|
|
13
13
|
headers: { 'Authorization': `Bearer ${this.apiKey}` }, // Set the API key here
|
|
14
14
|
...config,
|
|
15
15
|
});
|
package/test/createJobExample.ts
CHANGED
|
@@ -11,7 +11,7 @@ async function main() {
|
|
|
11
11
|
const jobInput: CreateJobInput = {
|
|
12
12
|
jobType: JobType.Time,
|
|
13
13
|
argType: ArgType.Static,
|
|
14
|
-
jobTitle: 'SDK Test Time Job',
|
|
14
|
+
jobTitle: 'SDK Test Time Job for mainnet',
|
|
15
15
|
timeFrame: 36,
|
|
16
16
|
scheduleType: 'interval',
|
|
17
17
|
timeInterval: 33,
|
|
@@ -49,6 +49,22 @@ async function main() {
|
|
|
49
49
|
// dynamicArgumentsScriptUrl: '',
|
|
50
50
|
// };
|
|
51
51
|
|
|
52
|
+
// // Example: Event-based static job
|
|
53
|
+
// const eventJobInput: CreateJobInput = {
|
|
54
|
+
// jobType: JobType.Event,
|
|
55
|
+
// argType: ArgType.Static,
|
|
56
|
+
// jobTitle: 'SDK Test Event Job',
|
|
57
|
+
// timeFrame: 25,
|
|
58
|
+
// triggerChainId: '11155420',
|
|
59
|
+
// triggerContractAddress: '0x49a81A591afdDEF973e6e49aaEa7d76943ef234C',
|
|
60
|
+
// triggerEvent: 'CounterIncremented(uint256,uint256,uint256)',
|
|
61
|
+
// timezone: 'Asia/Calcutta',
|
|
62
|
+
// chainId: '11155420',
|
|
63
|
+
// targetContractAddress: '0x49a81A591afdDEF973e6e49aaEa7d76943ef234C',
|
|
64
|
+
// targetFunction: 'incrementBy',
|
|
65
|
+
// abi: '[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previousValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"incrementAmount","type":"uint256"}],"name":"CounterIncremented","type":"event"},{"inputs":[],"name":"getCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"increment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"incrementBy","outputs":[],"stateMutability":"nonpayable","type":"function"}]',
|
|
66
|
+
// };
|
|
67
|
+
|
|
52
68
|
// To test, you can call createJob with this input as well:
|
|
53
69
|
// const conditionResult = await createJob(client, {
|
|
54
70
|
// jobInput: conditionJobInput,
|