scorechain-sdk
Version:
SDK for the Scorechain API
93 lines • 6.55 kB
TypeScript
import { Transaction } from "../types/transaction";
import { ScoringAnalysis, ScoringAnalysisType, ScoringObjectType } from "../types/scoringAnalysis";
import { FeedWithdrawal } from "../types/feedWithdrawal";
import { Address } from "../types/address";
import { BlockchainEnum } from "../types/common";
export declare class ScorechainConnector {
private readonly _apiUrl;
private readonly _header;
private readonly shouldVerifyAuthenticity;
constructor(apiKey: string, shouldVerifyAuthenticity?: boolean);
/**
* Retrieve and update local non deprecated public key
* @returns A promise that resolves to the retrieved public keys.
*/
updateScorechainPublicKey(): Promise<void>;
/**
* Retrieve a transaction by its hash from the specified blockchain.
* @param transactionHash - The hash of the transaction to retrieve.
* @param blockchain - The blockchain from which to retrieve the transaction.
* @returns A promise that resolves to the retrieved transaction.
*/
getTransaction(transactionHash: string, blockchain: BlockchainEnum): Promise<Transaction>;
/**
* Retrieve information about a specific address from the blockchain.
* @param address - The address to retrieve information for.
* @param blockchain - The blockchain to query.
* @returns A Promise that resolves to an Address object containing information about the address.
*/
getAddress(address: string, blockchain: BlockchainEnum): Promise<Address>;
private _scoringAnalysis;
/**
* Get a real-time scoring analysis for a transaction.
* @param transactionHash - The hash of the transaction.
* @param blockchain - The blockchain on which the transaction occurred.
* @param coin - The coin associated with the transaction.
* - ALL: get a global analysis (this is limited to addresses of less than 10K transactions and will return a 422 error otherwise).
* - MAIN: get an analysis on the main coin of the specified blockchain
* - [coinChainId]: get an analysis for a specific coin by providing the hash of the token contract.
* @param direction - The direction of the scoring analysis.
* @param depth - The depth of the scoring analysis (optional). For UTXO-based blockchains, default and maximum is enforced at 100. For account-based blockchains, default and maximum is enforced at 6.
* @returns A promise that resolves to the scoring analysis.
*/
getTransactionScoringAnalysis(transactionHash: string, blockchain: BlockchainEnum, coin: "MAIN" | "ALL" | string, direction: ScoringAnalysisType, depth?: number): Promise<ScoringAnalysis>;
/**
* Get a real-time scoring analysis for a specific address.
* @param addressHash - The hash of the address to retrieve scoring analysis for.
* @param blockchain - The blockchain to query for scoring analysis.
* @param coin - The coin associated with the address.
* - ALL: get a global analysis (this is limited to addresses of less than 10K transactions and will return a 422 error otherwise).
* - MAIN: get an analysis on the main coin of the specified blockchain
* - [coinChainId]: get an analysis for a specific coin by providing the hash of the token contract.
* @param direction - The direction of the scoring analysis.
* @param depth - The depth of the scoring analysis (optional). For UTXO-based blockchains, default and maximum is enforced at 100. For account-based blockchains, default and maximum is enforced at 6.
* @returns A promise that resolves to the scoring analysis for the address.
*/
getAddressScoringAnalysis(addressHash: string, blockchain: BlockchainEnum, coin: "MAIN" | "ALL" | string, direction: ScoringAnalysisType, depth?: number): Promise<ScoringAnalysis>;
/**
* Get a real-time scoring analysis for a wallet.
* @param addressHash - The hash of the wallet address.
* @param blockchain - The blockchain to retrieve the scoring analysis from.
* @param coin - The coin type for the wallet.
* - ALL: get a global analysis (this is limited to addresses of less than 10K transactions and will return a 422 error otherwise).
* - MAIN: get an analysis on the main coin of the specified blockchain
* - [coinChainId]: get an analysis for a specific coin by providing the hash of the token contract.
* @param direction - The direction of the scoring analysis.
* @param depth - The depth of the scoring analysis (optional). For UTXO-based blockchains, default and maximum is enforced at 100. For account-based blockchains, default and maximum is enforced at 6.
* @returns A promise that resolves to the scoring analysis for the wallet.
*/
getWalletScoringAnalysis(addressHash: string, blockchain: BlockchainEnum, coin: "MAIN" | "ALL" | string, direction: ScoringAnalysisType, depth?: number): Promise<ScoringAnalysis>;
/**
* Feed a transaction for analysis by risk scenarios.
* @param transactionHash - The hash of the transaction to be scored.
* @param blockchain - The blockchain on which the transaction occurred.
* @param direction - The direction of the transaction (incoming or outgoing).
* @param address - The address associated with the transaction.
* @param customerRefId - (Optional) Identifier used to determine if multiple transactions should be considered as referring to the same customer. If not provided, the blockchain address is considered the identifier.
* @returns A promise that resolves to void.
*/
feedTransaction(transactionHash: string, blockchain: BlockchainEnum, direction: ScoringObjectType, address: string, customerRefId?: string): Promise<void>;
/**
* Feed a not approved withdrawal for analysis by risk scenarios.
* @param address - The address to send the withdrawal to.
* @param blockchain - The blockchain to use for the withdrawal.
* @param amount - The amount to withdraw.
* @param coinChainId - hash of the token address or 'MAIN' for the base asset
* @param identifier - (Optional) A unique UUID that serves as the identifier for a specific withdrawal operation.
* @returns A promise that resolves to the result of the withdrawal feed.
*/
feedWithdrawal(address: string, blockchain: BlockchainEnum, amount: number, coinChainId: "MAIN" | string, identifier?: string): Promise<FeedWithdrawal>;
private getRequest;
private postRequest;
}
//# sourceMappingURL=scorechainConnector.d.ts.map