-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcovalent.ts
49 lines (30 loc) · 1.13 KB
/
covalent.ts
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import axios from "axios";
async function transaction() {
const walletName = "eth-mainnet";
const tokenAddress = "0x190D2A4D4d24E54f103f14882c97703Ce75421Ea";
const headers = {
Authorization: "Bearer cqt_rQ9KPqtHh6HhVvMx7MWxkQ7bQMTX",
};
const page = 0;
try {
const response = await axios.get(
`https://api.covalenthq.com/v1/${walletName}/address/${tokenAddress}/transactions_v3/page/${page}/`,
{ headers: headers }
);
const data = response.data;
console.log("dataaaaaa", data);
} catch (error) {
console.error("Error:", error);
}
}
transaction();
//hash
// `https://api.covalenthq.com/v1/{walletName}/transaction_v2/{txHash}/`
// summary transaction
// `https://api.covalenthq.com/v1/${walletName}/address/${tokenAddress}/transactions_summary/`,
// Earliest transaction
// `https://api.covalenthq.com/v1/${walletName}/bulk/transactions/${tokenAddress}/`,
// Recent transaction
// `https://api.covalenthq.com/v1/${walletName}/address/${tokenAddress}/transactions_v3/`,
// page
// `https://api.covalenthq.com/v1/${walletName}/address/${tokenAddress}/transactions_v3/page/${page}/`,