/* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { Account } from '../models/Account'; import type { CreateSubscriptionBalance } from '../models/CreateSubscriptionBalance'; import type { CreateSubscriptionContractLogEvent } from '../models/CreateSubscriptionContractLogEvent'; import type { CreateSubscriptionIncoming } from '../models/CreateSubscriptionIncoming'; import type { CreateSubscriptionInterval } from '../models/CreateSubscriptionInterval'; import type { CreateSubscriptionKMSError } from '../models/CreateSubscriptionKMSError'; import type { CreateSubscriptionKMSSuccess } from '../models/CreateSubscriptionKMSSuccess'; import type { CreateSubscriptionMultiTokenTransferEvent } from '../models/CreateSubscriptionMultiTokenTransferEvent'; import type { CreateSubscriptionNftTransferEvent } from '../models/CreateSubscriptionNftTransferEvent'; import type { CreateSubscriptionNotification } from '../models/CreateSubscriptionNotification'; import type { CreateSubscriptionPartialTradeMatch } from '../models/CreateSubscriptionPartialTradeMatch'; import type { CreateSubscriptionPending } from '../models/CreateSubscriptionPending'; import type { CreateSubscriptionTradeMatch } from '../models/CreateSubscriptionTradeMatch'; import type { CreateSubscriptionTxInTheBlock } from '../models/CreateSubscriptionTxInTheBlock'; import type { EntitiesCount } from '../models/EntitiesCount'; import type { HmacWebHook } from '../models/HmacWebHook'; import type { Id } from '../models/Id'; import type { Subscription } from '../models/Subscription'; import type { Transaction } from '../models/Transaction'; import type { WebHook } from '../models/WebHook'; import type { CancelablePromise } from '../core/CancelablePromise'; import { request as __request } from '../core/request'; export class NotificationSubscriptionsService { /** * Create a subscription *
2 credits per API call + credits spent on subscriptions themselves
* Each subscription type consumes a different number of credits.
For Free plans, there is a monthly limit of sent webhooks, which is 1000.
*If the webhook is sent unsuccessfully, it will be retried. The number of retries depends on the plan.
*Create a subscription as an HTTP web hook.
*The following subscription types are available:
*| Chain | *Testnet/Mainnet | *Token assets support | *Plan limitation | *Credit consumption / day / address | *
|---|---|---|---|---|
| Solana | *Yes/Yes | *SOL, SPL and NFTs | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *50 credits / day / address | *
| Ethereum | *Yes/Yes | *ETH, Internal transfers, ERC20, ERC721, ERC1155 | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *25 credits / day / address | *
| Polygon | *Yes/Yes | *MATIC, ERC20, ERC721, ERC1155 | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *40 credits / day / address | *
| Celo | *Yes/Yes | *CELO, Internal transfers, ERC20, ERC721, ERC1155 | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *25 credits / day / address | *
| Klaytn | *Yes/Yes | *Klay, ERC20, ERC721, ERC1155 | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *25 credits / day / address | *
| Bitcoin | *Yes/Yes | *BTC | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *5 credits / day / address | *
| Litecoin | *Yes/Yes | *LTC | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *7 credits / day / address | *
| Bitcoin Cash | *Yes/Yes | *BCH, only incoming transactions | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *5 credits / day / address | *
| Dogecoin | *Yes/Yes | *DOGE, only incoming transactions | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *7 credits / day / address | *
| Tron | *Yes/Yes | *Tron, TRC10/TRC20 | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *30 credits / day / address | *
| Binance Smart Chain | *Yes/Yes | *BSC, BEP20, ERC721, ERC1155 | *Free plans - 10 addresses across all blockchains, Paid plans - unlimited addresses across all blockchains | *40 credits / day / address | *
{
* "address": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ", // the address on which the transaction occurs; for EVM-based chains, this is the recipient's address
* "txId": "2rdy3YCZHSwvpWtuDom1d4Jjy5UU9STLxF3ffXau6GToReDkfw8wEgX541fvzvh6btVC5D8iNapcKTXfPsoDBk7A", // the transaction ID
* "blockNumber": 110827114, // the block number; does not appear if the transaction is in the mempool (for EMV-based blockchains)
* "asset": "3gUeeR3BfVhukYJMwtHownRtRkGcf1bvwiV8TbKMZBVz", // the asset of the transaction: for token assets, this is the token address; for native blochckain assets, this is the name of the asset (for example, SOL)
* "amount": "1", // the amount of the asset that was credited to (+) or debited from (-) the address; for EVM-based chains, when "counterAddress" is present, the amount is always positive
* "tokenId": "1", // (ERC-721 / ERC-1155 only) the ID of the transferred token
* "type": "token", // the type of the transaction; can be either "native" or "token"
* "mempool": true, // (EMV-based blockchains only) if appears and set to "true", the transaction is in the mempool; if set to "false" or does not appear at all, the transaction has been added to a block
* "counterAddress": undefined // an optional counter party address of the transaction; for EVM-based blockchains, this is the recipient's address
* }
* 5 credits are debited for each fired web hook.| Chain | *Available chains (the "chain" parameter in the response payload) | *Credit consumption / day | *
|---|---|---|
| Ethereum | *ethereum-sepolia / ethereum-mainnet | *500,000 credits / day | *
| Polygon | *polygon-mumbai / polygon-mainnet | *500,000 credits / day | *
| Celo | *celo-testnet / celo-mainnet | *500,000 credits / day | *
| Klaytn | *klaytn-baobab / klaytn-cypress | *500,000 credits / day | *
| BNB Smart Chain | *bsc-testnet / bsc-mainnet | *500,000 credits / day | *
{
* "events": [
* {
* "timestamp": 1661961758000,
* "from": "0x0000000000000000000000000000000000000000",
* "to": "0xfa4e7035b34294407e5df1603215983d65e5a773",
* "tokenId": "14671",
* "txId": "0x916fcf878656f7a3772317697e6d2740ac8b1b7dbe6d029aa79592fd72f3fb0b",
* "contractAddress": "0x55a2430e32dcebc3649120f26f917d1f0686f74c",
* "type": "erc721",
* "amount": "1",
* "logIndex": 578,
* "metadataURI": "https://graphigo.prd.galaxy.eco/metadata/0x55a2430e32dcebc3649120f26f917d1f0686f74c/14671.json"
* }
* ],
* "blockNumber": 32522207,
* "chain": "polygon-mainnet",
* "subscriptionType": "CONTRACT_NFT_TXS_PER_BLOCK"
* }
* 1 credit is debited for each fired web hook.| Chain | *Available chains (the "chain" parameter in the response payload) | *Credit consumption / day | *
|---|---|---|
| Ethereum | *ethereum-sepolia / ethereum-mainnet | *500,000 credits / day | *
| Polygon | *polygon-mumbai / polygon-mainnet | *500,000 credits / day | *
| Celo | *celo-testnet / celo-mainnet | *500,000 credits / day | *
| Klaytn | *klaytn-baobab / klaytn-cypress | *500,000 credits / day | *
| BNB Smart Chain | *bsc-testnet / bsc-mainnet | *500,000 credits / day | *
{
* "events": [
* {
* "timestamp": 1661961758000,
* "from": "0x85bd970cf0e49acd572f9c2d608713bc55b5ee0e",
* "to": "0x9ab31230d5413e4af01af9bb697651a3c70c95c9",
* "tokenId": "1450000023306",
* "txId": "0x565b9ca6b7b5ff1b1ce0725acd785dbf5ff0930d5ff547bad044c0960291555f",
* "contractAddress": "0xdb6290f355a528a7284bdd528b05a78fb05226ca",
* "type": "erc1155",
* "amount": "1",
* "logIndex": 571,
* "metadataURI": "https://touhao.bj.bcebos.com/nft/metadata/1450000023306.json"
* }
* ],
* "blockNumber": 32522207,
* "chain": "polygon-mainnet",
* "subscriptionType": "CONTRACT_MULTITOKEN_TXS_PER_BLOCK"
* }
* 1 credit is debited for each fired web hook.| Chain | *Available chains (the "chain" parameter in the response payload) | *Credit consumption / day | *
|---|---|---|
| Ethereum | *ethereum-sepolia / ethereum-mainnet | *50,000 credits / day | *
| Polygon | *polygon-mumbai / polygon-mainnet | *50,000 credits / day | *
| Celo | *celo-testnet / celo-mainnet | *50,000 credits / day | *
| Klaytn | *klaytn-baobab / klaytn-cypress | *50,000 credits / day | *
| BNB Smart Chain | *bsc-testnet / bsc-mainnet | *50,000 credits / day | *
{
* "events": [
* {
* "txId": "0xc98307f09ed527d5cff8305e8f65226b790e3317ded10b9e58f6f07286dcf8f1",
* "logIndex": 326,
* "timestamp": 1661774265000,
* "address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
* "topic_0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
* "topic_1": "0x000000000000000000000000a91ab7d77892a559d2a95baaf1d748fc97c65d29",
* "topic_2": "0x0000000000000000000000009b08288c3be4f62bbf8d1c20ac9c5e6f9467d8b7",
* "topic_3": null,
* "data": "0x0000000000000000000000000000000000000000000000000000000002c9e3e4"
* }
* ],
* "blockNumber": 32447538,
* "chain": "polygon-mumbai",
* "subscriptionType": "CONTRACT_LOG_EVENT"
* }
* 1 credit is debited for each fired web hook.{
* "date": 1619176527481,
* "amount": "0.005",
* "currency": "BTC",
* "accountId": "6082ab462936b4478117c6a0",
* "reference: "c9875708-4ba3-41c9-a4cd-271048b41b9a", // the reference of the transaction in the virtual account
* "txId": "45af182a0ffab58e5ba32fee57b297b2260c6e23a1de5ddc76c7ee22d72dea99",
* "blockHash": "45af182a0ffab58e5ba32fee57b297b2260c6e23a1de5ddc76c7ee22d72dea99", // the hash of the block, might not be present every time
* "blockHeight": 12345,
* "from": "SENDER_ADDRESS", // might not be present every time; not present for UTXO-based blockchains
* "to": "RECIPIENT_ADDRESS_CONNECTED_TO_LEDGER_ACCOUNT", // the blockchain address of the recipient
* "index": 5 // for UTXO-based blockchains (BCH, BTC, DOGE, LTC), this is the index of the output in the transaction
* }
* 1 credit is debited for each monitored account every day.{
* "date": 1619176527481,
* "amount": "0.005",
* "currency": "BTC",
* "accountId": "6082ab462936b4478117c6a0",
* "reference: "c9875708-4ba3-41c9-a4cd-271048b41b9a", // the reference of the transaction in the virtual account
* "txId": "45af182a0ffab58e5ba32fee57b297b2260c6e23a1de5ddc76c7ee22d72dea99",
* "blockHash": "45af182a0ffab58e5ba32fee57b297b2260c6e23a1de5ddc76c7ee22d72dea99", // the hash of the block, might not be present every time; if set to "null", the transaction is in the mempool (for EMV-based blockchains)
* "blockHeight": 12345, // if set to "null", the transaction is in the mempool (for EMV-based blockchains)
* "from": "SENDER_ADDRESS", // might not be present every time; not present for UTXO-based blockchains (BCH, BTC, DOGE, LTC)
* "to": "RECIPIENT_ADDRESS_CONNECTED_TO_LEDGER_ACCOUNT", // the blockchain address of the recipient
* "index": 5 // for UTXO-based blockchains (BCH, BTC, DOGE, LTC), this is the index of the output in the transaction
* }
* 1 credit is debited for each monitored account every day.{
* "created": 1619176527481,
* "amount": "0.005",
* "price": "0.02",
* "type": "SELL",
* "pair": "VC_CHF/VC_CHF3",
* "id": "6082ab462936b4478117c6a0", // id of the trade
* "currency1AccountId": "6082ab462936b4478117c6a0",
* "currency2AccountId": "6082ab512936b4478117c6a2",
* "fee": null,
* "feeAccountId": null,
* "isMaker": true,
* "expiredWithoutMatch": false
* }
* 10 credits will be debited for every monitored customer every day.{
* "created": 1619176527481,
* "amount": "0.005",
* "orderAmount": "0.1",
* "price": "0.02",
* "type": "SELL",
* "pair": "VC_CHF/VC_CHF3",
* "id": "6082ab462936b4478117c6a0", // id of the trade
* "currency1AccountId": "6082ab462936b4478117c6a0",
* "currency2AccountId": "6082ab512936b4478117c6a2",
* "fee": null,
* "feeAccountId": null,
* "isMaker": true,
* "expiredWithoutMatch": false
* }
* 10 credits will be debited for every monitored customer every day.
* {
* "txId": "0x026f4f05b972c09279111da13dfd20d8df04eff436d7f604cd97b9ffaa690567",
* "reference": "90270634-5b07-4fad-b17b-f82899953533",
* "accountId": "6086ed0744c45b24d4fbd039",
* "currency": "BSC",
* "withdrawalId": "608fe5b73a893234ba379ab2",
* "address": "0x8ce4e40889a13971681391AAd29E88eFAF91f784",
* "amount": "0.1",
* "blockHeight": 8517664
* }
* 10 credits will be debited every day, 1 credit for every included transaction notified via web hook.{
* "signatureId": "6082ab462936b4478117c6a0",
* "error": "Error message from the KMS"
* }
* 10 credits will be debited every day.{
* "signatureId": "6082ab462936b4478117c6a0",
* "txId": "0x7bb7d3b90567e89f999f2e3d263bc3738a018dbbcfa9f5397678cf17cdf0235f"
* }
* 10 credits will be debited every day.List all active subscriptions.
* @param pageSize Max number of items per page is 50. * @param offset Offset to obtain next page of the data. * @param address Value for filtering by address * @returns Subscription OK * @throws ApiError */ public static getSubscriptions( pageSize: number, offset?: number, address?: string, ): CancelablePromiseEnable HMAC hash ID on the fired webhooks from Tatum API.
* In order to make sure that a webhook is sent by us, we have the possibility to sign it with the HMAC Sha512 Hex algorithm.
* To verify that a webhook is sent by us
*
JSON.stringify(req.body)
require('crypto').createHmac('sha512', hmacSecret).update(JSON.stringify(req.body)).digest('base64').Disable HMAC hash ID on the fired webhooks from Tatum API.
* * @returns void * @throws ApiError */ public static disableWebHookHmac(): CancelablePromiseCount of subscriptions that were found from /v3/subscription
* @param pageSize Max number of items per page is 50. * @param offset Offset to obtain next page of the data. * @param address Value for filtering by address * @returns EntitiesCount OK * @throws ApiError */ public static getSubscriptionsCount( pageSize: number, offset?: number, address?: string, ): CancelablePromiseCancel existing subscription.
* @param id Subscription ID * @returns void * @throws ApiError */ public static deleteSubscription( id: string, ): CancelablePromiseObtain report from subscription based on its type. Following reports are supported: *
List all webhooks.
* @param pageSize Max number of items per page is 50. * @param offset Offset to obtain the next page of data. * @param direction Direction of sorting * @param failed Flag indicating whether the webhook was successful or not * @returns WebHook OK * @throws ApiError */ public static getAllWebhooks( pageSize: number, offset?: number, direction?: 'asc' | 'desc', failed?: boolean, ): CancelablePromiseCount of webhooks that were found from /v3/subscription/webhook
* @param pageSize Max number of items per page is 50. * @param offset Offset to obtain the next page of data. * @param direction Direction of sorting * @param failed Flag indicating whether the webhook was successful or not * @returns EntitiesCount OK * @throws ApiError */ public static getAllWebhooksCount( pageSize: number, offset?: number, direction?: 'asc' | 'desc', failed?: boolean, ): CancelablePromise