Socket
Socket
Sign inDemoInstall

@alephium/sdk

Package Overview
Dependencies
10
Maintainers
3
Versions
77
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @alephium/sdk

A JS/TS library to interact with the Alephium platform


Version published
Weekly downloads
15
increased by15.38%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

Alephium js-sdk

Github CI Code Coverage NPM code style: prettier

A JavaScript/TypeScript library for building applications that interact the Alephium platform.

Install

In Node projects

npm install @alephium/sdk

💥 Until our SDK is stable, breaking changes will be introduced in minor versions (instead of the traditional major versions of semver). We recommend allowing patch-level updates and to always read the release notes for breaking changes.

// package.json
{
   "dependencies": {
      "@alephium/sdk": "~X.Y.Z"
   }
}

In browser projects

All you have to do is to include the library in your HTML document. The alephium global variable will be available.

<script src="alephium.min.js"></script>
<script>
  const { walletGenerate } = alephium
  const wallet = walletGenerate()
  console.log(wallet)
</script>

You can either build the library by cloning this repo and running the build script (the file will be located at /dist/alephium.min.js), or simply using a CDN.

npm run build
via UNPKG CDN
<script src="https://unpkg.com/@alephium/sdk@X.Y.Z/dist/alephium.min.js"></script>
via jsDelivr CDN
<script src="https://cdn.jsdelivr.net/npm/@alephium/sdk@X.Y.Z/dist/alephium.min.js"></script>

Development

Release

To release a new version:

  1. Create a commit that updates the package version in package.json and package-lock.json and a tag with:

    npm version patch # if you want to bump the patch version, without breaking changes
    npm version minor # if you want to bump the minor version, with breaking changes
    npm version prerelease --preid=rc # if you want to create a release candidate
    
  2. Push the tag to GitHub and trigger the publish workflow that will publish it on NPM with:

    git push [remote] <tag>
    
  3. Unless you are on master, create a new branch and push it to GitHub so that the tagged commit belongs to a branch of this repo with:

    git checkout -b <tag>
    git push
    

    Otherwise, just push to master.

Build

Compile the TypeScript files into JavaScript:

npm run build

Testing

npm run devnet:start # this will start a devnet for smart contract tests
npm test

or, to watch for changes:

npm run test:watch

FAQs

Last updated on 21 Aug 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc