forked from SoroLabs/SoroTask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-rpc.js
More file actions
26 lines (26 loc) · 809 Bytes
/
Copy pathtest-rpc.js
File metadata and controls
26 lines (26 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { rpc } = require("@stellar/stellar-sdk");
const server = new rpc.Server("https://soroban-testnet.stellar.org");
async function main() {
const EVENT_TOPICS = {
TaskRegistered: 'AAAADwAAAA5UYXNrUmVnaXN0ZXJlZAAA',
TaskPaused: 'AAAADwAAAApUYXNrUGF1c2VkAAA=',
TaskResumed: 'AAAADwAAAAtUYXNrUmVzdW1lZAA=',
KeeperPaid: 'AAAADwAAAApLZWVwZXJQYWlkAAA=',
GasDeposited: 'AAAADwAAAAxHYXNEZXBvc2l0ZWQ=',
};
try {
const res = await server.getEvents({
startLedger: 1000000,
filters: [{
type: "contract",
contractIds: ["CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2MH"],
topics: [Object.values(EVENT_TOPICS), ['*']]
}],
limit: 10
});
console.log("Success", res);
} catch (e) {
console.error("Error", e);
}
}
main();