Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to @iota/sdk #7174

Merged
merged 54 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1b66742
feat: Point iota/wallet dependency to iota/sdk
msarcev Jul 12, 2023
fbd0617
chore: Fix AddressBalance -> Balance & MintNativeTokenParams -> Creat…
msarcev Jul 12, 2023
f74a531
chore: Migrate Node > INode, MintTokenTransaction > CreateNativeToken…
msarcev Jul 12, 2023
d6b6fdc
chore: Fix a couple of type sources
msarcev Jul 12, 2023
1740266
chore: Fix ClientOptions > IClientOptions (rename firefly IClientOpti…
msarcev Jul 12, 2023
26fe1f6
chore: Migrate EventType > WalletEventType
msarcev Jul 12, 2023
3714341
chore: Migrate AccountManagerOptions > WalletOptions
msarcev Jul 12, 2023
29c6593
chore: Migrate to iota/sdk models (remove @iota/types) pass 1
msarcev Jul 12, 2023
fb1c7cf
chore: Migrate to iota/sdk models (remove @iota/types) pass 2
msarcev Jul 13, 2023
abd219d
chore: Migrate to iota/sdk models (remove @iota/types) pass 3
msarcev Jul 14, 2023
0ddde68
chore: Remove @iota/types dependency
msarcev Jul 14, 2023
32ba0ad
chore: Fix issues after rebase (to develop). Bump iota/sdk used to 1.…
msarcev Jul 31, 2023
c4afa64
Merge branch 'develop' into migrate-to-iota-sdk
msarcev Jul 31, 2023
f6bf6e9
chore: Fix imports for enums (index.node loader issue fix attempt)
msarcev Aug 1, 2023
17d7707
chore: Replace all sdk imports to point to '@iota/wallet/out/types'
msarcev Aug 1, 2023
63e7b37
chore: Add import for 'reflect-metadata' to top of the app (needed fo…
msarcev Aug 1, 2023
f11ef84
chore: Rename AccountManager to Wallet
marc2332 Aug 1, 2023
3222e04
chore: Fix initialiseProfileManager
marc2332 Aug 1, 2023
63d2a72
chore: Move utility functions to electron
marc2332 Aug 1, 2023
5615dab
fix: Update getNodeInfo
marc2332 Aug 1, 2023
a927c1b
chore: Update sdk to v1.0.3
marc2332 Aug 1, 2023
3691923
chore: Small fixes
marc2332 Aug 2, 2023
2352480
chore: Fix "getters" from sdk in favour of readonly fields (instead o…
msarcev Aug 8, 2023
12bf34a
chore: Bump version of @iota/sdk used
msarcev Aug 8, 2023
ccc4b7f
Merge branch 'develop' into migrate-to-iota-sdk
msarcev Aug 8, 2023
a0dcec0
chore: Type fixes
marc2332 Aug 9, 2023
a23c0de
fix: Fix action "Create alias"
msarcev Aug 9, 2023
6fae005
chore: Type and test fixes
marc2332 Aug 10, 2023
00e9c01
chore: Fix Mint Nft/Native token flows
msarcev Aug 10, 2023
f95eec9
chore: Fix one accessor on ExpirationUnlockCondition
msarcev Aug 10, 2023
5f28ee8
chore: Rename dependency to @iota/sdk
msarcev Aug 10, 2023
711bab8
chore: Remove unused utils methods in favour of SDK Utils class (mapp…
msarcev Aug 10, 2023
7b43c0a
chore: Fix some failing tests
msarcev Aug 11, 2023
faf364e
chore: Fix getOutputParameters test
msarcev Aug 15, 2023
f65fc26
chore: Fix failing tests
msarcev Aug 15, 2023
24af73c
chore: Fix imports in buildNFtFromNftOutput.test
msarcev Aug 15, 2023
4ef5560
chore: Fix buildNftFromNftOutput.test again (prevent use of Client/Ut…
msarcev Aug 15, 2023
063ce2f
chore: Improve buildNftFromNftOutput.test. Remove unneeded async in t…
msarcev Aug 15, 2023
c453777
fix: imports and types
brancoder Aug 16, 2023
4b09793
fix: leftover Output imports @core/wallet/types
brancoder Aug 16, 2023
27e0792
chore: bump sdk version to 1.0.5
brancoder Aug 18, 2023
c0c6607
conflict resolved
brancoder Aug 18, 2023
b6333f2
fix: resolve conflict in yarn.lock
brancoder Aug 21, 2023
e87a02f
fix: sync IAccount interface with SDK Account Class
brancoder Aug 21, 2023
99796a0
chore: Revert manual binding instantiation experiment
marc2332 Aug 21, 2023
46f8ef5
chore: Simplify code
marc2332 Aug 21, 2023
3457d6b
Merge branch 'develop' into migrate-to-iota-sdk
brancoder Aug 21, 2023
614a9a8
Merge remote-tracking branch 'origin/develop' into migrate-to-iota-sdk
begonaalvarezd Aug 24, 2023
d895986
chore: Bump @iota/sdk version
msarcev Aug 28, 2023
57babc7
chore: Remove docs section about @iota/wallet
msarcev Aug 28, 2023
4e5c8ff
fix: Fix method not found on FoundryOutput (use readonly field directly)
msarcev Aug 28, 2023
c5418c6
chore: Add comment explaining reflect-metadata
msarcev Aug 28, 2023
3e44f74
chore: Refactor move computeOutputId
msarcev Aug 28, 2023
28445c8
Merge branch 'develop' into migrate-to-iota-sdk
begonaalvarezd Aug 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions docs/standard-operating-procedures/development/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ This SOP is only applicable to maintainers of this repository, that are responsi
* [Regular Releases](#regular-releases)
* [Milestone Releases](#milestone-releases)
* [Hotfix Releases](#hotfix-releases)
* [@iota/wallet (NPM) release](#iotawallet-npm-release)

## External References

Expand Down Expand Up @@ -287,23 +286,3 @@ After the hotfix has been released we can then merge the release branch into bot
* Do **not** use squash and merge at this point as we will loose the commit history used for the changelog
* Do **not** delete the release branch, as it will be used as the base for hotfixes in the future

## @iota/wallet (NPM) Release

The Firefly team is partly responsible for the npm package release of the [wallet.rs bindings](https://github.com/iotaledger/wallet.rs/tree/production/bindings/nodejs). The package serves
as the backend of the application. The following steps describe the release process of the wallet.rs bindings.

### 1. Opening changelog PR

To trigger the release process, you add a markdown file describing the type of release (major/minor/patch) together with a description of what changed.
The GitHub action expects the file to be under `wallet.rs/.changes`. More information can be found [here](https://github.com/iotaledger/wallet.rs/tree/production/.changes#readme).

[Here](https://github.com/iotaledger/wallet.rs/pull/1212) is an example PR.

The merge of this PR triggers the action described in the following step.

### 2. Merge the release PR

Upon merging the PR from the previous step, GitHub actions automatically opens a new PR. This PR deletes the previously added .md file and updates
the package.json file and appends the changelog message to the changelog file. Merging this PR triggers the automatic release of the npm package.

[Here](https://github.com/iotaledger/wallet.rs/pull/1216) is an example PR.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
],
"devDependencies": {
"@babel/eslint-parser": "^7.15.0",
"@iota/types": "^1.0.0-beta.9",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.57.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/components/ProposalAnswer.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { Answer } from '@iota/wallet'
import type { Answer } from '@iota/sdk/out/types'

import { Icon, PingingBadge, Text, TooltipIcon } from '@ui'
import { FontWeight, Position } from '@ui/enums'
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/components/ProposalQuestion.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { AnswerStatus, Question } from '@iota/wallet'
import type { AnswerStatus, Question } from '@iota/sdk/out/types'

import { ProposalAnswer } from '@components'
import { Icon, Text, TooltipIcon } from '@ui'
Expand Down Expand Up @@ -53,7 +53,7 @@
cursor-pointer dark:border-transparent dark:bg-gray-850"
class:animate-pulse={isLoading}
>
<button on:click={() => onQuestionClick(questionIndex)} class="flex justify-between items-center">

Check warning on line 56 in packages/desktop/components/ProposalQuestion.svelte

View workflow job for this annotation

GitHub Actions / lint

Missing return type on function
<div class="flex flex-col min-w-0">
{#if questionIndex !== undefined}
<Text smaller fontWeight={FontWeight.bold} overrideColor classes="mb-1 text-blue-500">
Expand Down Expand Up @@ -95,7 +95,7 @@
isWinner={answerIndex === winnerAnswerIndex}
proposalStatus={$selectedProposal?.status}
truncate={!isOpened}
onAnswerClick={() => onAnswerClick(answer.value, questionIndex)}

Check warning on line 98 in packages/desktop/components/ProposalQuestion.svelte

View workflow job for this annotation

GitHub Actions / lint

Missing return type on function
/>
{/each}
</proposal-answers>
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/components/popups/AddProposalPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { localize } from '@core/i18n'
import { activeAccounts, updateActiveAccountPersistedData } from '@core/profile'
import { truncateString } from '@core/utils/string'
import type { Auth } from '@iota/wallet'
import type { Auth } from '@iota/sdk/out/types'
import { Button, Checkbox, NodeInput, Text, TextInput, TextType } from 'shared/components'
import { HTMLButtonType } from 'shared/components/enums'

Expand Down
27 changes: 13 additions & 14 deletions packages/desktop/components/popups/AliasConfirmationPopup.svelte
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
<script lang="ts">
import { Button, KeyValueBox, Text, FontWeight, TextType } from 'shared/components'
import { selectedAccount, updateSelectedAccount } from '@core/account'
import { api, getClient } from '@core/profile-manager'
import { localize } from '@core/i18n'
import { checkActiveProfileAuth, getBaseToken } from '@core/profile'
import {
convertBech32ToHexAddress,
formatTokenAmountPrecise,
EMPTY_HEX_ID,
UNLOCK_CONDITION_GOVERNOR_ADDRESS,
UNLOCK_CONDITION_STATE_CONTROLLER_ADDRESS,
processAndAddToActivities,
} from '@core/wallet'
import { formatTokenAmountPrecise, EMPTY_HEX_ID, processAndAddToActivities } from '@core/wallet'
import { AliasOutput, UnlockConditionType, PreparedTransaction } from '@iota/sdk/out/types'
import { closePopup } from '@auxiliary/popup'
import { onMount } from 'svelte'
import { handleError } from '@core/error/handlers/handleError'
import { plainToInstance } from 'class-transformer'

export let _onMount: (..._: any[]) => Promise<void> = async () => {}

let storageDeposit: string = '0'

$: address = {
type: 0,
pubKeyHash: convertBech32ToHexAddress($selectedAccount.depositAddress),
pubKeyHash: api.bech32ToHex($selectedAccount.depositAddress),
}
$: aliasOutput = address
? {
aliasId: EMPTY_HEX_ID,
unlockConditions: [
{
type: UNLOCK_CONDITION_GOVERNOR_ADDRESS,
type: UnlockConditionType.GovernorAddress,
address,
},
{
type: UNLOCK_CONDITION_STATE_CONTROLLER_ADDRESS,
type: UnlockConditionType.StateControllerAddress,
address,
},
],
Expand All @@ -42,9 +38,10 @@
$: void setStorageDeposit(aliasOutput)
$: isTransferring = $selectedAccount.isTransferring

async function setStorageDeposit(aliasOutput): Promise<void> {
async function setStorageDeposit(aliasOutput: AliasOutput): Promise<void> {
try {
const { amount } = await $selectedAccount.buildAliasOutput(aliasOutput)
const client = await getClient()
const { amount } = await client.buildAliasOutput(aliasOutput)
msarcev marked this conversation as resolved.
Show resolved Hide resolved
storageDeposit = formatTokenAmountPrecise(Number(amount), getBaseToken())
} catch (err) {
handleError(err)
Expand All @@ -54,7 +51,9 @@
async function createAlias(): Promise<void> {
try {
updateSelectedAccount({ isTransferring: true })
const transaction = await $selectedAccount.createAliasOutput()
const transaction = await $selectedAccount
.prepareCreateAliasOutput()
.then((prepared) => plainToInstance(PreparedTransaction, prepared).send())
await processAndAddToActivities(transaction, $selectedAccount)
closePopup()
} catch (err) {
Expand Down
22 changes: 9 additions & 13 deletions packages/desktop/components/popups/BalanceBreakdownPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,9 @@
import { selectedAccount } from '@core/account'
import { localize } from '@core/i18n'
import { checkActiveProfileAuth } from '@core/profile'
import {
OUTPUT_TYPE_TREASURY,
UNLOCK_CONDITION_EXPIRATION,
UNLOCK_CONDITION_STORAGE_DEPOSIT_RETURN,
UNLOCK_CONDITION_TIMELOCK,
} from '@core/wallet'
import { consolidateOutputs } from '@core/wallet/actions/consolidateOutputs'
import { getStorageDepositFromOutput } from '@core/wallet/utils/generateActivity/helper'
import type { UnlockConditionTypes } from '@iota/types'
import { UnlockCondition, UnlockConditionType, OutputType, CommonOutput } from '@iota/sdk/out/types'
import { TextHintVariant } from 'shared/components/enums'
import { BalanceSummarySection, Button, FontWeight, Text, TextType } from 'shared/components'

Expand Down Expand Up @@ -58,16 +52,18 @@

let type: string
let amount: number
if (output.type !== OUTPUT_TYPE_TREASURY) {
if (containsUnlockCondition(output.unlockConditions, UNLOCK_CONDITION_EXPIRATION)) {
if (output.type !== OutputType.Treasury) {
const commonOutput = output as CommonOutput
if (containsUnlockCondition(commonOutput.unlockConditions, UnlockConditionType.Expiration)) {
type = PendingFundsType.Unclaimed
amount = Number(output.amount)
} else if (
containsUnlockCondition(output.unlockConditions, UNLOCK_CONDITION_STORAGE_DEPOSIT_RETURN)
containsUnlockCondition(commonOutput.unlockConditions, UnlockConditionType.StorageDepositReturn)
) {
type = PendingFundsType.StorageDepositReturn
amount = (await getStorageDepositFromOutput($selectedAccount, output))?.storageDeposit
} else if (containsUnlockCondition(output.unlockConditions, UNLOCK_CONDITION_TIMELOCK)) {
amount = (await getStorageDepositFromOutput($selectedAccount, output as CommonOutput))
?.storageDeposit
} else if (containsUnlockCondition(commonOutput.unlockConditions, UnlockConditionType.Timelock)) {
type = PendingFundsType.Timelock
amount = Number(output.amount)
}
Expand Down Expand Up @@ -115,7 +111,7 @@
return { amount: totalStorageDeposit, subBreakdown }
}

function containsUnlockCondition(unlockConditions: UnlockConditionTypes[], unlockConditionId: number) {
function containsUnlockCondition(unlockConditions: UnlockCondition[], unlockConditionId: number): boolean {
return unlockConditions.some((unlockCondition) => unlockCondition.type === unlockConditionId)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
import { Button, KeyValueBox, Text, FontWeight, TextType } from 'shared/components'
import { onMount } from 'svelte'
import { getClient } from '@core/profile-manager'
import { selectedAccount } from '@core/account'
import { handleError } from '@core/error/handlers/handleError'

Expand All @@ -33,7 +34,8 @@
metadata,
aliasId
)
const preparedOutput = await $selectedAccount.buildFoundryOutput(outputData)
const client = await getClient()
const preparedOutput = await client.buildFoundryOutput(outputData)
storageDeposit = formatTokenAmountPrecise(Number(preparedOutput.amount) ?? 0, getBaseToken())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { onMount } from 'svelte'
import { Button, Text, FontWeight, NftImageOrIconBox, Tabs, KeyValueBox, NftSize } from 'shared/components'
import { localize } from '@core/i18n'
import { getClient } from '@core/profile-manager'
import { selectedAccount } from '@core/account'
import { buildNftOutputData, formatTokenAmountPrecise, mintNft, mintNftDetails } from '@core/wallet'
import { getBaseToken, checkActiveProfileAuth } from '@core/profile'
Expand Down Expand Up @@ -51,7 +52,8 @@

async function prepareNftOutput(): Promise<void> {
const outputData = buildNftOutputData(irc27Metadata, $selectedAccount.depositAddress)
const preparedOutput = await $selectedAccount.buildNftOutput(outputData)
const client = await getClient()
const preparedOutput = await client.buildNftOutput(outputData)
storageDeposit = Number(preparedOutput.amount) ?? 0
totalStorageDeposit = storageDeposit * quantity
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Button, HTMLButtonType, Text, TextInput, TextType } from 'shared/components'
import type { Auth } from '@iota/wallet'
import type { Auth } from '@iota/sdk/out/types'
import { handleError } from '@core/error/handlers'
import { localize } from '@core/i18n'
import { closePopup } from '@auxiliary/popup'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import { sendOutput } from '@core/wallet/actions'
import { DEFAULT_TRANSACTION_OPTIONS } from '@core/wallet/constants'
import { getOutputParameters, validateSendConfirmation, getAddressFromSubject } from '@core/wallet/utils'
import { Activity, NewTokenTransactionDetails, Output } from '@core/wallet/types'
import { Activity, NewTokenTransactionDetails } from '@core/wallet/types'
import { CommonOutput, Output } from '@iota/sdk/out/types'
import { closePopup, openPopup, PopupId } from '@auxiliary/popup'
import { ledgerPreparedOutput } from '@core/ledger'
import { getStorageDepositFromOutput } from '@core/wallet/utils/generateActivity/helper'
Expand Down Expand Up @@ -145,7 +146,7 @@

async function updateStorageDeposit(): Promise<void> {
const { storageDeposit: _storageDeposit, giftedStorageDeposit: _giftedStorageDeposit } =
await getStorageDepositFromOutput($selectedAccount, preparedOutput)
await getStorageDepositFromOutput($selectedAccount, preparedOutput as CommonOutput)
begonaalvarezd marked this conversation as resolved.
Show resolved Hide resolved
storageDeposit = minimumStorageDeposit = _storageDeposit > 0 ? _storageDeposit : _giftedStorageDeposit
if (isBaseTokenTransfer) {
const rawAmount = Number((transactionDetails as NewTokenTransactionDetails).rawAmount)
Expand All @@ -166,7 +167,7 @@

async function onConfirmClick(): Promise<void> {
try {
await validateSendConfirmation($selectedAccount, preparedOutput)
await validateSendConfirmation($selectedAccount, preparedOutput as CommonOutput)

if ($isActiveLedgerProfile) {
ledgerPreparedOutput.set(preparedOutput)
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/electron-builder-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const prodConfig = () => ({
artifactName: 'firefly-desktop-${version}.${ext}',
copyright: 'IOTA Foundation',
directories: { buildResources: './public', output: './out' },
files: ['public/', 'package.json', '!node_modules/@iota/wallet/target/*'],
files: ['public/', 'package.json', '!node_modules/@iota/sdk/target/*'],
appId: APP_ID,
afterSign: async () => {
// eslint-disable-next-line no-useless-catch
Expand Down
52 changes: 41 additions & 11 deletions packages/desktop/electron/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

const { ipcRenderer, contextBridge } = require('electron')
const ElectronApi = require('./electronApi')
const WalletApi = require('@iota/wallet')
const IotaSdk = require('@iota/sdk')
const fs = require('fs')

const SEND_CRASH_REPORTS = window.process.argv.includes('--send-crash-reports=true')
Expand Down Expand Up @@ -65,7 +65,7 @@ try {
levelFilter: 'debug',
targetExclusions: ['h2', 'hyper', 'rustls', 'message_handler'],
}
WalletApi.initLogger(loggerOptions)
IotaSdk.initLogger(loggerOptions)

deleteOldLogs(logDir, versionDetails.currentVersion)
})
Expand Down Expand Up @@ -96,47 +96,77 @@ try {
// https://www.electronjs.org/docs/latest/api/context-bridge
// This workaround exposes the classes through factory methods
// The factory method also copies all the prototype methods to the object so that it gets passed through the bridge

const methodNames = Object.getOwnPropertyNames(IotaSdk.Utils).filter(
(m) => !['length', 'name', 'prototype'].includes(m)
)
const methods = {}

for (const name of methodNames) {
methods[name] = (...args) => IotaSdk.Utils[name](...args)
}

contextBridge.exposeInMainWorld('__WALLET__API__', {
createAccountManager(id, options) {
const manager = new WalletApi.AccountManager(options)
...methods,
async getNodeInfo(managerId, url, auth) {
const manager = profileManagers[managerId]
const client = await manager.getClient()
const nodeUrl = url ?? (await client.getNode()).url

const nodeInfo = await client.getNodeInfo(nodeUrl, auth)

return {
url: nodeUrl,
nodeInfo,
}
},
createWallet(id, options) {
const manager = new IotaSdk.Wallet(options)
manager.id = id
profileManagers[id] = manager
bindMethodsAcrossContextBridge(WalletApi.AccountManager.prototype, manager)
bindMethodsAcrossContextBridge(IotaSdk.Wallet.prototype, manager)
return manager
},
async createAccount(managerId, payload) {
const manager = profileManagers[managerId]
const account = await manager.createAccount(payload)
bindMethodsAcrossContextBridge(WalletApi.Account.prototype, account)
bindMethodsAcrossContextBridge(IotaSdk.Account.prototype, account)
return account
},
deleteAccountManager(id) {
deleteWallet(id) {
if (id && id in profileManagers) {
delete profileManagers[id]
}
},
async getAccount(managerId, index) {
const manager = profileManagers[managerId]
const account = await manager.getAccount(index)
bindMethodsAcrossContextBridge(WalletApi.Account.prototype, account)
bindMethodsAcrossContextBridge(IotaSdk.Account.prototype, account)
return account
},
async getAccounts(managerId) {
const manager = profileManagers[managerId]
const accounts = await manager.getAccounts()
accounts.forEach((account) => bindMethodsAcrossContextBridge(WalletApi.Account.prototype, account))
accounts.forEach((account) => bindMethodsAcrossContextBridge(IotaSdk.Account.prototype, account))
return accounts
},
async recoverAccounts(managerId, payload) {
const manager = profileManagers[managerId]
const accounts = await manager.recoverAccounts(...Object.values(payload))
accounts.forEach((account) => bindMethodsAcrossContextBridge(WalletApi.Account.prototype, account))
accounts.forEach((account) => bindMethodsAcrossContextBridge(IotaSdk.Account.prototype, account))
return accounts
},
async getClient(managerId) {
const manager = profileManagers[managerId]
const client = await manager.getClient()
bindMethodsAcrossContextBridge(IotaSdk.Client.prototype, client)

return client
},
async migrateStrongholdSnapshotV2ToV3(currentPath, newPath, currentPassword, newPassword) {
const snapshotSaltV2 = 'wallet.rs'
const snapshotRoundsV2 = 100
return WalletApi.migrateStrongholdSnapshotV2ToV3(
return IotaSdk.migrateStrongholdSnapshotV2ToV3(
currentPath,
newPath,
snapshotSaltV2,
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// needed for features from @iota/sdk which use reflection (decorators)
import 'reflect-metadata'
msarcev marked this conversation as resolved.
Show resolved Hide resolved
import App from './App.svelte'
import { Electron } from './lib/electron'
import { shouldReportError } from './electron/lib/errorHandling'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { VotingEventPayload, ParticipationEventType, TrackedParticipationOverview } from '@iota/wallet/out/types'
import { VotingEventPayload, ParticipationEventType, TrackedParticipationOverview } from '@iota/sdk/out/types'

import { onMount, onDestroy } from 'svelte'

Expand Down
Loading
Loading