/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { BnbAccount } from '../models/BnbAccount'; import type { BnbBlock } from '../models/BnbBlock'; import type { BnbTx } from '../models/BnbTx'; import type { BnbTxInAccount } from '../models/BnbTxInAccount'; import type { BnbWallet } from '../models/BnbWallet'; import type { Broadcast } from '../models/Broadcast'; import type { TransactionHash } from '../models/TransactionHash'; import type { TransferBnbBlockchain } from '../models/TransferBnbBlockchain'; import type { TransferBnbBlockchainKMS } from '../models/TransferBnbBlockchainKMS'; import type { CancelablePromise } from '../core/CancelablePromise'; import { request as __request } from '../core/request'; export class BnbBeaconChainService { /** * Generate Binance wallet *

5 credits per API call.


*

Generate BNB account. Tatum does not support HD wallet for BNB, only specific address and private key can be generated.

* * @returns BnbWallet OK * @throws ApiError */ public static bnbGenerateWallet(): CancelablePromise { return __request({ method: 'GET', path: `/v3/bnb/account`, errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Get Binance current block *

5 credits per API call.


Get Binance current block number.

* @returns number OK * @throws ApiError */ public static bnbGetCurrentBlock(): CancelablePromise { return __request({ method: 'GET', path: `/v3/bnb/block/current`, errors: { 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Get Binance Transactions in Block *

5 credits per API call.


Get Transactions in block by block height.

* @param height Block height * @returns BnbBlock OK * @throws ApiError */ public static bnbGetBlock( height: number, ): CancelablePromise { return __request({ method: 'GET', path: `/v3/bnb/block/${height}`, errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Get Binance Account *

5 credits per API call.


Get Binance Account Detail by address.

* @param address Account address you want to get balance of * @returns BnbAccount OK * @throws ApiError */ public static bnbGetAccount( address: string, ): CancelablePromise { return __request({ method: 'GET', path: `/v3/bnb/account/${address}`, errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Get Binance Transaction *

5 credits per API call.


Get Binance Transaction by transaction hash.

* @param hash Transaction hash * @returns BnbTx OK * @throws ApiError */ public static bnbGetTransaction( hash: string, ): CancelablePromise { return __request({ method: 'GET', path: `/v3/bnb/transaction/${hash}`, errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Get Binance Transactions By Address *

5 credits per API call.


Get Binance Transactions by address.

* @param address Account address * @param startTime Start time in milliseconds * @param endTime End time in milliseconds * @param limit Items per page. * @param offset Pagination offset * @param asset Asset name * @param addressType Address type * @returns BnbTxInAccount OK * @throws ApiError */ public static bnbGetTxByAccount( address: string, startTime: number, endTime: number, limit?: number, offset?: number, asset?: string, addressType?: 'FROM' | 'TO', ): CancelablePromise { return __request({ method: 'GET', path: `/v3/bnb/account/transaction/${address}`, query: { 'startTime': startTime, 'endTime': endTime, 'limit': limit, 'offset': offset, 'asset': asset, 'addressType': addressType, }, errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Send Binance / Binance Token from account to account *

10 credits per API call.


*

Send Binance or Binance Token token from account to account.

* This operation needs the private key of the blockchain address. Every time the funds are transferred, the transaction must be signed with the corresponding private key. * No one should ever send it's own private keys to the internet because there is a strong possibility of stealing keys and loss of funds. In this method, it is possible to enter privateKey. * PrivateKey should be used only for quick development on testnet versions of blockchain when there is no risk of losing funds. In production, * Tatum KMS should be used for the highest security standards, and signatureId should be present in the request. * Alternatively, using the Tatum client library for supported languages. *

* * @param requestBody * @returns TransactionHash OK * @throws ApiError */ public static bnbBlockchainTransfer( requestBody: (TransferBnbBlockchain | TransferBnbBlockchainKMS), ): CancelablePromise { return __request({ method: 'POST', path: `/v3/bnb/transaction`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Broadcast signed BNB transaction *

5 credits per API call.


*

Broadcast signed transaction to Binance blockchain. This method is used internally or Tatum client libraries. * It is possible to create custom signing mechanism and use this method only for broadcasting data to the blockchain.

* * @param requestBody * @returns TransactionHash OK * @throws ApiError */ public static bnbBroadcast( requestBody: Broadcast, ): CancelablePromise { return __request({ method: 'POST', path: `/v3/bnb/broadcast`, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.`, 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`, 403: `Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } }