Skip to content

Commit

Permalink
Create piNetwork.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 7, 2024
1 parent b1f5bf2 commit 6374302
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions projects/PiWalletBot/server/api/piNetwork.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import axios from 'axios';

const piNetworkApi = axios.create({
baseURL: 'https://api.pi.network',
});

export const getPiBalance = async (address) => {
const response = await piNetworkApi.get(`/balance/${address}`);
return response.data;
};

export const sendPiTransaction = async (from, to, amount) => {
const response = await piNetworkApi.post('/transaction', {
from,
to,
amount,
});
return response.data;
};

0 comments on commit 6374302

Please sign in to comment.