
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
@pushprotocol/push-chain
Advanced tools
This package provides access to the Push Network. Visit the [Developer Docs](https://push.org/docs) or [Push.org](https://push.org) to learn more.
This package provides access to the Push Network. Visit the Developer Docs or Push.org to learn more.
yarn add @pushprotocol/node-core@latest
or
npm install @pushprotocol/node-core@latest
import { PushNetwork } from '@pushprotocol/node-core';
// Initialize PushNetwork class instance
const userAlice = await PushNetwork.initialize('staging');
Parameters
Param | Type | Default | Remarks |
---|---|---|---|
env * | ENV | staging | API env - 'prod', 'staging' |
* - Optional
In any of the below methods (unless explicitly stated otherwise) we accept -
eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb
)Initializing PushNetwork class is the first step before proceeding to Block APIs. Please refer Initialize SDK Section
// get block data
const blockRes = await PushNetwork.block.get(
Math.floor(Date.now() / 1000),
'DESC',
true,
10,
2
);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
startTime * | number | Current Local Time | A number represting current time epoch |
direction * | ASC DESC | ASC | A string represting direction in which blocks are fetched |
showDetails * | boolean | false | A boolean represting whether tx Data shoudl be fetched or not |
page * | number | 1 | A number representing the page of results to retrieve. |
pageSize * | number | 30 | A number representing the maximum number of blocks to retrieve per page. |
* - Optional
// search block with a given block hash
const blockRes = await PushNetwork.block.search('block-hash');
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
blockHash | string | - | An string represting block hash |
* - Optional
import { Block } from '@pushprotocol/node-core';
const serializedBlock = Block.serialize(blockData);
ts: number; txObj: TransactionObj[]; signers: Signer[]; attestToken: Uint8Array;
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
ts | number | - | Block timestamp |
txObj | object[] | - | Block Transactions |
signers | object[] | - | Block Signers |
attestToken | Uint8Array | - | Block Attestation Token |
* - Optional
import { Block } from '@pushprotocol/node-core';
const deserializedBlock = Block.deserialize(blockDataBytes);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
block | Uint8Array | - | Block encoded in bytes format |
* - Optional
Initializing PushNetwork class is the first step before proceeding to Transaction APIs. Please refer Initialize SDK Section
// fetch transactions
const txRes = await PushNetwork.tx.get(
Math.floor(Date.now() / 1000),
'DESC',
10,
2
);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
startTime * | number | Current Local Time | A number represting current time epoch |
direction * | ASC DESC | ASC | A string represting direction in which transactions are fetched |
page * | number | 1 | A number representing the page of results to retrieve. |
pageSize * | number | 30 | A number representing the maximum number of transactions to retrieve per page. |
category * | string | - | A string representing the transaction category to be fetched |
* - Optional
// search transaction with a given tx hash
const txRes = await PushNetwork.tx.search('tx-hash');
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
txHash | string | - | An string represting transaction hash |
* - Optional
// create an unsigned transaction
const unsignedTx = PushNetwork.tx.createUnsigned(
'CATEGORY',
['RECIPIENT1', 'RECIPIENT2'],
serializedData
);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
category | string | - | Transaction category |
recipients | string[] | - | Array of recipient addresses |
data | Uint8Array | - | Serialized transaction payload data |
* - Optional
// send a transaction
const txHash = await PushNetwork.tx.send(unsignedTx, {
sender: 'SENDER_ADDRESS',
privKey: 'PRIVATE_KEY',
});
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
unsignedTx | Transaction | - | Unsigned transaction object |
session * | Object | - | Optional session object for signing |
* - Optional
import { Tx } from '@pushprotocol/node-core';
const serializedTx = Tx.serialize(txObject);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
tx | Transaction | - | Transaction object |
* - Optional
import { Tx } from '@pushprotocol/node-core';
const deserializedTx = Tx.deserialize(txDataBytes);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
tx | Uint8Array | - | Tx encoded in bytes format |
* - Optional
import { Tx, TxCategory } from '@pushprotocol/node-core';
const serializedData = Tx.serializeData(txData, TxCategory.INIT_DID);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
txData | InitDid | InitSessionKey Tx | - | Transaction payload data object |
category | TxCategory | - | Transaction category |
* - Optional
import { Tx, TxCategory } from '@pushprotocol/node-core';
const deserializedData = Tx.deserializeData(
serializedData,
TxCategory.INIT_DID
);
Parameters:
Parameter | Type | Default | Description |
---|---|---|---|
txData | Uint8Array | - | Serialized transaction payload |
category | TxCategory | - | Transaction category supported for Deserialization |
* - Optional
FAQs
This package provides access to the Push Network. Visit the [Developer Docs](https://push.org/docs) or [Push.org](https://push.org) to learn more.
The npm package @pushprotocol/push-chain receives a total of 2 weekly downloads. As such, @pushprotocol/push-chain popularity was classified as not popular.
We found that @pushprotocol/push-chain 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.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.