naviprotocol / navi-sdk

NAVI SDK Project for Sui Defi Ecosystem
https://naviprotocol.io/
Apache License 2.0
9 stars 4 forks source link

Account derived from menomic is random #8

Closed unpWn4bl3 closed 3 months ago

unpWn4bl3 commented 3 months ago

I'm using navi-sdk 1.1.20 ts sdk, and the account derived from same menomic is random. The menomic is read from .env using dotenv

截屏2024-04-25 10 59 04 截屏2024-04-25 11 24 16
ComeOnOliver commented 3 months ago

2 steps to validate this:

  1. Console.log to make sure you did get the menomic
  2. Specify {menomic: menomic} in the NAVISDKClient configration setup
unpWn4bl3 commented 3 months ago

2 steps to validate this:

  1. Console.log to make sure you did get the menomic
  2. Specify {menomic: menomic} in the NAVISDKClient configration setup

a { mnemonic: menomic} would fix my problem. Is this a expected behaviour or shoud it be more type issue robust?

ComeOnOliver commented 3 months ago

As you can see from the constructor: constructor({ mnemonic = "", networkType, accountIndex = 0 }: initializeParas = {}) If you not specify your paras menomic is for mnemonic, it will use "" for default, which auto generate a wallet mnemonic for you