/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { Account } from '../models/Account'; import type { Address } from '../models/Address'; import type { OffchainAddresses } from '../models/OffchainAddresses'; import type { CancelablePromise } from '../core/CancelablePromise'; import { request as __request } from '../core/request'; export class BlockchainAddressesService { /** * Create a deposit address for a virtual account *

2 credits per API call
* On Flow, additional 3000 credits are consumed for each created address.

*

Create a deposit address associated with a virtual account.

*

You can create multiple deposit addresses for one virtual account. When you have multiple deposit addresses created for the same virtual account, you aggregate various blockchain transactions from different addresses under a single account.
You can deposit funds from another blockchain address to a deposit address associated with the virtual account, and the funds will be credited to that virtual account.

*

Scanning for incoming deposits

*

By default, deposit addresses are scanned for incoming deposits. Deposit addresses are automatically synchronized with the associated virtual account, and you can see incoming deposits on the virtual account.
Scanning deposit addresses for incoming deposits consumes 20 credits per address per day.

*

If you want to be notified about certain events occurring on the deposit addresses, subscribe for notifications.

*

Virtual account cryptocurrency

*

Depending on the cryptocurrency of the virtual account, this API generates:

*

*

For fore information about supported blockchains and address types, see the API for creating virtual accounts.

*

Deposit addresses are generated in the natural order of the extended public key provided in the virtual account. The derivation index is the representation of that order; it starts from 0 and ends at 2^31.

*

When a new deposit address is generated, the last not used index is used to generate the address. You can skip some addresses to a different index, which means all the skipped addresses will no longer be used.

* * @param id Account ID * @param index

Derivation path index for specific address. If not present, last used index for given xpub of account + 1 is used. We recommend not to pass this value manually, since when some of the indexes are skipped, it is not possible to use them lately to generate address from it.

* @returns Address OK * @throws ApiError */ public static generateDepositAddress( id: string, index?: number, ): CancelablePromise
{ return __request({ method: 'POST', path: `/v3/offchain/account/${id}/address`, query: { 'index': index, }, 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 all deposit addresses for a virtual account *

1 credit per API call

*

Get all deposit addresses generated for a virtual account.

* * @param id The ID of the virtual account to get deposit addresses for * @returns Address OK * @throws ApiError */ public static getAllDepositAddresses( id: string, ): CancelablePromise> { return __request({ method: 'GET', path: `/v3/offchain/account/${id}/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.`, 500: `Internal server error. There was an error on the server while processing the request.`, }, }); } /** * Create multiple deposit addresses for a virtual account *

2 credits per API call + 1 credit for each created address
* On Flow, additional 3000 credits are consumed for each created address.

*

Create multiple deposit addresses associated with a virtual account.

*

When you have multiple deposit addresses created for the same virtual account, you aggregate various blockchain transactions from different addresses under a single account.
You can deposit funds from another blockchain address to a deposit address associated with the virtual account, and the funds will be credited to that virtual account.

*

Scanning for incoming deposits

*

By default, deposit addresses are scanned for incoming deposits. Deposit addresses are automatically synchronized with the associated virtual account, and you can see incoming deposits on the virtual account.
Scanning deposit addresses for incoming deposits consumes 20 credits per address per day.

*

If you want to be notified about certain events occurring on the deposit addresses, subscribe for notifications.

*

Virtual account cryptocurrency

*

Depending on the cryptocurrency of the virtual account, this API generates:

*

*

For fore information about supported blockchains and address types, see the API for creating virtual accounts.

*

Deposit addresses are generated in the natural order of the extended public key provided in the virtual account. The derivation index is the representation of that order; it starts from 0 and ends at 2^31.

*

When a new deposit address is generated, the last not used index is used to generate the address. You can skip some addresses to a different index, which means all the skipped addresses will no longer be used.

* * @param requestBody * @returns Address OK * @throws ApiError */ public static generateDepositAddressesBatch( requestBody: OffchainAddresses, ): CancelablePromise> { return __request({ method: 'POST', path: `/v3/offchain/account/address/batch`, 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.`, }, }); } /** * Check whether a blockchain address is assigned to a virtual account *

1 credit per API call

*

Check whether a blockchain address with the specified cryptocurrency is registered within Tatum and is assigned to a virtual account (that is, whether this blockchain address is a deposit address associated with the virtual account).

*

If the blockchain address is assigned to a virtual account, information about this account is returned. Otherwise, an error message is returned.

* * @param currency The cryptocurrency of the blockchain address to check * @param address The blockchain address to check * @param index In case of XLM or XRP, this is a memo or DestinationTag to search for. * @returns Account OK * @throws ApiError */ public static addressExists( currency: string, address: string, index?: number, ): CancelablePromise { return __request({ method: 'GET', path: `/v3/offchain/account/address/${address}/${currency}`, query: { 'index': index, }, 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.`, }, }); } /** * Assign a blockchain address to a virtual account *

2 credits per API call

*

Assign an existing blockchain address to a virtual account. The blockchain address becomes a deposit address associated with this account.
Use this API when the virtual account has no default extended public key (xpub) and deposit addresses are handled manually.

*

You can assign multiple blockchain addresses to one virtual account. When you have multiple blockchain addresses assigned to the same virtual account, you aggregate various blockchain transactions from different addresses under a single account.
You can deposit funds from another blockchain address to a deposit address associated with the virtual account, and the funds will be credited to that virtual account.

*

Scanning for incoming deposits

*

By default, deposit addresses are scanned for incoming deposits. Deposit addresses are automatically synchronized with the associated virtual account, and you can see incoming deposits on the virtual account.
Scanning deposit addresses for incoming deposits consumes 20 credits per address per day.

*

If you want to be notified about certain events occurring on the deposit addresses, subscribe for notifications.

* * @param id The ID of the virtual account to assign a blockchain address to * @param address The blockchain address to assign to the virtual account * @param index Destination tag or memo attribute for XRP or XLM addresses * @returns Address OK * @throws ApiError */ public static assignAddress( id: string, address: string, index?: number, ): CancelablePromise
{ return __request({ method: 'POST', path: `/v3/offchain/account/${id}/address/${address}`, query: { 'index': index, }, 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.`, }, }); } /** * Remove a deposit address from a virtual account *

1 credit per API call

*

Remove a deposit address from the virtual account.

*

The deposit address will no longer be scanned for incoming deposits. You will no longer be able to generate this address again.

* * @param id Account ID * @param address Blockchain address * @param index Destination tag or memo attribute for XRP, BNB or XLM addresses * @returns void * @throws ApiError */ public static removeAddress( id: string, address: string, index?: number, ): CancelablePromise { return __request({ method: 'DELETE', path: `/v3/offchain/account/${id}/address/${address}`, query: { 'index': index, }, 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.`, }, }); } }