Skip to content

Commit

Permalink
update (#183)
Browse files Browse the repository at this point in the history
Co-authored-by: jay_sun <[email protected]>
  • Loading branch information
JeyDev310 and jay_sun authored Oct 21, 2021
1 parent 160d443 commit 7e592ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum",
"version": "1.28.12",
"version": "1.28.13",
"description": "Tatum API client allows browsers and Node.js clients to interact with Tatum API.",
"main": "dist/src/index.js",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
6 changes: 3 additions & 3 deletions src/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ export const generateAdaWallet = async (mnemonic: string): Promise<Wallet> => {
* @param mnem mnemonic seed to use
* @returns address and secret
*/
export const generateAlgoWallet = async (mnem: string) => {
const account = algosdk.mnemonicToSecretKey(mnem);
export const generateAlgoWallet = async (mnem?: string) => {
const account = mnem ? algosdk.mnemonicToSecretKey(mnem) : algosdk.generateAccount();
const encoder = new base32.Encoder({type: "rfc4648"});
const secret = encoder.write(account.sk).finalize();
return {
Expand Down Expand Up @@ -421,7 +421,7 @@ export const generateWallet = (currency: Currency, testnet: boolean, mnemonic?:
case Currency.ADA:
return generateAdaWallet(mnem)
case Currency.ALGO:
return generateAlgoWallet(mnem)
return generateAlgoWallet(mnemonic)
default:
throw new Error('Unsupported blockchain.')
}
Expand Down

0 comments on commit 7e592ba

Please sign in to comment.