Skip to main content

Constants Reference

Overview

This page provides a comprehensive reference for all constants available in the Push Chain Core SDK (@pushchain/core). These constants are used throughout the SDK to ensure type safety and consistency when working with chains, networks, libraries, and other configurations.

All constants are accessed via the PushChain.CONSTANTS namespace.

Push Network

PushChain.CONSTANTS.PUSH_NETWORK

Defines the Push Chain network environments available for initialization.

ConstantValueDescription
PushChain.CONSTANTS.PUSH_NETWORK.MAINNETMAINNETPush Chain mainnet environment
PushChain.CONSTANTS.PUSH_NETWORK.TESTNET_DONUTTESTNET_DONUTPush Chain testnet environment (Donut)
PushChain.CONSTANTS.PUSH_NETWORK.TESTNETTESTNETPush Chain testnet environment (points to latest testnet)
PushChain.CONSTANTS.PUSH_NETWORK.LOCALNETLOCALNETLocal development environment

Usage Examples

import { PushChain } from '@pushchain/core';

// Initialize client with testnet (Donut)
const client = await PushChain.initialize(universalSigner, {
network: PushChain.CONSTANTS.PUSH_NETWORK.TESTNET_DONUT,
});

// Initialize client with localnet
const localClient = await PushChain.initialize(universalSigner, {
network: PushChain.CONSTANTS.PUSH_NETWORK.LOCALNET,
});

Chain Constants

PushChain.CONSTANTS.CHAIN

Defines all supported blockchain chains across the Push Chain ecosystem. These constants are used for chain-specific operations, account conversions, and cross-chain transactions.

ConstantChain NamespaceDescription
PushChain.CONSTANTS.CHAIN.PUSH_TESTNETeip155:42101Push Chain testnet, always points to latest version of testnet
PushChain.CONSTANTS.CHAIN.PUSH_TESTNET_DONUTeip155:42101Push Chain testnet (Donut)
PushChain.CONSTANTS.CHAIN.PUSH_LOCALNETeip155:9001Push Chain local development
PushChain.CONSTANTS.CHAIN.ETHEREUM_MAINNETeip155:1Ethereum mainnet
PushChain.CONSTANTS.CHAIN.ETHEREUM_SEPOLIAeip155:11155111Ethereum Sepolia testnet
PushChain.CONSTANTS.CHAIN.ARBITRUM_SEPOLIAeip155:421614Arbitrum Sepolia testnet
PushChain.CONSTANTS.CHAIN.BASE_SEPOLIAeip155:84532Base Sepolia testnet
PushChain.CONSTANTS.CHAIN.BNB_TESTNETeip155:97BNB Chain testnet
PushChain.CONSTANTS.CHAIN.SOLANA_MAINNETsolana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpSolana mainnet-beta
PushChain.CONSTANTS.CHAIN.SOLANA_TESTNETsolana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zSolana testnet
PushChain.CONSTANTS.CHAIN.SOLANA_DEVNETsolana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1Solana devnet

Usage Examples

import { PushChain } from '@pushchain/core';

// Convert address to UniversalAccount
const account = PushChain.utils.account.toUniversal(address, {
chain: PushChain.CONSTANTS.CHAIN.ETHEREUM_SEPOLIA,
});

// Get supported chains for a network
const chains = PushChain.utils.chains.getSupportedChains(
PushChain.CONSTANTS.PUSH_NETWORK.TESTNET
);

// Convert executor to origin with chain override
const originInfo = await PushChain.utils.account.convertExecutorToOrigin(
executorAddress,
{ chain: PushChain.CONSTANTS.CHAIN.BNB_TESTNET }
);

// Get explorer URL for specific chain
const explorerUrl = pushChainClient.explorer.getTransactionUrl(txHash, {
chain: PushChain.CONSTANTS.CHAIN.ARBITRUM_SEPOLIA
});

Library Constants

PushChain.CONSTANTS.LIBRARY

Defines the supported blockchain libraries for creating Universal Signers from keypairs.

ConstantValueDescription
PushChain.CONSTANTS.LIBRARY.ETHEREUM_ETHERSV6'ethers-v6'Ethers.js v6 library
PushChain.CONSTANTS.LIBRARY.ETHEREUM_VIEM'viem'Viem library for Ethereum
PushChain.CONSTANTS.LIBRARY.SOLANA_WEB3JS'solana-web3js'Solana Web3.js library

Usage Examples

import { PushChain } from '@pushchain/core';
import { ethers } from 'ethers';

// Create Universal Signer with Ethers v6
const wallet = ethers.Wallet.createRandom();
const universalSigner = await PushChain.utils.signer.toUniversalFromKeypair(
wallet,
{
chain: PushChain.CONSTANTS.CHAIN.ETHEREUM_SEPOLIA,
library: PushChain.CONSTANTS.LIBRARY.ETHEREUM_ETHERSV6,
}
);
import { PushChain } from '@pushchain/core';
import { Keypair } from '@solana/web3.js';

// Create Universal Signer with Solana Web3.js
const keypair = Keypair.generate();
const universalSigner = await PushChain.utils.signer.toUniversalFromKeypair(
keypair,
{
chain: PushChain.CONSTANTS.CHAIN.SOLANA_DEVNET,
library: PushChain.CONSTANTS.LIBRARY.SOLANA_WEB3JS,
}
);

Moveable Token Constants

PushChain.CONSTANTS.MOVEABLE.TOKEN

Defines tokens that can be transferred across chains using Push Chain's universal transaction system.

ConstantChainDescription
PushChain.CONSTANTS.MOVEABLE.TOKEN.ETHEREUM_SEPOLIA.ETHEthereum SepoliaNative ETH token
PushChain.CONSTANTS.MOVEABLE.TOKEN.ETHEREUM_SEPOLIA.USDTEthereum SepoliaTether USD stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.ETHEREUM_SEPOLIA.USDCEthereum SepoliaUSD Coin stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.ETHEREUM_SEPOLIA.WETHEthereum SepoliaWrapped ETH
PushChain.CONSTANTS.MOVEABLE.TOKEN.ETHEREUM_SEPOLIA.stETHEthereum SepoliaStaked ETH (Lido)
PushChain.CONSTANTS.MOVEABLE.TOKEN.ARBITRUM_SEPOLIA.ETHArbitrum SepoliaNative ETH token
PushChain.CONSTANTS.MOVEABLE.TOKEN.ARBITRUM_SEPOLIA.USDTArbitrum SepoliaTether USD stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.ARBITRUM_SEPOLIA.USDCArbitrum SepoliaUSD Coin stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.ARBITRUM_SEPOLIA.WETHArbitrum SepoliaWrapped ETH
PushChain.CONSTANTS.MOVEABLE.TOKEN.BASE_SEPOLIA.ETHBase SepoliaNative ETH token
PushChain.CONSTANTS.MOVEABLE.TOKEN.BASE_SEPOLIA.USDTBase SepoliaTether USD stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.BASE_SEPOLIA.USDCBase SepoliaUSD Coin stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.BASE_SEPOLIA.WETHBase SepoliaWrapped ETH
PushChain.CONSTANTS.MOVEABLE.TOKEN.BNB_TESTNET.ETHBNB TestnetNative ETH token
PushChain.CONSTANTS.MOVEABLE.TOKEN.BNB_TESTNET.USDTBNB TestnetTether USD stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.SOLANA_DEVNET.SOLSolana DevnetNative SOL token
PushChain.CONSTANTS.MOVEABLE.TOKEN.SOLANA_DEVNET.USDTSolana DevnetTether USD stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.SOLANA_DEVNET.USDCSolana DevnetUSD Coin stablecoin
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.pEthPush Testnet DonutPush-wrapped ETH from Ethereum
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.pEthArbPush Testnet DonutPush-wrapped ETH from Arbitrum
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.pEthBasePush Testnet DonutPush-wrapped ETH from Base
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.pEthBnbPush Testnet DonutPush-wrapped ETH from BNB Chain
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.pSolPush Testnet DonutPush-wrapped SOL from Solana
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDT.ethPush Testnet DonutPush-wrapped USDT from Ethereum
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDT.arbPush Testnet DonutPush-wrapped USDT from Arbitrum
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDT.basePush Testnet DonutPush-wrapped USDT from Base
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDT.bnbPush Testnet DonutPush-wrapped USDT from BNB Chain
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDT.solPush Testnet DonutPush-wrapped USDT from Solana
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDC.ethPush Testnet DonutPush-wrapped USDC from Ethereum
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDC.arbPush Testnet DonutPush-wrapped USDC from Arbitrum
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDC.basePush Testnet DonutPush-wrapped USDC from Base
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDC.bnbPush Testnet DonutPush-wrapped USDC from BNB Chain
PushChain.CONSTANTS.MOVEABLE.TOKEN.PUSH_TESTNET_DONUT.USDC.solPush Testnet DonutPush-wrapped USDC from Solana

Usage Examples

import { PushChain } from '@pushchain/core';

// Move USDT from Ethereum Sepolia to Push Chain
const txHash = await pushChainClient.universal.sendTransaction({
to: '0xa54E96d3fB93BD9f6cCEf87c2170aEdB1D47E1cF',
funds: {
amount: PushChain.utils.helpers.parseUnits('100', 6), // 100 USDT
token: PushChain.CONSTANTS.MOVEABLE.TOKEN.ETHEREUM_SEPOLIA.USDT,
},
});

// Move SOL from Solana to Push Chain
const solTxHash = await pushChainClient.universal.sendTransaction({
to: 'FNDJWigdNWsmxXYGrFV2gCvioLYwXnsVxZ4stL33wFHf',
funds: {
amount: PushChain.utils.helpers.parseUnits('1', 9), // 1 SOL
token: PushChain.CONSTANTS.MOVEABLE.TOKEN.SOLANA_DEVNET.SOL,
},
});

Payable Token Constants

PushChain.CONSTANTS.PAYABLE.TOKEN

Defines tokens that can be used to pay for gas fees on Push Chain transactions.

ConstantChainDescription
PushChain.CONSTANTS.PAYABLE.TOKEN.ETHEREUM_SEPOLIA.ETHEthereum SepoliaNative ETH token
PushChain.CONSTANTS.PAYABLE.TOKEN.ETHEREUM_SEPOLIA.USDTEthereum SepoliaTether USD stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.ETHEREUM_SEPOLIA.USDCEthereum SepoliaUSD Coin stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.ETHEREUM_SEPOLIA.WETHEthereum SepoliaWrapped ETH
PushChain.CONSTANTS.PAYABLE.TOKEN.ETHEREUM_SEPOLIA.stETHEthereum SepoliaStaked ETH (Lido)
PushChain.CONSTANTS.PAYABLE.TOKEN.ARBITRUM_SEPOLIA.ETHArbitrum SepoliaNative ETH token
PushChain.CONSTANTS.PAYABLE.TOKEN.ARBITRUM_SEPOLIA.USDTArbitrum SepoliaTether USD stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.ARBITRUM_SEPOLIA.USDCArbitrum SepoliaUSD Coin stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.BASE_SEPOLIA.ETHBase SepoliaNative ETH token
PushChain.CONSTANTS.PAYABLE.TOKEN.BASE_SEPOLIA.USDTBase SepoliaTether USD stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.BASE_SEPOLIA.USDCBase SepoliaUSD Coin stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.BNB_TESTNET.BNBBNB TestnetNative BNB token
PushChain.CONSTANTS.PAYABLE.TOKEN.BNB_TESTNET.USDTBNB TestnetTether USD stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.SOLANA_DEVNET.SOLSolana DevnetNative SOL token
PushChain.CONSTANTS.PAYABLE.TOKEN.SOLANA_DEVNET.USDTSolana DevnetTether USD stablecoin
PushChain.CONSTANTS.PAYABLE.TOKEN.SOLANA_DEVNET.USDCSolana DevnetUSD Coin stablecoin

Usage Examples

import { PushChain } from '@pushchain/core';

// Pay gas fees with USDT instead of native token
const txHash = await pushChainClient.universal.sendTransaction({
to: '0xa54E96d3fB93BD9f6cCEf87c2170aEdB1D47E1cF',
value: PushChain.utils.helpers.parseUnits('0.1', 18),
payGasWith: {
token: PushChain.CONSTANTS.PAYABLE.TOKEN.ETHEREUM_SEPOLIA.USDT,
slippageBps: 100, // 1% slippage tolerance
},
});

// Pay gas with USDC on Arbitrum
const arbTxHash = await pushChainClient.universal.sendTransaction({
to: '0xa54E96d3fB93BD9f6cCEf87c2170aEdB1D47E1cF',
value: PushChain.utils.helpers.parseUnits('0.05', 18),
payGasWith: {
token: PushChain.CONSTANTS.PAYABLE.TOKEN.ARBITRUM_SEPOLIA.USDC,
slippageBps: 50, // 0.5% slippage tolerance
},
});

Common Patterns

Chain Selection

When working with multiple chains, use the CHAIN constants to ensure consistency:

// Define supported chains for your app
const SUPPORTED_CHAINS = [
PushChain.CONSTANTS.CHAIN.PUSH_TESTNET_DONUT,
PushChain.CONSTANTS.CHAIN.ETHEREUM_SEPOLIA,
PushChain.CONSTANTS.CHAIN.BASE_SEPOLIA,
PushChain.CONSTANTS.CHAIN.ARBITRUM_SEPOLIA,
PushChain.CONSTANTS.CHAIN.SOLANA_DEVNET,
];

// Get chain-specific configuration
function getChainConfig(chain: string) {
switch (chain) {
case PushChain.CONSTANTS.CHAIN.ETHEREUM_SEPOLIA:
return { rpc: 'https://sepolia.gateway.tenderly.co', explorer: 'https://sepolia.etherscan.io' };
case PushChain.CONSTANTS.CHAIN.SOLANA_DEVNET:
return { rpc: 'https://api.devnet.solana.com', explorer: 'https://explorer.solana.com' };
// ... more chains
}
}

Network-Specific Initialization

// Development environment
if (process.env.NODE_ENV === 'development') {
const client = await PushChain.initialize(signer, {
network: PushChain.CONSTANTS.PUSH_NETWORK.LOCALNET,
});
}

// Production/Testnet environment
if (process.env.NODE_ENV === 'production') {
const client = await PushChain.initialize(signer, {
network: PushChain.CONSTANTS.PUSH_NETWORK.TESTNET_DONUT,
});
}

Library Detection

import { ethers } from 'ethers';
import * as viem from 'viem';

function detectLibrary(signer: any) {
if (signer instanceof ethers.Wallet) {
return PushChain.CONSTANTS.LIBRARY.ETHEREUM_ETHERSV6;
} else if (signer.type === 'viem') {
return PushChain.CONSTANTS.LIBRARY.ETHEREUM_VIEM;
}
// ... more detection logic
}

Type Safety

All constants are strongly typed in TypeScript. When using TypeScript, you'll get autocomplete and type checking:

import { PushChain } from '@pushchain/core';

// TypeScript will autocomplete available chains
const chain: typeof PushChain.CONSTANTS.CHAIN =
PushChain.CONSTANTS.CHAIN.ETHEREUM_SEPOLIA;

// TypeScript will catch invalid values
const invalidChain = PushChain.CONSTANTS.CHAIN.INVALID; // ❌ Type error

Next Steps