Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8d86145
auto-claude: subtask-1-1 - Update package.json for RainbowKit to Reow…
Jan 17, 2026
a8fe9cd
auto-claude: subtask-2-1 - Create appkit.ts configuration file with a…
Jan 17, 2026
915f0a2
auto-claude: subtask-2-2 - Refactor wagmi.ts to use WagmiAdapter and …
Jan 17, 2026
8ba0428
auto-claude: subtask-3-1 - Refactor WalletProvider.tsx to use AppKit …
Jan 17, 2026
97966df
auto-claude: subtask-3-2 - Update demo/App.tsx to use AppKit instead …
Jan 17, 2026
e2f1738
auto-claude: subtask-4-1 - Verify EVM wallet connection and transacti…
Jan 17, 2026
ab5a1f9
auto-claude: subtask-5-1 - Create transactionStatus.ts service for ch…
Jan 17, 2026
0c7a98f
auto-claude: subtask-5-2 - Create useTransactionStatus.ts hook for un…
Jan 17, 2026
6082c68
auto-claude: subtask-6-1 - Create useBitcoinSigning.ts hook for UTXO …
Jan 17, 2026
3104126
auto-claude: subtask-6-2 - Update SwapWidget.tsx to handle UTXO chain…
Jan 17, 2026
29bdba0
auto-claude: subtask-7-1 - Create useSolanaSigning.ts hook for Solana…
Jan 17, 2026
59e2f30
auto-claude: subtask-7-2 - Update SwapWidget.tsx to handle Solana cha…
Jan 17, 2026
564e965
auto-claude: subtask-8-1 - Update useBalances.ts to support UTXO and …
Jan 17, 2026
13af1f8
auto-claude: subtask-9-1 - Update types/index.ts with multi-chain wal…
Jan 17, 2026
cd337da
auto-claude: subtask-10-2 - Run ESLint to verify code quality
Jan 17, 2026
ccb3d83
auto-claude: subtask-10-4 - Manual browser verification of all chain …
Jan 17, 2026
997650d
fix: hnnng
NeOMakinG Jan 18, 2026
ae5e096
fix: review feedbacks
NeOMakinG Jan 18, 2026
bbf3f46
fix: hnnng
NeOMakinG Jan 18, 2026
6a885e5
Merge branch 'develop' into auto-claude/001-feat-switch-widget-to-wal…
NeOMakinG Jan 18, 2026
02460b6
fix: address CodeRabbit review comments
NeOMakinG Jan 21, 2026
b9033c3
fix: update @reown packages to 1.8.17 to fix Solana chain id error
NeOMakinG Jan 21, 2026
556cdd2
fix: lock
NeOMakinG Jan 21, 2026
aea72ce
fix: address new CodeRabbit review comments
NeOMakinG Jan 21, 2026
38a240e
fix: validate projectId in createWagmiAdapter to prevent silent reuse
NeOMakinG Jan 21, 2026
cbe931b
fix: address GOMES review comments
NeOMakinG Jan 21, 2026
bef4da8
fix: add defensive check for Solana instruction data
NeOMakinG Jan 21, 2026
aa78ebc
fix: sync yarn.lock from develop
NeOMakinG Jan 21, 2026
84fa788
fix: remove unused _timeoutMs parameter from waitForSolanaConfirmation
NeOMakinG Jan 21, 2026
f5f9b20
fix: lock
NeOMakinG Jan 21, 2026
87293e5
Merge remote-tracking branch 'origin/develop' into auto-claude/001-fe…
NeOMakinG Jan 21, 2026
cc1e558
Merge branch 'develop' into auto-claude/001-feat-switch-widget-to-wal…
NeOMakinG Jan 21, 2026
33f6152
Merge branch 'develop' into auto-claude/001-feat-switch-widget-to-wal…
NeOMakinG Jan 21, 2026
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
32 changes: 22 additions & 10 deletions packages/swap-widget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function App() {
| `theme` | `ThemeMode \| ThemeConfig` | `"dark"` | Theme mode (`"light"` or `"dark"`) or full theme configuration. |
| `defaultSlippage` | `string` | `"0.5"` | Default slippage tolerance percentage. |
| `showPoweredBy` | `boolean` | `true` | Show "Powered by ShapeShift" branding. |
| `enableWalletConnection` | `boolean` | `false` | Enable built-in wallet connection UI using RainbowKit. Requires `walletConnectProjectId`. |
| `enableWalletConnection` | `boolean` | `false` | Enable built-in wallet connection UI using Reown AppKit. Supports EVM, Bitcoin, and Solana wallets. Requires `walletConnectProjectId`. |
| `walletConnectProjectId` | `string` | - | WalletConnect project ID for the built-in wallet connection. Get one at <https://cloud.walletconnect.com>. |
| `defaultReceiveAddress` | `string` | - | Fixed receive address for swaps. When set, users cannot change the receive address. |

Expand Down Expand Up @@ -136,22 +136,24 @@ function App() {
}
```

### With Wallet Connection (wagmi/viem)
### With External Wallet Connection (wagmi/viem)

If you already have wagmi set up in your application, you can pass the wallet client directly:

```tsx
import { SwapWidget } from "@shapeshiftoss/swap-widget";
import { useWalletClient } from "wagmi";
import { useConnectModal } from "@rainbow-me/rainbowkit";

function App() {
const { data: walletClient } = useWalletClient();
const { openConnectModal } = useConnectModal();

return (
<SwapWidget
apiKey="your-api-key"
walletClient={walletClient}
onConnectWallet={openConnectModal}
onConnectWallet={() => {
// Your custom wallet connection logic
}}
onSwapSuccess={(txHash) => {
console.log("Swap successful:", txHash);
}}
Expand Down Expand Up @@ -230,9 +232,9 @@ function App() {
}
```

### With Built-in Wallet Connection
### With Built-in Wallet Connection (Multi-Chain)

The widget can manage wallet connections internally using RainbowKit. This is useful when you don't have an existing wallet connection setup.
The widget can manage wallet connections internally using Reown AppKit, which supports EVM chains, Bitcoin, and Solana. This is useful when you don't have an existing wallet connection setup.

```tsx
import { SwapWidget } from "@shapeshiftoss/swap-widget";
Expand All @@ -249,6 +251,12 @@ function App() {
}
```

When `enableWalletConnection` is true, the widget will:
- Show a "Connect" button that opens the AppKit modal
- Support connecting EVM wallets (MetaMask, WalletConnect, etc.)
- Support connecting Bitcoin wallets via WalletConnect
- Support connecting Solana wallets (Phantom, Solflare, etc.)

### With Fixed Receive Address

Use `defaultReceiveAddress` to lock the receive address. When set, users cannot change the destination address. This is useful for integrations where you want all swaps to go to a specific address.
Expand Down Expand Up @@ -466,10 +474,14 @@ import {

## Notes and Limitations

### EVM vs Non-EVM Swaps
### Multi-Chain Swap Support

The widget supports swaps across multiple blockchain types:

- **EVM swaps** (e.g., ETH to USDC, MATIC to WETH) can be executed directly within the widget when a wallet is connected via the `walletClient` prop.
- **Non-EVM swaps** (e.g., BTC to ETH, SOL to USDC) redirect the user to [app.shapeshift.com](https://app.shapeshift.com) to complete the transaction. This is because non-EVM chains require different wallet types.
- **EVM swaps** (e.g., ETH to USDC, MATIC to WETH) can be executed directly within the widget when a wallet is connected via the `walletClient` prop or through the built-in AppKit wallet connection.
- **Bitcoin/UTXO swaps** - When using the built-in wallet connection (`enableWalletConnection={true}`), Bitcoin and other UTXO chains can be signed directly via WalletConnect-compatible wallets.
- **Solana swaps** - Solana transactions can be signed via Phantom, Solflare, or other Solana wallets when using the built-in wallet connection.
- **Unsupported chains** - Swaps involving chains without wallet support will redirect to [app.shapeshift.com](https://app.shapeshift.com) to complete the transaction.

### API Key

Expand Down
9 changes: 7 additions & 2 deletions packages/swap-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@rainbow-me/rainbowkit": "2.1.7",
"@reown/appkit": "^1.8.17",
"@reown/appkit-adapter-bitcoin": "^1.8.17",
"@reown/appkit-adapter-solana": "^1.8.17",
"@reown/appkit-adapter-wagmi": "^1.8.17",
"@shapeshiftoss/caip": "npm:@shapeshiftoss/[email protected]",
"@shapeshiftoss/utils": "npm:@shapeshiftoss/[email protected]",
"@solana/wallet-adapter-wallets": "^0.19.32",
"@solana/web3.js": "^1.98.0",
"@tanstack/react-query": "^5.69.0",
"bech32": "^2.0.0",
"p-queue": "^8.0.1",
"react-virtuoso": "^4.7.11",
"viem": "2.40.3",
"wagmi": "^2.9.2"
"wagmi": "3.3.2"
},
"devDependencies": {
"@types/react": "^19.0.0",
Expand Down
Loading