Skip to content

Instantly share code, notes, and snippets.

@zurgl
Created April 28, 2021 14:40
Show Gist options
  • Select an option

  • Save zurgl/4e52e56c762df38837467d011c2571d4 to your computer and use it in GitHub Desktop.

Select an option

Save zurgl/4e52e56c762df38837467d011c2571d4 to your computer and use it in GitHub Desktop.
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