-
Notifications
You must be signed in to change notification settings - Fork 308
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: traderxyz #6120
feat: traderxyz #6120
Conversation
}, | ||
name, | ||
tutorialLink: | ||
'https://realmasknetwork.notion.site/Use-File-Service-via-Arweave-IPFS-SIA-Swarm-soon-8c8fe1efce5a48b49739a38f4ea8c60f', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'https://realmasknetwork.notion.site/Use-File-Service-via-Arweave-IPFS-SIA-Swarm-soon-8c8fe1efce5a48b49739a38f4ea8c60f', | |
'https://realmasknetwork.notion.site/8c8fe1efce5a48b49739a38f4ea8c60f', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was there before let me remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the traderxyz tutorial is upload to notion, i will put the updated link here.
const useTraderApi_ = memoize( | ||
(chainId: ChainId) => { | ||
const p = useWeb3Provider() | ||
const provider = new Web3Provider(p as unknown as ExternalProvider, chainId) | ||
const signer = provider.getSigner(0) | ||
return new NftSwap(provider, signer, chainId) | ||
}, | ||
(chainId: ChainId) => String(chainId), | ||
) | ||
|
||
export function useTraderApi(chainId: number) { | ||
return useTraderApi_(chainId) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const useTraderApi_ = memoize( | |
(chainId: ChainId) => { | |
const p = useWeb3Provider() | |
const provider = new Web3Provider(p as unknown as ExternalProvider, chainId) | |
const signer = provider.getSigner(0) | |
return new NftSwap(provider, signer, chainId) | |
}, | |
(chainId: ChainId) => String(chainId), | |
) | |
export function useTraderApi(chainId: number) { | |
return useTraderApi_(chainId) | |
} | |
export const useTraderApi = memoize( | |
(chainId: ChainId) => { | |
const p = useWeb3Provider() | |
const provider = new Web3Provider(p as unknown as ExternalProvider, chainId) | |
const signer = provider.getSigner(0) | |
return new NftSwap(provider, signer, chainId) | |
}, | |
(chainId: ChainId) => String(chainId), | |
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { useTraderApi } from '../apis/nftSwap' | ||
import type { TradeMetaData, NFTData } from '../types' | ||
import type { SwappableAsset } from '@traderxyz/nft-swap-sdk' | ||
import { ActionButtonPromise } from '../../../../mask/src/extension/options-page/DashboardComponents/ActionButton' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not import from mask
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is available in shared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you should avoid using this component. ActionButtonPromise is overcomplicated and we want to get rid of it.
|
||
export const PreviewOrderView = (props: { | ||
nftList: NFTData[] | undefined | ||
setDisplaySection: Function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type not accurate.
import { InputTokenPanel } from '../../../../../packages/mask/src/plugins/Trader/SNSAdaptor/trader/InputTokenPanel' | ||
import { TokenPanelType } from '../../../../../packages/mask/src/plugins/Trader/types' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @guanbinrui
const [step1, setState1] = useState(true) | ||
const [step2, setState2] = useState(false) | ||
const [step3, setState3] = useState(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a single state to represent step.
const { classes } = useStyles() | ||
const t = useI18N() | ||
|
||
const CustomTreeParent = styled( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't declare a component inside another component.
export function useTraderApi(chainId: number) { | ||
return useTraderApi_(chainId) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you need to wrap this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ID: PLUGIN_ID, | ||
name: { fallback: PLUGIN_NAME }, | ||
description: { fallback: PLUGIN_DESCRIPTION }, | ||
publisher: { name: { fallback: '' }, link: '' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not resolved.
import type { Result } from 'ts-results' | ||
import BigNumber from 'bignumber.js' | ||
|
||
const reader_v2 = createTypedMessageMetadataReader<TradeMetaData>(META_KEY, schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why v2
? Is there a v1
?
|
||
export interface TradeMetaData { | ||
assetsInfo: { | ||
nfts: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean T[]
instead of [T]
?
"include": ["src", "src/**/*.json"], | ||
"references": [ | ||
{ "path": "../../theme" }, | ||
{ "path": "../../mask/src" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not resolved.
Please remove it from draft. |
This PR still has some problems (including import |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
Traderxyz plugin added, opeansea cost exported to support the plugin
Closes # (NO_ISSUE)
Type of change
Previews
NFT Swap Preview
Checklist
console.log
s