From 81e4ab0c1135fd631346e2d33adb68ce06e95259 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Tue, 27 Aug 2024 18:42:44 +0700 Subject: [PATCH] Create wallet.js --- pi-nexus-sdk/lib/utils/wallet.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pi-nexus-sdk/lib/utils/wallet.js diff --git a/pi-nexus-sdk/lib/utils/wallet.js b/pi-nexus-sdk/lib/utils/wallet.js new file mode 100644 index 000000000..a5f3e1a5e --- /dev/null +++ b/pi-nexus-sdk/lib/utils/wallet.js @@ -0,0 +1,23 @@ +import { Api } from './api'; + +class Wallet { + constructor(apiUrl, apiKey) { + this.apiUrl = apiUrl; + this.apiKey = apiKey; + this.api = new Api(apiUrl, apiKey); + } + + async getWallets() { + return this.api.get('/v1/wallets'); + } + + async getWallet(walletId) { + return this.api.get(`/v1/wallets/${walletId}`); + } + + async createWallet(walletData) { + return this.api.post('/v1/wallets', walletData); + } +} + +export default Wallet;