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 #224

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0f95a81
feat: add permits
chybisov Dec 5, 2024
04c2871
fix: allowance adjustments
chybisov Dec 10, 2024
7bdd175
fix: lock files
chybisov Dec 10, 2024
c9a1c60
fix: test types
chybisov Dec 10, 2024
c092684
chore(release): 3.5.0-beta.0
chybisov Dec 10, 2024
66d2ccf
fix: remove token receiver
chybisov Dec 20, 2024
a6b822c
feat: add relayer service (draft)
chybisov Jan 2, 2025
cb1854b
Merge branch 'main' into permits
chybisov Jan 2, 2025
c35d9cc
fix: replace more actions with getAction util
chybisov Jan 2, 2025
12db08e
Merge branch 'main' into permits
chybisov Jan 7, 2025
90915a9
fix: add quote update
chybisov Jan 7, 2025
faf7a16
fix: relayer status improvements
chybisov Jan 9, 2025
e8f2e1b
Merge branch 'main' into permits
chybisov Jan 9, 2025
484f083
chore(release): 3.6.0-beta.0
chybisov Jan 9, 2025
bbef7f0
refactor: improve relayed tx handling
chybisov Jan 13, 2025
df73b5e
Merge branch 'main' into permits
chybisov Jan 14, 2025
44e09e3
chore(release): 3.6.0-beta.1
chybisov Jan 14, 2025
3def922
chore: export typeguard
chybisov Jan 14, 2025
78c591b
chore(release): 3.6.0-beta.2
chybisov Jan 14, 2025
0e585e2
fix: move ankr provider to the bottom
chybisov Jan 14, 2025
4b03fb0
chore: adjust typeguard
chybisov Jan 14, 2025
83117fa
fix: improve permit flow
chybisov Jan 15, 2025
7f0aff7
chore(release): 3.6.0-beta.3
chybisov Jan 15, 2025
f22142e
fix: error name
chybisov Jan 17, 2025
adb6081
refactor: permit
chybisov Jan 27, 2025
06cb14f
chore: bump packages
chybisov Jan 27, 2025
d84aa9a
chore(release): 3.6.0-beta.4
chybisov Jan 27, 2025
de51430
Merge branch 'main' into permits
chybisov Feb 4, 2025
bc086a3
fix: add chain
chybisov Feb 5, 2025
2fbfbef
Merge branch 'main' into permits
chybisov Feb 5, 2025
1d65536
chore(release): 3.6.0-beta.5
chybisov Feb 6, 2025
1ee44c2
feat: add check permit
chybisov Feb 13, 2025
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
11 changes: 6 additions & 5 deletions examples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"author": "LI.FI <[email protected]>",
"license": "MIT",
"dependencies": {
"@lifi/data-types": "^5.23.0",
"@lifi/sdk": "^3.5.2",
"@wagmi/connectors": "^5.7.5",
"@lifi/data-types": "^5.24.0",
"@lifi/sdk": "^3.5.3",
"@wagmi/connectors": "^5.7.6",
"@wagmi/core": "^2.16.3",
"dotenv": "^16.4.7",
"viem": "^2.22.21"
"viem": "^2.22.22"
},
"scripts": {
"example:swap": "tsx examples/swap.ts",
Expand All @@ -27,5 +27,6 @@
"@types/node": "^22.13.1",
"tsx": "^4.19.2",
"typescript": "^5.7.3"
}
},
"packageManager": "[email protected]"
}
95 changes: 50 additions & 45 deletions examples/node/pnpm-lock.yaml

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lifi/sdk",
"version": "3.5.3",
"version": "3.6.0-beta.5",
"description": "LI.FI Any-to-Any Cross-Chain-Swap SDK",
"keywords": [
"bridge",
Expand Down Expand Up @@ -93,14 +93,14 @@
},
"dependencies": {
"@bigmi/core": "^0.1.1",
"@lifi/types": "^16.6.0",
"@lifi/types": "^16.8.0",
"@noble/curves": "^1.8.1",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/web3.js": "^1.98.0",
"bech32": "^2.0.0",
"bitcoinjs-lib": "^7.0.0-rc.0",
"bs58": "^6.0.0",
"viem": "^2.22.21"
"viem": "^2.22.22"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
Expand Down Expand Up @@ -133,5 +133,5 @@
"postbump": "node scripts/version.js && git add ."
}
},
"packageManager": "pnpm@10.2.0"
"packageManager": "pnpm@9.15.5"
}
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

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

5 changes: 4 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId, type ExtendedChain } from '@lifi/types'
import { ChainId, type ChainType, type ExtendedChain } from '@lifi/types'
import type { SDKProvider } from './core/types.js'
import type { RPCUrls, SDKBaseConfig, SDKConfig } from './types/internal.js'

Expand Down Expand Up @@ -34,6 +34,9 @@ export const config = (() => {
}
return _config
},
getProvider(type: ChainType) {
return _config.providers.find((provider) => provider.type === type)
},
setProviders(providers: SDKProvider[]) {
const providerMap = new Map(
_config.providers.map((provider) => [provider.type, provider])
Expand Down
7 changes: 6 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
export const AddressZero = '0x0000000000000000000000000000000000000000'
export const AlternativeAddressZero =
'0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
export const wrappedSolAddress = 'So11111111111111111111111111111111111111112'

export const SolSystemProgram = '11111111111111111111111111111111'

export const MaxUint48 = BigInt('0xffffffffffff')
export const MaxUint160 = BigInt('0xffffffffffffffffffffffffffffffffffffffff')
export const MaxUint256 =
BigInt(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn)
Loading
Loading