Skip to content

Entropy-Foundation/supra-ts-sdk

Repository files navigation

Supra TypeScript SDK

npm version npm downloads License: MIT TypeScript

Type-safe client library for the Supra blockchain (MoveVM)

supra-ts-sdk is a lightweight, modern TypeScript SDK for building applications on the Supra Layer-1 blockchain (MoveVM-based).

It provides strongly-typed helpers for:

  • Connecting to Supra nodes (Mainnet / Testnet)
  • Reading account balances & resources
  • Submitting transactions
  • Calling view / entry functions on Move modules
  • Working with Move structs and ABIs

✨ Features

  • Full TypeScript support with excellent type inference
  • Native Move function calling (entry & view)
  • Clean builder-style transaction creation
  • Automatic BCS serialization / deserialization
  • Built-in support for Supra Mainnet & Testnet
  • Minimal dependencies

📦 Installation

# Recommended (fastest + best disk usage)
pnpm add supra-ts-sdk

# or with npm
npm install supra-ts-sdk

# or with Yarn
yarn add supra-ts-sdk

Requirements

  • Node.js ≥ 18
  • TypeScript ≥ 4.9 (5.x strongly recommended)

🚀 Quick Start

import { SupraClient, Network } from 'supra-ts-sdk';

(async () => {
  const supra = new SupraClient({ network: Network.TESTNET });
  console.log("Connected to Supra Testnet (Chain ID 6)");
})();

Querying Accounts

1. Check if an Account Exists

import { SupraClient, Network } from 'supra-ts-sdk';

(async () => {
  const supra = new SupraClient({ network: Network.TESTNET });

  const accountAddress = "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1c55";

  const exists = await supra.account.isAccountExists({ accountAddress });

  console.log(`Account ${accountAddress.slice(0, 8)}... exists:`, exists);

})();

Note: Accounts on Supra only exist after receiving a transaction or resource. This is a fast, gas-free check.

2. Get Full Account Information

import { SupraClient, Network } from 'supra-ts-sdk';

(async () => {
  const supra = new SupraClient({ network: Network.TESTNET });

  const rootAddress = "0x0000000000000000000000000000000000000000000000000000000000000001";

  const accountData = await supra.account.getAccountInfo({ accountAddress: rootAddress });

  console.log("Framework (0x1) account info:", accountData);
  // Expected fields: sequence_number, authentication_key, etc.
})();

📚 More Examples

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/your-feature)
  3. Commit your changes (git commit -m 'Add your feature')
  4. Push to the branch (git push origin feat/your-feature)
  5. Open a Pull Request

Please:

  • Follow existing code style & add tests where possible
  • Update README/examples if behavior changes
  • Report bugs via Issues with reproduction steps

📄 License

MIT License

See the LICENSE file for full details.

Built with ❤️ for the Supra ecosystem. Happy coding! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors