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

feat: add Permit (ERC-2612), Permit2 and Wallet Call API (EIP-5792) support #331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions examples/deposit-flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"@lifi/sdk": "^3.4.2",
"@lifi/widget": "workspace:^",
"@mui/material": "^5.16.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"events": "^3.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.54",
"wagmi": "^2.13.3"
"wagmi": "^2.13.5"
},
"devDependencies": {
"@types/events": "^3.0.3",
Expand Down
14 changes: 7 additions & 7 deletions examples/dynamic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
"preview": "vite preview"
},
"dependencies": {
"@dynamic-labs/bitcoin": "^3.9.0",
"@dynamic-labs/ethereum": "^3.9.0",
"@dynamic-labs/sdk-react-core": "^3.9.0",
"@dynamic-labs/solana": "^3.9.0",
"@dynamic-labs/wagmi-connector": "^3.9.0",
"@dynamic-labs/bitcoin": "^3.9.1",
"@dynamic-labs/ethereum": "^3.9.1",
"@dynamic-labs/sdk-react-core": "^3.9.1",
"@dynamic-labs/solana": "^3.9.1",
"@dynamic-labs/wagmi-connector": "^3.9.1",
"@lifi/wallet-management": "workspace:^",
"@lifi/widget": "workspace:^",
"@mui/material": "^5.16.8",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/web3.js": "^1.95.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"mitt": "^3.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.54",
"wagmi": "^2.13.3"
"wagmi": "^2.13.5"
},
"devDependencies": {
"@types/react": "^18.3.13",
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-page-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "next start"
},
"dependencies": {
"@lifi/widget": "^3.12.2",
"@lifi/widget": "^3.12.3",
"next": "^14.2.18",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@lifi/sdk": "^3.4.2",
"@lifi/widget": "^3.12.2",
"@lifi/widget": "^3.12.3",
"next": "^14.2.18",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"@lifi/widget": "^3.12.2",
"@lifi/widget": "^3.12.3",
"nuxt": "3.14.1592",
"veaury": "^2.5.1",
"veaury": "^2.6.1",
"vite-plugin-node-polyfills": "^0.22.0",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/rainbowkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"dependencies": {
"@lifi/widget": "workspace:^",
"@rainbow-me/rainbowkit": "^2.2.1",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.54",
"wagmi": "^2.13.3"
"wagmi": "^2.13.5"
},
"devDependencies": {
"@types/react": "^18.3.13",
Expand Down
14 changes: 7 additions & 7 deletions examples/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
"typecheck": "tsc"
},
"dependencies": {
"@lifi/widget": "^3.12.2",
"@remix-run/css-bundle": "^2.15.0",
"@remix-run/node": "^2.15.0",
"@remix-run/react": "^2.15.0",
"@remix-run/serve": "^2.15.0",
"@lifi/widget": "^3.12.3",
"@remix-run/css-bundle": "^2.15.1",
"@remix-run/node": "^2.15.1",
"@remix-run/react": "^2.15.1",
"@remix-run/serve": "^2.15.1",
"isbot": "^5.1.13",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"remix-utils": "^7.6.0"
},
"devDependencies": {
"@remix-run/dev": "^2.15.0",
"@remix-run/dev": "^2.15.1",
"@types/react": "^18.3.13",
"@types/react-dom": "^18.3.1",
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vite-tsconfig-paths": "^5.1.3"
"vite-tsconfig-paths": "^5.1.4"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/node": "^22.10.1",
"@types/react": "^18.3.13",
"@types/react-dom": "^18.3.1",
"svelte": "^5.7.0",
"svelte": "^5.10.0",
"svelte-check": "^4.1.1",
"svelte-preprocess": "^6.0.2",
"tslib": "^2.8.1",
Expand Down
6 changes: 3 additions & 3 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
},
"dependencies": {
"@lifi/sdk": "^3.4.2",
"@lifi/wallet-management": "^3.4.5",
"@lifi/wallet-management": "^3.4.6",
"@lifi/widget": "workspace:^",
"@mui/material": "^5.16.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"@wagmi/connectors": "^5.5.3",
"events": "^3.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.54",
"wagmi": "^2.13.3"
"wagmi": "^2.13.5"
},
"devDependencies": {
"@types/events": "^3.0.3",
Expand Down
4 changes: 2 additions & 2 deletions examples/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"preview": "vite preview"
},
"dependencies": {
"@lifi/widget": "^3.12.2",
"veaury": "^2.5.1",
"@lifi/widget": "^3.12.3",
"veaury": "^2.6.1",
"vue": "^3.5.13"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/zustand-widget-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"dependencies": {
"@lifi/widget": "workspace:^",
"@mui/material": "^5.16.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"wagmi": "^2.13.3",
"wagmi": "^2.13.5",
"zustand": "^5.0.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@commitlint/config-conventional": "^19.6.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2",
"@types/events": "^3.0.3",
"@types/node": "^22.10.1",
Expand All @@ -67,5 +67,5 @@
"bs58": ">=4.0.1"
}
},
"packageManager": "pnpm@9.14.4"
"packageManager": "pnpm@9.15.0"
}
12 changes: 6 additions & 6 deletions packages/wallet-management/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"@bigmi/client": "^0.0.5",
"@bigmi/core": "^0.0.5",
"@bigmi/react": "^0.0.5",
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@lifi/sdk": "^3.4.2",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@lifi/sdk": "^3.5.0-beta.0",
"@mui/icons-material": "^5.16.8",
"@mui/lab": "5.0.0-alpha.174",
"@mui/material": "^5.16.8",
Expand All @@ -65,10 +65,10 @@
"i18next": "^24.0.5",
"mitt": "^3.0.1",
"react": "^18.3.1",
"react-i18next": "^15.1.3",
"use-sync-external-store": "^1.2.2",
"react-i18next": "^15.1.4",
"use-sync-external-store": "^1.4.0",
"viem": "^2.21.54",
"wagmi": "^2.13.3",
"wagmi": "^2.13.5",
"zustand": "^5.0.2"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/widget-embedded/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
},
"author": "Eugene Chybisov <[email protected]>",
"dependencies": {
"@lifi/sdk": "^3.4.2",
"@lifi/sdk": "^3.5.0-beta.0",
"@lifi/wallet-management": "workspace:*",
"@lifi/widget": "workspace:*",
"@mui/icons-material": "^5.16.8",
"@mui/lab": "5.0.0-alpha.174",
"@mui/material": "^5.16.8",
"@mui/system": "^5.16.8",
"@opensea/seaport-js": "4.0.4",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"bignumber.js": "^9.1.2",
"ethers": "^6.13.4",
"events": "^3.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.28.0",
"viem": "^2.21.54",
"wagmi": "^2.13.3"
"wagmi": "^2.13.5"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
Expand Down
8 changes: 4 additions & 4 deletions packages/widget-playground-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
"start": "next start"
},
"dependencies": {
"@emotion/cache": "^11.13.5",
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@emotion/cache": "^11.14.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@lifi/widget": "workspace:*",
"@lifi/widget-playground": "workspace:*",
"@mui/material": "^5.16.8",
"@mui/material-nextjs": "^5.16.8",
"@mui/system": "^5.16.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"core-js": "^3.39.0",
"next": "14.2.15",
"react": "^18.3.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/widget-playground-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
},
"author": "Eugene Chybisov <[email protected]>",
"dependencies": {
"@emotion/cache": "^11.13.5",
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@emotion/cache": "^11.14.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@lifi/widget-playground": "workspace:*",
"@mui/material": "^5.16.8",
"@mui/system": "^5.16.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/widget-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"./widget-config": "./src/defaultWidgetConfig.ts"
},
"dependencies": {
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@lifi/sdk": "^3.4.2",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@lifi/sdk": "^3.5.0-beta.0",
"@lifi/wallet-management": "workspace:*",
"@lifi/widget": "workspace:*",
"@monaco-editor/react": "^4.6.0",
Expand All @@ -41,14 +41,14 @@
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/web3.js": "^1.95.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query": "^5.62.3",
"csstype": "^3.1.3",
"lodash.isequal": "^4.5.0",
"microdiff": "^1.4.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.54",
"wagmi": "^2.13.3",
"wagmi": "^2.13.5",
"zustand": "^5.0.2"
},
"devDependencies": {
Expand Down
14 changes: 7 additions & 7 deletions packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"@bigmi/client": "^0.0.5",
"@bigmi/core": "^0.0.5",
"@bigmi/react": "^0.0.5",
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@lifi/sdk": "^3.4.2",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@lifi/sdk": "^3.5.0-beta.0",
"@lifi/wallet-management": "workspace:^",
"@mui/icons-material": "^5.16.8",
"@mui/lab": "5.0.0-alpha.174",
Expand All @@ -62,18 +62,18 @@
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/web3.js": "^1.95.8",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-virtual": "^3.10.9",
"@tanstack/react-query": "^5.62.3",
"@tanstack/react-virtual": "^3.11.1",
"i18next": "^24.0.5",
"microdiff": "^1.4.0",
"mitt": "^3.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^15.1.3",
"react-i18next": "^15.1.4",
"react-intersection-observer": "^9.13.1",
"react-router-dom": "^6.28.0",
"viem": "^2.21.54",
"wagmi": "^2.13.3",
"wagmi": "^2.13.5",
"zustand": "^5.0.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const ActiveTransactionItem: React.FC<{

const getStatusComponent = () => {
switch (lastActiveProcess?.status) {
case 'PERMIT_REQUIRED':
case 'ACTION_REQUIRED':
return <InfoRounded color="info" fontSize="small" />
case 'FAILED':
Expand Down
15 changes: 13 additions & 2 deletions packages/widget/src/components/Step/CircularProgress.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const getStatusColor = (
substatus?: Substatus
) => {
switch (status) {
case 'PERMIT_REQUIRED':
case 'ACTION_REQUIRED':
return alpha(theme.palette.info.main, 0.12)
case 'DONE':
Expand All @@ -33,12 +34,22 @@ export const CircularIcon = styled(Box, {
shouldForwardProp: (prop: string) => !['status', 'substatus'].includes(prop),
})<{ status?: ProcessStatus; substatus?: Substatus }>(
({ theme, status, substatus }) => ({
backgroundColor: ['ACTION_REQUIRED', 'DONE', 'FAILED'].includes(status!)
backgroundColor: [
'PERMIT_REQUIRED',
'ACTION_REQUIRED',
'DONE',
'FAILED',
].includes(status!)
? getStatusColor(theme, status, substatus)
: theme.palette.background.paper,
borderStyle: 'solid',
borderColor: getStatusColor(theme, status, substatus),
borderWidth: !['ACTION_REQUIRED', 'DONE', 'FAILED'].includes(status!)
borderWidth: ![
'PERMIT_REQUIRED',
'ACTION_REQUIRED',
'DONE',
'FAILED',
].includes(status!)
? 3
: 0,
display: 'grid',
Expand Down
3 changes: 2 additions & 1 deletion packages/widget/src/components/Step/CircularProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export function CircularProgress({ process }: { process: Process }) {
{process.status === 'STARTED' || process.status === 'PENDING' ? (
<CircularProgressPending size={40} />
) : null}
{process.status === 'ACTION_REQUIRED' ? (
{process.status === 'PERMIT_REQUIRED' ||
process.status === 'ACTION_REQUIRED' ? (
<InfoRounded
color="info"
sx={{
Expand Down
Loading
Loading