@stacks/stacks-blockchain-api-types
Advanced tools
Comparing version 7.0.0-stacks-2.1.1 to 7.0.0-stacks-2.1.2
{ | ||
"name": "@stacks/stacks-blockchain-api-types", | ||
"version": "7.0.0-stacks-2.1.1", | ||
"version": "7.0.0-stacks-2.1.2", | ||
"access": "public", | ||
@@ -41,2 +41,3 @@ "description": "TypeScript descriptions of Stacks 2.0 blockchain API entities", | ||
"@types/json-schema-merge-allof": "0.6.0", | ||
"@types/node": "16.18.3", | ||
"ajv": "6.12.6", | ||
@@ -43,0 +44,0 @@ "chalk": "4.1.1", |
@@ -27,2 +27,6 @@ import type { | ||
// Allows timeout callbacks for messages. See | ||
// https://socket.io/docs/v4/typescript/#emitting-with-a-timeout | ||
type WithTimeoutAck<isSender extends boolean, args extends any[]> = isSender extends true ? [Error, ...args] : args; | ||
export interface ClientToServerMessages { | ||
@@ -33,27 +37,27 @@ subscribe: (topic: Topic | Topic[], callback: (error: string | null) => void) => void; | ||
export interface ServerToClientMessages { | ||
block: (block: Block) => void; | ||
microblock: (microblock: Microblock) => void; | ||
mempool: (transaction: MempoolTransaction) => void; | ||
transaction: (transaction: Transaction | MempoolTransaction) => void; | ||
export interface ServerToClientMessages<isSender extends boolean = false> { | ||
block: (block: Block, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
microblock: (microblock: Microblock, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
mempool: (transaction: MempoolTransaction, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
transaction: (transaction: Transaction | MempoolTransaction, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
// @ts-ignore scheduled for support in TS v4.3 https://github.com/microsoft/TypeScript/pull/26797 | ||
[key: 'nft-event']: (event: NftEvent) => void; | ||
'nft-event': (event: NftEvent) => void; | ||
[key: 'nft-event']: (event: NftEvent, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
'nft-event': (event: NftEvent, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
// @ts-ignore scheduled for support in TS v4.3 https://github.com/microsoft/TypeScript/pull/26797 | ||
[key: NftAssetEventTopic]: (assetIdentifier: string, value: string, event: NftEvent) => void; | ||
'nft-asset-event': (assetIdentifier: string, value: string, event: NftEvent) => void; | ||
[key: NftAssetEventTopic]: (assetIdentifier: string, value: string, event: NftEvent, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
'nft-asset-event': (assetIdentifier: string, value: string, event: NftEvent, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
// @ts-ignore scheduled for support in TS v4.3 https://github.com/microsoft/TypeScript/pull/26797 | ||
[key: NftCollectionEventTopic]: (assetIdentifier: string, event: NftEvent) => void; | ||
'nft-collection-event': (assetIdentifier: string, event: NftEvent) => void; | ||
[key: NftCollectionEventTopic]: (assetIdentifier: string, event: NftEvent, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
'nft-collection-event': (assetIdentifier: string, event: NftEvent, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
// @ts-ignore scheduled for support in TS v4.3 https://github.com/microsoft/TypeScript/pull/26797 | ||
[key: AddressTransactionTopic]: (address: string, stxBalance: AddressTransactionWithTransfers) => void; | ||
'address-transaction': (address: string, tx: AddressTransactionWithTransfers) => void; | ||
[key: AddressTransactionTopic]: (address: string, stxBalance: AddressTransactionWithTransfers, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
'address-transaction': (address: string, tx: AddressTransactionWithTransfers, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
// @ts-ignore scheduled for support in TS v4.3 https://github.com/microsoft/TypeScript/pull/26797 | ||
[key: AddressStxBalanceTopic]: (address: string, stxBalance: AddressStxBalanceResponse) => void; | ||
'address-stx-balance': (address: string, stxBalance: AddressStxBalanceResponse) => void; | ||
[key: AddressStxBalanceTopic]: (address: string, stxBalance: AddressStxBalanceResponse, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
'address-stx-balance': (address: string, stxBalance: AddressStxBalanceResponse, callback: (...args: WithTimeoutAck<isSender, [string]>) => void) => void; | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
540094
350
13046
23