From 5b9df7ada7afe5fe0b314065c789d29695765fde Mon Sep 17 00:00:00 2001
From: Hathoriel
Date: Thu, 27 Jun 2024 13:55:34 +0200
Subject: [PATCH] ALL-4914 - Add missing Fantom models for L1
---
.../models/CallFantomSmartContractMethod.ts | 44 +++
.../CallFantomSmartContractMethodCaller.ts | 30 ++
.../CallFantomSmartContractMethodKMS.ts | 47 +++
.../CallFantomSmartContractReadMethod.ts | 19 +
.../models/Error403FantomBep20NotFound.ts | 18 +
.../models/Error403FantomBep20Set.ts | 18 +
.../models/Error403FantomBep20Unsupported.ts | 18 +
.../models/Error403FantomBroadcast.ts | 18 +
.../models/Error403FantomErc20TxSign.ts | 18 +
.../models/Error403FantomGasCalculation.ts | 18 +
.../models/Error403FantomGasPrice.ts | 18 +
.../Error403FantomMnemonicPrivateKey.ts | 18 +
.../generated/models/Error403FantomScBody.ts | 18 +
.../generated/models/Error403FantomTxBody.ts | 18 +
.../generated/models/Error403FantomTxHash.ts | 18 +
.../generated/models/Error403FantomTxSign.ts | 18 +
.../src/generated/models/FantomBalance.ts | 10 +
.../src/generated/models/FantomBlock.ts | 78 ++++
.../src/generated/models/FantomEstimateGas.ts | 22 ++
.../src/generated/models/FantomTx.ts | 103 ++++++
.../models/GeneratedAddressFantom.ts | 10 +
.../models/TransferFantomBlockchain.ts | 43 +++
.../models/TransferFantomBlockchainKMS.ts | 47 +++
.../src/generated/services/FantomService.ts | 343 ++++++++++++++++++
24 files changed, 1012 insertions(+)
create mode 100644 packages/api-client/src/generated/models/CallFantomSmartContractMethod.ts
create mode 100644 packages/api-client/src/generated/models/CallFantomSmartContractMethodCaller.ts
create mode 100644 packages/api-client/src/generated/models/CallFantomSmartContractMethodKMS.ts
create mode 100644 packages/api-client/src/generated/models/CallFantomSmartContractReadMethod.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomBep20NotFound.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomBep20Set.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomBep20Unsupported.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomBroadcast.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomErc20TxSign.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomGasCalculation.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomGasPrice.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomMnemonicPrivateKey.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomScBody.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomTxBody.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomTxHash.ts
create mode 100644 packages/api-client/src/generated/models/Error403FantomTxSign.ts
create mode 100644 packages/api-client/src/generated/models/FantomBalance.ts
create mode 100644 packages/api-client/src/generated/models/FantomBlock.ts
create mode 100644 packages/api-client/src/generated/models/FantomEstimateGas.ts
create mode 100644 packages/api-client/src/generated/models/FantomTx.ts
create mode 100644 packages/api-client/src/generated/models/GeneratedAddressFantom.ts
create mode 100644 packages/api-client/src/generated/models/TransferFantomBlockchain.ts
create mode 100644 packages/api-client/src/generated/models/TransferFantomBlockchainKMS.ts
create mode 100644 packages/api-client/src/generated/services/FantomService.ts
diff --git a/packages/api-client/src/generated/models/CallFantomSmartContractMethod.ts b/packages/api-client/src/generated/models/CallFantomSmartContractMethod.ts
new file mode 100644
index 000000000..5afcb20a6
--- /dev/null
+++ b/packages/api-client/src/generated/models/CallFantomSmartContractMethod.ts
@@ -0,0 +1,44 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type CallFantomSmartContractMethod = {
+ /**
+ * The address of the smart contract
+ */
+ contractAddress: string;
+ /**
+ * Amount of the assets to be sent.
+ */
+ amount?: string;
+ /**
+ * Name of the method to invoke on smart contract.
+ */
+ methodName: string;
+ /**
+ * ABI of the method to invoke.
+ */
+ methodABI: any;
+ params: Array;
+ /**
+ * Private key of sender address. Private key, or signature Id must be present.
+ */
+ fromPrivateKey: string;
+ /**
+ * Nonce to be set to Fantom transaction. If not present, last known nonce will be used.
+ */
+ nonce?: number;
+ /**
+ * Custom defined fee. If not present, it will be calculated automatically.
+ */
+ fee?: {
+ /**
+ * Gas limit for transaction in gas price.
+ */
+ gasLimit: string;
+ /**
+ * Gas price in Gwei.
+ */
+ gasPrice: string;
+ };
+}
diff --git a/packages/api-client/src/generated/models/CallFantomSmartContractMethodCaller.ts b/packages/api-client/src/generated/models/CallFantomSmartContractMethodCaller.ts
new file mode 100644
index 000000000..34986fa1e
--- /dev/null
+++ b/packages/api-client/src/generated/models/CallFantomSmartContractMethodCaller.ts
@@ -0,0 +1,30 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+import type { CustomFee } from './CustomFee';
+
+export type CallFantomSmartContractMethodCaller = {
+ /**
+ * The address of the account, which will be sender and fee payer of this transaction
+ */
+ caller: string;
+ /**
+ * The address of the smart contract
+ */
+ contractAddress: string;
+ /**
+ * Amount of the assets to be sent.
+ */
+ amount?: string;
+ /**
+ * Name of the method to invoke on smart contract.
+ */
+ methodName: string;
+ /**
+ * ABI of the method to invoke.
+ */
+ methodABI: any;
+ params: Array;
+ fee?: CustomFee;
+}
diff --git a/packages/api-client/src/generated/models/CallFantomSmartContractMethodKMS.ts b/packages/api-client/src/generated/models/CallFantomSmartContractMethodKMS.ts
new file mode 100644
index 000000000..343bc297b
--- /dev/null
+++ b/packages/api-client/src/generated/models/CallFantomSmartContractMethodKMS.ts
@@ -0,0 +1,47 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type CallFantomSmartContractMethodKMS = {
+ /**
+ * The address of the smart contract
+ */
+ contractAddress: string;
+ /**
+ * Name of the method to invoke on smart contract.
+ */
+ methodName: string;
+ /**
+ * ABI of the method to invoke.
+ */
+ methodABI: any;
+ /**
+ * Parameters of the method to be invoked.
+ */
+ params: Array;
+ /**
+ * If signatureId is mnemonic-based, this is the index to the specific address from that mnemonic.
+ */
+ index?: number;
+ /**
+ * Identifier of the private key associated in signing application. Private key, or signature Id must be present.
+ */
+ signatureId: string;
+ /**
+ * Nonce to be set to Fantom transaction. If not present, last known nonce will be used.
+ */
+ nonce?: number;
+ /**
+ * Custom defined fee. If not present, it will be calculated automatically.
+ */
+ fee?: {
+ /**
+ * Gas limit for transaction in gas price.
+ */
+ gasLimit: string;
+ /**
+ * Gas price in Gwei.
+ */
+ gasPrice: string;
+ };
+}
diff --git a/packages/api-client/src/generated/models/CallFantomSmartContractReadMethod.ts b/packages/api-client/src/generated/models/CallFantomSmartContractReadMethod.ts
new file mode 100644
index 000000000..b074e22ea
--- /dev/null
+++ b/packages/api-client/src/generated/models/CallFantomSmartContractReadMethod.ts
@@ -0,0 +1,19 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type CallFantomSmartContractReadMethod = {
+ /**
+ * The address of the smart contract
+ */
+ contractAddress: string;
+ /**
+ * Name of the method to invoke on smart contract.
+ */
+ methodName: string;
+ /**
+ * ABI of the method to invoke.
+ */
+ methodABI: any;
+ params: Array;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomBep20NotFound.ts b/packages/api-client/src/generated/models/Error403FantomBep20NotFound.ts
new file mode 100644
index 000000000..33f7e25d4
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomBep20NotFound.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomBep20NotFound = {
+ /**
+ * erc20.token.notFound
+ */
+ errorCode: string;
+ /**
+ * No such ERC20 currency ${name}.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomBep20Set.ts b/packages/api-client/src/generated/models/Error403FantomBep20Set.ts
new file mode 100644
index 000000000..03bf78d2b
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomBep20Set.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomBep20Set = {
+ /**
+ * erc20.address.set
+ */
+ errorCode: string;
+ /**
+ * ERC20 address was already set.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomBep20Unsupported.ts b/packages/api-client/src/generated/models/Error403FantomBep20Unsupported.ts
new file mode 100644
index 000000000..47e33dd61
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomBep20Unsupported.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomBep20Unsupported = {
+ /**
+ * fantom.bep20.unsupported
+ */
+ errorCode: string;
+ /**
+ * Unsupported FTM ERC20 blockchain.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomBroadcast.ts b/packages/api-client/src/generated/models/Error403FantomBroadcast.ts
new file mode 100644
index 000000000..039c7da5e
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomBroadcast.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomBroadcast = {
+ /**
+ * fantom.broadcast.failed
+ */
+ errorCode: string;
+ /**
+ * Unable to broadcast transaction due to ${error}.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomErc20TxSign.ts b/packages/api-client/src/generated/models/Error403FantomErc20TxSign.ts
new file mode 100644
index 000000000..95851c1f5
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomErc20TxSign.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomErc20TxSign = {
+ /**
+ * fantom.bep20.sign
+ */
+ errorCode: string;
+ /**
+ * Unable to sign transaction for contract creation. ${error}
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomGasCalculation.ts b/packages/api-client/src/generated/models/Error403FantomGasCalculation.ts
new file mode 100644
index 000000000..cb0793f71
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomGasCalculation.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomGasCalculation = {
+ /**
+ * fantom.transaction.gas
+ */
+ errorCode: string;
+ /**
+ * Unable to calculate gas limit for transaction. ${error}
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomGasPrice.ts b/packages/api-client/src/generated/models/Error403FantomGasPrice.ts
new file mode 100644
index 000000000..f6956adf4
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomGasPrice.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomGasPrice = {
+ /**
+ * gas.price.failed
+ */
+ errorCode: string;
+ /**
+ * Unable to obtain current GAS price.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomMnemonicPrivateKey.ts b/packages/api-client/src/generated/models/Error403FantomMnemonicPrivateKey.ts
new file mode 100644
index 000000000..eeb37c80a
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomMnemonicPrivateKey.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomMnemonicPrivateKey = {
+ /**
+ * private.mnemonic.missing
+ */
+ errorCode: string;
+ /**
+ * Either mnemonic and index or private key must be present.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomScBody.ts b/packages/api-client/src/generated/models/Error403FantomScBody.ts
new file mode 100644
index 000000000..482c2702e
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomScBody.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomScBody = {
+ /**
+ * fantom.sc.invalid
+ */
+ errorCode: string;
+ /**
+ * Invalid parameters for smart contract invocation.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomTxBody.ts b/packages/api-client/src/generated/models/Error403FantomTxBody.ts
new file mode 100644
index 000000000..556f1d0ff
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomTxBody.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomTxBody = {
+ /**
+ * fantom.transaction.body
+ */
+ errorCode: string;
+ /**
+ * Either currency, or tokenAddress must be defined.
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomTxHash.ts b/packages/api-client/src/generated/models/Error403FantomTxHash.ts
new file mode 100644
index 000000000..6811c633e
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomTxHash.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomTxHash = {
+ /**
+ * fantom.transaction.hash
+ */
+ errorCode: string;
+ /**
+ * Unable to calculate transaction hash. ${error}
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/Error403FantomTxSign.ts b/packages/api-client/src/generated/models/Error403FantomTxSign.ts
new file mode 100644
index 000000000..44b9ffeef
--- /dev/null
+++ b/packages/api-client/src/generated/models/Error403FantomTxSign.ts
@@ -0,0 +1,18 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type Error403FantomTxSign = {
+ /**
+ * fantom.transaction.sign
+ */
+ errorCode: string;
+ /**
+ * Unable to sign transaction. ${error}
+ */
+ message: string;
+ /**
+ * 403
+ */
+ statusCode: number;
+}
diff --git a/packages/api-client/src/generated/models/FantomBalance.ts b/packages/api-client/src/generated/models/FantomBalance.ts
new file mode 100644
index 000000000..d2694c8bf
--- /dev/null
+++ b/packages/api-client/src/generated/models/FantomBalance.ts
@@ -0,0 +1,10 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type FantomBalance = {
+ /**
+ * Balance in FTM
+ */
+ balance?: string;
+}
diff --git a/packages/api-client/src/generated/models/FantomBlock.ts b/packages/api-client/src/generated/models/FantomBlock.ts
new file mode 100644
index 000000000..d6966aa1c
--- /dev/null
+++ b/packages/api-client/src/generated/models/FantomBlock.ts
@@ -0,0 +1,78 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+import type { FantomTx } from './FantomTx';
+
+export type FantomBlock = {
+ /**
+ * Difficulty for this block.
+ */
+ difficulty?: string;
+ /**
+ * The 'extra data' field of this block.
+ */
+ extraData?: string;
+ /**
+ * The maximum gas allowed in this block.
+ */
+ gasLimit?: number;
+ /**
+ * The total used gas by all transactions in this block.
+ */
+ gasUsed?: number;
+ /**
+ * Hash of the block. 'null' when its pending block.
+ */
+ hash?: string;
+ /**
+ * The bloom filter for the logs of the block. 'null' when its pending block.
+ */
+ logsBloom?: string;
+ /**
+ * The address of the beneficiary to whom the mining rewards were given.
+ */
+ miner?: string;
+ mixHash?: string;
+ /**
+ * Hash of the generated proof-of-work. 'null' when its pending block.
+ */
+ nonce?: string;
+ /**
+ * The block number. 'null' when its pending block.
+ */
+ number?: number;
+ /**
+ * Hash of the parent block.
+ */
+ parentHash?: string;
+ receiptsRoot?: string;
+ /**
+ * SHA3 of the uncles data in the block.
+ */
+ sha3Uncles?: string;
+ /**
+ * The size of this block in bytes.
+ */
+ size?: number;
+ /**
+ * The root of the final state trie of the block.
+ */
+ stateRoot?: string;
+ /**
+ * The unix timestamp for when the block was collated.
+ */
+ timestamp?: number;
+ /**
+ * Total difficulty of the chain until this block.
+ */
+ totalDifficulty?: string;
+ /**
+ * Array of transactions.
+ */
+ transactions?: Array;
+ /**
+ * The root of the transaction trie of the block.
+ */
+ transactionsRoot?: string;
+}
diff --git a/packages/api-client/src/generated/models/FantomEstimateGas.ts b/packages/api-client/src/generated/models/FantomEstimateGas.ts
new file mode 100644
index 000000000..1e3cad10c
--- /dev/null
+++ b/packages/api-client/src/generated/models/FantomEstimateGas.ts
@@ -0,0 +1,22 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type FantomEstimateGas = {
+ /**
+ * Sender address.
+ */
+ from: string;
+ /**
+ * Blockchain address to send assets
+ */
+ to: string;
+ /**
+ * Amount to be sent in Fantom.
+ */
+ amount: string;
+ /**
+ * Additional data that can be passed to a blockchain transaction as a data property; must be in the hexadecimal format
+ */
+ data?: string;
+}
diff --git a/packages/api-client/src/generated/models/FantomTx.ts b/packages/api-client/src/generated/models/FantomTx.ts
new file mode 100644
index 000000000..3938ed2c2
--- /dev/null
+++ b/packages/api-client/src/generated/models/FantomTx.ts
@@ -0,0 +1,103 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type FantomTx = {
+ /**
+ * Hash of the block where this transaction was in.
+ */
+ blockHash?: string;
+ /**
+ * TRUE if the transaction was successful, FALSE, if the EVM reverted the transaction.
+ */
+ status?: boolean;
+ /**
+ * Block number where this transaction was in.
+ */
+ blockNumber?: number;
+ /**
+ * Address of the sender.
+ */
+ from?: string;
+ /**
+ * Gas provided by the sender.
+ */
+ gas?: number;
+ /**
+ * Gas price provided by the sender in wei.
+ */
+ gasPrice?: string;
+ /**
+ * Hash of the transaction.
+ */
+ transactionHash?: string;
+ /**
+ * The data sent along with the transaction.
+ */
+ input?: string;
+ /**
+ * The number of transactions made by the sender prior to this one.
+ */
+ nonce?: number;
+ /**
+ * Address of the receiver. 'null' when its a contract creation transaction.
+ */
+ to?: string;
+ /**
+ * Integer of the transactions index position in the block.
+ */
+ transactionIndex?: number;
+ /**
+ * Value transferred in wei.
+ */
+ value?: string;
+ /**
+ * The amount of gas used by this specific transaction alone.
+ */
+ gasUsed?: number;
+ /**
+ * The total amount of gas used when this transaction was executed in the block.
+ */
+ cumulativeGasUsed?: number;
+ /**
+ * The contract address created, if the transaction was a contract creation, otherwise null.
+ */
+ contractAddress?: string;
+ /**
+ * Log events, that happened in this transaction.
+ */
+ logs?: Array<{
+ /**
+ * From which this event originated from.
+ */
+ address?: string;
+ /**
+ * An array with max 4 32 Byte topics, topic 1-3 contains indexed parameters of the log.
+ */
+ topics?: Array;
+ /**
+ * The data containing non-indexed log parameter.
+ */
+ data?: string;
+ /**
+ * Integer of the event index position in the block.
+ */
+ logIndex?: number;
+ /**
+ * Block number where this transaction was in.
+ */
+ blockNumber?: number;
+ /**
+ * Hash of the block.
+ */
+ blockHash?: string;
+ /**
+ * Integer of the transaction’s index position, the event was created in.
+ */
+ transactionIndex?: number;
+ /**
+ * Hash of the transaction this event was created in.
+ */
+ transactionHash?: string;
+ }>;
+}
diff --git a/packages/api-client/src/generated/models/GeneratedAddressFantom.ts b/packages/api-client/src/generated/models/GeneratedAddressFantom.ts
new file mode 100644
index 000000000..bb3531682
--- /dev/null
+++ b/packages/api-client/src/generated/models/GeneratedAddressFantom.ts
@@ -0,0 +1,10 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type GeneratedAddressFantom = {
+ /**
+ * Fantom address
+ */
+ address?: string;
+}
diff --git a/packages/api-client/src/generated/models/TransferFantomBlockchain.ts b/packages/api-client/src/generated/models/TransferFantomBlockchain.ts
new file mode 100644
index 000000000..8bf095ce1
--- /dev/null
+++ b/packages/api-client/src/generated/models/TransferFantomBlockchain.ts
@@ -0,0 +1,43 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type TransferFantomBlockchain = {
+ /**
+ * Additional data that can be passed to a blockchain transaction as a data property; must be in the hexadecimal format
+ */
+ data?: string;
+ /**
+ * Nonce to be set to Fantom transaction. If not present, last known nonce will be used.
+ */
+ nonce?: number;
+ /**
+ * Blockchain address to send assets
+ */
+ to: string;
+ /**
+ * Currency to transfer from Fantom Blockchain Account.
+ */
+ currency: 'FTM';
+ /**
+ * Custom defined fee. If not present, it will be calculated automatically.
+ */
+ fee?: {
+ /**
+ * Gas limit for transaction in gas price.
+ */
+ gasLimit: string;
+ /**
+ * Gas price in Gwei.
+ */
+ gasPrice: string;
+ };
+ /**
+ * Amount to be sent.
+ */
+ amount: string;
+ /**
+ * Private key of sender address. Private key, or signature Id must be present.
+ */
+ fromPrivateKey: string;
+}
diff --git a/packages/api-client/src/generated/models/TransferFantomBlockchainKMS.ts b/packages/api-client/src/generated/models/TransferFantomBlockchainKMS.ts
new file mode 100644
index 000000000..6a62d6378
--- /dev/null
+++ b/packages/api-client/src/generated/models/TransferFantomBlockchainKMS.ts
@@ -0,0 +1,47 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+
+export type TransferFantomBlockchainKMS = {
+ /**
+ * Additional data that can be passed to a blockchain transaction as a data property; must be in the hexadecimal format
+ */
+ data?: string;
+ /**
+ * Nonce to be set to Fantom transaction. If not present, last known nonce will be used.
+ */
+ nonce?: number;
+ /**
+ * Blockchain address to send assets
+ */
+ to: string;
+ /**
+ * Currency to transfer from Fantom Blockchain Account.
+ */
+ currency: 'FTM';
+ /**
+ * Custom defined fee. If not present, it will be calculated automatically.
+ */
+ fee?: {
+ /**
+ * Gas limit for transaction in gas price.
+ */
+ gasLimit: string;
+ /**
+ * Gas price in Gwei.
+ */
+ gasPrice: string;
+ };
+ /**
+ * Amount to be sent.
+ */
+ amount: string;
+ /**
+ * If signatureId is mnemonic-based, this is the index to the specific address from that mnemonic.
+ */
+ index?: number;
+ /**
+ * Identifier of the private key associated in signing application. Private key, or signature Id must be present.
+ */
+ signatureId: string;
+}
diff --git a/packages/api-client/src/generated/services/FantomService.ts b/packages/api-client/src/generated/services/FantomService.ts
new file mode 100644
index 000000000..30992ec28
--- /dev/null
+++ b/packages/api-client/src/generated/services/FantomService.ts
@@ -0,0 +1,343 @@
+/* istanbul ignore file */
+/* tslint:disable */
+/* eslint-disable */
+import type { BroadcastKMS } from '../models/BroadcastKMS';
+import type { CallFantomSmartContractMethodCaller } from '../models/CallFantomSmartContractMethodCaller';
+import type { CallReadSmartContractMethod } from '../models/CallReadSmartContractMethod';
+import type { CallSmartContractMethod } from '../models/CallSmartContractMethod';
+import type { CallSmartContractMethodKMS } from '../models/CallSmartContractMethodKMS';
+import type { Data } from '../models/Data';
+import type { FantomBalance } from '../models/FantomBalance';
+import type { FantomBlock } from '../models/FantomBlock';
+import type { FantomTx } from '../models/FantomTx';
+import type { GeneratedAddressFantom } from '../models/GeneratedAddressFantom';
+import type { PrivKey } from '../models/PrivKey';
+import type { PrivKeyRequest } from '../models/PrivKeyRequest';
+import type { SignatureId } from '../models/SignatureId';
+import type { TransactionHash } from '../models/TransactionHash';
+import type { TransferFantomBlockchain } from '../models/TransferFantomBlockchain';
+import type { TransferFantomBlockchainKMS } from '../models/TransferFantomBlockchainKMS';
+import type { Wallet } from '../models/Wallet';
+import type { CancelablePromise } from '../core/CancelablePromise';
+import { request as __request } from '../core/request';
+
+export class FantomService {
+
+ /**
+ * Generate Fantom wallet
+ * 1 credit per API call.
Tatum supports BIP44 HD wallets. Because they can generate 2^31 addresses from 1 mnemonic phrase, they are very convenient and secure. A mnemonic phrase consists of 24 special words in a defined order and can restore access to all generated addresses and private keys.
Each address is identified by 3 main values:
- Private Key - your secret value which should never be revealed
- Public Key - a public address to be published
- Derivation index - an index of generated address
Tatum follows the BIP44 specification and generates for Fantom wallets with the derivation path m/44'/60'/0'/0. More about BIP44 HD wallets can be found here - https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki.
+ * Generates a BIP44 compatible Fantom wallet.
+ *
+ * @param mnemonic Mnemonic to use for generating extended public and private keys.
+ * @returns Wallet OK
+ * @throws ApiError
+ */
+ public static fantomGenerateWallet(
+ mnemonic?: string,
+ ): CancelablePromise {
+ return __request({
+ method: 'GET',
+ path: `/v3/fantom/wallet`,
+ query: {
+ 'mnemonic': mnemonic,
+ },
+ 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 during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Generate Fantom account address from Extended public key
+ * 1 credit per API call.
+ * Generates an Fantom account deposit address from an Extended public key. The deposit address is generated for the specific index - each extended public key can generate
+ * up to 2^31 addresses starting from index 0 until 2^31 - 1.
+ *
+ * @param xpub Extended public key of wallet.
+ * @param index Derivation index of the address to be generated.
+ * @returns GeneratedAddressFantom OK
+ * @throws ApiError
+ */
+ public static fantomGenerateAddress(
+ xpub: string,
+ index: number,
+ ): CancelablePromise {
+ return __request({
+ method: 'GET',
+ path: `/v3/fantom/address/${xpub}/${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.`,
+ 500: `Internal server error. There was an error on the server during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Generate Fantom private key
+ * 1 credit per API call.
+ * Generates the private key of an address from a mnemonic for a given derivation path index. The private key is generated for the specific index - each mnemonic
+ * can generate up to 2^32 private keys starting from index 0 until 2^31 - 1.
+ *
+ * @param requestBody
+ * @returns PrivKey OK
+ * @throws ApiError
+ */
+ public static fantomGenerateAddressPrivateKey(
+ requestBody: PrivKeyRequest,
+ ): CancelablePromise {
+ return __request({
+ method: 'POST',
+ path: `/v3/fantom/wallet/priv`,
+ 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.`,
+ 500: `Internal server error. There was an error on the server during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * @deprecated
+ * Web3 HTTP driver
+ * 2 credits per API call
+ * This endpoint is deprecated. Use the HTTP-based JSON RPC driver instead.
+ * Use this endpoint URL as an http-based web3 driver to connect directly to the Fantom node provided by Tatum.
+ * To learn more about Fantom Web3, visit the Fantom developers' guide.
+ *
+ * @param xApiKey Tatum X-API-Key used for authorization.
+ * @param requestBody
+ * @returns any OK
+ * @throws ApiError
+ */
+ public static fantomWeb3Driver(
+ xApiKey: string,
+ requestBody: any,
+ ): CancelablePromise {
+ return __request({
+ method: 'POST',
+ path: `/v3/fantom/web3/${xApiKey}`,
+ 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.`,
+ 500: `Internal server error. There was an error on the server during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Get current block number
+ * 1 credit per API call.
Gets the current Fantom block number. This is the number of the latest block in the blockchain.
+ * @returns number OK
+ * @throws ApiError
+ */
+ public static fantomGetCurrentBlock(): CancelablePromise {
+ return __request({
+ method: 'GET',
+ path: `/v3/fantom/block/current`,
+ errors: {
+ 401: `Unauthorized. Not valid or inactive subscription key present in the HTTP Header.`,
+ 500: `Internal server error. There was an error on the server during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Get Fantom block by hash
+ * 1 credit per API call.
Gets an Fantom block-by-block hash or block number.
+ * @param hash Block hash or block number
+ * @returns FantomBlock OK
+ * @throws ApiError
+ */
+ public static fantomGetBlock(
+ hash: string,
+ ): CancelablePromise {
+ return __request({
+ method: 'GET',
+ path: `/v3/fantom/block/${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.`,
+ 500: `Internal server error. There was an error on the server during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Get the FTM balance of an Fantom account
+ * 1 credit per API call
+ * Get the balance of FTM of an Fantom account.
+ * To get the balance of tokens, use the APIs for getting the balance of fungible tokens (ERC-20) and NFTs (ERC-721).
+ *
+ * @param address Account address you want to get balance of
+ * @returns FantomBalance OK
+ * @throws ApiError
+ */
+ public static fantomGetBalance(
+ address: string,
+ ): CancelablePromise {
+ return __request({
+ method: 'GET',
+ path: `/v3/fantom/account/balance/${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 during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Get Fantom Transaction
+ * 1 credit per API call
+ * Get Fantom transaction by transaction hash.
+ *
+ * @param hash Transaction hash
+ * @returns FantomTx OK
+ * @throws ApiError
+ */
+ public static fantomGetTransaction(
+ hash: string,
+ ): CancelablePromise {
+ return __request({
+ method: 'GET',
+ path: `/v3/fantom/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.`,
+ 404: `Transaction not found.`,
+ 500: `Internal server error. There was an error on the server during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Get count of outgoing Fantom transactions
+ * 1 credit per API call.
+ * Get a number of outgoing Fantom transactions for the address. When a transaction is sent, there can be multiple outgoing transactions,
+ * which are not yet processed by the blockchain. To distinguish between them, there is a counter called a nonce, which represents
+ * the order of the transaction in the list of outgoing transactions.
+ *
+ * @param address address
+ * @returns number OK
+ * @throws ApiError
+ */
+ public static fantomGetTransactionCount(
+ address: string,
+ ): CancelablePromise {
+ return __request({
+ method: 'GET',
+ path: `/v3/fantom/transaction/count/${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 during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Send FTM or fungible tokens (ERC-20) from account to account
+ * 2 credits per API call
+ * Send FTM or Tatum-supported fungible tokens (ERC-20) from account to account.
+ * NOTE: Sending the fungible tokens is supported only on the mainnet.
+ * Signing a transaction
+ * When sending FTM, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.
+ * Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.
+ * For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.
+ *
+ * @param requestBody
+ * @returns any OK
+ * @throws ApiError
+ */
+ public static fantomBlockchainTransfer(
+ requestBody: (TransferFantomBlockchain | TransferFantomBlockchainKMS),
+ ): CancelablePromise<(TransactionHash | SignatureId)> {
+ return __request({
+ method: 'POST',
+ path: `/v3/fantom/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 during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Invoke a method in a smart contract on Fantom
+ * 2 credits per API call
+ * Invoke a method in an existing smart contract on Fantom.
+ * You can call a read-only or write method.
+ *
+ * - For read-only methods, the output of the invoked method is returned.
+ * - For write methods, the ID of the associated transaction is returned.
+ *
+ * Troubleshooting a failed transaction
+ * Tatum ensures that this API works against the blockchain (accesses the blockchain, finds the specified smart contract, and executes the specified ABI method with the provided parameters).
However, because this API can be run against any smart contract on the blockchain, Tatum cannot in any way guarantee that the method itself will be executed successfully.
+ * If you have issues with invoking the method, refer to the user documentation for this method, or contact the author of the smart contract.
+ * For more information about invoking methods in smart contracts, see this article on our Support Portal.
+ * Signing a transaction
+ * When invoking a method in a smart contract, you are charged a fee for the transaction, and you must sign the transaction with the private key of the blockchain address from which the fee will be deducted.
+ * If caller field is present instead of the private key, Tatum will sign the transaction with the managed private key connected to the caller address. This is applicable only for paid mainnet plans and all testnet plans. Keep in mind that the caller address must have enough access right to perform the action in the smart contract method.
+ * Providing the private key in the API is not a secure way of signing transactions, because the private key can be stolen or exposed. Your private keys should never leave your security perimeter. You should use the private keys only for testing a solution you are building on the testnet of a blockchain.
+ * For signing transactions on the mainnet, we strongly recommend that you use the Tatum Key Management System (KMS) and provide the signature ID instead of the private key in the API. Alternatively, you can use the Tatum JavaScript client.
+ *
+ * @param requestBody
+ * @returns any OK
+ * @throws ApiError
+ */
+ public static fantomBlockchainSmartContractInvocation(
+ requestBody: (CallSmartContractMethod | CallReadSmartContractMethod | CallFantomSmartContractMethodCaller | CallSmartContractMethodKMS),
+ ): CancelablePromise<(TransactionHash | SignatureId | Data)> {
+ return __request({
+ method: 'POST',
+ path: `/v3/fantom/smartcontract`,
+ 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 during the processing of the request.`,
+ },
+ });
+ }
+
+ /**
+ * Broadcast signed Fantom transaction
+ * 2 credits per API call
+ * Broadcast signed transaction to Fantom blockchain. This method is used internally from Tatum KMS 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 fantomBroadcast(
+ requestBody: BroadcastKMS,
+ ): CancelablePromise {
+ return __request({
+ method: 'POST',
+ path: `/v3/fantom/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 during the processing of the request.`,
+ },
+ });
+ }
+
+}
\ No newline at end of file