Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
cwi-external-services
Advanced tools
Implementations of external service APIs and standardized APIs for use within CWI
Implementations of external service APIs.
Standardized service APIs for use within CWI.
Links: API, Interfaces, Classes, Functions, Types, Variables
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface ArcMinerApi {
name: string;
url: string;
apiKey?: string;
deploymentId?: string;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface ArcMinerPostBeefDataApi {
status: number;
title: string;
extraInfo: string;
blockHash?: string;
blockHeight?: number;
competingTxs?: null;
merklePath?: string;
timestamp?: string;
txStatus?: string;
txid?: string;
type?: string;
detail?: string;
instance?: string;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface BsvExchangeRateApi {
timestamp: Date;
base: "USD";
rate: number;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface ChaintracksChainTrackerOptions {
maxRetries?: number;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface ChaintracksServiceClientOptions {
useAuthrite: boolean;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Defines standard interfaces to access functionality implemented by external transaction processing services.
export interface CwiExternalServicesApi {
getBsvExchangeRate(): Promise<number>;
getFiatExchangeRate(currency: "USD" | "GBP" | "EUR", base?: "USD" | "GBP" | "EUR"): Promise<number>;
getRawTx(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<GetRawTxResultApi>;
getTransaction(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<Transaction>;
getTransactionOutput(vout: number, txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<TransactionOutput>;
getMerkleProof(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<GetMerkleProofResultApi>;
postRawTx(rawTx: string | Buffer, chain: Chain, callback?: MapiCallbackApi): Promise<PostRawTxResultApi[]>;
postRawTxs(rawTxs: string[] | Buffer[] | number[][], chain: Chain): Promise<PostRawTxResultApi[][]>;
postBeef(beef: number[], chain: Chain): Promise<PostBeefResultApi[]>;
postBeefs(beefs: number[][], chain: Chain): Promise<PostBeefResultApi[][]>;
getUtxoStatus(output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi, useNext?: boolean): Promise<GetUtxoStatusResultApi>;
}
See also: GetMerkleProofResultApi, GetRawTxResultApi, GetUtxoStatusOutputFormatApi, GetUtxoStatusResultApi, MapiCallbackApi, PostBeefResultApi, PostRawTxResultApi
Approximate exchange rate US Dollar / BSV, USD / BSV
This is the US Dollar price of one BSV
getBsvExchangeRate(): Promise<number>
Approximate exchange rate currency per base.
getFiatExchangeRate(currency: "USD" | "GBP" | "EUR", base?: "USD" | "GBP" | "EUR"): Promise<number>
Attempts to obtain the merkle proof associated with a 32 byte transaction hash (txid).
Cycles through configured transaction processing services attempting to get a valid response.
On success: Result txid is the requested transaction hash Result proof will be the merkle proof. Result name will be the responding service's identifying name. Returns result without incrementing active service.
On failure: Result txid is the requested transaction hash Result mapi will be the first mapi response obtained (service name and response), or null Result error will be the first error thrown (service name and CwiError), or null Increments to next configured service and tries again until all services have been tried.
getMerkleProof(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<GetMerkleProofResultApi>
See also: GetMerkleProofResultApi
Argument Details
Attempts to obtain the raw transaction bytes associated with a 32 byte transaction hash (txid).
Cycles through configured transaction processing services attempting to get a valid response.
On success: Result txid is the requested transaction hash Result rawTx will be Buffer containing raw transaction bytes. Result name will be the responding service's identifying name. Returns result without incrementing active service.
On failure: Result txid is the requested transaction hash Result mapi will be the first mapi response obtained (service name and response), or null Result error will be the first error thrown (service name and CwiError), or null Increments to next configured service and tries again until all services have been tried.
getRawTx(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<GetRawTxResultApi>
See also: GetRawTxResultApi
Argument Details
Typically uses getRawTx to lookup a raw transaction to return a parsed Transaction
.
getTransaction(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<Transaction>
Argument Details
Throws
ERR_INVALID_PARAMETER if txid does not exist, or can't be found, on chain.
Typically uses getTransaction to obtain a parsed Transaction
and returns a specific TransactionOutput
.
getTransactionOutput(vout: number, txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<TransactionOutput>
Argument Details
Throws
ERR_INVALID_PARAMETER if txid does not exist, or can't be found, on chain, or if vout is invalid.
Attempts to determine the UTXO status of a transaction output.
Cycles through configured transaction processing services attempting to get a valid response.
getUtxoStatus(output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi, useNext?: boolean): Promise<GetUtxoStatusResultApi>
See also: GetUtxoStatusOutputFormatApi, GetUtxoStatusResultApi
Argument Details
outputFormat
.output
is 32 then 'hashBE`, otherwise 'script'.Attempts to post a new transaction to each configured external transaction processing service.
Asynchronously posts the transaction simultaneously to all the configured services.
postRawTx(rawTx: string | Buffer, chain: Chain, callback?: MapiCallbackApi): Promise<PostRawTxResultApi[]>
See also: MapiCallbackApi, PostRawTxResultApi
Returns
an array of PostRawTxResultApi
objects with results of posting to each service
Argument Details
Attempts to post multiple new transaction to each configured external transaction processing service.
Posting multiple transactions is recommended when chaining new transactions and for performance gains.
Asynchronously posts the transactions simultaneously to all the configured services.
postRawTxs(rawTxs: string[] | Buffer[] | number[][], chain: Chain): Promise<PostRawTxResultApi[][]>
See also: PostRawTxResultApi
Returns
an array of PostRawTxResultApi
objects with results of posting to each service
Argument Details
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface CwiExternalServicesOptions {
mainTaalApiKey?: string;
testTaalApiKey?: string;
bsvExchangeRate: BsvExchangeRateApi;
bsvUpdateMsecs: number;
fiatExchangeRates: FiatExchangeRatesApi;
fiatUpdateMsecs: number;
disableMapiCallback?: boolean;
exchangeratesapiKey?: string;
chaintracksFiatExchangeRatesUrl?: string;
}
See also: BsvExchangeRateApi, FiatExchangeRatesApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface ExchangeRatesIoApi {
success: boolean;
timestamp: number;
base: "EUR" | "USD";
date: string;
rates: Record<string, number>;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface FiatExchangeRatesApi {
timestamp: Date;
base: "USD";
rates: Record<string, number>;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface GetEnvelopeOptionsApi {
chaintracks?: ChaintracksClientApi;
maxRecursionDepth?: number;
minProofLevel?: number;
}
Use to generate test envelopes. If set to a number greater than zero, proofs will be ignored until that level. The first level is zero. userId must be undefined.
minProofLevel?: number
Links: API, Interfaces, Classes, Functions, Types, Variables
Properties on result returned from CwiExternalServicesApi
function getMerkleProof
.
export interface GetMerkleProofResultApi {
name?: string;
proof?: TscMerkleProofApi | TscMerkleProofApi[];
mapi?: {
name?: string;
resp: MapiResponseApi;
};
error?: {
name?: string;
err: CwiError;
};
}
The first exception error that occurred during processing, if any.
error?: {
name?: string;
err: CwiError;
}
The first valid mapi response received from a service, if any. Relevant when no proof was received.
mapi?: {
name?: string;
resp: MapiResponseApi;
}
The name of the service returning the proof, or undefined if no proof
name?: string
Multiple proofs may be returned when a transaction also appears in one or more orphaned blocks
proof?: TscMerkleProofApi | TscMerkleProofApi[]
Links: API, Interfaces, Classes, Functions, Types, Variables
Properties on result returned from CwiExternalServicesApi
function getRawTx
.
export interface GetRawTxResultApi {
txid: string;
name?: string;
rawTx?: Buffer;
mapi?: {
name?: string;
resp: MapiResponseApi;
};
error?: {
name?: string;
err: CwiError;
};
}
The first exception error that occurred during processing, if any.
error?: {
name?: string;
err: CwiError;
}
The first valid mapi response received from a service, if any. Relevant when no proof was received.
mapi?: {
name?: string;
resp: MapiResponseApi;
}
The name of the service returning the rawTx, or undefined if no rawTx
name?: string
Multiple proofs may be returned when a transaction also appears in one or more orphaned blocks
rawTx?: Buffer
Transaction hash or rawTx (and of initial request)
txid: string
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface GetScriptHistoryDetailsApi {
txid: string;
height?: number;
fee?: number;
}
the fee paid by the transaction referencing this output script, may be an input or output
typically valid if the transaction has not been mined.
fee?: number
the block height of the transaction referencing this output script, may be an input or output
typically valid if the transaction has been mined.
height?: number
the hash of the transaction referencing this output script, may be an input or output
txid: string
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface GetScriptHistoryResultApi {
name: string;
status: "success" | "error";
error?: CwiError;
details: GetScriptHistoryDetailsApi[];
}
See also: GetScriptHistoryDetailsApi
Additional details about occurances of this output script.
Sorted by decreasing fee, then decreasing height. i.e. most likely spending transaction first.
details: GetScriptHistoryDetailsApi[]
See also: GetScriptHistoryDetailsApi
When status is 'error', provides code and description
error?: CwiError
The name of the service to which the transaction was submitted for processing
name: string
'success' - the operation was successful, non-error results are valid. 'error' - the operation failed, error may have relevant information.
status: "success" | "error"
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface GetUtxoStatusDetailsApi {
height?: number;
txid?: string;
index?: number;
amount?: number;
}
if isUtxo, the amount of the matching unspent transaction output
typically there will be only one, but future orphans can result in multiple values
amount?: number
if isUtxo, the block height containing the matching unspent transaction output
typically there will be only one, but future orphans can result in multiple values
height?: number
if isUtxo, the output index in the transaction containing of the matching unspent transaction output
typically there will be only one, but future orphans can result in multiple values
index?: number
if isUtxo, the transaction hash (txid) of the transaction containing the matching unspent transaction output
typically there will be only one, but future orphans can result in multiple values
txid?: string
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface GetUtxoStatusResultApi {
name: string;
status: "success" | "error";
error?: CwiError;
isUtxo?: boolean;
details: GetUtxoStatusDetailsApi[];
}
See also: GetUtxoStatusDetailsApi
Additional details about occurances of this output script as a utxo.
Normally there will be one item in the array but due to the possibility of orphan races there could be more than one block in which it is a valid utxo.
details: GetUtxoStatusDetailsApi[]
See also: GetUtxoStatusDetailsApi
When status is 'error', provides code and description
error?: CwiError
true if the output is associated with at least one unspent transaction output
isUtxo?: boolean
The name of the service to which the transaction was submitted for processing
name: string
'success' - the operation was successful, non-error results are valid. 'error' - the operation failed, error may have relevant information.
status: "success" | "error"
Links: API, Interfaces, Classes, Functions, Types, Variables
An API that enables unique callback IDs to be generated for potentially multiple independent callback clients.
export interface MapiCallbackApi {
getId: () => Promise<string>;
url: string;
}
Each call to this method generates a unique callbackID string and creates a record of the circumstances under which it was generated.
getId: () => Promise<string>
The public url to which callbacks will occur.
Callback requests must include a previously getId
generated callbackID which must match
an already existing callback record.
url: string
Links: API, Interfaces, Classes, Functions, Types, Variables
As defined in https://github.com/bitcoin-sv-specs/brfc-merchantapi/blob/master/README.md
export interface MapiCallbackPayloadApi {
apiVersion: string;
timestamp: string;
blockHash: string;
blockHeight: number;
callbackTxId: string;
callbackReason: string;
callbackPayload: string;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
As defined in https://github.com/bitcoin-sv-specs/brfc-merchantapi/blob/master/README.md
export interface MapiPostTxPayloadApi {
apiVersion: string;
timestamp: string;
txid: string;
returnResult: string;
resultDescription: string;
minerId: string;
currentHighestBlockHash?: string;
currentHighestBlockHeight?: number;
txSecondMempoolExpiry?: number;
failureRetryable?: boolean;
warnings?: unknown[];
conflictedWith?: unknown[];
}
Links: API, Interfaces, Classes, Functions, Types, Variables
As defined in https://github.com/bitcoin-sv-specs/brfc-merchantapi/blob/master/README.md
export interface MapiTxStatusPayloadApi {
apiVersion: string;
timestamp: string;
txid: string;
returnResult: string;
blockHash: string;
blockHeight: number;
confirmations: number;
minerId: string;
txSecondMempoolExpiry: number;
merkleProof?: TscMerkleProofApi;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Used to parse payloads when only confirmation that a miner acknowledges a specific txid matters.
export interface MapiTxidReturnResultApi {
apiVersion?: string;
timestamp?: string;
txid: string;
returnResult: string;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Properties on array items of result returned from CwiExternalServicesApi
function postBeef
.
export interface PostBeefResultApi {
name: string;
status: "success" | "error";
error?: CwiError;
alreadyKnown?: boolean;
txid?: string;
blockHash?: string;
blockHeight?: number;
merklePath?: string;
data?: object;
}
if true, the transaction was already known to this service. Usually treat as a success.
Potentially stop posting to additional transaction processors.
alreadyKnown?: boolean
Service response object. Use service name and status to infer type of object.
data?: object
When status is 'error', provides code and description
Specific potential errors: ERR_BAD_REQUEST ERR_EXTSVS_DOUBLE_SPEND ERR_EXTSVS_ALREADY_MINED (description has error details) ERR_EXTSVS_INVALID_TRANSACTION (description has error details) ERR_EXTSVS_TXID_INVALID (service response txid doesn't match rawTx)
error?: CwiError
The name of the service to which the transaction was submitted for processing
name: string
'success' - The transaction was accepted for processing
status: "success" | "error"
Links: API, Interfaces, Classes, Functions, Types, Variables
Properties on array items of result returned from CwiExternalServicesApi
function postRawTx
.
export interface PostRawTxResultApi {
name: string;
callbackID?: string;
status: "success" | "error";
mapi?: MapiResponseApi;
payload?: MapiPostTxPayloadApi;
error?: CwiError;
alreadyKnown?: boolean;
}
See also: MapiPostTxPayloadApi
if true, the transaction was already known to this service. Usually treat as a success.
Potentially stop posting to additional transaction processors.
alreadyKnown?: boolean
callbackID associated with this request
callbackID?: string
When status is 'error', provides code and description
Specific potential errors: ERR_BAD_REQUEST ERR_EXTSVS_DOUBLE_SPEND ERR_EXTSVS_ALREADY_MINED (description has error details) ERR_EXTSVS_INVALID_TRANSACTION (description has error details) ERR_EXTSVS_TXID_INVALID (service response txid doesn't match rawTx) ERR_EXTSVS_MAPI_SIGNATURE_INVALID ERR_EXTSVS_MAPI_UNSUPPORTED_ENCODING ERR_EXTSVS_MAPI_UNSUPPORTED_MIMETYPE ERR_EXTSVS_MAPI_MISSING (description has service request error details)
error?: CwiError
Raw mapi response including stringified payload
mapi?: MapiResponseApi
The name of the service to which the transaction was submitted for processing
name: string
Parsed and signature verified mapi payload
payload?: MapiPostTxPayloadApi
See also: MapiPostTxPayloadApi
'success' - The transaction was accepted for processing
status: "success" | "error"
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface PostTransactionMapiMinerApi {
name: string;
url: string;
authType: "none" | "bearer";
authToken?: string;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export interface RawTxForPost {
txid: string;
rawTx: Buffer;
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Links: API, Interfaces, Classes, Functions, Types, Variables
export class ChaintracksChainTracker implements ChainTracker {
chaintracks: ChaintracksClientApi;
cache: Record<number, string>;
options: ChaintracksChainTrackerOptions;
constructor(chain?: Chain, chaintracks?: ChaintracksClientApi, options?: ChaintracksChainTrackerOptions)
async isValidRootForHeight(root: string, height: number): Promise<boolean>
}
See also: ChaintracksChainTrackerOptions
Links: API, Interfaces, Classes, Functions, Types, Variables
Connects to a ChaintracksService to implement ChaintracksClientApi
export class ChaintracksServiceClient implements ChaintracksClientApi {
static createChaintracksServiceClientOptions(): ChaintracksServiceClientOptions
authrite?: AuthriteClient;
options: ChaintracksServiceClientOptions;
constructor(public chain: Chain, public serviceUrl: string, options?: ChaintracksServiceClientOptions)
async isValidRootForHeight(root: string, height: number): Promise<boolean>
async subscribeHeaders(listener: HeaderListener): Promise<string>
async subscribeReorgs(listener: ReorgListener): Promise<string>
async unsubscribe(subscriptionId: string): Promise<boolean>
async getJsonOrUndefined<T>(path: string): Promise<T | undefined>
async getJson<T>(path: string): Promise<T>
async postJsonVoid<T>(path: string, params: T): Promise<void>
async addHeaderHex(header: BaseBlockHeaderHex): Promise<void>
async startListening(): Promise<void>
async listening(): Promise<void>
async getChain(): Promise<Chain>
async getInfo(wait?: number): Promise<ChaintracksInfoApi>
async isListening(): Promise<boolean>
async isSynchronized(): Promise<boolean>
async getPresentHeight(): Promise<number>
async findChainTipHeaderHex(): Promise<BlockHeaderHex>
async findChainTipHashHex(): Promise<string>
async getHeadersHex(height: number, count: number): Promise<string>
async findHeaderHexForHeight(height: number): Promise<BlockHeaderHex | undefined>
async findChainWorkHexForBlockHash(hash: string | Buffer): Promise<string | undefined>
async findHeaderHexForBlockHash(hash: Buffer | string): Promise<BlockHeaderHex | undefined>
async findHeaderHexForMerkleRoot(merkleRoot: Buffer | string, height?: number): Promise<BlockHeaderHex | undefined>
async findChainTipHeader(): Promise<BlockHeader>
async findChainTipHash(): Promise<Buffer>
async findChainWorkForBlockHash(hash: string | Buffer): Promise<Buffer | undefined>
async findHeaderForBlockHash(hash: string | Buffer): Promise<BlockHeader | undefined>
async getHeaders(height: number, count: number): Promise<Buffer>
async findHeaderForHeight(height: number): Promise<BlockHeader | undefined>
async findHeaderForMerkleRoot(root: string | Buffer, height?: number): Promise<BlockHeader | undefined>
async addHeader(header: BaseBlockHeader | BaseBlockHeaderHex): Promise<void>
}
See also: ChaintracksServiceClientOptions
Links: API, Interfaces, Classes, Functions, Types, Variables
export class CwiExternalServices implements CwiExternalServicesApi {
static createDefaultOptions(): CwiExternalServicesOptions
options: CwiExternalServicesOptions;
getMerkleProofServices: ServiceCollection<GetMerkleProofServiceApi>;
getRawTxServices: ServiceCollection<GetRawTxServiceApi>;
postRawTxServices: ServiceCollection<PostRawTxServiceApi>;
postRawTxsServices: ServiceCollection<PostRawTxsServiceApi>;
postBeefServices: ServiceCollection<PostBeefServiceApi>;
postBeefsServices: ServiceCollection<PostBeefsServiceApi>;
getUtxoStatusServices: ServiceCollection<GetUtxoStatusServiceApi>;
getScriptHistoryServices: ServiceCollection<GetScriptHistoryServiceApi>;
updateFiatExchangeRateServices: ServiceCollection<UpdateFiatExchangeRateServiceApi>;
constructor(options?: CwiExternalServicesOptions)
async getBsvExchangeRate(): Promise<number>
async getFiatExchangeRate(currency: "USD" | "GBP" | "EUR", base?: "USD" | "GBP" | "EUR"): Promise<number>
targetCurrencies = ["USD", "GBP", "EUR"];
async updateFiatExchangeRates(rates?: FiatExchangeRatesApi, updateMsecs?: number): Promise<FiatExchangeRatesApi>
get getProofsCount()
get getRawTxsCount()
get postRawTxsCount()
get postBeefServicesCount()
get postRawTxsServicesCount()
get getUtxoStatsCount()
async getUtxoStatus(output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi, useNext?: boolean): Promise<GetUtxoStatusResultApi>
async getScriptHistory(output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi, useNext?: boolean): Promise<GetScriptHistoryResultApi>
async verifyOutput(output: {
outputScript: Buffer | null;
amount: number | null;
}, chain: Chain): Promise<boolean>
async postBeef(beef: number[], chain: Chain): Promise<PostBeefResultApi[]>
async postBeefs(beefs: number[][], chain: Chain): Promise<PostBeefResultApi[][]>
async postRawTxs(rawTxs: string[] | Buffer[] | number[][], chain: Chain): Promise<PostRawTxResultApi[][]>
async postRawTx(rawTx: string | Buffer, chain: Chain, callback?: MapiCallbackApi): Promise<PostRawTxResultApi[]>
async getRawTx(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<GetRawTxResultApi>
async getTransaction(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<Transaction>
async getTransactionOutput(vout: number, txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<TransactionOutput>
async getMerkleProof(txid: string | Buffer, chain: Chain, useNext?: boolean): Promise<GetMerkleProofResultApi>
}
See also: CwiExternalServicesApi, CwiExternalServicesOptions, FiatExchangeRatesApi, GetMerkleProofResultApi, GetMerkleProofServiceApi, GetRawTxResultApi, GetRawTxServiceApi, GetScriptHistoryResultApi, GetScriptHistoryServiceApi, GetUtxoStatusOutputFormatApi, GetUtxoStatusResultApi, GetUtxoStatusServiceApi, MapiCallbackApi, PostBeefResultApi, PostBeefServiceApi, PostBeefsServiceApi, PostRawTxResultApi, PostRawTxServiceApi, PostRawTxsServiceApi, ServiceCollection, UpdateFiatExchangeRateServiceApi
Links: API, Interfaces, Classes, Functions, Types, Variables
Transaction was already mined.
export class ERR_EXTSVS_ALREADY_MINED extends CwiError {
constructor(description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Header for block hash ${hash} was not found.
export class ERR_EXTSVS_BLOCK_HASH_MISSING extends CwiError {
constructor(hash?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Header for block height ${height} was not found.
export class ERR_EXTSVS_BLOCK_HEIGHT_MISSING extends CwiError {
constructor(height?: number)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Transaction with txid of ${txid} is a double spend.
This class does not include spendingTransactions
, see ERR_DOUBLE_SPEND
if required.
export class ERR_EXTSVS_DOUBLE_SPEND extends CwiError {
constructor(public txid: string, description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Exceeded max envelope depth ${maxDepth}
export class ERR_EXTSVS_ENVELOPE_DEPTH extends CwiError {
constructor(maxDepth: number)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Expected txid ${expected} doesn't match proof txid ${actual}
export class ERR_EXTSVS_FAILURE extends CwiError {
constructor(public url: string, public cwiError?: CwiError, description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Fee error.
export class ERR_EXTSVS_FEE extends CwiError {
constructor(description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
See description.
export class ERR_EXTSVS_GENERIC extends CwiError {
constructor(description: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Transaction is invalid.
export class ERR_EXTSVS_INVALID_TRANSACTION extends CwiError {
constructor(description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Txid of broadcast transaction doesn't match returned txid.
export class ERR_EXTSVS_INVALID_TXID extends CwiError {
constructor(description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Required Mapi response is missing.
export class ERR_EXTSVS_MAPI_MISSING extends CwiError {
constructor(description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Mapi response signature is invalid.
export class ERR_EXTSVS_MAPI_SIGNATURE_INVALID extends CwiError {
constructor()
}
Links: API, Interfaces, Classes, Functions, Types, Variables
mAPI response unsupported encoding ${encoding}
export class ERR_EXTSVS_MAPI_UNSUPPORTED_ENCODING extends CwiError {
constructor(encoding?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
mAPI response unsupported mimetype ${mimeType}
export class ERR_EXTSVS_MAPI_UNSUPPORTED_MIMETYPE extends CwiError {
constructor(mimeType?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
mAPI response unsupported returnResult ${result}
export class ERR_EXTSVS_MAPI_UNSUPPORTED_RETURNRESULT extends CwiError {
constructor(result?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Unsupported merkle proof node type ${nodeType}.
export class ERR_EXTSVS_MERKLEPROOF_NODE_TYPE extends CwiError {
constructor(nodeType?: string | number)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Merkle proof parsing error.
export class ERR_EXTSVS_MERKLEPROOF_PARSING extends CwiError {
constructor()
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Unsupported merkle proof target type ${targetType}.
export class ERR_EXTSVS_MERKLEPROOF_TAGET_TYPE extends CwiError {
constructor(targetType?: string | number)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Merkle proof unsuported feature ${feature}.
export class ERR_EXTSVS_MERKLEPROOF_UNSUPPORTED extends CwiError {
constructor(feature?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Expected merkleRoot ${expected} doesn't match computed ${actual}
export class ERR_EXTSVS_MERKLEROOT_INVALID extends CwiError {
constructor(expected?: string, actual?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
MerkleRoot ${merkleRoot} was not found in active chain.
export class ERR_EXTSVS_MERKLEROOT_MISSING extends CwiError {
constructor(merkleRoot?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Security error.
export class ERR_EXTSVS_SECURITY extends CwiError {
constructor(description?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Expected txid ${expected} doesn't match proof txid ${actual}
export class ERR_EXTSVS_TXID_INVALID extends CwiError {
constructor(expected?: string, actual?: string)
}
Links: API, Interfaces, Classes, Functions, Types, Variables
export class ServiceCollection<T> {
services: {
name: string;
service: T;
}[];
_index: number;
constructor(services?: {
name: string;
service: T;
}[])
add(s: {
name: string;
service: T;
}): ServiceCollection<T>
remove(name: string): void
get name()
get service()
get allServices()
get count()
get index()
reset()
next(): number
clone(): ServiceCollection<T>
}
Links: API, Interfaces, Classes, Functions, Types, Variables
Links: API, Interfaces, Classes, Functions, Types, Variables
Verifies the payload signature on a mAPI response object
export function checkMapiResponse(response: MapiResponseApi)
Throws
ERR_EXTSVS_MAPI_SIGNATURE_INVALID if signature fails to validate.
https://github.com/bitcoin-sv-specs/brfc-misc/tree/master/jsonenvelope
Links: API, Interfaces, Classes, Functions, Types, Variables
export function checkMapiResponseForTxid(response: MapiResponseApi, txid?: string | Buffer): boolean
Links: API, Interfaces, Classes, Functions, Types, Variables
Implement merkle proof per https://tsc.bitcoinassociation.net/standards/merkle-proof-standardised-format/
We extend the current standard by implementing targetType 'height' (binary value 3). This extension avoids the need to maintain a merkleroot or block hash index for all headers, reducing the space required by 50%.
Other extensions are not currently supported.
Supports partial and full binary format as well as hex strings.
External Assumptions:
Checking the proof verifies these claims:
Implications:
export async function checkMerkleProof(txid: string | Buffer, proof: TscMerkleProofApi | Buffer, chaintracks: ChaintracksClientApi): Promise<BlockHeader>
Returns
The block header containing the verified merkleRoot
Argument Details
Links: API, Interfaces, Classes, Functions, Types, Variables
export function createMapiPostTxResponse(txid: string, key: string, resultDescription: string, returnResult = "success"): {
mapi: MapiResponseApi;
payloadData: MapiPostTxPayloadApi;
}
See also: MapiPostTxPayloadApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function deserializeTscMerkleProof(txid: string, buffer: TscMerkleProofApi | Buffer): TscMerkleProofApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function deserializeTscMerkleProofNodes(nodes: Buffer | string[]): string[]
Links: API, Interfaces, Classes, Functions, Types, Variables
A transaction envelope is a tree of inputs where all the leaves are proven transactions. The trivial case is a single leaf: the envelope for a proven transaction is the rawTx and its proof.
Each branching level of the tree corresponds to an unmined transaction without a proof, in which case the envelope is:
If storage is defined, any previously unseen txids that are required to build the envelope will be added to the proven_txs table, if they can be proven.
The options.maxRecursionDepth can be set to prevent overly deep and large envelopes. Will throw ERR_EXTSVS_ENVELOPE_DEPTH if exceeded.
export async function getEnvelopeForTransaction(services: CwiExternalServices, chain: Chain, txid: string | Buffer, options?: GetEnvelopeOptionsApi): Promise<EnvelopeApi>
See also: CwiExternalServices, GetEnvelopeOptionsApi
Argument Details
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function getExchangeRatesIo(key: string): Promise<ExchangeRatesIoApi>
See also: ExchangeRatesIoApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function getMapiCallbackPayload(txid: string | Buffer | undefined, response: MapiResponseApi): MapiCallbackPayloadApi
See also: MapiCallbackPayloadApi
Links: API, Interfaces, Classes, Functions, Types, Variables
Parses a mAPI mimetype 'application/json' response payload after verifying the envelope signature.
Throws on verification errors.
export function getMapiJsonResponsePayload<T>(response: MapiResponseApi): T
Returns
parse JSON payload object
Argument Details
Links: API, Interfaces, Classes, Functions, Types, Variables
export function getMapiPostTxPayload(response: MapiResponseApi, txid?: string | Buffer, checkFailure?: boolean): MapiPostTxPayloadApi
See also: MapiPostTxPayloadApi
Links: API, Interfaces, Classes, Functions, Types, Variables
Validates the mapi response signature and parses payload as transaction status.
Throws an error if payload txid doesn't match requested txid.
Throws an error if payload returnResult is not 'success' or 'failure'.
'failure' indicates the txid is unknown to the service.
'success' indicates the txid is known to the service and status was returned.
export function getMapiTxStatusPayload(txid: string | Buffer | undefined, response: MapiResponseApi): MapiTxStatusPayloadApi
See also: MapiTxStatusPayloadApi
Argument Details
Links: API, Interfaces, Classes, Functions, Types, Variables
GorillaPool.io has a mapi transaction status endpoint for mainNet, not for testNet, and does NOT return merkle proofs...
mapiResponse is signed and has txStatus payload. { apiVersion: "", timestamp: "2023-03-23T02:14:39.362Z", txid: "9c31ed1dea4ec1aae0475addc0a74eaed68b718d9983d42b111c387d6696a949", returnResult: "success", resultDescription: "", blockHash: "00000000000000000e155235fd83a8757c44c6299e63104fb12632368f3f0cc9", blockHeight: 700000, confirmations: 84353, minerId: "03ad780153c47df915b3d2e23af727c68facaca4facd5f155bf5018b979b9aeb83", txSecondMempoolExpiry: 0, }
export async function getMerkleProofFromGorillaPool(txid: string | Buffer): Promise<TscMerkleProofApi | undefined>
Links: API, Interfaces, Classes, Functions, Types, Variables
metastreme.com has a partially conforming merkleProof implementation.
Both mainNet and testNet are supported.
Proofs incorrectly included a copy of the computed value instead of "*" along right side of merkle tree.
targetType of hash is used which prevents automatic proof checking as the target root value isn't known without a lookup request.
export async function getMerkleProofFromMetastreme(txid: string | Buffer, chain: Chain): Promise<TscMerkleProofApi | undefined>
Links: API, Interfaces, Classes, Functions, Types, Variables
Taal.com has the most functional txStatus and merkleProof endpoint for both mainNet and testNet
Proofs use targetType "header" which is converted to "merkleRoot".
Proofs correctly use duplicate computed node value symbol "*".
An apiKey must be used and must correspond to the target chain: mainNet or testNet.
export async function getMerkleProofFromTaal(txid: string | Buffer, apiKey: string): Promise<TscMerkleProofApi | undefined>
Links: API, Interfaces, Classes, Functions, Types, Variables
WhatOnChain.com has their own "hash/pos/R/L" proof format and a more TSC compliant proof format.
The "/proof" endpoint returns an object for each node with "hash" and "pos" properties. "pos" can have values "R" or "L". Normally "pos" indicates which side of a concatenation the provided "hash" goes with one exception! EXCEPTION: When the provided should be "*" indicating edge-of-the-tree-duplicate-computed-value, they include the expected computed value and the pos value is always "L", even when it should really be "R". This only matters if you are trying to compute index from the "R" and "L" values.
export async function getMerkleProofFromWhatsOnChain(txid: string | Buffer, chain: Chain): Promise<TscMerkleProofApi | undefined>
Links: API, Interfaces, Classes, Functions, Types, Variables
WhatOnChain.com has their own "hash/pos/R/L" proof format and a more TSC compliant proof format.
The "/proof/tsc" endpoint is much closer to the TSC specification. It provides "index" directly and each node is just the provided hash value. The "targetType" is unspecified and thus defaults to block header hash, requiring a Chaintracks lookup to get the merkleRoot... Duplicate hash values are provided in full instead of being replaced by "*".
export async function getMerkleProofFromWhatsOnChainTsc(txid: string | Buffer, chain: Chain): Promise<TscMerkleProofApi | undefined>
Links: API, Interfaces, Classes, Functions, Types, Variables
GorillaPool.io MAINNET ONLY
has a mapi transaction status endpoint for mainNet, not for testNet, and does NOT return merkle proofs...
mapiResponse is signed and has txStatus payload. { apiVersion: "", timestamp: "2023-03-23T02:14:39.362Z", txid: "9c31ed1dea4ec1aae0475addc0a74eaed68b718d9983d42b111c387d6696a949", returnResult: "success", resultDescription: "", blockHash: "00000000000000000e155235fd83a8757c44c6299e63104fb12632368f3f0cc9", blockHeight: 700000, confirmations: 84353, minerId: "03ad780153c47df915b3d2e23af727c68facaca4facd5f155bf5018b979b9aeb83", txSecondMempoolExpiry: 0, }
export async function getProofFromGorillaPool(txid: string | Buffer, chain: Chain): Promise<GetMerkleProofResultApi>
See also: GetMerkleProofResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
metastreme.com has a partially conforming merkleProof implementation.
Both mainNet and testNet are supported.
Proofs incorrectly included a copy of the computed value instead of "*" along right side of merkle tree.
targetType of hash
export async function getProofFromMetastreme(txid: string | Buffer, chain: Chain): Promise<GetMerkleProofResultApi>
See also: GetMerkleProofResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
Taal.com has the most functional txStatus and merkleProof endpoint for both mainNet and testNet
Proofs use targetType "header" which is converted to "merkleRoot".
Proofs correctly use duplicate computed node value symbol "*".
An apiKey must be used and must correspond to the target chain: mainNet or testNet.
export async function getProofFromTaal(txid: string | Buffer, apiKey: string): Promise<GetMerkleProofResultApi>
See also: GetMerkleProofResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
WhatOnChain.com has their own "hash/pos/R/L" proof format and a more TSC compliant proof format.
The "/proof" endpoint returns an object for each node with "hash" and "pos" properties. "pos" can have values "R" or "L". Normally "pos" indicates which side of a concatenation the provided "hash" goes with one exception! EXCEPTION: When the provided should be "*" indicating edge-of-the-tree-duplicate-computed-value, they include the expected computed value and the pos value is always "L", even when it should really be "R". This only matters if you are trying to compute index from the "R" and "L" values.
export async function getProofFromWhatsOnChain(txid: string | Buffer, chain: Chain): Promise<GetMerkleProofResultApi>
See also: GetMerkleProofResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
WhatOnChain.com has their own "hash/pos/R/L" proof format and a more TSC compliant proof format.
The "/proof/tsc" endpoint is much closer to the TSC specification. It provides "index" directly and each node is just the provided hash value. The "targetType" is unspecified and thus defaults to block header hash, requiring a Chaintracks lookup to get the merkleRoot... Duplicate hash values are provided in full instead of being replaced by "*".
export async function getProofFromWhatsOnChainTsc(txid: string | Buffer, chain: Chain): Promise<GetMerkleProofResultApi>
See also: GetMerkleProofResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function getRawTxFromWhatsOnChain(txid: string | Buffer, chain: Chain): Promise<GetRawTxResultApi>
See also: GetRawTxResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function getScriptHistoryFromWhatsOnChain(output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi): Promise<GetScriptHistoryResultApi>
See also: GetScriptHistoryResultApi, GetUtxoStatusOutputFormatApi
Links: API, Interfaces, Classes, Functions, Types, Variables
Attempts to validate whether or not an outpoint has been spent by using the WhatsOnChain API
export async function getSpentStatusForOutpoint(outpoint: string, chain: Chain): Promise<boolean>
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function getUtxoStatusFromWhatsOnChain(output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi): Promise<GetUtxoStatusResultApi>
See also: GetUtxoStatusOutputFormatApi, GetUtxoStatusResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function makeErrorResult(error: CwiError, miner: ArcMinerApi, beef: number[], dd?: ArcMinerPostBeefDataApi): PostBeefResultApi
See also: ArcMinerApi, ArcMinerPostBeefDataApi, PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function makePostBeefResult(dd: ArcMinerPostBeefDataApi, miner: ArcMinerApi, beef: number[]): PostBeefResultApi
See also: ArcMinerApi, ArcMinerPostBeefDataApi, PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function postBeefToArcMiner(beef: number[], miner: ArcMinerApi): Promise<PostBeefResultApi>
See also: ArcMinerApi, PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function postBeefToTaalArcMiner(beef: number[], chain: Chain, miner?: ArcMinerApi): Promise<PostBeefResultApi>
See also: ArcMinerApi, PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function postBeefsToArcMiner(beefs: number[][], miner: ArcMinerApi): Promise<PostBeefResultApi[]>
See also: ArcMinerApi, PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function postBeefsToTaalArcMiner(beefs: number[][], chain: Chain, miner?: ArcMinerApi): Promise<PostBeefResultApi[]>
See also: ArcMinerApi, PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function postRawTxToGorillaPool(txid: string | Buffer, rawTx: string | Buffer, chain: Chain, callback?: MapiCallbackApi): Promise<PostRawTxResultApi>
See also: MapiCallbackApi, PostRawTxResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function postRawTxToMapiMiner(txid: string | Buffer, rawTx: string | Buffer, miner: PostTransactionMapiMinerApi, callback?: MapiCallbackApi): Promise<PostRawTxResultApi>
See also: MapiCallbackApi, PostRawTxResultApi, PostTransactionMapiMinerApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function postRawTxToTaal(txid: string | Buffer, rawTx: string | Buffer, chain: Chain, callback?: MapiCallbackApi, apiKey?: string): Promise<PostRawTxResultApi>
See also: MapiCallbackApi, PostRawTxResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function postRawTxToWhatsOnChain(txid: string | Buffer | undefined, rawTx: string | Buffer, chain: Chain, callback?: MapiCallbackApi): Promise<PostRawTxResultApi>
See also: MapiCallbackApi, PostRawTxResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
Convert JSON style TSC Merkle Proof to standard binary format.
export function serializeTscMerkleProof(proof: TscMerkleProofApi): Buffer
Links: API, Interfaces, Classes, Functions, Types, Variables
export function serializeTscMerkleProofNodes(nodes: Buffer | string[]): Buffer
Links: API, Interfaces, Classes, Functions, Types, Variables
export function signMapiPayload(payload: string, privateKey: string): string
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function updateBsvExchangeRate(rate?: BsvExchangeRateApi, updateMsecs?: number): Promise<BsvExchangeRateApi>
See also: BsvExchangeRateApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function updateChaintracksFiatExchangeRates(targetCurrencies: string[], options: CwiExternalServicesOptions): Promise<FiatExchangeRatesApi>
See also: CwiExternalServicesOptions, FiatExchangeRatesApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export async function updateExchangeratesapi(targetCurrencies: string[], options: CwiExternalServicesOptions): Promise<FiatExchangeRatesApi>
See also: CwiExternalServicesOptions, FiatExchangeRatesApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function validateScriptHash(output: string | Buffer, outputFormat?: GetUtxoStatusOutputFormatApi): string
See also: GetUtxoStatusOutputFormatApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export function verifyMapiResponseForTxid<T extends MapiTxidReturnResultApi>(response: MapiResponseApi, txid?: string | Buffer, checkFailure?: boolean): T
See also: MapiTxidReturnResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
Links: API, Interfaces, Classes, Functions, Types, Variables
export type GetMerkleProofServiceApi = (txid: string | Buffer, chain: Chain) => Promise<GetMerkleProofResultApi>
See also: GetMerkleProofResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export type GetRawTxServiceApi = (txid: string | Buffer, chain: Chain) => Promise<GetRawTxResultApi>
See also: GetRawTxResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export type GetScriptHistoryServiceApi = (output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi) => Promise<GetScriptHistoryResultApi>
See also: GetScriptHistoryResultApi, GetUtxoStatusOutputFormatApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export type GetUtxoStatusOutputFormatApi = "hashLE" | "hashBE" | "script"
Links: API, Interfaces, Classes, Functions, Types, Variables
export type GetUtxoStatusServiceApi = (output: string | Buffer, chain: Chain, outputFormat?: GetUtxoStatusOutputFormatApi) => Promise<GetUtxoStatusResultApi>
See also: GetUtxoStatusOutputFormatApi, GetUtxoStatusResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export type PostBeefServiceApi = (beef: number[], chain: Chain) => Promise<PostBeefResultApi>
See also: PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export type PostBeefsServiceApi = (beefs: number[][], chain: Chain) => Promise<PostBeefResultApi[]>
See also: PostBeefResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export type PostRawTxServiceApi = (txid: string | Buffer, rawTx: string | Buffer, chain: Chain, callback?: MapiCallbackApi) => Promise<PostRawTxResultApi>
See also: MapiCallbackApi, PostRawTxResultApi
Links: API, Interfaces, Classes, Functions, Types, Variables
export type PostRawTxsServiceApi = (txs: RawTxForPost[], chain: Chain) => Promise<PostRawTxResultApi[]>
See also: PostRawTxResultApi, RawTxForPost
Links: API, Interfaces, Classes, Functions, Types, Variables
export type UpdateFiatExchangeRateServiceApi = (targetCurrencies: string[], options: CwiExternalServicesOptions) => Promise<FiatExchangeRatesApi>
See also: CwiExternalServicesOptions, FiatExchangeRatesApi
Links: API, Interfaces, Classes, Functions, Types, Variables
arcMinerTaalMainDefault |
arcMinerTaalTestDefault |
Links: API, Interfaces, Classes, Functions, Types, Variables
arcMinerTaalMainDefault: ArcMinerApi = {
name: "TaalArc",
url: "https://tapi.taal.com/arc",
}
See also: ArcMinerApi
Links: API, Interfaces, Classes, Functions, Types, Variables
arcMinerTaalTestDefault: ArcMinerApi = {
name: "TaalArc",
url: "https://arc-test.taal.com",
}
See also: ArcMinerApi
Links: API, Interfaces, Classes, Functions, Types, Variables
The license for the code in this repository is the Open BSV License.
FAQs
Implementations of external service APIs and standardized APIs for use within CWI
We found that cwi-external-services demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.