Skip to content

Commit

Permalink
feat: add support for Abstract Global Wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
rkalis committed Jan 3, 2025
1 parent 4cc1ebf commit b8f2fb8
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 10 deletions.
2 changes: 2 additions & 0 deletions lib/hooks/ethereum/EthereumProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { abstractWalletConnector } from '@abstract-foundation/agw-react/connectors';
import { useCsrRouter } from 'lib/i18n/csr-navigation';
import { usePathname } from 'lib/i18n/navigation';
import { ORDERED_CHAINS, createViemPublicClientForChain, getViemChainConfig } from 'lib/utils/chains';
Expand All @@ -26,6 +27,7 @@ export const connectors = [
},
}),
coinbaseWallet({ appName: 'Revoke.cash' }),
abstractWalletConnector(),
];

export const wagmiConfig = createConfig({
Expand Down
1 change: 1 addition & 0 deletions lib/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const isNetworkError = (error?: string | any): boolean => {

export const parseErrorMessage = (error: any): string => {
const errorMessage =
error?.cause?.details || // Abstract Global Wallet
error?.error?.message ||
error?.data?.message ||
error?.response?.data?.message ||
Expand Down
1 change: 1 addition & 0 deletions lib/utils/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const getWalletIcon = (connector: Connector): string | undefined => {
const mapping: Record<string, string> = {
// Injected wallets
'1inchwallet': '/assets/images/vendor/wallets/1inch.svg',
abstract: '/assets/images/vendor/wallets/abstract.jpg',
backpack: '/assets/images/vendor/wallets/backpack.svg',
'bifrost wallet': '/assets/images/vendor/wallets/bifrost.svg',
bitkeep: '/assets/images/vendor/wallets/bitkeep.svg',
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@
},
"private": true,
"dependencies": {
"@abstract-foundation/agw-client": "^0.1.5",
"@abstract-foundation/agw-react": "^0.1.7",
"@dotenvx/dotenvx": "^1.14.2",
"@headlessui/react": "^2.1.2",
"@heroicons/react": "^2.1.5",
"@neondatabase/serverless": "^0.10.1",
"@privy-io/cross-app-connect": "^0.1.2",
"@revoke.cash/chains": "^59.0.0",
"@tanstack/query-sync-storage-persister": "^5.52.0",
"@tanstack/react-query": "^5.52.0",
Expand Down Expand Up @@ -77,6 +80,7 @@
"@cypress/grep": "^4.1.0",
"@lavamoat/allow-scripts": "^3.2.0",
"@localazy/cli": "^1.7.14",
"@rainbow-me/rainbowkit": "^2.2.1",
"@tailwindcss/typography": "^0.5.14",
"@types/md5": "^2.3.5",
"@types/mixpanel-browser": "^2.49.1",
Expand Down Expand Up @@ -111,15 +115,16 @@
"lavamoat": {
"allowScripts": {
"$root$": true,
"@abstract-foundation/agw-react>secp256k1": false,
"@biomejs/biome": true,
"@vercel/speed-insights": false,
"cypress": true,
"sharp": true,
"tsx>esbuild": true,
"viem>ws>bufferutil": true,
"viem>ws>utf-8-validate": true,
"wagmi>@wagmi/connectors>cbw-sdk>keccak": false,
"wagmi>@wagmi/connectors>@metamask/sdk>eciesjs>secp256k1": false,
"@biomejs/biome": true
"wagmi>@wagmi/connectors>@metamask/sdk>eciesjs>secp256k1": false
}
},
"mocha": {
Expand Down
Binary file added public/assets/images/vendor/wallets/abstract.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b8f2fb8

Please sign in to comment.