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

feat: remove hardcoded base token dependencies from the app #8160

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
fix: remove nodeInfo deriveds
cpl121 committed Apr 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 0fed75eb3b548ae79dfcf50e1de38e8abae7d55a
6 changes: 1 addition & 5 deletions packages/shared/lib/core/network/stores/node-info.store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { INodeInfo } from '@iota/sdk/out/types'
import { writable, derived } from 'svelte/store'
import { writable } from 'svelte/store'

export const nodeInfo = writable<INodeInfo | undefined>(undefined)

export function setNodeInfo(newNodeInfo: INodeInfo | undefined): void {
return nodeInfo.set(newNodeInfo)
}

export const nodeInfoBaseToken = derived(nodeInfo, ($nodeInfo) => $nodeInfo?.baseToken)

export const nodeInfoProtocol = derived(nodeInfo, ($nodeInfo) => $nodeInfo?.protocol)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { IBaseToken, TokenStandard } from '@core/wallet'
import { nodeInfoBaseToken } from '@core/network'
import { nodeInfo } from '@core/network'
import { get } from 'svelte/store'

export function getBaseToken(): IBaseToken {
const $nodeInfoBaseToken = get(nodeInfoBaseToken)
const $nodeInfo = get(nodeInfo)

return {
standard: TokenStandard.BaseToken,
...$nodeInfoBaseToken,
...$nodeInfo?.baseToken,
}
}