Skip to content

Commit

Permalink
Update Node.js to v18.16.1 (#1059)
Browse files Browse the repository at this point in the history
* 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.ahmedkamal@googlemail.com>

* Update all non-major dependencies

---------

Signed-off-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>
Co-authored-by: Graham Tackley <gtackley@brave.com>
Co-authored-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>
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.ahmedkamal@googlemail.com>
Co-authored-by: David Suh <davidsuh@Davids-MacBook-Pro.local>
Co-authored-by: David Suh <suhdavid11@gmail.com>
Co-authored-by: Marshall T. Rose <mrose17@gmail.com>
Co-authored-by: Graham Tackley <gtackley@brave.com>
Co-authored-by: Ahmed Kamal <email.ahmedkamal@googlemail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored Jun 27, 2023
1 parent 216df15 commit 0dc1969
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.9.1
18.16.1
10 changes: 10 additions & 0 deletions src/components/web3/OptionalSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ export const OptionalSettings: React.FC<Props> = ({
</ExapandablePanel>
</React.Fragment>
)}
{startCall && permissionType === "balance" && (
<React.Fragment>
<ExapandablePanel
header={"Non Zero BAT gating"}
subhead={
"Only participants with non-zero BAT balance can join the call"
}
/>
</React.Fragment>
)}
</div>
);
};
6 changes: 6 additions & 0 deletions src/components/web3/PermissionTypeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export const PermissionTypeSelector: React.FC<Props> = ({
>
{t("nft_collection_permission_type")}
</button>
<button
onClick={() => setPermissionType("balance")}
css={[styles.base, permissionType === "balance" && styles.selected]}
>
{"BAT-gating"}
</button>
</div>
);
};
12 changes: 12 additions & 0 deletions src/components/web3/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ export interface Web3Authorization {
method: string;
POAPs: Web3AuthList;
Collections: Web3AuthList;
Balances: Web3BalancesList;
}

export interface Web3BalancesList {
participants: Web3BalancesRequireList;
moderators: Web3BalancesRequireList;
}

export interface Web3BalancesRequireList {
network: string; // Use enum instead?
token: string; //optional
minimum: string; // in wei, e.g. 10e-18
}

export interface Web3AuthList {
Expand Down
16 changes: 16 additions & 0 deletions src/hooks/use-web3-call-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export function useWeb3CallState(
const [moderatorNFTCollections, setModeratorNFTCollections] = useState<
NFTcollection[]
>([]);
const [minimumParticipantBATBalance, setMinimumParticipanyBATBalance] =
useState<string>("0");
const [minimumModeratorBATBalance, setMinimumModeratorBATBalance] =
useState<string>("0");

const setWeb3Address = (address: string, event: string) => {
_setWeb3Address((prevAddress) => {
Expand Down Expand Up @@ -151,6 +155,18 @@ export function useWeb3CallState(
deny: [],
},
},
Balances: {
participants: {
network: "ETH", // TODO: can change
token: "BAT",
minimum: minimumParticipantBATBalance,
},
moderators: {
network: "ETH",
token: "BAT",
minimum: minimumModeratorBATBalance,
},
},
},
avatarURL: nft,
};
Expand Down

0 comments on commit 0dc1969

Please sign in to comment.