You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimum fee for a standard 1-in 2-out transaction (exfers)
DEFAULT_FEE
880n
Default fee (average tier, exfers)
DUST_THRESHOLD
200n
Minimum output value (exfers)
EXFERS_PER_EXFER
100_000_000n
1 EXFER in base units
GENESIS_BLOCK_ID
string
Production genesis block hash
Key Management
Function
Returns
Description
createMnemonic()
string
Generate a new 24-word BIP39 mnemonic
generateMnemonic()
string
Alias of createMnemonic
isValidMnemonic(m)
boolean
Validate a BIP39 mnemonic
walletFromMnemonic(m)
Promise<KeyPair>
Derive key pair from mnemonic
keyPairFromSeed(seed)
Promise<KeyPair>
Derive key pair from 32-byte seed
importKeyFile(bytes, passphrase)
Promise<KeyPair>
Import official .key file
sign(message, privateKey)
Promise<Uint8Array>
Ed25519 sign
KeyPair fields:
Field
Type
Description
privateKey
Uint8Array
32-byte private key seed
publicKey
Uint8Array
32-byte Ed25519 public key
address
Uint8Array
32-byte address bytes
addressHex
string
64-char hex address
publicKeyHex
string
64-char hex public key
Transactions
Function
Returns
Description
buildTransaction(params)
Promise<SignedTx>
Build and sign a single transfer
buildBatchTransaction(params)
Promise<SignedTx>
Build and sign a batch transfer (≤200 recipients)
estimateFee(numInputs, numOutputs)
bigint
Exact minimum fee from consensus cost formula
buildTransaction / buildBatchTransaction params:
Field
Type
Required
Description
utxos
Utxo[]
✓
Available UTXOs from the sender
toAddress
string
✓ (single only)
Recipient address (64-char hex)
recipients
BatchRecipient[]
✓ (batch only)
Array of { address, amount }
amount
bigint
✓ (single only)
Amount in exfers
privateKey
Uint8Array
✓
32-byte private key seed
publicKey
Uint8Array
✓
32-byte public key
senderAddress
Uint8Array
✓
32-byte address (receives change)
fee
bigint
optional
Override fee; omit to auto-calculate
SignedTx fields:
Field
Type
Description
txHex
string
Signed transaction hex for broadcast
txId
string
Transaction ID (computed locally)
fee
bigint
Actual fee used (exfers)
totalAmount
bigint | undefined
Sum of recipient amounts (batch only)
RPC Client (ExferRpcClient)
Connects to the Exfer node JSON-RPC endpoint (https://rpc.exfer.dev).
constrpc=createClient()// or: new ExferRpcClient(url)
Method
Returns
Description
getBlockHeight()
BlockHeight
Current tip height and block ID
getBlock({ height?, hash? })
Block
Block by height or hash
getTransaction(hash)
Transaction
Transaction by ID
getBalance(address)
AddressBalance
Address balance (raw)
getAddressUtxos(address)
AddressUtxos
UTXOs for an address
sendRawTransaction(txHex)
BroadcastResult
Broadcast signed transaction
getOutputSpentBy(txId, outputIndex)
OutputSpentBy
Which tx spent this output (v1.11.8+)
tryParseHtlc(script)
HtlcInfo
Parse script as HTLC (v1.11.8+)
REST Client (ExferRestClient)
Full coverage of the Explorer REST API (https://api.exfer.dev).
constrest=createRestClient()// or: new ExferRestClient(url)
Stats
Method
Returns
Description
getTipHeight()
number
Current block height
getNetworkStats()
NetworkStats
Full stats: height, supply, hashrate, block time
getFeeSuggestions()
FeeSuggestions
Min / average / fast fee tiers
getHashrateHistory(period?)
HashrateHistory
Hashrate chart data (1h/6h/24h/7d/30d/all)
getBlockTimeHistory(period?)
BlockTimeHistory
Block time chart data
getDailyStats(period?)
DailyStats
Daily block/tx count (7d/14d/30d/90d)
getMiners(period?)
MinersStats
Miner distribution (24h/7d)
Blocks
Method
Returns
Description
getBlocks(page?, limit?)
BlocksResponse
Paginated block list
getBlockDetail(id)
BlockDetail
Block by height or hash (with transactions[])
Transactions
Method
Returns
Description
getTxDetail(txId)
TxDetail
Transaction with outputs, fee, total amounts
getConfirmations(txId)
number
Confirmation count
Address
Method
Returns
Description
getAddressInfo(address, page?, limit?)
AddressInfo
Balance, counts, activity
getAddressUtxosRest(address, mempool?)
UtxosResponse
UTXOs with confirmed flag
getMempool(address)
MempoolData
Pending (unconfirmed) transactions
getDeposits(address, fromHeight, limit?)
Deposit[]
Confirmed deposits since height
batchAddresses(addresses[])
BatchAddressesResponse
Up to 20 addresses in one request
batchBalances(addresses[])
BalanceMap
address → bigint balance map
Rich List & Whales
Method
Returns
Description
getRichList(page?, limit?)
RichListResponse
Addresses sorted by balance
getWhales(page?, limit?)
WhalesResponse
Large transactions (≥10,000 EXFER, last 24h)
Search
Method
Returns
Description
search(query)
SearchResult
Auto-detect type: block / tx / address
Exchange Integration
import{createRestClient,sendWithdrawal,parseExfer}from'exfer-js'constapi=createRestClient()// Monitor deposits since last processed heightconstdeposits=awaitapi.getDeposits(hotWalletAddress,fromHeight)for(constdofdeposits){console.log(d.txId,d.amountFormatted,'EXFER at block',d.blockHeight)}// Batch balance check across many addressesconstbalances=awaitapi.batchBalances([addr1,addr2,addr3])console.log(balances[addr1])// bigint in exfers// Full batch with metadataconstbatch=awaitapi.batchAddresses([addr1,addr2])for(constitemofbatch.addresses){console.log(item.address,item.found,item.balance)}// Withdraw: build + sign + broadcastconstresult=awaitsendWithdrawal({
utxos,toAddress: recipientAddress,amount: parseExfer('50'),privateKey: wallet.privateKey,publicKey: wallet.publicKey,senderAddress: wallet.address,})console.log('txId:',result.txId,'fee:',result.fee)
Utilities
Function
Description
parseExfer(string)
Parse EXFER string → base units bigint. "1" → 100_000_000n, "1.5" → 150_000_000n. Strips commas and EXFER suffix.
formatExfer(exfers)
Format base units (bigint/number/string) → human-readable EXFER string
shortAddr(address)
Shorten address for display: "abcd1234…efgh5678"
shortHash(hash)
Shorten block hash / tx ID for display
formatHashrate(hr)
Format H/s number: 1_500_000 → "1.50 MH/s"
timeAgo(timestamp)
Unix timestamp → "5m ago", "2h ago", "just now"
estimateBlockReward(height)
Estimated block reward in EXFER at a given height
bytesToHex(bytes)
Uint8Array → lowercase hex string
hexToBytes(hex)
Hex string → Uint8Array (throws on invalid characters)