Skip to content

Commit

Permalink
Polygon Gating (#1168)
Browse files Browse the repository at this point in the history
* polygon url

* polygon url (#1163)

Co-authored-by: David Suh <[email protected]>

* Dsuh avatar selection bug (#1162)

* adding inital fix

* changing NFT border selection from imageurl comp to id comp

* chaged indexFind

* debug messages in prod only

---------

Co-authored-by: David Suh <[email protected]>

* Dsuh 943 bat gating (#1166)

* first mockup on dev2

* remove cluttered talk, add request payload

* change permission name from BAT-gating to balance as per spec sheet

* Renovate/all minor patch (#1062)

* Use renovate for dependency updates (#1054)

1. Disable dependabot for normal dependency updates. Note the dependabot PRs will need to be manually closed, and the "security" dependabot PRs will continue.

2. Use renovateapp instead.

The renovate configuration included here is based on that from ads-serve, and:

a. waits for updates to have been published for 4 days before raising a PR - this both reduces churn and also avoids the 3 day period where npm-published entries can be "unpublished"
b. combines all minor and patch updates into a single PR

* removed as *[bot] is not accepted by AWS (#1055)

Signed-off-by: Ahmed Kamal <[email protected]>

* Update all non-major dependencies

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Renovate/node 18.x (#1068)

* Use renovate for dependency updates (#1054)

1. Disable dependabot for normal dependency updates. Note the dependabot PRs will need to be manually closed, and the "security" dependabot PRs will continue.

2. Use renovateapp instead.

The renovate configuration included here is based on that from ads-serve, and:

a. waits for updates to have been published for 4 days before raising a PR - this both reduces churn and also avoids the 3 day period where npm-published entries can be "unpublished"
b. combines all minor and patch updates into a single PR

* removed as *[bot] is not accepted by AWS (#1055)

Signed-off-by: Ahmed Kamal <[email protected]>

* Update all non-major dependencies (#1057)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Pin dependencies (#1056)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update all non-major dependencies (#1063)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update Node.js to v18.16.1

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* aesthetic changes

* updating default gated value to 1 wei

* adding type/enum safety and removing needless futureproofing, using translation rather than string literals

* simple change for dev2 compat

* fix error message + typo

* adding error text for no BAT in BAT-gating

* fixed some optional stuff

* remove unsused prop in NonExpandablePanel

* Avatar selection bug fix for Web3 Brave Talk (#1164)

* adding inital fix

* changing NFT border selection from imageurl comp to id comp

* chaged indexFind

* debug messages in prod only

---------

Co-authored-by: David Suh <[email protected]>

* adding japanese translations

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: David Suh <[email protected]>
Co-authored-by: Marshall T. Rose <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* update NFT subheader

* adding tooltip

* Dsuh polygon gating (#1170)

* polygon url

* Avatar selection bug fix for Web3 Brave Talk (#1164)

* adding inital fix

* changing NFT border selection from imageurl comp to id comp

* chaged indexFind

* debug messages in prod only

---------

Co-authored-by: David Suh <[email protected]>

* BAT gating translations (#1167)

* first mockup on dev2

* remove cluttered talk, add request payload

* change permission name from BAT-gating to balance as per spec sheet

* Renovate/all minor patch (#1062)

* Use renovate for dependency updates (#1054)

1. Disable dependabot for normal dependency updates. Note the dependabot PRs will need to be manually closed, and the "security" dependabot PRs will continue.

2. Use renovateapp instead.

The renovate configuration included here is based on that from ads-serve, and:

a. waits for updates to have been published for 4 days before raising a PR - this both reduces churn and also avoids the 3 day period where npm-published entries can be "unpublished"
b. combines all minor and patch updates into a single PR

* removed as *[bot] is not accepted by AWS (#1055)

Signed-off-by: Ahmed Kamal <[email protected]>

* Update all non-major dependencies

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Renovate/node 18.x (#1068)

* Use renovate for dependency updates (#1054)

1. Disable dependabot for normal dependency updates. Note the dependabot PRs will need to be manually closed, and the "security" dependabot PRs will continue.

2. Use renovateapp instead.

The renovate configuration included here is based on that from ads-serve, and:

a. waits for updates to have been published for 4 days before raising a PR - this both reduces churn and also avoids the 3 day period where npm-published entries can be "unpublished"
b. combines all minor and patch updates into a single PR

* removed as *[bot] is not accepted by AWS (#1055)

Signed-off-by: Ahmed Kamal <[email protected]>

* Update all non-major dependencies (#1057)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Pin dependencies (#1056)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update all non-major dependencies (#1063)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update Node.js to v18.16.1

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* aesthetic changes

* updating default gated value to 1 wei

* adding type/enum safety and removing needless futureproofing, using translation rather than string literals

* simple change for dev2 compat

* fix error message + typo

* adding error text for no BAT in BAT-gating

* fixed some optional stuff

* remove unsused prop in NonExpandablePanel

* adding japanese translations

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: David Suh <[email protected]>
Co-authored-by: Marshall T. Rose <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* update NFT subheader

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: David Suh <[email protected]>
Co-authored-by: Marshall T. Rose <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* added polygon to gating

---------

Signed-off-by: Ahmed Kamal <[email protected]>
Co-authored-by: David Suh <[email protected]>
Co-authored-by: Marshall T. Rose <[email protected]>
Co-authored-by: Graham Tackley <[email protected]>
Co-authored-by: Ahmed Kamal <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored Jul 25, 2023
1 parent 2b98c70 commit 5b196df
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/web3/SelectableImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import noNftImage from "../../images/no-nft-image.png";
interface Item {
imageUrl: string;
name?: string;
chain: string;
collection?: {
collection_id: string;
name: string;
Expand Down Expand Up @@ -68,7 +69,7 @@ export const SelectableImageList: React.FC<Props> = ({
title={item[0].name}
>
<img
title={item[0].name}
title={`${item[0].name} (${item[0].chain})`}
height={167}
width={167}
src={item[0].imageUrl ? item[0].imageUrl : noNftImage}
Expand Down
1 change: 1 addition & 0 deletions src/components/web3/SelectableNFTCollectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const SelectableNFTCollectionList: React.FC<Props> = ({
const nftCollectionItems = nftCollections.map((p) => ({
imageUrl: p.image_url,
name: p.name,
chain: p.chain,
}));

const selectedIdxs = nftCollections.flatMap((p, idx) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/web3/SelectablePoapList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const SelectablePoapList: React.FC<Props> = ({
const poapItems = poaps.map((p) => ({
imageUrl: p.event.image_url,
name: p.event.name,
chain: p.chain,
}));

const selectedIdxs = poaps.flatMap((p, idx) => {
Expand Down
6 changes: 4 additions & 2 deletions src/components/web3/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const web3Login = async (): Promise<string> => {

export const web3NFTs = async (address: string): Promise<NFT[]> => {
try {
const getNFTsURL = `${SIMPLEHASH_PROXY_ROOT_URL}/api/v0/nfts/owners?chains=ethereum&wallet_addresses=${encodeURIComponent(
const getNFTsURL = `${SIMPLEHASH_PROXY_ROOT_URL}/api/v0/nfts/owners?chains=ethereum,polygon&wallet_addresses=${encodeURIComponent(
address
)}`;
console.log(`>>> GET ${getNFTsURL}`);
Expand Down Expand Up @@ -95,6 +95,7 @@ export const web3NFTs = async (address: string): Promise<NFT[]> => {
: nft.image_url,
name: nft.name,
id: nft.nft_id,
chain: nft.chain,
collection: {
collection_id: nft.collection?.collection_id,
name: nft.collection?.name,
Expand Down Expand Up @@ -143,6 +144,7 @@ export const web3NFTcollections = async (
collections[nft.collection.collection_id] = {
id: nft.collection.collection_id,
name: nft.collection.name,
chain: nft.chain,
image_url: nft.previews?.image_small_url
? nft.previews.image_small_url
: nft.image_url
Expand All @@ -160,7 +162,7 @@ export const web3NFTcollections = async (
};

try {
const getNFTsByWalletURL = `${SIMPLEHASH_PROXY_ROOT_URL}/api/v0/nfts/owners?chains=ethereum&wallet_addresses=${encodeURIComponent(
const getNFTsByWalletURL = `${SIMPLEHASH_PROXY_ROOT_URL}/api/v0/nfts/owners?chains=ethereum,polygon&wallet_addresses=${encodeURIComponent(
address
)}`;
console.log(`>>> GET ${getNFTsByWalletURL}`);
Expand Down
3 changes: 3 additions & 0 deletions src/components/web3/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ export interface POAP {
image_url: string;
};
tokenId: string;
chain: string;
}

export interface NFTcollection {
id: string;
name: string;
image_url: string;
chain: string;
}

export interface NFT {
image_url: string;
name: string;
id: string;
chain: string;
collection?: {
collection_id: string;
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"avatar_fetch_error": "Failed to fetch avatar NFTs",
"avatar_nft_subhead": "Currently supports Ethereum ERC-721 NFTs",
"avatar_nft_subhead": "Currently supports Ethereum ERC-721 NFTs and ERC-1155 NFTs ",
"bat_gating_panel_header": "Non-Zero BAT gating will be applied.",
"bat_gating_panel_subheader": "Users will need to have a non-zero balance of BAT in their wallet to join this call.",
"call_permission_type": "Call permission type:",
Expand Down

0 comments on commit 5b196df

Please sign in to comment.