@tatumio/celo-connector
Version:
Celo Connector for Tatum API
105 lines (104 loc) • 4.06 kB
TypeScript
import { PinoLogger } from 'nestjs-pino';
import { BurnCeloErc20, CeloBurnErc721, CeloDeployErc721, CeloMintErc721, CeloMintMultipleErc721, CeloSmartContractMethodInvocation, CeloTransferErc721, DeployCeloErc20, MintCeloErc20, SmartContractReadMethodInvocation, TransactionHash, TransferCeloOrCeloErc20Token } from '@tatumio/tatum';
import { Block, Transaction, TransactionReceipt } from 'web3-eth';
import Web3 from 'web3';
export declare abstract class CeloService {
protected readonly logger: PinoLogger;
protected constructor(logger: PinoLogger);
protected abstract storeKMSTransaction(txData: string, currency: string, signatureId: string[], index?: number): Promise<string>;
protected abstract completeKMSTransaction(txId: string, signatureId: string): Promise<void>;
protected abstract isTestnet(): Promise<boolean>;
protected abstract getNodesUrl(testnet: boolean): Promise<string[]>;
broadcast(txData: string, signatureId?: string, withdrawalId?: string): Promise<{
txId: string;
failed?: boolean;
}>;
getCurrentBlock(testnet?: boolean): Promise<number>;
getBalance(address: string, testnet?: boolean): Promise<{
celo: string;
cUsd: string;
cEur: string;
}>;
getBlock(hash: string | number, testnet?: boolean): Promise<Block>;
getTransaction(txId: string, testnet?: boolean): Promise<Transaction & TransactionReceipt>;
transfer(body: TransferCeloOrCeloErc20Token): Promise<TransactionHash | {
signatureId: string;
}>;
transferErc20(body: TransferCeloOrCeloErc20Token): Promise<TransactionHash | {
signatureId: string;
}>;
invokeSmartContractMethod(body: CeloSmartContractMethodInvocation | SmartContractReadMethodInvocation): Promise<{
data: any;
} | {
txId: string;
failed?: boolean;
} | {
signatureId: string;
}>;
mintErc20(body: MintCeloErc20): Promise<TransactionHash | {
signatureId: string;
}>;
burnErc20(body: BurnCeloErc20): Promise<TransactionHash | {
signatureId: string;
}>;
deployErc20(body: DeployCeloErc20): Promise<TransactionHash | {
signatureId: string;
}>;
getErc20Balance(address: string, contractAddress: string): Promise<{
balance: any;
}>;
getTransactionCount(address: string, c?: Web3): Promise<number>;
getBalanceErc721(address: string, contractAddress: string): Promise<{
data: string;
}>;
getTokenErc721(address: string, index: number, contractAddress: string): Promise<{
data: string;
}>;
getMetadataErc721(token: string, contractAddress: string): Promise<{
data: string;
}>;
getOwnerErc721(token: string, contractAddress: string): Promise<{
data: string;
}>;
getTokensOfOwner(address: string, contractAddress: string): Promise<{
data: string;
}>;
transferErc721(body: CeloTransferErc721): Promise<TransactionHash | {
signatureId: string;
}>;
mintErc721(body: CeloMintErc721): Promise<TransactionHash | {
signatureId: string;
}>;
mintMultipleErc721(body: CeloMintMultipleErc721): Promise<TransactionHash | {
signatureId: string;
}>;
burnErc721(body: CeloBurnErc721): Promise<TransactionHash | {
signatureId: string;
}>;
deployErc721(body: CeloDeployErc721): Promise<TransactionHash | {
signatureId: string;
}>;
web3Method(body: any): Promise<any>;
generateAddress(xpub: string, i: number): Promise<{
address: any;
}>;
generateWallet(mnemonic?: string): Promise<{
mnemonic: string;
} | {
address: string;
privateKey: string;
} | {
privateKey: string;
address: string;
} | {
address: string;
secret: string;
} | {
address: any;
secret: any;
}>;
generateAddressPrivateKey(index: number, mnemonic: string): Promise<{
key: string;
}>;
protected getClient(testnet: boolean): Promise<Web3>;
}