Skip to content

Commit

Permalink
Simplifyed walletSign
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Electron committed Jan 13, 2024
1 parent cd9dd5c commit 9583855
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/sdk/examples/utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Dataset, Member } from '@build-5/interfaces';
import { Build5, SoonaverseApiKey, https } from '@build-5/sdk';
import { CoinType, SecretManager, utf8ToHex } from '@iota/sdk';
import { mnemonicToSeedSync } from 'bip39';
import { AddressDetails } from './secret';

/**
Expand All @@ -17,9 +16,7 @@ export const walletSign = async (uid: string, address: AddressDetails) => {
.dataset(Dataset.MEMBER)
.id(uid)
.get();
const seed = mnemonicToSeedSync(address.mnemonic);
const hexSeed = '0x' + seed.toString('hex');
const secretManager = new SecretManager({ hexSeed });
const secretManager = new SecretManager({ mnemonic: address.mnemonic });
const signature = await secretManager.signEd25519(utf8ToHex((member as Member).nonce!), {
coinType: CoinType.IOTA,
});
Expand Down

0 comments on commit 9583855

Please sign in to comment.