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

fix(core): update algosdk import to resolve CommonJS module issue #259

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions packages/use-wallet/src/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Algodv2 } from 'algosdk'
import algosdk from 'algosdk'
import { NetworkId, isValidNetworkId } from 'src/network'
import { WalletId, type WalletAccount } from 'src/wallets'
import type { Store } from '@tanstack/store'
Expand All @@ -14,14 +14,14 @@ export interface State {
wallets: WalletStateMap
activeWallet: WalletId | null
activeNetwork: NetworkId
algodClient: Algodv2
algodClient: algosdk.Algodv2
}

export const defaultState: State = {
wallets: {},
activeWallet: null,
activeNetwork: NetworkId.TESTNET,
algodClient: new Algodv2('', 'https://testnet-api.4160.nodely.dev/')
algodClient: new algosdk.Algodv2('', 'https://testnet-api.4160.nodely.dev/')
}

export const LOCAL_STORAGE_KEY = '@txnlab/use-wallet:v3'
Expand Down Expand Up @@ -145,7 +145,7 @@ export function setAccounts(

export function setActiveNetwork(
store: Store<State>,
{ networkId, algodClient }: { networkId: NetworkId; algodClient: Algodv2 }
{ networkId, algodClient }: { networkId: NetworkId; algodClient: algosdk.Algodv2 }
) {
store.setState((state) => ({
...state,
Expand Down