Skip to content

Commit

Permalink
release: desktop 0.1.0 (#1371)
Browse files Browse the repository at this point in the history
* chore: set feature flags

* remove border bottom (#1372)

* add feature flag for particles (#1374)

* fix: filter modal height after re-open (#1369)

* fix: filter modal height after re-open

* fix calculation

* revert visibility control changes

* Fix: gas estimation (#1373)

* feat: throw error if gasEstimate is wrong

* fix: update fallback amounts

---------

Co-authored-by: Nicole O'Brien <[email protected]>

* calculate storage deposit on mint nft (#1375)

Co-authored-by: Nicole O'Brien <[email protected]>

* fix: image preventing click

* dont restart the poll on dashboard render (#1376)

Co-authored-by: Tuditi <[email protected]>

* fix: hideValue in NodeConfigurationForm's SelectInput

* hotfix: removes `link` currency (crashes the app & corrupts profile)

* Add fix for zero balance (#1378)

* chore: increment version to 0.1.0-alpha-7

* feat: follow MM convention for using address indices to generate multiple accounts (#1381)

* feat: follow MM convention

* chore: prepare release

* fix: tokenError reset

* fix: early access instead of production in version toast

* chore: remove private token from auto update

* chore: disable faq

---------

Co-authored-by: Mark Nardi <[email protected]>
Co-authored-by: Jean Ribeiro <[email protected]>
Co-authored-by: Tuditi <[email protected]>
Co-authored-by: Matthew Maxwell <[email protected]>
Co-authored-by: Tuditi <[email protected]>
  • Loading branch information
6 people authored Nov 15, 2023
1 parent d77ffbc commit b19d6e5
Show file tree
Hide file tree
Showing 25 changed files with 153 additions and 86 deletions.
35 changes: 15 additions & 20 deletions .github/workflows/reusable_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,36 @@ jobs:
- name: Set up certificate (Windows)
if: ${{ inputs.sign && inputs.os == 'windows-2022' }}
run: |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash

- name: Set variables for signing (Windows)
if: ${{ inputs.sign && inputs.os == 'windows-2022' }}
run: |
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
shell: bash

- name: Install DigiCert KeyLocker KSP (Windows)
if: ${{ inputs.sign && inputs.os == 'windows-2022' }}
run: |
curl -X GET "https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download" -H "x-api-key:${{ secrets.SM_API_KEY }}" -o Keylockertools-windows-x64.msi
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
smksp_registrar.exe list
smctl.exe keypair ls
C:\\Windows\\System32\\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
curl -X GET "https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download" -H "x-api-key:${{ secrets.SM_API_KEY }}" -o Keylockertools-windows-x64.msi
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
smksp_registrar.exe list
smctl.exe keypair ls
C:\\Windows\\System32\\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
shell: cmd

- name: Sync Certificates with KeyLocker KSP (Windows)
if: ${{ inputs.sign && inputs.os == 'windows-2022' }}
run: smctl windows certsync
shell: cmd

- name: Set deployment target (MacOS)
run: echo "MACOSX_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV # TODO: set this to 10.12 once rocksDB issue is fixed
if: inputs.os == 'macos-11'
Expand Down Expand Up @@ -146,7 +146,6 @@ jobs:
BLOOM_APPLE_ID: ${{ secrets.APPLE_ID }} # Requires prefix of BLOOM otherwise electron builder tries to notarize the app using the env variables
BLOOM_APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} # Requires prefix of BLOOM otherwise electron builder tries to notarize the app using the env variables
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRIVATE_REPO_ACCESS_TOKEN: ${{ vars.PRIVATE_REPO_ACCESS_TOKEN }} # TODO: Remove following lines after we're open source
MACOS_SKIP_NOTARIZATION: false
working-directory: packages/desktop
if: ${{ inputs.sign && inputs.os == 'macos-11' }}
Expand All @@ -156,7 +155,6 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MACOS_SKIP_NOTARIZATION: true
PRIVATE_REPO_ACCESS_TOKEN: ${{ vars.PRIVATE_REPO_ACCESS_TOKEN }} # TODO: Remove following lines after we're open source
working-directory: packages/desktop
if: ${{ ! inputs.sign && inputs.os == 'macos-11' }}

Expand All @@ -165,7 +163,6 @@ jobs:
env:
CERTIFICATE_FINGERPRINT: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRIVATE_REPO_ACCESS_TOKEN: ${{ vars.PRIVATE_REPO_ACCESS_TOKEN }} # TODO: Remove following lines after we're open source
SIGN: true
working-directory: packages/desktop
if: ${{ inputs.sign && inputs.os == 'windows-2022' }}
Expand All @@ -174,7 +171,6 @@ jobs:
run: yarn compile:${env:STAGE}:win
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRIVATE_REPO_ACCESS_TOKEN: ${{ vars.PRIVATE_REPO_ACCESS_TOKEN }} # TODO: Remove following lines after we're open source
SIGN: false
working-directory: packages/desktop
if: ${{ ! inputs.sign && inputs.os == 'windows-2022' }}
Expand All @@ -185,7 +181,6 @@ jobs:
if: inputs.os == 'ubuntu-20.04'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRIVATE_REPO_ACCESS_TOKEN: ${{ vars.PRIVATE_REPO_ACCESS_TOKEN }} # TODO: Remove following lines after we're open source
- name: Import GPG key (Linux)
run: |
echo "$GPG_PRIVATE_KEY" | base64 -d > /tmp/private.key && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@
...(attributes && { attributes }),
}
async function prepareNftOutput(): Promise<void> {
const outputData = buildNftOutputBuilderParams(irc27Metadata, $selectedAccount.depositAddress)
const client = await getClient()
const preparedOutput = await client.buildNftOutput(outputData)
storageDeposit = Number(preparedOutput.amount) ?? 0
totalStorageDeposit = storageDeposit * quantity
async function setStorageDeposit(): Promise<void> {
try {
const outputData = buildNftOutputBuilderParams(irc27Metadata, $selectedAccount.depositAddress)
const client = await getClient()
const preparedOutput = await client.buildNftOutput(outputData)
storageDeposit = Number(preparedOutput.amount) ?? 0
totalStorageDeposit = storageDeposit * quantity
} catch (err) {
handleError(err)
}
}
async function mintAction(): Promise<void> {
Expand Down Expand Up @@ -72,8 +77,8 @@
onMount(async () => {
try {
void setStorageDeposit()
await _onMount()
await prepareNftOutput()
} catch (err) {
handleError(err)
}
Expand All @@ -97,7 +102,7 @@
<div class="max-h-100 scrollable-y flex-1">
<nft-details class="flex flex-col justify-center items-center space-y-5">
<Avatar size="lg" shape="square" surface={2}>
<MediaIcon {type} size="base" />
<MediaIcon {type} size="base" surface={2} />
</Avatar>
<activity-details class="w-full h-full space-y-2 flex flex-auto flex-col shrink-0">
<Tabs bind:selectedTab tabs={TABS} />
Expand All @@ -123,7 +128,7 @@
{
key: localize('general.storageDeposit'),
value:
quantity === 0
quantity === 1
? formatTokenAmountPrecise(storageDeposit, getBaseToken())
: undefined,
},
Expand Down
3 changes: 0 additions & 3 deletions packages/desktop/electron-builder-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ const prodConfig: Configuration = {
vPrefixedTagName: false,
channel: 'latest',
publishAutoUpdate: true,
// TODO: Remove following lines after we're open source
private: true,
token: process.env.PRIVATE_REPO_ACCESS_TOKEN,
},
}

Expand Down
3 changes: 3 additions & 0 deletions packages/desktop/features/app.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const appFeatures: IAppFeatures = {
de: false,
},
},
particles: {
enabled: false,
},
}

export default appFeatures
2 changes: 1 addition & 1 deletion packages/desktop/features/contacts.features.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IContactsFeatures } from '@lib/features/interfaces'

const contactsFeatures: IContactsFeatures = {
enabled: true,
enabled: false,
sendTo: {
enabled: true,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/features/onboarding.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const onboardingFeaturesForTestnet: IOnboardingFeaturesForNetwork = {
softwareProfile: {
enabled: true,
skipVerification: {
enabled: true,
enabled: false,
},
},
ledgerProfile: {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/features/settings.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const settingsFeatures: ISettingsFeatures = {
enabled: true,
},
faq: {
enabled: true,
enabled: false,
},
discord: {
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "desktop",
"productName": "Bloom",
"version": "0.1.0-alpha-6",
"version": "0.1.0",
"description": "Simple and secure web3 wallet for the IOTA and Shimmer ecosystem",
"main": "public/build/main.process.js",
"repository": "[email protected]:bloomwalletio/bloom.git",
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop/views/components/Background.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import appFeatures from '@features/app.features'
import { BgGradient, Particles } from '.'
export let surface: 0 | 1 | 2 | 'brand' | 'invert' = 0
Expand All @@ -10,7 +11,7 @@
{#if gradient}
<BgGradient variant={gradient} />
{/if}
{#if particles}
{#if particles && appFeatures?.particles?.enabled}
<Particles />
{/if}
</div>
6 changes: 2 additions & 4 deletions packages/desktop/views/dashboard/Dashboard.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { NavbarContainer } from '@components'
import { selectedAccount, selectedAccountIndex } from '@core/account/stores'
import { selectedAccountIndex } from '@core/account/stores'
import { IS_MAC, Platform } from '@core/app'
import { clearL2TokensPoll, pollL2BalanceForAccount } from '@core/layer-2/actions'
import { clearL2TokensPoll } from '@core/layer-2/actions'
import {
addNftsToDownloadQueue,
downloadNextNftInQueue,
Expand Down Expand Up @@ -56,8 +56,6 @@
})
Platform.DeepLinkManager.checkForDeepLinkRequest()
void pollL2BalanceForAccount($selectedAccount)
})
onDestroy(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { localize } from '@core/i18n'
import { canAccountMakeEvmTransaction } from '@core/layer-2/actions'
import { marketCoinPrices } from '@core/market/stores'
import { getNetwork, isEvmChain } from '@core/network'
import { canAccountMakeStardustTransaction, getNetwork, isEvmChain, isStardustNetwork } from '@core/network'
import { AccountTokens, BASE_TOKEN_ID, IToken, ITokenWithBalance, TokenStandard } from '@core/token'
import { getAccountTokensForSelectedAccount, getTokenBalance } from '@core/token/actions'
import { selectedAccountTokens } from '@core/token/stores'
Expand All @@ -28,15 +28,19 @@
$: accountTokens = getAccountTokensForSelectedAccount($marketCoinPrices)
$: accountTokens, searchValue, selectedTab, setFilteredTokenList()
let hasTokenError: boolean = false
$: if (isEvmChain(selectedToken?.networkId)) {
hasTokenError = !canAccountMakeEvmTransaction(
$selectedAccountIndex,
selectedToken.networkId,
$sendFlowParameters?.type
)
let tokenError: string = ''
$: if (
isEvmChain(selectedToken?.networkId) &&
!canAccountMakeEvmTransaction($selectedAccountIndex, selectedToken.networkId, $sendFlowParameters?.type)
) {
tokenError = localize('error.send.insufficientFundsTransaction')
} else if (
isStardustNetwork(selectedToken?.networkId) &&
!canAccountMakeStardustTransaction($selectedAccountIndex, selectedToken.networkId, $sendFlowParameters?.type)
) {
tokenError = localize('error.send.insufficientFundsTransaction')
} else {
hasTokenError = false
tokenError = ''
}
let selectedTab: { key: string; value: string } = { key: 'all', value: 'All' }
Expand Down Expand Up @@ -95,7 +99,7 @@
function onTokenClick(token: ITokenWithBalance): void {
try {
if (token === selectedToken && !hasTokenError) {
if (token === selectedToken && !tokenError) {
onContinueClick()
} else {
selectedToken = token
Expand Down Expand Up @@ -150,7 +154,7 @@
continueButton={{
text: localize('actions.continue'),
onClick: onContinueClick,
disabled: !selectedToken || hasTokenError,
disabled: !selectedToken || tokenError,
}}
>
<div class="space-y-4">
Expand All @@ -159,18 +163,20 @@
<div class="-mr-3">
<token-list class="w-full flex flex-col">
{#each tokenList as token}
{@const selected = selectedToken?.id === token.id && selectedToken?.networkId === token?.networkId}
{@const error = selected ? Boolean(tokenError) : false}
<TokenAmountTile
{token}
{error}
{selected}
amount={getTokenBalance(token.id, token.networkId)?.available}
error={token === selectedToken && hasTokenError}
onClick={() => onTokenClick(token)}
selected={selectedToken?.id === token.id && selectedToken?.networkId === token?.networkId}
/>
{/each}
</token-list>
</div>
{#if hasTokenError}
<Alert variant="danger" text={localize('error.send.insufficientFundsGasFee')} />
{#if tokenError}
<Alert variant="danger" text={tokenError} />
{/if}
</div>
</PopupTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,19 @@
{localize(`views.settings.${category}.title`)}
</Text>
{#each visibleSettings as { component, childRoute, props }, index}
<section id={childRoute} class="w-full sm:w-3/4 pb-6 border-solid border-b border-stroke">
<section id={childRoute}>
<svelte:component this={component} {...props} route={childRoute} />
</section>
{/each}
</div>

<style lang="scss">
section {
@apply w-full sm:w-3/4 pb-6;
@apply border-solid border-b border-stroke dark:border-stroke-dark;
&:last-child {
@apply border-none;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const isLedgerLiveIllustration = illustration === 'ledger-live'
</script>

<ledger-illustration class="flex relative justify-center items-center w-full">
<ledger-illustration class="flex relative justify-center items-center w-full overflow-hidden">
{#if pill}
<pill class="absolute">
<Pill color={pill.color}>
Expand Down
23 changes: 13 additions & 10 deletions packages/shared/src/components/modals/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,32 @@
if (!show || !modal) {
return
}
const viewportHeight = window.innerHeight
const modalRect = modal?.getBoundingClientRect()
const spaceAbove = modalRect?.top
const spaceBelow = viewportHeight - modalRect?.bottom
const maxSpace =
spaceBelow > 0 ? modalRect?.height - Math.abs(spaceAbove) : modalRect?.height - Math.abs(spaceBelow)
maxHeight = maxSpace - 10
const modalRect = modal.getBoundingClientRect()
const availableSpace = position.top ? viewportHeight - modalRect.top : modalRect.bottom
maxHeight = availableSpace - 10
}
function handleResize() {
updateMaxHeight()
}
onMount(() => {
if (autoMaxHeight) {
window.addEventListener('resize', () => void updateMaxHeight())
void updateMaxHeight()
window.addEventListener('resize', handleResize)
updateMaxHeight()
}
})
onDestroy(() => {
if (autoMaxHeight) {
window.removeEventListener('resize', () => void updateMaxHeight())
window.removeEventListener('resize', handleResize)
}
})
$: show, autoMaxHeight && void updateMaxHeight()
$: if (show && autoMaxHeight) updateMaxHeight()
</script>

{#if show}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
label={localize('general.network')}
options={networkOptions}
disabled={isBusy}
hideValue
/>
{#if networkType === OnboardingNetworkType.Custom}
<NumberInput bind:value={coinType} label={localize('general.coinType')} disabled={isBusy} isInteger />
Expand Down
Loading

0 comments on commit b19d6e5

Please sign in to comment.