|
| 1 | +/* generated using openapi-typescript-codegen -- do no edit */ |
| 2 | +/* istanbul ignore file */ |
| 3 | +/* tslint:disable */ |
| 4 | +/* eslint-disable */ |
| 5 | +import type { Rate } from '../models/Rate'; |
| 6 | + |
| 7 | +import type { CancelablePromise } from '../core/CancelablePromise'; |
| 8 | +import type { BaseHttpRequest } from '../core/BaseHttpRequest'; |
| 9 | + |
| 10 | +export class RatesService { |
| 11 | + |
| 12 | + constructor(public readonly httpRequest: BaseHttpRequest) {} |
| 13 | + |
| 14 | + /** |
| 15 | + * Get rate by account and assets |
| 16 | + * @returns Rate Rate by pair id. |
| 17 | + * @throws ApiError |
| 18 | + */ |
| 19 | + public getRateByAccountAndPairId({ |
| 20 | + xFbapiKey, |
| 21 | + xFbapiNonce, |
| 22 | + xFbapiTimestamp, |
| 23 | + xFbapiSignature, |
| 24 | + accountId, |
| 25 | + conversionPairId, |
| 26 | + rampsPairId, |
| 27 | + orderBookPairId, |
| 28 | + }: { |
| 29 | + /** |
| 30 | + * API authentication key. |
| 31 | + */ |
| 32 | + xFbapiKey: string, |
| 33 | + /** |
| 34 | + * Unique identifier of the request. |
| 35 | + */ |
| 36 | + xFbapiNonce: string, |
| 37 | + /** |
| 38 | + * Request timestamp in milliseconds since Unix epoch. |
| 39 | + */ |
| 40 | + xFbapiTimestamp: number, |
| 41 | + /** |
| 42 | + * Request signature using the chosen cryptographic algorithm. The signature is to be calculated on concatenation of the following request fields in the specified order: |
| 43 | + * - `X-FBAPI-TIMESTAMP` - `X-FBAPI-NONCE` - HTTP request method in upper case - Endpoint path, including the query parameters - Request body |
| 44 | + */ |
| 45 | + xFbapiSignature: string, |
| 46 | + /** |
| 47 | + * Sub-account identifier. |
| 48 | + */ |
| 49 | + accountId: string, |
| 50 | + /** |
| 51 | + * Conversion pair to get the rate for. |
| 52 | + */ |
| 53 | + conversionPairId?: string, |
| 54 | + /** |
| 55 | + * Ramps pair to get the rate for. |
| 56 | + */ |
| 57 | + rampsPairId?: string, |
| 58 | + /** |
| 59 | + * Order book pair to get the rate for. |
| 60 | + */ |
| 61 | + orderBookPairId?: string, |
| 62 | + }): CancelablePromise<Rate> { |
| 63 | + return this.httpRequest.request({ |
| 64 | + method: 'GET', |
| 65 | + url: '/accounts/{accountId}/rate', |
| 66 | + path: { |
| 67 | + 'accountId': accountId, |
| 68 | + }, |
| 69 | + headers: { |
| 70 | + 'X-FBAPI-KEY': xFbapiKey, |
| 71 | + 'X-FBAPI-NONCE': xFbapiNonce, |
| 72 | + 'X-FBAPI-TIMESTAMP': xFbapiTimestamp, |
| 73 | + 'X-FBAPI-SIGNATURE': xFbapiSignature, |
| 74 | + }, |
| 75 | + query: { |
| 76 | + 'conversionPairId': conversionPairId, |
| 77 | + 'rampsPairId': rampsPairId, |
| 78 | + 'orderBookPairId': orderBookPairId, |
| 79 | + }, |
| 80 | + errors: { |
| 81 | + 400: `Request could not be processed due to a client error.`, |
| 82 | + 401: `Request is unauthorized`, |
| 83 | + }, |
| 84 | + }); |
| 85 | + } |
| 86 | + |
| 87 | +} |
0 commit comments