@alephium/web3 v0.39.3
Alephium Web3
A JavaScript/TypeScript library for building decentralized applications and smart contracts on Alephium.
You could run the following command to scaffold a skeleton project for smart contract development:
npx @alephium/web3 <project-dir> [-t template-name]
Install
In Node projects
npm install @alephium/web3
š„ Until our library 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/web3": "~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-web3.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-web3.min.js
), or simply using a CDN.
npm run build
via UNPKG CDN
<script src="https://unpkg.com/@alephium/web3@X.Y.Z/dist/alephium-web3.min.js"></script>
via jsDelivr CDN
<script src="https://cdn.jsdelivr.net/npm/@alephium/web3@X.Y.Z/dist/alephium-web3.min.js"></script>
Development
Update schemas
One first needs to update the version number of alephium
and explorer-backend
in package.json
. Kindly note that one needs to check the compatibility of both OpenAPI files manually.
Typings can automatically generated using the following command:
npm run update-schemas
Packaging
We need to include the .gitignore
file inside the npm package so that it can be used by the dist/cli/create-project.js
script. To do that we define the prepack
and postpack
npm scripts that will rename the .gitignore
file to gitignore
, pack it into the package, and rename it back to .gitignore
. Similar approach has been followed by create-react-app
1.
Release
To release a new version:
- 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 npm version prerelease --preid=leman # if you want to create a leman prerelease
Push the tag to GitHub and trigger the publish workflow that will publish it on NPM with:
git push [remote] <tag>
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 start-devnet # this will start a devnet for smart contract tests
npm test
or, to watch for changes:
npm run test:watch
9 days ago
14 days ago
15 days ago
17 days ago
26 days ago
29 days ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
10 months ago
9 months ago
9 months ago
9 months ago
11 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago