Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@0xsequence/signhub": "2.3.41",
"@0xsequence/wallet-core": "3.0.6",
"@0xsequence/wallet-primitives": "3.0.6",
"@0xsequence/wallet-wdk": "3.0.6",
"@radix-ui/react-popover": "1.1.2",
"@tailwindcss/postcss": "^4.1.18",
"@tailwindcss/vite": "^4.1.18",
Expand Down Expand Up @@ -65,4 +64,4 @@
"typescript": "5.7.2",
"vite": "5.4.10"
}
}
}
120 changes: 0 additions & 120 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 31 additions & 1 deletion src/arweave-reader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
import { State } from '@0xsequence/wallet-core'

export const arweaveReader = new State.Arweave.Reader({
const arweaveSource: State.Reader = new State.Arweave.Reader({
rateLimitRetryDelayMs: 10_000,
})

const arweaveProvider: State.Provider = {
getConfiguration: imageHash => arweaveSource.getConfiguration(imageHash),
getDeploy: wallet => arweaveSource.getDeploy(wallet),
getWallets: signer => arweaveSource.getWallets(signer),
getWalletsForSapient: (signer, imageHash) => arweaveSource.getWalletsForSapient(signer, imageHash),
getWitnessFor: (wallet, signer) => arweaveSource.getWitnessFor(wallet, signer),
getWitnessForSapient: (wallet, signer, imageHash) =>
arweaveSource.getWitnessForSapient(wallet, signer, imageHash),
getConfigurationUpdates: (wallet, fromImageHash, options) =>
arweaveSource.getConfigurationUpdates(wallet, fromImageHash, options),
getTree: rootHash => arweaveSource.getTree(rootHash),
getPayload: opHash => arweaveSource.getPayload(opHash),
saveWallet: () => undefined,
saveWitnesses: () => undefined,
saveUpdate: () => undefined,
saveTree: () => undefined,
saveConfiguration: () => undefined,
saveDeploy: () => undefined,
savePayload: () => undefined,
}

const arweaveCache = new State.Local.Provider(
new State.Local.IndexedDbStore('sequence-arweave-cache')
)

export const arweaveReader: State.Reader = new State.Cached({
source: arweaveProvider,
cache: arweaveCache,
})
14 changes: 10 additions & 4 deletions src/components/recovery/InsufficientBalanceMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Alert } from "@0xsequence/design-system"
import type { TokenBalance } from "@0xsequence/indexer"
import { ethers } from "ethers"
import { ParsedCall } from "~/utils/transaction-parser"
import type { CollectibleInfo } from "~/stores/CollectibleStore"
import type { ParsedCall } from "~/utils/transaction-parser"
import { formatPrettyBalance } from "~/utils/format-pretty-balance"

interface InsufficientBalanceMessageProps {
firstCall: ParsedCall
firstCall?: ParsedCall
transactionAmount?: bigint
balances: any[]
collectibles: any[]
balances: TokenBalance[]
collectibles: CollectibleInfo[]
chainId: number
tokenMetadata: Map<string, { decimals: number; symbol: string }>
}
Expand All @@ -20,6 +22,10 @@ export function InsufficientBalanceMessage({
chainId,
tokenMetadata
}: InsufficientBalanceMessageProps) {
if (!firstCall) {
return null
}

const getMessage = () => {
if (firstCall.type === 'erc721') {
return `You don't own this NFT (Token ID: ${firstCall.tokenId?.toString()}).`
Expand Down
Loading
Loading