Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { defineChain } from "../utils.js";

/**
* @chain
*/
export const HashkeyTestnet = /*@__PURE__*/ defineChain({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm export naming style matches the directory’s convention

Ensure “HashkeyTestnet” casing matches other testnet exports (e.g., FooTestnet vs fooTestnet). Rename if needed before public release to avoid churn.

List export names in this folder:

If most are PascalCaseTestnet, keep as-is; otherwise consider aligning.


🏁 Script executed:

#!/bin/bash
rg -nP -g 'packages/thirdweb/src/chains/chain-definitions/**' '^export const\s+\w+' \
  | sed -E 's/.*export const\s+([A-Za-z0-9_]+).*/\1/' | sort -u

Length of output: 1047


Rename HashkeyTestnet export to lower-camel-case

Most testnet exports in this directory use lower-camel-case (e.g., bscTestnet, fantomTestnet, celoAlfajoresTestnet), but HashkeyTestnet is the only one starting with an uppercase letter. To maintain consistency, rename the export in hashkey-testnet.ts and update all its imports:

• File: packages/thirdweb/src/chains/chain-definitions/hashkey-testnet.ts
Line 6:

-export const HashkeyTestnet = /*@__PURE__*/ defineChain({
+export const hashkeyTestnet = /*@__PURE__*/ defineChain({

After this change, search for any HashkeyTestnet references elsewhere and update them to hashkeyTestnet to avoid breaking imports.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const HashkeyTestnet = /*@__PURE__*/ defineChain({
export const hashkeyTestnet = /*@__PURE__*/ defineChain({
🤖 Prompt for AI Agents
In packages/thirdweb/src/chains/chain-definitions/hashkey-testnet.ts around line
6, the named export is currently "HashkeyTestnet" (PascalCase) but should follow
the directory's lower-camel-case convention; rename the export to
"hashkeyTestnet" (export const hashkeyTestnet = /*@__PURE__*/
defineChain({...})), save the file, then search the repo for any imports or
references to "HashkeyTestnet" and update them to "hashkeyTestnet" to keep
imports consistent and avoid breakage.

blockExplorers: [
{
name: "Hashkey Explorer",
url: "https://testnet-explorer.hsk.xyz",
},
],
rpc: "https://testnet.hsk.xyz",
id: 133,
name: "Hashkey Testnet",
nativeCurrency: {
decimals: 18,
name: "HashKey Platform Token",
symbol: "HSK",
},
testnet: true,
});
21 changes: 21 additions & 0 deletions packages/thirdweb/src/chains/chain-definitions/hashkey.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineChain } from "../utils.js";

/**
* @chain
*/
export const Hashkey = /*@__PURE__*/ defineChain({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Add the lint exception for direct defineChain usage (repo rule)

Per project learnings, direct usage of defineChain may be restricted by ESLint. Add the inline exception to avoid lint failures.

Apply:

- export const Hashkey = /*@__PURE__*/ defineChain({
+// eslint-disable-next-line no-restricted-syntax
+export const Hashkey = /*@__PURE__*/ defineChain({

And verify lint behavior:


🏁 Script executed:

#!/bin/bash
# Inspect if other chain-definitions disable this rule too
rg -nC1 -g 'packages/thirdweb/src/chains/chain-definitions/**' \
  -P 'eslint-disable-next-line\s+no-restricted-syntax'

Length of output: 117


🏁 Script executed:

#!/bin/bash
# List all occurrences of defineChain in chain-definitions to check for existing lint exceptions
rg -nC1 -g 'packages/thirdweb/src/chains/chain-definitions/**' -P 'defineChain'

Length of output: 34776


🏁 Script executed:

#!/bin/bash
set -eux

echo "Searching ESLint config for no-restricted-syntax rule..."
rg -nR "no-restricted-syntax" -g "*.eslintrc*" || true

echo "Searching ESLint config for defineChain restriction..."
rg -nR "defineChain" -g "*.eslintrc*" || true

Length of output: 1161


🏁 Script executed:

#!/bin/bash
set -e

echo "=== Checking .eslintrc* files for no-restricted-syntax rule ==="
rg -n "no-restricted-syntax" -g ".eslintrc*" || echo "<none in .eslintrc*>"

echo "=== Checking package.json for no-restricted-syntax ==="
rg -n "no-restricted-syntax" -g "package.json" || echo "<none in package.json>"

echo "=== Checking ESLint configs for defineChain mention ==="
rg -n "defineChain" -g ".eslintrc*" || echo "<none in .eslintrc*>"
rg -n "defineChain" -g "package.json" || echo "<none in package.json>"

Length of output: 1096


Add ESLint disable for no-restricted-syntax on defineChain

The repository’s ESLint config (packages/thirdweb/.eslintrc.cjs) includes a no-restricted-syntax rule blocking direct calls to defineChain, so any chain-definition file will fail lint unless it’s explicitly disabled.

• File to update:

  • packages/thirdweb/src/chains/chain-definitions/hashkey.ts

• Change required:

- export const Hashkey = /*@__PURE__*/ defineChain({
+ // eslint-disable-next-line no-restricted-syntax
+ export const Hashkey = /*@__PURE__*/ defineChain({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const Hashkey = /*@__PURE__*/ defineChain({
// eslint-disable-next-line no-restricted-syntax
export const Hashkey = /*@__PURE__*/ defineChain({
🤖 Prompt for AI Agents
In packages/thirdweb/src/chains/chain-definitions/hashkey.ts around line 6, the
call to defineChain is blocked by the repo ESLint rule no-restricted-syntax; add
an ESLint disable for that rule immediately before the export (use an inline
directive such as eslint-disable-next-line no-restricted-syntax) so the
defineChain invocation is exempted; keep the disable scoped to that line to
avoid silencing the rule globally.

blockExplorers: [
{
name: "Hashkey Explorer",
url: "https://hashkey.blockscout.com/",
},
],
rpc: "https://mainnet.hsk.xyz",
id: 177,
name: "Hashkey",
nativeCurrency: {
decimals: 18,
name: "HashKey Platform Token",
symbol: "HSK",
},
});