
Blockchain In TypeScript
TypeScript developed by Microsoft is an open source next generation programming library based on JavaScript and C#. TypeScript is is a superset of JavaScript which mainly offers optional static typing, classes, and interfaces.
ARK Blockchain provides a wrapper for TypeScript developers to build blockchain solutions in TypeScript on top of Ark Blockchain.
The API wrapper is TSARK. TSARK compiles into ES5 so you can work with both, ECMAScript or TypeScript.
TSARK is available on Github: https://github.com/ArkEcosystem/ark-ts
TypeScript Blockchain Examples
Get delegate list from Devnet network.
-
import { Client, Network, NetworkType } from 'ark-ts';
-
const devnet = Network.getDefault(NetworkType.Devnet);
-
const client = new Client(devnet);
-
client.delegate.list().subscribe((list) => {
-
console.log(list);
-
});
Get address from passphrase.
-
import { PrivateKey } from 'ark-ts/core';
-
// if no specify a second param, default is mainnet
-
const key = PrivateKey.fromSeed('my secret passphrase');
-
console.log(key.getPublicKey().getAddress()); // AaWU6X3pGdtSCK3s9weo9tjth64F3hixgT
Get the weekly commit
New blockchain deep dives every week.