-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from decentraland/feat/add-contract-validation
feat: Add contract validation & remove new URN logic
- Loading branch information
Showing
21 changed files
with
258 additions
and
97 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
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,8 @@ | ||
import { ContractNetwork } from '../../modules/thirdParty/types' | ||
|
||
export const RPC_URLS = { | ||
[ContractNetwork.ETHEREUM_MAINNET]: 'https://rpc.decentraland.org/mainnet', | ||
[ContractNetwork.MATIC_MAINNET]: 'https://rpc.decentraland.org/polygon', | ||
[ContractNetwork.ETHEREUM_SEPOLIA]: 'https://rpc.decentraland.org/sepolia', | ||
[ContractNetwork.MATIC_AMOY]: 'https://rpc.decentraland.org/amoy' | ||
} |
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 |
---|---|---|
@@ -1,34 +1,37 @@ | ||
import React from 'react' | ||
import { Table } from 'decentraland-ui' | ||
import { Message, Table } from 'decentraland-ui' | ||
import { Props } from './ContractsTable.types' | ||
import { t } from 'decentraland-dapps/dist/modules/translation' | ||
|
||
export const ContractsTable = ({ contracts }: Props) => { | ||
export const ContractsTable = ({ contracts, message, error }: Props) => { | ||
return ( | ||
<Table basic="very"> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.HeaderCell></Table.HeaderCell> | ||
<Table.HeaderCell>{t('linked_contracts.network')}</Table.HeaderCell> | ||
<Table.HeaderCell>{t('linked_contracts.address')}</Table.HeaderCell> | ||
</Table.Row> | ||
</Table.Header> | ||
|
||
<Table.Body> | ||
{contracts.length === 0 ? ( | ||
<> | ||
<Table basic="very"> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.Cell>{t('linked_contracts.no_contracts')}</Table.Cell> | ||
<Table.HeaderCell></Table.HeaderCell> | ||
<Table.HeaderCell>{t('linked_contracts.network')}</Table.HeaderCell> | ||
<Table.HeaderCell>{t('linked_contracts.address')}</Table.HeaderCell> | ||
</Table.Row> | ||
) : ( | ||
contracts.map(({ network, address }, index) => ( | ||
<Table.Row key={index}> | ||
<Table.Cell>{index}</Table.Cell> | ||
<Table.Cell>{network}</Table.Cell> | ||
<Table.Cell>{address}</Table.Cell> | ||
</Table.Header> | ||
|
||
<Table.Body> | ||
{contracts.length === 0 ? ( | ||
<Table.Row> | ||
<Table.Cell>{t('linked_contracts.no_contracts')}</Table.Cell> | ||
</Table.Row> | ||
)) | ||
)} | ||
</Table.Body> | ||
</Table> | ||
) : ( | ||
contracts.map(({ network, address }, index) => ( | ||
<Table.Row key={index}> | ||
<Table.Cell>{index}</Table.Cell> | ||
<Table.Cell>{network}</Table.Cell> | ||
<Table.Cell>{address}</Table.Cell> | ||
</Table.Row> | ||
)) | ||
)} | ||
</Table.Body> | ||
</Table> | ||
{message && error && <Message error={error} content={message} />} | ||
</> | ||
) | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export type Props = { | ||
managers: string[]; | ||
error?: string; | ||
onChange: (managers: string[]) => void; | ||
}; | ||
managers: string[] | ||
error?: string | ||
onBlur?: () => void | ||
onChange: (managers: string[]) => void | ||
} |
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
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
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
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
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,9 @@ | ||
export const debounce = (fn: (...args: any[]) => void, ms: number) => { | ||
let timeout: any = null | ||
return (...args: any[]) => { | ||
if (timeout) { | ||
clearTimeout(timeout) | ||
} | ||
timeout = setTimeout(() => fn(...args), ms) | ||
} | ||
} |
Oops, something went wrong.