Created
April 28, 2021 14:40
-
-
Save zurgl/4e52e56c762df38837467d011c2571d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require("axios"); | |
| require("dotenv").config(); | |
| const main = async () => { | |
| const addr = "12VpUFS23SePmovN9PXjXn6yRprUCXUG5YVbfYJoTY9MsDNw"; | |
| const api = axios.create({ | |
| baseURL: process.env.TX_SEARCH_URL, | |
| headers: { | |
| "Content-Type": "application/json", | |
| }, | |
| }); | |
| try { | |
| const result = await api.post("/transactions_search", { | |
| network: "polkadot", | |
| account: [addr], | |
| limit: 102, | |
| }); | |
| console.log("limit set to 102"); | |
| console.log(result.data.length); | |
| } catch (e) { | |
| console.log("Something goes wrong", e.message); | |
| } | |
| try { | |
| const result = await api.post("/transactions_search", { | |
| network: "polkadot", | |
| account: [addr], | |
| }); | |
| console.log("limit not set"); | |
| console.log(result.data.length); | |
| } catch (e) { | |
| console.log("Something goes wrong", e.message); | |
| } | |
| }; | |
| main() | |
| .catch((err) => { | |
| console.error(err); | |
| }) | |
| .finally(() => process.exit()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment