-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'ca31adb52d0318c41eea0bf0a845fb966e7c8044' into 2681----…
…update-build-actions-before-they-are-deprecated
- Loading branch information
Showing
30 changed files
with
358 additions
and
233 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
4 changes: 2 additions & 2 deletions
4
packages/desktop/views/settings/views/profile/Currency.svelte
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
46 changes: 46 additions & 0 deletions
46
packages/shared/src/lib/auxiliary/wallet-connect/actions/addAccountToAllDappSessions.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,46 @@ | ||
import { IAccountState, getAddressFromAccountForNetwork } from '@core/account' | ||
import { get } from 'svelte/store' | ||
import { ISupportedNamespace } from '../types' | ||
import { getWalletClient, walletClient } from '../stores' | ||
import { EvmNetworkId } from '@core/network/types' | ||
import { buildCaip10Address } from '../utils' | ||
import { connectedDapps } from '../stores' | ||
|
||
export async function addAccountToAllDappSessions(account: IAccountState): Promise<void> { | ||
const dapps = get(connectedDapps) | ||
for (const dapp of dapps) { | ||
if (dapp.sessionTopic && dapp.namespaces) { | ||
await addAccountForDappSession(dapp.sessionTopic, dapp.namespaces, account) | ||
} | ||
} | ||
} | ||
|
||
export async function addAccountForDappSession( | ||
sessionTopic: string, | ||
namespaces: Record<string, ISupportedNamespace>, | ||
account: IAccountState | ||
): Promise<void> { | ||
const walletConnectClient = get(walletClient) | ||
if (!walletConnectClient) { | ||
return | ||
} | ||
|
||
const protocols = Object.keys(namespaces ?? {}) | ||
for (const protocol of protocols) { | ||
if (!namespaces[protocol]) { | ||
continue | ||
} | ||
|
||
const chainsForSession = (namespaces[protocol].chains ?? []) as EvmNetworkId[] | ||
const addressOfAccountForEachChain = chainsForSession | ||
.map((chainId) => { | ||
const address = getAddressFromAccountForNetwork(account, chainId) | ||
return address ? buildCaip10Address(address, chainId) : undefined | ||
}) | ||
.filter(Boolean) as string[] | ||
|
||
namespaces[protocol].accounts = [...addressOfAccountForEachChain, ...namespaces[protocol].accounts] | ||
} | ||
|
||
await getWalletClient()?.updateSession({ topic: sessionTopic, namespaces }) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/shared/src/lib/auxiliary/wallet-connect/actions/index.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
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
2 changes: 1 addition & 1 deletion
2
packages/shared/src/lib/core/app/interfaces/transak-window-data.interface.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
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
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
4 changes: 2 additions & 2 deletions
4
packages/shared/src/lib/core/market/constants/default-market-currency.constant.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { MarketCurrency } from '../enums' | ||
import { FiatCurrency } from '../enums' | ||
|
||
export const DEFAULT_MARKET_CURRENCY = MarketCurrency.Usd | ||
export const DEFAULT_MARKET_CURRENCY = FiatCurrency.USD |
16 changes: 16 additions & 0 deletions
16
packages/shared/src/lib/core/market/enums/crypto-currency.enum.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 @@ | ||
// Coingecko supported crypto currencies prices | ||
export enum CryptoCurrency { | ||
BTC = 'btc', | ||
ETH = 'eth', | ||
LTC = 'ltc', | ||
BCH = 'bch', | ||
BNB = 'bnb', | ||
EOS = 'eos', | ||
XRP = 'xrp', | ||
XLM = 'xlm', | ||
LINK = 'link', | ||
DOT = 'dot', | ||
YFI = 'yfi', | ||
BITS = 'bits', | ||
SATS = 'sats', | ||
} |
Oops, something went wrong.