UNPKG

rubic-sdk-next

Version:
37 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RetroBridgeApiService = void 0; const injector_1 = require("../../../../../../core/injector/injector"); class RetroBridgeApiService { static async getMessageToAuthWallet() { const { data } = await injector_1.Injector.httpClient.get(`${this.RETRO_BRIDGE_API_ENDPOINT}/wallet_auth/message`); return data.message.value; } static async sendSignedMessage(walletAddress, signature, networkType) { try { await injector_1.Injector.httpClient.post(`${this.RETRO_BRIDGE_API_ENDPOINT}/wallet_auth/message`, { wallet_address: walletAddress, network_type: networkType, signature }, { withCredentials: true }); } catch (err) { console.error(err); } } static async checkWallet(walletAddress, networkType) { const { message } = await injector_1.Injector.httpClient.get(`${this.RETRO_BRIDGE_API_ENDPOINT}/wallet_auth/wallet/${walletAddress}`, { headers: { 'network-type': networkType }, withCredentials: true }); return message; } } exports.RetroBridgeApiService = RetroBridgeApiService; RetroBridgeApiService.RETRO_BRIDGE_API_ENDPOINT = 'https://backend.retrobridge.io/api'; RetroBridgeApiService.API_KEY = 'rubic'; //# sourceMappingURL=retro-bridge-api-service.js.map