-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[alpha / breaking] - pass
chain
objects around everywhere, expose m…
…ore chains (#2321)
- Loading branch information
Showing
98 changed files
with
776 additions
and
464 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
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
19 changes: 19 additions & 0 deletions
19
packages/thirdweb/src/chains/chain-definitions/arbitrum-sepolia.ts
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,19 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const arbitrumSepolia = /* @__PURE__ */ defineChain({ | ||
id: 421_614, | ||
name: "Arbitrum Sepolia", | ||
nativeCurrency: { | ||
name: "Arbitrum Sepolia Ether", | ||
symbol: "ETH", | ||
decimals: 18, | ||
}, | ||
blockExplorers: [ | ||
{ | ||
name: "Arbiscan", | ||
url: "https://sepolia.arbiscan.io", | ||
apiUrl: "https://sepolia.arbiscan.io/api", | ||
}, | ||
], | ||
testnet: true, | ||
}); |
14 changes: 14 additions & 0 deletions
14
packages/thirdweb/src/chains/chain-definitions/arbitrum.ts
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,14 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const arbitrum = /* @__PURE__ */ defineChain({ | ||
id: 42161, | ||
name: "Arbitrum One", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "Arbiscan", | ||
url: "https://arbiscan.io", | ||
apiUrl: "https://api.arbiscan.io/api", | ||
}, | ||
], | ||
}); |
19 changes: 19 additions & 0 deletions
19
packages/thirdweb/src/chains/chain-definitions/avalanche-fuji.ts
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,19 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const avalancheFuji = /* @__PURE__ */ defineChain({ | ||
id: 43113, | ||
name: "Avalanche Fuji", | ||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Avalanche Fuji", | ||
symbol: "AVAX", | ||
}, | ||
blockExplorers: [ | ||
{ | ||
name: "SnowTrace", | ||
url: "https://testnet.snowtrace.io", | ||
apiUrl: "https://api-testnet.snowtrace.io/api", | ||
}, | ||
], | ||
testnet: true, | ||
}); |
18 changes: 18 additions & 0 deletions
18
packages/thirdweb/src/chains/chain-definitions/avalanche.ts
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,18 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const avalanche = /* @__PURE__ */ defineChain({ | ||
id: 43114, | ||
name: "Avalanche", | ||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Avalanche", | ||
symbol: "AVAX", | ||
}, | ||
blockExplorers: [ | ||
{ | ||
name: "SnowTrace", | ||
url: "https://snowtrace.io", | ||
apiUrl: "https://api.snowtrace.io/api", | ||
}, | ||
], | ||
}); |
15 changes: 15 additions & 0 deletions
15
packages/thirdweb/src/chains/chain-definitions/base-sepolia.ts
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,15 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const baseSepolia = /* @__PURE__ */ defineChain({ | ||
id: 84532, | ||
name: "Base Sepolia", | ||
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "Basescan", | ||
url: "https://sepolia.basescan.org", | ||
apiUrl: "https://api-sepolia.basescan.org/api", | ||
}, | ||
], | ||
testnet: true, | ||
}); |
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,14 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const base = /* @__PURE__ */ defineChain({ | ||
id: 8453, | ||
name: "Base", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "Basescan", | ||
url: "https://basescan.org", | ||
apiUrl: "https://api.basescan.org/api", | ||
}, | ||
], | ||
}); |
22 changes: 22 additions & 0 deletions
22
packages/thirdweb/src/chains/chain-definitions/ethereum.ts
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,22 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const ethereum = /* @__PURE__ */ defineChain({ | ||
id: 1, | ||
name: "Ethereum", | ||
nativeCurrency: { | ||
name: "Ether", | ||
symbol: "ETH", | ||
decimals: 18, | ||
}, | ||
blockExplorers: [ | ||
{ | ||
name: "Etherscan", | ||
url: "https://etherscan.io", | ||
}, | ||
], | ||
}); | ||
|
||
/** | ||
* @alias ethereum | ||
*/ | ||
export const mainnet = ethereum; |
15 changes: 15 additions & 0 deletions
15
packages/thirdweb/src/chains/chain-definitions/optimism-sepolia.ts
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,15 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const optimismSepolia = /* @__PURE__ */ defineChain({ | ||
id: 11155420, | ||
name: "OP Sepolia", | ||
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "Blockscout", | ||
url: "https://optimism-sepolia.blockscout.com", | ||
apiUrl: "https://optimism-sepolia.blockscout.com/api", | ||
}, | ||
], | ||
testnet: true, | ||
}); |
14 changes: 14 additions & 0 deletions
14
packages/thirdweb/src/chains/chain-definitions/optimism.ts
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,14 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const optimism = /* @__PURE__ */ defineChain({ | ||
id: 10, | ||
name: "OP Mainnet", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "Optimism Explorer", | ||
url: "https://optimistic.etherscan.io", | ||
apiUrl: "https://api-optimistic.etherscan.io", | ||
}, | ||
], | ||
}); |
20 changes: 20 additions & 0 deletions
20
packages/thirdweb/src/chains/chain-definitions/polygon-mumbai.ts
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,20 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const polygonMumbai = /*@__PURE__*/ defineChain({ | ||
id: 80001, | ||
name: "Polygon Mumbai", | ||
nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "PolygonScan", | ||
url: "https://mumbai.polygonscan.com", | ||
apiUrl: "https://mumbai.polygonscan.com/api", | ||
}, | ||
], | ||
testnet: true, | ||
}); | ||
|
||
/** | ||
* @alias polygonMumbai | ||
*/ | ||
export const mumbai = polygonMumbai; |
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,14 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const polygon = /*@__PURE__*/ defineChain({ | ||
id: 137, | ||
name: "Polygon", | ||
nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "PolygonScan", | ||
url: "https://polygonscan.com", | ||
apiUrl: "https://api.polygonscan.com/api", | ||
}, | ||
], | ||
}); |
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,15 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const sepolia = /*@__PURE__*/ defineChain({ | ||
id: 11155111, | ||
name: "Sepolia", | ||
nativeCurrency: { name: "Sepolia Ether", symbol: "SEP", decimals: 18 }, | ||
blockExplorers: [ | ||
{ | ||
name: "Etherscan", | ||
url: "https://sepolia.etherscan.io", | ||
apiUrl: "https://api-sepolia.etherscan.io/api", | ||
}, | ||
], | ||
testnet: true, | ||
}); |
20 changes: 20 additions & 0 deletions
20
packages/thirdweb/src/chains/chain-definitions/zora-sepolia.ts
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,20 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const zoraSepolia = /*@__PURE__*/ defineChain({ | ||
id: 999999999, | ||
name: "Zora Sepolia", | ||
|
||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Zora Sepolia", | ||
symbol: "ETH", | ||
}, | ||
blockExplorers: [ | ||
{ | ||
name: "Zora Sepolia Explorer", | ||
url: "https://sepolia.explorer.zora.energy/", | ||
apiUrl: "https://sepolia.explorer.zora.energy/api", | ||
}, | ||
], | ||
testnet: true, | ||
}); |
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,18 @@ | ||
import { defineChain } from "../utils.js"; | ||
|
||
export const zora = /*@__PURE__*/ defineChain({ | ||
id: 7777777, | ||
name: "Zora", | ||
nativeCurrency: { | ||
decimals: 18, | ||
name: "Ether", | ||
symbol: "ETH", | ||
}, | ||
blockExplorers: [ | ||
{ | ||
name: "Explorer", | ||
url: "https://explorer.zora.energy", | ||
apiUrl: "https://explorer.zora.energy/api", | ||
}, | ||
], | ||
}); |
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,24 @@ | ||
// chain type | ||
export type { Chain } from "./types.js"; | ||
// define chain | ||
export { defineChain } from "./utils.js"; | ||
|
||
/** | ||
* PRE_DEFINED CHAINS | ||
*/ | ||
export { arbitrumSepolia } from "./chain-definitions/arbitrum-sepolia.js"; | ||
export { arbitrum } from "./chain-definitions/arbitrum.js"; | ||
export { avalancheFuji } from "./chain-definitions/avalanche-fuji.js"; | ||
export { avalanche } from "./chain-definitions/avalanche.js"; | ||
export { baseSepolia } from "./chain-definitions/base-sepolia.js"; | ||
export { base } from "./chain-definitions/base.js"; | ||
// mainnet = alias for ethereum | ||
export { ethereum, mainnet } from "./chain-definitions/ethereum.js"; | ||
export { optimismSepolia } from "./chain-definitions/optimism-sepolia.js"; | ||
export { optimism } from "./chain-definitions/optimism.js"; | ||
// mumbai = alias for polygonMumbai | ||
export { polygonMumbai, mumbai } from "./chain-definitions/polygon-mumbai.js"; | ||
export { polygon } from "./chain-definitions/polygon.js"; | ||
export { sepolia } from "./chain-definitions/sepolia.js"; | ||
export { zoraSepolia } from "./chain-definitions/zora-sepolia.js"; | ||
export { zora } from "./chain-definitions/zora.js"; |
21 changes: 21 additions & 0 deletions
21
packages/thirdweb/src/chain/types.ts → packages/thirdweb/src/chains/types.ts
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
Oops, something went wrong.