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: convert #2116

Merged
merged 113 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 92 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
a7c7ce0
feat(swap): add swap view
Cali93 Nov 21, 2023
9693a2a
refactor: update swap view ui (#1492)
enesozturk Nov 22, 2023
fff2914
chore: fix ts issues
enesozturk Nov 22, 2023
e3eca53
feat(1inch-api): request data from 1inch swap API (#1497)
Cali93 Nov 24, 2023
fedbb87
fix(multiple-requests): fix multiple requests issue
Cali93 Nov 24, 2023
9cf5b70
feat: implement remaining pages and ui components (#1493)
enesozturk Nov 24, 2023
d5ee070
refactor: update swap token state logics
enesozturk Nov 24, 2023
66061e9
fix(swaps): fix input onChange
Cali93 Nov 24, 2023
7bf805c
refactor: update all swap comps
enesozturk Mar 5, 2024
671cdd7
chore: update styles, remove unused functions
enesozturk Mar 5, 2024
b00813d
refactor: add amount input validation and formatting
enesozturk Mar 5, 2024
a93aaf7
chore: comment client methods
enesozturk Mar 5, 2024
ffaa666
chore: update lock file
enesozturk Mar 5, 2024
bf39179
refactor: ui changes, add gas price API
enesozturk Mar 6, 2024
7c4a76f
fix: build issues
enesozturk Mar 6, 2024
8781d6b
fix: linter issues
enesozturk Mar 6, 2024
82ebc55
fix: type error
enesozturk Mar 6, 2024
83ff610
refactor: update controller values, calculations, separate components
enesozturk Mar 7, 2024
ae8eed4
fix: build issues
enesozturk Mar 7, 2024
fac33b5
refactor: handle TX success
enesozturk Mar 8, 2024
452e158
feat: calculate price impact and slippage values
enesozturk Mar 11, 2024
25bca0b
chore: remove unused variables
enesozturk Mar 11, 2024
c1d511d
feat: add search, separate utils
enesozturk Mar 11, 2024
a7ec5b9
fix: linter issues
enesozturk Mar 11, 2024
554bc85
refactor: separate convert controllers
enesozturk Mar 15, 2024
5d1ca7d
chore: remove convert from default account view
enesozturk Mar 15, 2024
7ded284
refactor: improve business logics
enesozturk Mar 15, 2024
0144050
refactor: linter and build issues
enesozturk Mar 15, 2024
2836515
Merge branch 'V4' into feat/1inch-swaps
enesozturk Mar 19, 2024
a4f6d95
refactor: update token button usage
enesozturk Mar 19, 2024
4e2b47c
feat: add gas price checking
enesozturk Mar 21, 2024
0d66179
feat: add bignumber.js, refactor convert business logics
enesozturk Mar 22, 2024
f07dfdf
refactor: update price impact calculation method
enesozturk Mar 22, 2024
3cf32e3
chore: add suggested tokens list
enesozturk Mar 22, 2024
8ea56d7
chore: linter issues
enesozturk Mar 22, 2024
c63f4e6
fix: build and linter issues
enesozturk Mar 22, 2024
8c3d915
feat: add new ui components for different variations of transaction UIs
enesozturk Mar 28, 2024
877dee8
Merge branch 'V4' into feat/1inch-swaps
enesozturk Mar 28, 2024
a80ec50
feat: ui/styling improvements
enesozturk Apr 1, 2024
220a2d2
refactor: approve transaction view opening business logic
enesozturk Apr 1, 2024
af14fbc
chore: convert details section styling
enesozturk Apr 1, 2024
e249bd3
Merge branch 'V4' into feat/1inch-swaps
enesozturk Apr 2, 2024
c37cf68
chore: set native token as source token when reset state
enesozturk Apr 2, 2024
b8750a3
refactor: approve transaction iframe position stylings
enesozturk Apr 2, 2024
ddcdaa0
chore: update lock file
enesozturk Apr 2, 2024
9cf0ca0
feat: implement new lab with tailwind and shadcn comps
enesozturk Apr 2, 2024
bd165ae
chore: update lock file
enesozturk Apr 2, 2024
00e0d0f
chore: w3m color variables
enesozturk Apr 2, 2024
e5916f9
chore: fix package versions and format files
enesozturk Apr 2, 2024
63a6cf1
chore: add sonner
enesozturk Apr 2, 2024
1d75013
fix: toast call
enesozturk Apr 2, 2024
d11964a
chore: remove brackets for string props
enesozturk Apr 2, 2024
0c00a32
chore: remove loose dependency
enesozturk Apr 2, 2024
56db6d2
chore: hydration and styling issues
enesozturk Apr 2, 2024
6e7f04e
chore: svg props
enesozturk Apr 2, 2024
5ac15e5
chore: remove classname from the lit elements
enesozturk Apr 2, 2024
b2f4eb3
chore: remove lucid, refactor class names
enesozturk Apr 2, 2024
13d8dac
fix: dialog forwarded comps
enesozturk Apr 2, 2024
1888fc7
chore: update comp locations, refactor class names
enesozturk Apr 2, 2024
ed9e434
Merge branch 'refactor/lab-ui-update-design-system-vars' into feat/1i…
enesozturk Apr 2, 2024
fc5d5f8
chore: list more polygon tokens, add token balance watcher
enesozturk Apr 2, 2024
6b2ae0d
chore: build issues
enesozturk Apr 2, 2024
678fdb3
chore: code review updates
enesozturk Apr 3, 2024
befc141
chore: move convert api to utils, export missing comps
enesozturk Apr 3, 2024
4712c6a
fix: imports
enesozturk Apr 3, 2024
1767677
Revert "Merge branch 'refactor/lab-ui-update-design-system-vars' into…
enesozturk Apr 3, 2024
cf5665b
Merge branch 'V4' into feat/1inch-swaps
enesozturk Apr 3, 2024
4bb1008
chore: remove ts ignores, add mock functions for solana client
enesozturk Apr 3, 2024
a07300c
chore: export missing comps
enesozturk Apr 3, 2024
726e30e
chore: convert controller tests
enesozturk Apr 3, 2024
47b1ca8
chore: linter issues
enesozturk Apr 3, 2024
8b8b4d2
Merge branch 'V4' into feat/1inch-swaps
enesozturk Apr 3, 2024
74486a1
refactor: update transaction and router logics
enesozturk Apr 3, 2024
b738d98
chore: make sure about component exports
enesozturk Apr 3, 2024
25b1a7d
chore: update transaction stack callbacks
enesozturk Apr 3, 2024
4258418
chore: add missing exported composites
enesozturk Apr 3, 2024
d054a5c
chore: update lock file
enesozturk Apr 3, 2024
32e5d57
Merge branch 'V4' into feat/1inch-swaps
enesozturk Apr 4, 2024
0f43f7b
chore: update token fetch listeners
enesozturk Apr 5, 2024
7a21054
chore: update intervals
enesozturk Apr 5, 2024
17701e2
Merge branch 'V4' into feat/convert
enesozturk Apr 8, 2024
b97d069
chore: fix ui comp exports and conflicts
enesozturk Apr 8, 2024
e52483b
chore: remove scaffold components from ui package
enesozturk Apr 8, 2024
d6a7900
fix: convert components and styles
enesozturk Apr 8, 2024
18baf26
feat: add unit tests for convert, fix router controller tests
enesozturk Apr 8, 2024
ca72aed
chore: linter issues
enesozturk Apr 8, 2024
0460fec
Merge branch 'V4' into feat/convert
enesozturk Apr 9, 2024
17b0bdb
Merge branch 'V4' into feat/convert
enesozturk Apr 11, 2024
2dcfaf5
Merge branch 'V4' into feat/convert
enesozturk Apr 11, 2024
1f53b1c
Merge branch 'feat/convert' of https://github.com/WalletConnect/web3m…
enesozturk Apr 11, 2024
46c986e
Merge branch 'V4' into feat/convert
enesozturk Apr 14, 2024
43c29c6
chore: remove swap from default w3m and remove toast on cancel transa…
enesozturk Apr 15, 2024
647e7ae
refactor: convert input text color
enesozturk Apr 15, 2024
aa9374d
chore: switch to blockchain api for convert tokens and balance
enesozturk Apr 15, 2024
99db707
Merge branch 'V4' into feat/convert
enesozturk Apr 16, 2024
03a07fd
refactor: switch to blockchain api for convert endpoints
enesozturk Apr 16, 2024
0645a37
refactor: update type definitions
enesozturk Apr 17, 2024
e9ab90f
refactor: approve tx params and type updates
enesozturk Apr 17, 2024
80c01d6
Merge branch 'V4' into feat/convert
enesozturk Apr 18, 2024
246b340
refactor: blockchain api switching done
enesozturk Apr 19, 2024
7b1706a
refactor: remove 1inch endpoints, linter issues and general refactor
enesozturk Apr 19, 2024
463d674
refactor: code review updates
enesozturk Apr 19, 2024
458b9bc
refactor: code review improvements
enesozturk Apr 19, 2024
885a275
chore: estimate gas naming
enesozturk Apr 19, 2024
11601bc
Merge branch 'V4' into feat/convert
enesozturk Apr 19, 2024
5f6f129
feat: add regex util for checking transactions
enesozturk Apr 19, 2024
204dc8e
chore: linter issues
enesozturk Apr 19, 2024
bf9e857
fix: ethers onrpcresponse function param
enesozturk Apr 19, 2024
418bc74
chore: remove unused core method
enesozturk Apr 19, 2024
05e017a
refactor: rpc response logics
enesozturk Apr 19, 2024
1cd5b54
Merge branch 'V4' into feat/convert
enesozturk Apr 19, 2024
3d47f7e
refactor: add long tx hash handling to rpc response handler
enesozturk Apr 22, 2024
b7ca507
chore: update regex name
enesozturk Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/gallery/stories/composites/wui-button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
size: 'md',
variant: 'fill',
disabled: false,
fullWidth: false,
iconLeft: undefined,
iconRight: undefined,
loading: false
Expand Down
502 changes: 248 additions & 254 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export type { EventsControllerState } from './src/controllers/EventsController.j
export { TransactionsController } from './src/controllers/TransactionsController.js'
export type { TransactionsControllerState } from './src/controllers/TransactionsController.js'

export { ConvertController } from './src/controllers/ConvertController.js'
export type { ConvertControllerState } from './src/controllers/ConvertController.js'

export { SendController } from './src/controllers/SendController.js'
export type { SendControllerState } from './src/controllers/SendController.js'

Expand Down
27 changes: 26 additions & 1 deletion packages/core/src/controllers/ConnectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { subscribeKey as subKey } from 'valtio/vanilla/utils'
import { proxy, ref } from 'valtio/vanilla'
import { CoreHelperUtil } from '../utils/CoreHelperUtil.js'
import { StorageUtil } from '../utils/StorageUtil.js'
import type { Connector, WcWallet } from '../utils/TypeUtil.js'
import type {
Connector,
EstimateGasTransactionArgs,
SendTransactionArgs,
WcWallet
} from '../utils/TypeUtil.js'
import { TransactionsController } from './TransactionsController.js'

// -- Types --------------------------------------------- //
Expand All @@ -17,6 +22,10 @@ export interface ConnectionControllerClient {
connectWalletConnect: (onUri: (uri: string) => void) => Promise<void>
disconnect: () => Promise<void>
signMessage: (message: string) => Promise<string>
sendTransaction: (args: SendTransactionArgs) => Promise<`0x${string}` | null>
getEstimatedGas: (args: EstimateGasTransactionArgs) => Promise<bigint>
parseUnits: (value: string, decimals: number) => bigint
formatUnits: (value: bigint, decimals: number) => string
connectExternal?: (options: ConnectExternalOptions) => Promise<void>
checkInstalled?: (ids?: string[]) => boolean
}
Expand Down Expand Up @@ -83,6 +92,22 @@ export const ConnectionController = {
return this._getClient().signMessage(message)
},

parseUnits(value: string, decimals: number) {
return this._getClient().parseUnits(value, decimals)
},

formatUnits(value: bigint, decimals: number) {
return this._getClient().formatUnits(value, decimals)
},

async sendTransaction(args: SendTransactionArgs) {
return this._getClient().sendTransaction(args)
},

async getEstimatedGas(args: EstimateGasTransactionArgs) {
return this._getClient().getEstimatedGas(args)
},

checkInstalled(ids?: string[]) {
return this._getClient().checkInstalled?.(ids)
},
Expand Down