What's the best way to create an address in Ontology using Javascript?
I can see how to call getBalance
and getTransactions
but need to get an address first.
What's the best way to create an address in Ontology using Javascript?
I can see how to call getBalance
and getTransactions
but need to get an address first.
You can create a new Ontology wallet with the Ontology TS SDK.
Install it with yarn or npm:
npm install 'ontology-ts-sdk' --save
And use with the following:
const Ont = require('ontology-ts-sdk');
const {
Crypto,
Account,
} = Ont;
const {
PrivateKey,
} = Crypto;
const {
Account,
} = Account;
const privateKey = PrivateKey.random();
const account = Account.create(privateKey, '123456', 'mickey');
console.log('Address: ' + account.address.toBase58());
Source: Ontology Typescript SDK