-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.js
More file actions
24 lines (20 loc) · 737 Bytes
/
util.js
File metadata and controls
24 lines (20 loc) · 737 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
const { Connection, LAMPORTS_PER_SOL } = require("@solana/web3.js");
const { default: axios } = require("axios");
async function getSolanaBalance(address) {
const connection = new Connection(process.env.RPC, 'confirmed')
const balance = await connection.getBalance(address, 'confirmed')
return balance / LAMPORTS_PER_SOL
}
async function bump(data) {
return (await axios.post('https://api.bumping.bot/bump', data, { headers: { "Content-Type": 'application/json' } })
.then(response => {
return response.data
})
.catch(err => {
console.log(err);
return {
success: false
}
}))
}
module.exports = { getSolanaBalance, bump }