<script type="text/javascript" src="https://unpkg.com/filecoin.js"></script>
<script type="text/javascript">
(async () => {
  const connector = new FilecoinJs.HttpJsonRpcConnector({ url: "https://api.node.glif.io" })

  const hdWalletMnemonic = 'test'
  const hdDerivationPath = `m/44'/461'/0'/0/0`
  const lotusClient =  new FilecoinJs.LotusClient(connector)
  const walletProvider = new FilecoinJs.MnemonicWalletProvider(
    lotusClient,
    hdWalletMnemonic,
    hdDerivationPath
  );

  const myAddress = await walletProvider.getDefaultAddress();
  console.log(myAddress)

  // f1hzeuwilciofsesevmhbsbvaistgyludgmhuphxi
})().then().catch()
</script>
Edit
Pub: 03 Jan 2024 22:22 UTC
Edit: 03 Jan 2024 22:23 UTC
Views: 36