Skip to content

ecency/sdk

Repository files navigation

Ecency SDK

Packages

  1. @ecency/sdkNPM JavaScript Style Guide
  2. @ecency/walletsNPM JavaScript Style Guide

Overview

  1. @ecency/sdk provides an API and state management based on @tanstack/react-query for building Hive user interfaces.
  2. @ecency/wallets provides an API for managing Hive blockchain wallets and external cryptocurrency wallets within the Ecency ecosystem.

Installation

yarn add @ecency/sdk
# or
npm install @ecency/sdk

Setup

  1. Install react @tanstack/react-query @hiveio/dhive
  2. Use!

SDK

@ecency/sdk bundles React Query helpers for the Hive blockchain:

  • Accounts, posts, operations, communities, games, analytics, and keychain modules
  • Query and mutation option builders
  • Customisable Hive RPC clients via the CONFIG object

See packages/core/README.md for detailed usage.

Wallets

This package is built on top of @hiveio/dhive and okweb3 packages.

The main functionality is creating wallets based on seed phrase(BIP39) and generating addresses with keys on device. Seed phrases and private keys are never sent to any API, all operations happen locally.

Supported tokens: BTC, ETH, SOL, TRX, TON, ATOM, APT—theoretically all child tokens of these systems. Make forks for it. Use useGetExternalWalletBalanceQuery to fetch balances for these chains.

Hive helpers

@ecency/wallets also exposes helpers for interacting with the Hive blockchain:

  • signDigest – create a signature for an arbitrary digest
  • signTx – sign a transaction with an optional custom chain ID
  • signTxAndBroadcast – sign a transaction and immediately broadcast it
  • signExternalTx – sign transactions for external chains like BTC or ETH
  • signExternalTxAndBroadcast – sign and broadcast transactions on external networks
  • encryptMemoWithKeys / decryptMemoWithKeys – encrypt or decrypt memos with explicit keys
  • encryptMemoWithAccounts / decryptMemoWithAccounts – encrypt or decrypt memos by looking up account memo keys

See packages/wallets/README.md for usage examples.

Roadmap

  • Add more Hive wallets operations
  • Allow importing existing wallets by phrase or private keys
  • Support of DASH
  • Support of DOGE

About

Ecency SDK | @ecency/sdk and @ecency/wallets

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •