-
Notifications
You must be signed in to change notification settings - Fork 574
[SDK] Add Hashkey chain configuration #7910
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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({ | ||
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, | ||
}); |
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({ | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainAdd 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 The repository’s ESLint config ( • File to update:
• Change required: - export const Hashkey = /*@__PURE__*/ defineChain({
+ // eslint-disable-next-line no-restricted-syntax
+ export const Hashkey = /*@__PURE__*/ defineChain({ 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||
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", | ||||||||
}, | ||||||||
}); |
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.
💡 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:
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
), butHashkeyTestnet
is the only one starting with an uppercase letter. To maintain consistency, rename the export inhashkey-testnet.ts
and update all its imports:• File:
packages/thirdweb/src/chains/chain-definitions/hashkey-testnet.ts
Line 6:
After this change, search for any
HashkeyTestnet
references elsewhere and update them tohashkeyTestnet
to avoid breaking imports.📝 Committable suggestion
🤖 Prompt for AI Agents