Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 670 Bytes

EXAMPLES_API.md

File metadata and controls

26 lines (21 loc) · 670 Bytes

Broadcast a Deploy Certificate to the Chain

import { certificate as akashCertificate, keplr } from "@akashnetwork/akashjs";

const chain = keplr.getChains().testnet;
const signer = await keplr.getSigner(chain);
const client = await keplr.get(chain, signer);
const accounts = await signer.getAccounts();

try {
  const myAddress = accounts[0].address;

  const pems: akashCertificate.pems = await akashCertificate.createCertificate(
    myAddress
  );

  akashCertificate.broadcastCertificate(
    { csr: pems.csr, publicKey: pems.publicKey },
    myAddress,
    client
  );
} catch (error) {
  console.log(`Akash Transport : ${error.message}`);
}