UNPKG

diamwallet-sdk-new

Version:

The DIAM Wallet Mobile SDK allows developers to seamlessly connect their dApps with both web apps (on Android mobile browsers) and mobile apps (on Android and iOS) through the DIAM Wallet App.

38 lines (35 loc) 823 B
export function encrypt(payload) { const encrypted = payload; // CryptoJS.AES.encrypt( // payload, // CryptoJS.enc.Hex.parse(AesKey), // { // mode: CryptoJS.mode.ECB, // padding: CryptoJS.pad.Pkcs7, // } // ).toString(); return encrypted; } export const getBalanceData = async (params) => { let encryptData = encrypt( JSON.stringify({ address: params.address, network: params.network, }) ); let response = await fetch( `${params.serverUrl}/api/wallet/get-wallet-balance`, { method: "POST", body: JSON.stringify({ encryptedWalletData: encryptData, }), headers: { Accept: "application/json", "Content-Type": "application/json", }, } ); const data = await response.json(); return data; };