Skip to content

Commit

Permalink
Fix getting NFT id
Browse files Browse the repository at this point in the history
  • Loading branch information
greimela committed Jun 29, 2022
1 parent 8543db9 commit 32fcb31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,14 @@ ipcMain.on('mint_nft', async (event, { responseChannel, ...args }) => {
});

function getEncodedId(launcherCoinRecord: any) {
const smartLauncherCoin = new SmartCoin({
parentCoinInfo: launcherCoinRecord.coin.parent_coin_info,
puzzleHash: launcherCoinRecord.coin.puzzle_hash,
const launcherCoin = new SmartCoin({
parentCoinInfo: launcherCoinRecord.coin.parent_coin_info.replace('0x', ''),
puzzleHash: launcherCoinRecord.coin.puzzle_hash.replace('0x', ''),
amount: launcherCoinRecord.coin.amount,
});
console.log(smartLauncherCoin);
let id = smartLauncherCoin.getId();
console.log(id);
let id = launcherCoin.getId();
if (id) {
const idBuffer: Buffer = Buffer.from(id, 'hex');

return bech32m.encode('nft', bech32m.toWords(idBuffer));
}
}
1 change: 0 additions & 1 deletion src/pages/Minting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { IpcService } from '../helpers/ipc-service';
import { NftStorageUploader } from '../helpers/nft-storage';
import { chiaState } from '../state/chia';
import { shell } from 'electron';
import { add_rate_limited_funds } from 'chia-agent/api/rpc';
const ipc = new IpcService();
Expand Down

0 comments on commit 32fcb31

Please sign in to comment.