Importing a Wallet
Import Wallet
Small example of how to get the address from the WIF.
const { Address, PhantasmaKeys } = require('phantasma-ts');
const wif = "";
const wallet = PhantasmaKeys.fromWIF(wif);
const addr = wallet.Address; // Get the Address.
Importing a Wallet from a private key
Small example of how to import a wallet from a private key.
const { Address, PhantasmaKeys, getWifFromPrivateKey} = require('phantasma-ts');
const privateKey = "";
let wif = getWifFromPrivateKey(privateKey);
const wallet = PhantasmaKeys.fromWIF(wif);
const addr = wallet.Address; // Get the Address.
const { Address, PhantasmaKeys, getPrivateKeyFromWif } = require('phantasma-ts');
const wif = "";
const privKey = getPrivateKeyFromWif(wif);
Last updated