Skip to content

Commit

Permalink
fix promise race
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 committed Aug 13, 2024
1 parent 95fb2e9 commit 6013846
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@pythnetwork/client": "2.21.1",
"@raydium-io/raydium-sdk": "1.3.1-beta.31",
"@sentry/nextjs": "8.24.0",
"@solana/promises": "2.0.0-canary-20240812091942",
"@solana/spl-governance": "0.3.27",
"@solana/spl-token": "0.4.8",
"@solana/wallet-adapter-base": "0.9.23",
Expand Down
3 changes: 2 additions & 1 deletion utils/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Metadata,
JsonMetadata,
} from '@metaplex-foundation/js'
import { safeRace } from '@solana/promises'

export class TokenAccount {
publicKey!: PublicKey
Expand Down Expand Up @@ -103,7 +104,7 @@ function loadNft(
) {
const metaplex = new Metaplex(connection)

return Promise.race([
return safeRace([
metaplex
.nfts()
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3134,6 +3134,11 @@
"@solana/codecs-strings" "2.0.0-preview.4"
"@solana/errors" "2.0.0-preview.4"

"@solana/[email protected]":
version "2.0.0-canary-20240812091942"
resolved "https://registry.yarnpkg.com/@solana/promises/-/promises-2.0.0-canary-20240812091942.tgz#e0f1d0c200170a791f120e320b10c446d30644c9"
integrity sha512-HLYVZxrXnMatnBBtHCK1qY7T2AEnhI2AL4PY10iZZ98JIO9dE6igRwFlBulC3ts8qBBkivDf0rF6RahvkrHV0A==

"@solana/spl-account-compression@^0.1.4", "@solana/spl-account-compression@^0.1.8":
version "0.1.10"
resolved "https://registry.yarnpkg.com/@solana/spl-account-compression/-/spl-account-compression-0.1.10.tgz#b3135ce89349d6090832b3b1d89095badd57e969"
Expand Down

0 comments on commit 6013846

Please sign in to comment.