UNPKG

@yash101/schwab-api-client

Version:

A TypeScript client library for interacting with the Charles Schwab Brokerage APIs.

24 lines 818 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUserPreference = getUserPreference; async function getUserPreference(request, token, apiOptions) { const uri = new URL('/trader/v1/userPreference', apiOptions?.getBaseUri() || 'https://api.schwabapi.com'); try { const response = await fetch(uri, { headers: { Authorization: token.getAuthHeader(), 'Content-Type': 'application/json', Accept: 'application/json', } }); const json = await response.json(); if (!response.ok) { return json; } return json; } catch (e) { throw new Error(`Failed to get user preferences: ${e.message}`); } } //# sourceMappingURL=user.api.js.map