-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add cancel order component to deprecated limit orders (#10291)
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces the handling of existing limit orders in the application, enhancing the user interface with a new component for displaying these orders. It also implements caching for transaction queries to improve performance. ### Detailed summary - Added `ORDER_CATEGORY.Existing` to handle existing orders. - Created `ExistingOrder` interface for existing limit order data structure. - Introduced `ExistingLimitOrderTable` component to display existing orders. - Implemented caching mechanism in `handler` for transaction queries. - Updated `LimitOrderTable` to include logic for rendering existing orders. - Modified localization files to add translations for existing orders. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
Showing
8 changed files
with
687 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,363 @@ | ||
export const gelatoLimitABI = [ | ||
{ | ||
inputs: [{ internalType: 'address', name: '_gelato', type: 'address' }], | ||
stateMutability: 'nonpayable', | ||
type: 'constructor', | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ indexed: true, internalType: 'bytes32', name: '_key', type: 'bytes32' }, | ||
{ | ||
indexed: true, | ||
internalType: 'address', | ||
name: '_caller', | ||
type: 'address', | ||
}, | ||
{ indexed: false, internalType: 'uint256', name: '_amount', type: 'uint256' }, | ||
{ | ||
indexed: false, | ||
internalType: 'bytes', | ||
name: '_data', | ||
type: 'bytes', | ||
}, | ||
], | ||
name: 'DepositETH', | ||
type: 'event', | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ indexed: true, internalType: 'bytes32', name: '_key', type: 'bytes32' }, | ||
{ | ||
indexed: false, | ||
internalType: 'address', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ indexed: false, internalType: 'address', name: '_owner', type: 'address' }, | ||
{ | ||
indexed: false, | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ indexed: false, internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
{ | ||
indexed: false, | ||
internalType: 'uint256', | ||
name: '_amount', | ||
type: 'uint256', | ||
}, | ||
], | ||
name: 'OrderCancelled', | ||
type: 'event', | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ indexed: true, internalType: 'bytes32', name: '_key', type: 'bytes32' }, | ||
{ | ||
indexed: false, | ||
internalType: 'address', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ indexed: false, internalType: 'address', name: '_owner', type: 'address' }, | ||
{ | ||
indexed: false, | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ indexed: false, internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
{ | ||
indexed: false, | ||
internalType: 'bytes', | ||
name: '_auxData', | ||
type: 'bytes', | ||
}, | ||
{ indexed: false, internalType: 'uint256', name: '_amount', type: 'uint256' }, | ||
{ | ||
indexed: false, | ||
internalType: 'uint256', | ||
name: '_bought', | ||
type: 'uint256', | ||
}, | ||
], | ||
name: 'OrderExecuted', | ||
type: 'event', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'ETH_ADDRESS', | ||
outputs: [{ internalType: 'address', name: '', type: 'address' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [], | ||
name: 'GELATO', | ||
outputs: [{ internalType: 'address', name: '', type: 'address' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'contract IModule', | ||
name: '_module', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'contract IERC20', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
{ | ||
internalType: 'bytes', | ||
name: '_auxData', | ||
type: 'bytes', | ||
}, | ||
], | ||
name: 'canExecuteOrder', | ||
outputs: [{ internalType: 'bool', name: '', type: 'bool' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'contract IModule', | ||
name: '_module', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'contract IERC20', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'cancelOrder', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'bytes', name: '_data', type: 'bytes' }], | ||
name: 'decodeOrder', | ||
outputs: [ | ||
{ internalType: 'address', name: 'module', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: 'inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: 'owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: 'witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: 'data', type: 'bytes' }, | ||
{ | ||
internalType: 'bytes32', | ||
name: 'secret', | ||
type: 'bytes32', | ||
}, | ||
], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'bytes', name: '_data', type: 'bytes' }], | ||
name: 'depositEth', | ||
outputs: [], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: '_module', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
{ | ||
internalType: 'bytes32', | ||
name: '_secret', | ||
type: 'bytes32', | ||
}, | ||
], | ||
name: 'encodeEthOrder', | ||
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'contract IModule', | ||
name: '_module', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'contract IERC20', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
{ | ||
internalType: 'bytes32', | ||
name: '_secret', | ||
type: 'bytes32', | ||
}, | ||
{ internalType: 'uint256', name: '_amount', type: 'uint256' }, | ||
], | ||
name: 'encodeTokenOrder', | ||
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], | ||
name: 'ethDeposits', | ||
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'contract IModule', | ||
name: '_module', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'contract IERC20', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'bytes', | ||
name: '_data', | ||
type: 'bytes', | ||
}, | ||
{ internalType: 'bytes', name: '_signature', type: 'bytes' }, | ||
{ | ||
internalType: 'bytes', | ||
name: '_auxData', | ||
type: 'bytes', | ||
}, | ||
], | ||
name: 'executeOrder', | ||
outputs: [], | ||
stateMutability: 'nonpayable', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'contract IModule', | ||
name: '_module', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'contract IERC20', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'existOrder', | ||
outputs: [{ internalType: 'bool', name: '', type: 'bool' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'contract IModule', | ||
name: '_module', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'contract IERC20', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'keyOf', | ||
outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], | ||
stateMutability: 'pure', | ||
type: 'function', | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: 'contract IModule', | ||
name: '_module', | ||
type: 'address', | ||
}, | ||
{ | ||
internalType: 'contract IERC20', | ||
name: '_inputToken', | ||
type: 'address', | ||
}, | ||
{ internalType: 'address payable', name: '_owner', type: 'address' }, | ||
{ | ||
internalType: 'address', | ||
name: '_witness', | ||
type: 'address', | ||
}, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'vaultOfOrder', | ||
outputs: [{ internalType: 'address', name: '', type: 'address' }], | ||
stateMutability: 'view', | ||
type: 'function', | ||
}, | ||
{ stateMutability: 'payable', type: 'receive' }, | ||
] |
Oops, something went wrong.