Skip to content

Commit

Permalink
Create pi-nexus-api.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 27, 2024
1 parent c281c2d commit f072bbf
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions traditional-financial-systems-integration/api/pi-nexus-api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import axios from 'axios';

const piNexusApiEndpoint = 'https://api.pi-nexus.io';

export const getPiNexusAccountId = () => {
return axios.get(`${piNexusApiEndpoint}/accounts/me`);
};

export const getPiNexusAccountBalance = (accountId: string) => {
return axios.get(`${piNexusApiEndpoint}/accounts/${accountId}/balance`);
};

export const transferPiNexusFunds = (fromAccountId: string, toAccountId: string, amount: number) => {
return axios.post(`${piNexusApiEndpoint}/accounts/${fromAccountId}/transfers`, {
toAccountId,
amount,
});
};

0 comments on commit f072bbf

Please sign in to comment.