-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: mana in block issued * fix: minor improvement * fix: formatTokenAmountDefault test
- Loading branch information
Showing
7 changed files
with
51 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/shared/lib/core/wallet/utils/isOutputOfSelectedWalletAddress.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { CommonOutput, UnlockConditionType, OutputData, AddressUnlockCondition } from '@iota/sdk/out/types' | ||
import { selectedWallet } from '../stores' | ||
import { get } from 'svelte/store' | ||
import { AddressConverter } from './AddressConverter' | ||
|
||
export async function isOutputOfSelectedWalletAddress(outputData: OutputData): Promise<boolean> { | ||
const output = outputData.output as CommonOutput | ||
const walletAddress = await get(selectedWallet)?.address() | ||
const address = ( | ||
output.unlockConditions.find( | ||
(unlockCondition) => unlockCondition.type === UnlockConditionType.Address | ||
) as AddressUnlockCondition | ||
).address | ||
const bech32Address = AddressConverter.addressToBech32(address) | ||
return bech32Address === walletAddress | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters