Compare commits

...
Author SHA1 Message Date
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
c52e3beac1 Version Packages (#2486)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-14 23:04:16 -07:00
Joaquim VergesandGitHub f0250a77cd [SDK] Revert min maxPriorityFeePerGas (#2490) 2024-03-15 05:08:55 +00:00
d4be6479db Added Domain Separator as an input for gasless (#2332)
Co-authored-by: Jonas Daniels <[email protected]>
2024-03-15 05:03:17 +00:00
YashandGitHub c67b287764 Contract verification on zksync (#2481) 2024-03-15 02:47:29 +00:00
7ac4e6ba4e Contracts version 3.11.1 (#2459)
Co-authored-by: Joaquim Verges <[email protected]>
2024-03-14 18:57:34 +00:00
Joaquim VergesandGitHub c494db87cb sync chains (#2484) 2024-03-14 08:01:38 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
1932d601c1 Version Packages (#2474)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-14 01:09:17 -07:00
Joaquim VergesandGitHub 846a3503fe [SDK] Enforce minimum for maxPriorityFeePerGas (#2483) 2024-03-14 07:44:14 +00:00
Jonas DanielsandGitHub 3e7f9cb946 feat(sdk): add support for overriding default admin (#2479) 2024-03-14 01:14:21 +00:00
iketwandGitHub 83526c519a Only pass bundleId if defined (#2472) 2024-03-13 20:13:11 +00:00
Joaquim VergesandGitHub 2e01627c99 [Chains] sync chains (#2464) 2024-03-13 19:11:06 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
7b52c6bba0 Version Packages (#2467)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-13 11:56:41 -07:00
Edward SunandGitHub e024d78ed0 Add pay to usageEventSchema (#2465) 2024-03-13 05:02:40 +00:00
Joaquim VergesandGitHub a2002d1637 [SDK] Better return type for getProofsForAllowListEntry (#2469) 2024-03-13 01:20:22 +00:00
FirekeeperandGitHub 607ab7e860 [Unity] Expose SW isDeployed (#2466) 2024-03-12 22:37:02 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
f27989741a Version Packages (#2461)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-12 12:55:05 -07:00
Joaquim VergesandGitHub b2be63ada4 handle l2 estimations when forcing gasLimit (#2457) 2024-03-12 19:37:02 +00:00
Winston YeoandGitHub eee200f8d4 chore: whitelist embedded-wallet.thirdweb.com in service utils (#2453) 2024-03-12 15:45:09 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
817ab2249f Version Packages (#2446)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-11 17:22:24 -07:00
Joaquim VergesandGitHub 173777ade4 [SDK] update OP SDK to fix pnpm preinstall script issue (#2455) 2024-03-11 23:53:16 +00:00
Manan TankandGitHub 838233075a [react] Fix onConnect called multiple times in EmbeddedWalletSocialLogin (#2447) 2024-03-11 19:03:32 +00:00
FirekeeperandGitHub cabfc29119 [Smart Wallet] Use bundler eth_getUserOperationReceipt instead of rpc eth_getLogs (#2443) 2024-03-11 17:12:35 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
f02570db88 Version Packages (#2442)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-08 16:56:41 -08:00
Joaquim VergesandGitHub c6b025e844 [SDK] handle estimateGasCost for OP chains (#2441) 2024-03-08 16:49:28 -08:00
Joaquim VergesandGitHub 332a14552b [Wallets] make accountInfo/factoryInfo internal props optional in SmartWalletConfig (#2439) 2024-03-09 00:45:04 +00:00
FirekeeperandGitHub c894270401 [Smart Wallet] try fetch sw abi if deployed (#2440) 2024-03-09 00:02:46 +00:00
Joaquim VergesandGitHub 595815dc3e Update README.md (#2438)
Signed-off-by: Joaquim Verges <[email protected]>
2024-03-08 12:42:35 -08:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
b959cafccc Version Packages (#2435)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-08 09:21:46 -08:00
Edward SunandGitHub 4cf0aede0e Update service-utils change to patch (#2434) 2024-03-08 01:53:20 +00:00
Edward SunandGitHub 6cf298a29a Add pay to Services list (#2431) 2024-03-08 01:15:42 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
62b2508a6c Version Packages (#2420)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-07 13:57:31 -08:00
c3967b798e chore(chains): update chains (#2426)
Co-authored-by: GitHub Action <[email protected]>
2024-03-07 13:21:11 -08:00
588897d1b0 chore(chains): update chains (#2416)
Co-authored-by: GitHub Action <[email protected]>
2024-03-07 11:59:05 -08:00
862905e161 refactor: Move checkContractWalletSignature function to a separate file (#2417)
Co-authored-by: 0xFirekeeper <[email protected]>
2024-03-07 06:09:48 +00:00
saminaandGitHub 5f81e246f2 Update README.md (#2418)
Signed-off-by: samina <[email protected]>
2024-03-07 02:43:38 +00:00
Jonas DanielsGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>GitHub Action
1b052d63e9 Version Packages (#2409)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <[email protected]>
2024-03-06 15:23:29 -08:00
FirekeeperandGitHub a3f6878649 [Unity] Remove unnecessary logs, add getEmail check (#2415) 2024-03-06 22:44:51 +00:00
Jonas DanielsandGitHub 74a92dcb7d feat(wallets): pass clientId and secretKey to verifySignature functions (#2414) 2024-03-06 22:20:10 +00:00
38fc0b796a chore(chains): update chains (#2412)
Co-authored-by: GitHub Action <[email protected]>
2024-03-06 13:07:04 -08:00
YashandGitHub ef76a96c2d [CLI] Option to link external libraries (#2400) 2024-03-06 18:45:04 +00:00
2667706d8d chore(chains): update chains (#2408)
Co-authored-by: GitHub Action <[email protected]>
2024-03-06 00:03:24 -08:00
047fbe2918 chore(chains): update chains (#2406)
Co-authored-by: GitHub Action <[email protected]>
2024-03-05 23:58:43 -08:00
149 changed files with 3938 additions and 1102 deletions
+57 -23
View File
@@ -5,7 +5,7 @@
<br />
</p>
<h1 align="center"><a href='https://thirdweb.com/'>thirdweb</a> JavaScript/TypeScript monorepo</h1>
<h1 align="center"><a href='https://thirdweb.com/'>thirdweb</a> TypeScript SDK</h1>
<p align="center">
<a href="https://github.com/thirdweb-dev/js/actions/workflows/build-test-lint.yml">
@@ -16,38 +16,72 @@
</a>
</p>
<p align="center"><strong>Best in class web3 SDKs for Browser, Node and Mobile apps</strong></p>
<p align="center"><strong>All-in-one web3 SDK for Browser, Node and Mobile apps</strong></p>
> [!IMPORTANT]
> We rewrote the thirdweb SDK from scratch for performance! Head over to the [Beta version unified SDK](https://github.com/thirdweb-dev/js/tree/beta/packages/thirdweb).
## Features
- Support for React & React-Native
- First party support for [Embedded Wallets](https://portal.thirdweb.com/connect/embedded-wallet/overview) (social/email login)
- First party support for [Account Abstraction](https://portal.thirdweb.com/connect/account-abstraction)
- Instant connection to any chain with RPC Edge integration
- Integrated IPFS upload/download
- UI Components for connection, transactions, nft rendering
- High level contract extensions for interacting with common standards
- Automatic ABI resolution
## Library Comparison
| | thirdweb | Wagmi | Viem | Ethers@6 |
| ----------------------------------------- | -------- | ------------------ | ------------------ | -------- |
| Type safe contract API | ✅ | ✅ | ✅ | ✅ |
| Type safe wallet API | ✅ | ✅ | ✅ | ✅ |
| EVM utils | ✅ | ❌ | ✅ | ✅ |
| RPC for any EVM | ✅  | ⚠️ public RPC only | ⚠️ public RPC only | ❌ |
| Automatic ABI Resolution | ✅ | ❌ | ❌ | ❌ |
| IPFS Upload/Download | ✅ | ❌ | ❌ | ❌ |
| Embedded wallet (email/ social login) | ✅ | ⚠️ via 3rd party | ❌ | ❌ |
| Account abstraction (ERC4337) support | ✅ | ⚠️ via 3rd party | ⚠️ via 3rd party | ❌ |
| Web3 wallet connectors | ✅ | ✅ | ❌ | ❌ |
| Local wallet creation | ✅ | ❌ | ✅ | ✅ |
| Auth (SIWE) | ✅ | ⚠️ via 3rd party | ❌ | ❌ |
| Extensions functions for common standards | ✅ | ❌ | ❌ | ❌ |
| React Hooks | ✅ | ✅ | ❌ | ❌ |
| React UI components | ✅ | ❌ | ❌ | ❌ |
| React Native Hooks | ✅ | ❌ | ❌ | ❌ |
| React Native UI Components | ✅ | ❌ | ❌ | ❌ |
## Packages
| Package | Description | Latest Version |
| ---------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [/sdk](./packages/sdk) | Best in class web3 SDK for Browser, Node and Mobile apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/sdk"><img src="https://img.shields.io/npm/v/@thirdweb-dev/sdk?color=red&label=npm&logo=npm" alt="npm version"/></a> |
| [/wallets](./packages/wallets) | Unified web3 Wallet library to integrate any wallet into your applications. | <a href="https://www.npmjs.com/package/@thirdweb-dev/wallets"><img src="https://img.shields.io/npm/v/@thirdweb-dev/wallets?color=red&label=npm&logo=npm" alt="npm version"/></a> |
| [/react](./packages/react) | Ultimate collection of React hooks for your web3 apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/react"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react?color=red&label=npm&logo=npm" alt="npm version"/></a> |
| [/react-native](./packages/react-native) | Ultimate collection of React hooks for your native mobile web3 apps | <a href="https://www.npmjs.com/package/@thirdweb-dev/react-native"><img src="https://img.shields.io/npm/v/@thirdweb-dev/react-native?color=red&label=npm&logo=npm" alt="npm version"/></a> |
| [/auth](./packages/auth) | Best in class wallet authentication for Node backends | <a href="https://www.npmjs.com/package/@thirdweb-dev/auth"><img src="https://img.shields.io/npm/v/@thirdweb-dev/auth?color=red&label=npm&logo=npm" alt="npm version"/></a> |
| [/storage](./packages/storage) | Best in class decentralized storage SDK for Browser and Node | <a href="https://www.npmjs.com/package/@thirdweb-dev/storage"><img src="https://img.shields.io/npm/v/@thirdweb-dev/storage?color=red&label=npm&logo=npm" alt="npm version"/></a> |
| [/cli](./packages/cli) | Publish and deploy smart contracts without dealing with private keys | <a href="https://www.npmjs.com/package/thirdweb"><img src="https://img.shields.io/npm/v/thirdweb?color=red&label=npm&logo=npm" alt="npm version"/></a> |
| [/chains](./packages/chains) | All EVM chain information as JS objects for easy handling | <a href="https://www.npmjs.com/package/@thirdweb-dev/chains"><img src="https://img.shields.io/npm/v/@thirdweb-dev/chains?color=red&label=npm&logo=npm" alt="npm version"/></a> |
## Documentation
Visit [https://portal.thirdweb.com/](https://portal.thirdweb.com/) to view the full documentation.
<br />
| Package | Description
| -----------------------------------------|-----------------------------------------------------------------------------|
| [/sdk](./packages/sdk) | Best in class web3 SDK for Browser, Node and Mobile apps |
| [/wallets](./packages/wallets) | Unified web3 Wallet library to integrate any wallet into your applications. |
| [/react](./packages/react) | Ultimate collection of React hooks for your web3 apps |
| [/react-native](./packages/react-native) | Ultimate collection of React hooks for your native mobile web3 apps |
| [/auth](./packages/auth) | Best in class wallet authentication for Node backends |
| [/storage](./packages/storage) | Best in class decentralized storage SDK for Browser and Node |
| [/cli](./packages/cli) | Publish and deploy smart contracts without dealing with private keys |
| [/chains](./packages/chains) | All EVM chain information as JS objects for easy handling |
## Contributing
We welcome contributions from all developers, regardless of experience level. If you are interested in contributing, please read our [Contributing Guide](.github/contributing.md) where you'll learn how the repo works, how to test your changes, and how to submit a pull request.
We welcome contributions from all developers regardless of experience level. If you are interested in contributing, please read our [Contributing Guide](.github/contributing.md) to learn how the repo works, how to test your changes, and how to submit a pull request.
<br />
See our [open source page](https://thirdweb.com/open-source) for more information on our open-source bounties and program.
## Community
## Additional Resources
The best place to discuss your ideas, ask questions, and troubleshoot issues is our [Discord server](https://discord.gg/thirdweb).
- [SDK Documentation](https://portal.thirdweb.com/typescript/v5)
- [Templates](https://thirdweb.com/templates)
- [YouTube](https://www.youtube.com/c/thirdweb_)
<br/>
## Support
For help or feedback, please [visit our support site](https://thirdweb.com/support)
## Security
+58
View File
@@ -1,5 +1,63 @@
# @thirdweb-dev/auth
## 4.1.44
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.22
## 4.1.43
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.21
## 4.1.42
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.20
## 4.1.41
### Patch Changes
- Updated dependencies []:
- @thirdweb-dev/wallets@2.4.19
## 4.1.40
### Patch Changes
- Updated dependencies [[`cabfc29`](https://github.com/thirdweb-dev/js/commit/cabfc29119f25a78010f59f766bdcb8c392afa2d)]:
- @thirdweb-dev/wallets@2.4.18
## 4.1.39
### Patch Changes
- Updated dependencies [[`c894270`](https://github.com/thirdweb-dev/js/commit/c894270401850575d1a4df73e16198177b46477a), [`332a145`](https://github.com/thirdweb-dev/js/commit/332a14552bf95e13e5220b1bd73414f000088568)]:
- @thirdweb-dev/wallets@2.4.17
## 4.1.38
### Patch Changes
- [#2417](https://github.com/thirdweb-dev/js/pull/2417) [`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6) Thanks [@jnsdls](https://github.com/jnsdls)! - make verify login payload be self-sufficient
- Updated dependencies [[`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6)]:
- @thirdweb-dev/wallets@2.4.16
## 4.1.37
### Patch Changes
- Updated dependencies [[`74a92dc`](https://github.com/thirdweb-dev/js/commit/74a92dcb7dc4be7d03bcb8b7211e87016f52a81f)]:
- @thirdweb-dev/wallets@2.4.15
## 4.1.36
### Patch Changes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/auth",
"version": "4.1.36",
"version": "4.1.44",
"main": "dist/thirdweb-dev-auth.cjs.js",
"module": "dist/thirdweb-dev-auth.esm.js",
"browser": {
@@ -61,7 +61,7 @@
"lint": "eslint src/ && bunx publint --strict --level warning",
"fix": "eslint src/ --fix",
"clean": "rm -rf dist/ && rm -rf node_modules/",
"test": "mocha --config './test/.mocharc.json' --timeout 30000 --parallel './test/**/*.test.ts'",
"test": "mocha --config './test/.mocharc.json' --timeout 240000 --parallel './test/**/*.test.ts'",
"push": "yalc push"
},
"preconstruct": {
+11 -2
View File
@@ -23,14 +23,21 @@ import {
AuthenticateOptionsWithOptionalDomain,
AuthenticationPayload,
} from "./schema/authenticate";
import { ThirdwebAuthOptions } from "./types";
export class ThirdwebAuth {
private domain: string;
private wallet: GenericAuthWallet;
private options: ThirdwebAuthOptions;
constructor(wallet: GenericAuthWallet, domain: string) {
constructor(
wallet: GenericAuthWallet,
domain: string,
options: ThirdwebAuthOptions = {},
) {
this.wallet = wallet;
this.domain = domain;
this.options = options;
}
public updateWallet(wallet: GenericAuthWallet) {
@@ -66,9 +73,9 @@ export class ThirdwebAuth {
options?: VerifyOptionsWithOptionalDomain,
): Promise<string> {
return verifyLoginPayload({
wallet: this.wallet,
payload,
options: this.formatOptions(options),
clientOptions: this.options,
});
}
@@ -80,6 +87,7 @@ export class ThirdwebAuth {
wallet: this.wallet,
payload,
options: this.formatOptions(options),
clientOptions: this.options,
});
}
@@ -99,6 +107,7 @@ export class ThirdwebAuth {
wallet: this.wallet,
jwt,
options: this.formatOptions(options),
clientOptions: this.options,
});
}
+7 -2
View File
@@ -14,6 +14,7 @@ import {
import { GenerateOptionsSchema } from "../schema/generate";
import { RefreshOptionsSchema } from "../schema/refresh";
import { verifyLoginPayload } from "./login";
import { verifySignature } from "./verify-signature";
function isBrowser() {
return typeof window !== "undefined";
@@ -71,15 +72,16 @@ export async function generateJWT({
wallet,
payload,
options,
clientOptions,
}: GenerateJwtParams): Promise<string> {
const parsedOptions = GenerateOptionsSchema.parse(options);
const userAddress = await verifyLoginPayload({
wallet,
payload,
options: {
domain: parsedOptions.domain,
...parsedOptions.verifyOptions,
},
clientOptions,
});
let session: Json | undefined = undefined;
@@ -156,6 +158,7 @@ export async function authenticateJWT<TSession extends Json = Json>({
wallet,
jwt,
options,
clientOptions,
}: AuthenticateJwtParams): Promise<User<TSession>> {
const parsedOptions = AuthenticateOptionsSchema.parse(options);
const { payload, signature } = parseJWT(jwt);
@@ -210,11 +213,13 @@ export async function authenticateJWT<TSession extends Json = Json>({
}
}
const verified = await wallet.verifySignature(
const verified = await verifySignature(
JSON.stringify(payload),
signature,
issuerAddress,
chainId,
clientOptions.clientId,
clientOptions.secretKey,
);
if (!verified) {
throw new Error(
+10 -12
View File
@@ -10,6 +10,7 @@ import {
LoginPayloadDataSchema,
} from "../schema/login";
import { VerifyOptionsSchema } from "../schema/verify";
import { verifySignature } from "./verify-signature";
/**
* Create an EIP-4361 & CAIP-122 compliant message to sign based on the login payload
@@ -113,18 +114,12 @@ export async function buildAndSignLoginPayload({
}
export async function verifyLoginPayload({
wallet,
payload,
options,
clientOptions,
}: VerifyLoginPayloadParams): Promise<string> {
const parsedOptions = VerifyOptionsSchema.parse(options);
if (payload.payload.type !== wallet.type) {
throw new Error(
`Expected chain type '${wallet.type}' does not match chain type on payload '${payload.payload.type}'`,
);
}
// Check that the intended domain matches the domain of the payload
if (payload.payload.domain !== parsedOptions.domain) {
throw new Error(
@@ -204,16 +199,19 @@ export async function verifyLoginPayload({
// Check that the signing address is the claimed wallet address
const message = createLoginMessage(payload.payload);
const chainId =
wallet.type === "evm" && payload.payload.chain_id
? parseInt(payload.payload.chain_id)
: undefined;
const verified = await wallet.verifySignature(
const chainId = payload.payload.chain_id
? parseInt(payload.payload.chain_id)
: undefined;
const verified = await verifySignature(
message,
payload.signature,
payload.payload.address,
chainId,
clientOptions?.clientId,
clientOptions?.secretKey,
);
if (!verified) {
throw new Error(
`Signer address does not match payload address '${payload.payload.address.toLowerCase()}'`,
@@ -0,0 +1,35 @@
import { checkContractWalletSignature } from "@thirdweb-dev/wallets";
import { utils } from "ethers";
export async function verifySignature(
message: string,
signature: string,
address: string,
chainId?: number,
clientId?: string,
secretKey?: string,
): Promise<boolean> {
try {
const messageHash = utils.hashMessage(message);
const messageHashBytes = utils.arrayify(messageHash);
const recoveredAddress = utils.recoverAddress(messageHashBytes, signature);
if (recoveredAddress === address) {
return true;
}
} catch {
// no-op
}
if (!chainId) {
return false;
}
return checkContractWalletSignature(
message,
signature,
address,
chainId,
clientId,
secretKey,
);
}
+4 -1
View File
@@ -7,6 +7,7 @@ import {
} from "./authenticate";
import { RefreshOptions } from "./refresh";
import { GenerateOptions } from "./generate";
import { ThirdwebAuthOptions } from "../types";
export type BuildLoginPayloadParams = {
wallet: GenericAuthWallet;
@@ -19,9 +20,9 @@ export type SignLoginPayloadParams = {
};
export type VerifyLoginPayloadParams = {
wallet: GenericAuthWallet;
payload: LoginPayload;
options: VerifyOptions;
clientOptions: ThirdwebAuthOptions;
};
export type BuildJwtParams = {
@@ -33,6 +34,7 @@ export type GenerateJwtParams = {
wallet: GenericAuthWallet;
payload: LoginPayload;
options: GenerateOptions;
clientOptions: ThirdwebAuthOptions;
};
export type RefreshJwtParams = {
@@ -45,4 +47,5 @@ export type AuthenticateJwtParams = {
wallet: GenericAuthWallet;
jwt: string;
options: AuthenticateOptions;
clientOptions: ThirdwebAuthOptions;
};
+4
View File
@@ -0,0 +1,4 @@
export type ThirdwebAuthOptions = {
clientId?: string;
secretKey?: string;
};
+1 -1
View File
@@ -41,7 +41,7 @@ export function ThirdwebAuth<
): ThirdwebAuthReturnType<TData, TSession> {
const ctx = {
...cfg,
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain),
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain, cfg.thirdwebAuthOptions),
};
const router = express.Router();
+2
View File
@@ -1,4 +1,5 @@
import { ThirdwebAuth } from "../../core";
import { ThirdwebAuthOptions } from "../../core/types";
import { Json, LoginPayloadOutputSchema, User } from "../../core";
import type { GenericAuthWallet } from "@thirdweb-dev/wallets";
import { Request } from "express";
@@ -68,6 +69,7 @@ export type ThirdwebAuthConfig<
| ((user: User, req: Request) => void)
| ((user: User, req: Request) => Promise<void>);
};
thirdwebAuthOptions?: ThirdwebAuthOptions;
};
export type ThirdwebAuthContext<
+1 -1
View File
@@ -44,7 +44,7 @@ export function ThirdwebAuth<
): ThirdwebAuthReturnType<TData, TSession> {
const ctx = {
...cfg,
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain),
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain, cfg.thirdwebAuthOptions),
};
const authRouter = async (
+2
View File
@@ -9,6 +9,7 @@ import {
import { z } from "zod";
import { IncomingMessage, ServerResponse } from "http";
import { ZodTypeProvider } from "fastify-type-provider-zod";
import { ThirdwebAuthOptions } from "../../core/types";
export const PayloadBodySchema = z.object({
address: z.string(),
@@ -76,6 +77,7 @@ export type ThirdwebAuthConfig<
| ((user: User, req: FastifyRequest) => void)
| ((user: User, req: FastifyRequest) => Promise<void>);
};
thirdwebAuthOptions?: ThirdwebAuthOptions;
};
export type ThirdwebAuthContext<
+3 -1
View File
@@ -2,6 +2,7 @@ import type { GenericAuthWallet } from "@thirdweb-dev/wallets";
import { z } from "zod";
import { Json, LoginPayloadOutputSchema, User } from "../../core";
import { ThirdwebAuthOptions } from "../../core/types";
export const PayloadBodySchema = z.object({
address: z.string(),
@@ -55,8 +56,9 @@ export type ThirdwebAuthConfigShared = {
sameSite?: "lax" | "strict" | "none";
secure?: boolean;
};
thirdwebAuthOptions?: ThirdwebAuthOptions;
};
export type ThirdwebNextContext = {
params?: Record<string, string | string[]>
params?: Record<string, string | string[]>;
};
+9 -15
View File
@@ -8,19 +8,10 @@ import loginHandler from "./routes/login";
import logoutHandler from "./routes/logout";
import userHandler from "./routes/user";
import switchAccountHandler from "./routes/switch-account";
import type {
ThirdwebAuthConfig,
ThirdwebAuthContext,
} from "./types";
import type {
ThirdwebAuthRoute,
ThirdwebNextContext,
} from "../common/types";
import type { ThirdwebAuthConfig, ThirdwebAuthContext } from "./types";
import type { ThirdwebAuthRoute, ThirdwebNextContext } from "../common/types";
export type {
ThirdwebAuthConfig,
ThirdwebAuthContext,
} from "./types";
export type { ThirdwebAuthConfig, ThirdwebAuthContext } from "./types";
export async function ThirdwebAuthRouter(
req: NextRequest,
@@ -44,7 +35,7 @@ export async function ThirdwebAuthRouter(
default:
return Response.json(
{ message: "Invalid route for authentication." },
{ status: 400},
{ status: 400 },
);
}
}
@@ -55,10 +46,13 @@ export function ThirdwebAuth<
>(cfg: ThirdwebAuthConfig<TData, TSession>) {
const authCtx = {
...cfg,
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain),
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain, cfg.thirdwebAuthOptions),
};
async function ThirdwebAuthHandler(req: NextRequest, ctx: ThirdwebNextContext) {
async function ThirdwebAuthHandler(
req: NextRequest,
ctx: ThirdwebNextContext,
) {
return await ThirdwebAuthRouter(req, ctx, authCtx as ThirdwebAuthContext);
}
+1 -1
View File
@@ -52,7 +52,7 @@ export function ThirdwebAuth<
>(cfg: ThirdwebAuthConfig<TData, TSession>) {
const ctx = {
...cfg,
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain),
auth: new ThirdwebAuthSDK(cfg.wallet, cfg.domain, cfg.thirdwebAuthOptions),
};
function ThirdwebAuthHandler(
+5 -1
View File
@@ -3,6 +3,8 @@ import { EthersWallet } from "@thirdweb-dev/wallets/evm/wallets/ethers";
import { expect } from "chai";
import { Wallet } from "ethers";
require("dotenv-mono").load();
describe("Wallet Authentication - EVM", async () => {
let adminWallet: any, signerWallet: any, attackerWallet: any;
let auth: ThirdwebAuth;
@@ -18,7 +20,9 @@ describe("Wallet Authentication - EVM", async () => {
signerWallet = new EthersWallet(signerSigner);
attackerWallet = new EthersWallet(attackerSigner);
auth = new ThirdwebAuth(signerWallet, "thirdweb.com");
auth = new ThirdwebAuth(signerWallet, "thirdweb.com", {
secretKey: process.env.TW_SECRET_KEY,
});
});
beforeEach(async () => {
+384
View File
@@ -0,0 +1,384 @@
import { LocalWallet, SmartWallet } from "@thirdweb-dev/wallets";
import { ThirdwebAuth } from "../src/core";
import { EthersWallet } from "@thirdweb-dev/wallets/evm/wallets/ethers";
import { expect } from "chai";
import { Wallet } from "ethers";
require("dotenv-mono").load();
describe("Wallet Authentication - EVM - Smart Wallet", async () => {
let adminWallet: any, signerWallet: any, attackerWallet: any;
let auth: ThirdwebAuth;
before(async () => {
const factoryAddress = "0x13947435c2fe6BE51ED82F6f59C38617a323dB9B";
const chain = 80001;
const localWallet = new LocalWallet();
await localWallet.generate();
const smartWallet = new SmartWallet({
chain: chain,
factoryAddress: factoryAddress,
gasless: true,
secretKey: process.env.TW_SECRET_KEY,
});
await smartWallet.connect({ personalWallet: localWallet });
adminWallet = new EthersWallet(Wallet.createRandom());
signerWallet = smartWallet;
attackerWallet = new EthersWallet(Wallet.createRandom());
auth = new ThirdwebAuth(signerWallet, "thirdweb.com", {
secretKey: process.env.TW_SECRET_KEY,
});
});
beforeEach(async () => {
auth.updateWallet(signerWallet);
});
it("Should verify logged in wallet", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload);
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should verify logged in wallet with chain ID and expiration", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() + 1000 * 60 * 5),
chainId: "80001",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
chainId: "80001",
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should verify payload with resources", async () => {
const payload = await auth.login({
resources: ["https://example.com", "https://test.com"],
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload without necessary resources", async () => {
const payload = await auth.login({
resources: ["https://example.com"],
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
resources: ["https://example.com", "https://test.com"],
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Login request is missing required resources: https://test.com",
);
}
});
it("Should verify payload with customized statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
statement: "Please sign!",
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload with incorrect statement", async () => {
const payload = await auth.login({
statement: "Please sign!",
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
statement: "Please sign again!",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.include(
"Expected statement 'Please sign again!' does not match statement on payload",
);
}
});
it("Should reject invalid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce === payload.payload.nonce) {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request nonce is invalid");
}
});
it("Should accept valid nonce", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const address = await auth.verify(payload, {
validateNonce: (nonce: string) => {
if (nonce !== payload.payload.nonce) {
throw new Error();
}
},
});
expect(address).to.equal(await signerWallet.getAddress());
});
it("Should reject payload with incorrect domain", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected domain 'test.thirdweb.com' does not match domain on payload 'thirdweb.com'",
);
}
});
it("Should reject expired login payload", async () => {
const payload = await auth.login({
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.equal("Login request has expired");
}
});
it("Should reject payload with incorrect chain ID", async () => {
const payload = await auth.login({
chainId: "1",
});
auth.updateWallet(adminWallet);
try {
await auth.verify(payload, {
chainId: "137",
});
expect.fail();
} catch (err: any) {
expect(err.message).to.equal(
"Expected chain ID '137' does not match chain ID on payload '1'",
);
}
});
it("Should reject payload with incorrect signer", async () => {
const payload = await auth.login();
payload.payload.address = await attackerWallet.getAddress();
auth.updateWallet(adminWallet);
try {
await auth.verify(payload);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("does not match payload address");
}
});
it("Should generate valid authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject token with incorrect domain", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
try {
await auth.authenticate(token, { domain: "test.thirdweb.com" });
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
"Expected token to be for the domain 'test.thirdweb.com', but found token with domain 'thirdweb.com'",
);
}
});
it("Should reject token before invalid before", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
invalidBefore: new Date(Date.now() + 1000 * 60 * 5),
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token is invalid before");
}
});
it("Should reject expired authentication token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
expirationTime: new Date(Date.now() - 1000 * 60 * 5),
});
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("This token expired");
}
});
it("Should reject if admin address is not connected wallet address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(signerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain(
`The expected issuer address '${await signerWallet.getAddress()}' did not match the token issuer address '${await adminWallet.getAddress()}'`,
);
}
});
it("Should accept token with valid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
});
const user = await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "test") {
throw new Error();
}
},
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
it("Should reject token with invalid token ID", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
tokenId: "test",
});
try {
await auth.authenticate(token, {
validateTokenId: (tokenId: string) => {
if (tokenId !== "invalid") {
throw new Error();
}
},
});
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("Token ID is invalid");
}
});
it("Should propagate session on token", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: { role: "admin" },
});
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({ role: "admin" });
});
it("Should call session callback function", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload, {
session: (address: string) => {
return { address, role: "admin" };
},
});
const user = await auth.authenticate(token);
expect(user.address).to.equal(await signerWallet.getAddress());
expect(user.session).to.deep.equal({
address: await signerWallet.getAddress(),
role: "admin",
});
});
it("Should authenticate with issuer address", async () => {
const payload = await auth.login();
auth.updateWallet(adminWallet);
const token = await auth.generate(payload);
auth.updateWallet(attackerWallet);
try {
await auth.authenticate(token);
expect.fail();
} catch (err: any) {
expect(err.message).to.contain("The expected issuer address");
}
const user = await auth.authenticate(token, {
issuerAddress: await adminWallet.getAddress(),
});
expect(user.address).to.equal(await signerWallet.getAddress());
});
});
+24
View File
@@ -1,5 +1,29 @@
# @thirdweb-dev/chains
## 0.1.80
### Patch Changes
- [#2484](https://github.com/thirdweb-dev/js/pull/2484) [`c494db8`](https://github.com/thirdweb-dev/js/commit/c494db87cbfa4b6fc4013abb01936e86a4350ea8) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Update chains
## 0.1.79
### Patch Changes
- [#2464](https://github.com/thirdweb-dev/js/pull/2464) [`2e01627`](https://github.com/thirdweb-dev/js/commit/2e01627c998a49a1dd41041f3743a28488c92697) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Sync chains
## 0.1.78
### Patch Changes
- [#2416](https://github.com/thirdweb-dev/js/pull/2416) [`588897d`](https://github.com/thirdweb-dev/js/commit/588897d1b04e6c63da13639aeb47ca701308e1b2) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.77
### Patch Changes
- [#2406](https://github.com/thirdweb-dev/js/pull/2406) [`047fbe2`](https://github.com/thirdweb-dev/js/commit/047fbe2918808cbc8fded90104458b6e38d1207d) Thanks [@github-actions](https://github.com/apps/github-actions)! - Synced Chains Package
## 0.1.76
### Patch Changes
+35
View File
@@ -0,0 +1,35 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 17186,
"explorers": [
{
"name": "lazy crimson coral explorer",
"url": "https://explorerl2new-lazy-crimson-coral-cotlv0ftqf.t.conduit.xyz",
"standard": "standard"
}
],
"faucets": [],
"features": [],
"name": "lazy-crimson-coral",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 17186,
"parent": {
"type": "L3",
"chain": "Base",
"bridges": [
{
"url": "https://lazy-crimson-coral-cotlv0ftqf.testnets.superbridge.app"
}
]
},
"redFlags": [],
"rpc": [],
"shortName": "lazy-crimson-coral",
"slug": "lazy-crimson-coral",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 20519,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser4113 Testnet",
"nativeCurrency": {
"name": "QaUser4113 Testnet Token",
"symbol": "FYP",
"decimals": 18
},
"networkId": 20519,
"redFlags": [],
"rpc": [
"https://20519.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser4113 Testnet",
"slug": "qauser4113-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 22662,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QA5-03-07 Testnet",
"nativeCurrency": {
"name": "QA5-03-07 Testnet Token",
"symbol": "TYP",
"decimals": 18
},
"networkId": 22662,
"redFlags": [],
"rpc": [
"https://22662.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QA5-03-07 Testnet",
"slug": "qa5-03-07-testnet",
"testnet": true
} as const satisfies Chain;
+42
View File
@@ -0,0 +1,42 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 22985,
"explorers": [
{
"name": "beyond-sepolia-3wng1zu3j3 explorer",
"url": "https://explorerl2new-beyond-sepolia-3wng1zu3j3.t.conduit.xyz",
"standard": "standard",
"icon": {
"url": "ipfs://QmbLxRVZ27Yy6RE9xAdYgSxGPB1TjPtcxahy6uNnp2Pt6T/Beyond.jpg",
"width": 512,
"height": 512,
"format": "jpg"
}
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmbLxRVZ27Yy6RE9xAdYgSxGPB1TjPtcxahy6uNnp2Pt6T/Beyond.jpg",
"width": 512,
"height": 512,
"format": "jpg"
},
"infoURL": "https://explorerl2new-beyond-sepolia-3wng1zu3j3.t.conduit.xyz",
"name": "Beyond Sepolia",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 22985,
"redFlags": [],
"rpc": [
"https://22985.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-beyond-sepolia-3wng1zu3j3.t.conduit.xyz"
],
"shortName": "beyond-sepolia",
"slug": "beyond-sepolia",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 24867,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser45 Testnet",
"nativeCurrency": {
"name": "QaUser45 Testnet Token",
"symbol": "ZAG",
"decimals": 18
},
"networkId": 24867,
"redFlags": [],
"rpc": [
"https://24867.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser45 Testnet",
"slug": "qauser45-testnet",
"testnet": true
} as const satisfies Chain;
+51
View File
@@ -0,0 +1,51 @@
import type { Chain } from "../src/types";
export default {
"chain": "2911",
"chainId": 2911,
"explorers": [
{
"name": "blockscout",
"url": "https://explorer.hychain.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmcSJmAfk3iay6uCGJxgUPd9pTsRxbtF4BrNnC5txE9cg8",
"width": 400,
"height": 400,
"format": "jpg"
}
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmcSJmAfk3iay6uCGJxgUPd9pTsRxbtF4BrNnC5txE9cg8",
"width": 400,
"height": 400,
"format": "jpg"
},
"infoURL": "https://www.hychain.com",
"name": "HYCHAIN",
"nativeCurrency": {
"name": "TOPIA",
"symbol": "TOPIA",
"decimals": 18
},
"networkId": 2911,
"parent": {
"type": "L2",
"chain": "eip155-1",
"bridges": [
{
"url": "https://bridge.hychain.com"
}
]
},
"redFlags": [],
"rpc": [
"https://2911.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.hychain.com/http"
],
"shortName": "hychain",
"slug": "hychain",
"testnet": true
} as const satisfies Chain;
+47
View File
@@ -0,0 +1,47 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 29112,
"explorers": [
{
"name": "blockscout",
"url": "https://testnet.explorer.hychain.com",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmcSJmAfk3iay6uCGJxgUPd9pTsRxbtF4BrNnC5txE9cg8",
"width": 400,
"height": 400,
"format": "jpg"
}
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmcSJmAfk3iay6uCGJxgUPd9pTsRxbtF4BrNnC5txE9cg8",
"width": 400,
"height": 400,
"format": "jpg"
},
"infoURL": "https://www.hychain.com",
"name": "HYCHAIN Testnet",
"nativeCurrency": {
"name": "TOPIA",
"symbol": "TOPIA",
"decimals": 18
},
"networkId": 29112,
"parent": {
"type": "L2",
"chain": "eip155-58008",
"bridges": []
},
"redFlags": [],
"rpc": [
"https://29112.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnet-rpc.hychain.com/http"
],
"shortName": "hychain-testnet",
"slug": "hychain-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 29645,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser6355 Testnet",
"nativeCurrency": {
"name": "QaUser6355 Testnet Token",
"symbol": "MQO",
"decimals": 18
},
"networkId": 29645,
"redFlags": [],
"rpc": [
"https://29645.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser6355 Testnet",
"slug": "qauser6355-testnet",
"testnet": true
} as const satisfies Chain;
+42
View File
@@ -0,0 +1,42 @@
import type { Chain } from "../src/types";
export default {
"chain": "3839",
"chainId": 3839,
"explorers": [
{
"name": "traderlands explorer",
"url": "https://sepolia.arbiscan.io/",
"standard": "standard",
"icon": {
"url": "ipfs://QmRQVgjLcoWAVTocuYegwumz8J8b2F3Le2WnQhwffRmWcg/traderlands%20logo.png",
"width": 512,
"height": 512,
"format": "png"
}
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmRQVgjLcoWAVTocuYegwumz8J8b2F3Le2WnQhwffRmWcg/traderlands%20logo.png",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://sepolia.arbiscan.io/",
"name": "traderlands-sepolia",
"nativeCurrency": {
"name": "Traderlands",
"symbol": "TRADE",
"decimals": 18
},
"networkId": 3839,
"redFlags": [],
"rpc": [
"https://3839.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://traderlands-sepolia.rpc.caldera.xyz/http"
],
"shortName": "Tradetest",
"slug": "traderlands-sepolia",
"testnet": true
} as const satisfies Chain;
+3 -1
View File
@@ -11,6 +11,7 @@ export default {
],
"faucets": [],
"features": [],
"infoURL": "https://crossfi.org/",
"name": "CrossFi Testnet",
"nativeCurrency": {
"name": "XFI",
@@ -21,9 +22,10 @@ export default {
"redFlags": [],
"rpc": [
"https://4157.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.testnet.ms/"
"https://rpc.testnet.ms"
],
"shortName": "XFI",
"slip44": 1,
"slug": "crossfi-testnet",
"testnet": true,
"title": "https://scan.testnet.ms/"
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 45544,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser6609 Testnet",
"nativeCurrency": {
"name": "QaUser6609 Testnet Token",
"symbol": "NHU",
"decimals": 18
},
"networkId": 45544,
"redFlags": [],
"rpc": [
"https://45544.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser6609 Testnet",
"slug": "qauser6609-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 50528,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser9606 Testnet",
"nativeCurrency": {
"name": "QaUser9606 Testnet Token",
"symbol": "JTW",
"decimals": 18
},
"networkId": 50528,
"redFlags": [],
"rpc": [
"https://50528.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser9606 Testnet",
"slug": "qauser9606-testnet",
"testnet": true
} as const satisfies Chain;
+28
View File
@@ -0,0 +1,28 @@
import type { Chain } from "../src/types";
export default {
"chain": "SIC Testnet",
"chainId": 5102,
"explorers": [
{
"name": "blockscout",
"url": "https://explorerl2new-sic-testnet-zvr7tlkzsi.t.conduit.xyz",
"standard": "EIP3091"
}
],
"faucets": [],
"infoURL": "https://www.fwb.help/",
"name": "SIC Testnet",
"nativeCurrency": {
"name": "ETH",
"symbol": "ETH",
"decimals": 18
},
"networkId": 5102,
"rpc": [
"https://5102.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-sic-testnet-zvr7tlkzsi.t.conduit.xyz"
],
"shortName": "sic-testnet",
"slug": "sic-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 51277,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QI0344s1 Testne",
"nativeCurrency": {
"name": "QI0344s1 Testne Token",
"symbol": "LKG",
"decimals": 18
},
"networkId": 51277,
"redFlags": [],
"rpc": [
"https://51277.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QI0344s1 Testne",
"slug": "qi0344s1-testne",
"testnet": true
} as const satisfies Chain;
+1 -1
View File
@@ -40,7 +40,7 @@ export default {
"networkId": 52014,
"rpc": [
"https://52014.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://api.electroneum.com"
"https://rpc.electroneum.com"
],
"shortName": "etn-mainnet",
"slug": "electroneum",
+1 -1
View File
@@ -40,7 +40,7 @@ export default {
"networkId": 5201420,
"rpc": [
"https://5201420.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://api.electroneum.com"
"https://testnet-rpc.electroneum.com"
],
"shortName": "etn-testnet",
"slip44": 1,
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 57021,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QIM2403061",
"nativeCurrency": {
"name": "QIM2403061 Token",
"symbol": "VVC",
"decimals": 18
},
"networkId": 57021,
"redFlags": [],
"rpc": [
"https://57021.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QIM2403061",
"slug": "qim2403061",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 59944,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser7920 Testnet",
"nativeCurrency": {
"name": "QaUser7920 Testnet Token",
"symbol": "USH",
"decimals": 18
},
"networkId": 59944,
"redFlags": [],
"rpc": [
"https://59944.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser7920 Testnet",
"slug": "qauser7920-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 61258,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser7821 Testnet",
"nativeCurrency": {
"name": "QaUser7821 Testnet Token",
"symbol": "WND",
"decimals": 18
},
"networkId": 61258,
"redFlags": [],
"rpc": [
"https://61258.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser7821 Testnet",
"slug": "qauser7821-testnet",
"testnet": true
} as const satisfies Chain;
+42
View File
@@ -0,0 +1,42 @@
import type { Chain } from "../src/types";
export default {
"chain": "KEC",
"chainId": 61406,
"explorers": [
{
"name": "KEC SCAN",
"url": "https://explorer.kaichain.net/",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmbfRP2Ugo66pw6Mn8m9ChP4UE6Rn5nobtDo7Vy7ej93qA/kaichain%20icon.png",
"width": 512,
"height": 512,
"format": "png"
}
}
],
"faucets": [],
"features": [],
"icon": {
"url": "ipfs://QmbfRP2Ugo66pw6Mn8m9ChP4UE6Rn5nobtDo7Vy7ej93qA/kaichain%20icon.png",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "http://kaichain.net/",
"name": "Kaichain Mainnet",
"nativeCurrency": {
"name": "Kaichain",
"symbol": "KEC",
"decimals": 18
},
"networkId": 61406,
"redFlags": [],
"rpc": [
"https://61406.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://mainnet-rpc.kaichain.net"
],
"shortName": "Kaichain",
"slug": "kaichain",
"testnet": false
} as const satisfies Chain;
+47
View File
@@ -0,0 +1,47 @@
import type { Chain } from "../src/types";
export default {
"chain": "FTM",
"chainId": 64165,
"ens": {
"registry": "standard"
},
"explorers": [
{
"name": "Fantom Sonic Builders Testnet",
"url": "https://sonicscan.io/",
"standard": "standard",
"icon": {
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/fantom/512.png",
"width": 512,
"height": 512,
"format": "png"
}
}
],
"faucets": [
"https://public-sonic.fantom.network/account"
],
"features": [],
"icon": {
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/fantom/512.png",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://sonicscan.io/",
"name": "Fantom Sonic Builders Testnet",
"nativeCurrency": {
"name": "Fantom",
"symbol": "FTM",
"decimals": 18
},
"networkId": 64165,
"redFlags": [],
"rpc": [
"https://64165.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.sonic.fantom.network/"
],
"shortName": "FantomTestnet",
"slug": "fantom-sonic-builders-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 64361,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser8734 Testnet",
"nativeCurrency": {
"name": "QaUser8734 Testnet Token",
"symbol": "XPI",
"decimals": 18
},
"networkId": 64361,
"redFlags": [],
"rpc": [
"https://64361.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser8734 Testnet",
"slug": "qauser8734-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 65300,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser46 Testnet",
"nativeCurrency": {
"name": "QaUser46 Testnet Token",
"symbol": "ZAG",
"decimals": 18
},
"networkId": 65300,
"redFlags": [],
"rpc": [
"https://65300.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser46 Testnet",
"slug": "qauser46-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 65842,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser4143 Testnet",
"nativeCurrency": {
"name": "QaUser4143 Testnet Token",
"symbol": "NHU",
"decimals": 18
},
"networkId": 65842,
"redFlags": [],
"rpc": [
"https://65842.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser4143 Testnet",
"slug": "qauser4143-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 66904,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser1335 Testnet",
"nativeCurrency": {
"name": "QaUser1335 Testnet Token",
"symbol": "KFZ",
"decimals": 18
},
"networkId": 66904,
"redFlags": [],
"rpc": [
"https://66904.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser1335 Testnet",
"slug": "qauser1335-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 67451,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser6097 Testnet",
"nativeCurrency": {
"name": "QaUser6097 Testnet Token",
"symbol": "NHU",
"decimals": 18
},
"networkId": 67451,
"redFlags": [],
"rpc": [
"https://67451.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser6097 Testnet",
"slug": "qauser6097-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Galadriel",
"chainId": 696969,
"explorers": [
{
"name": "Galadriel Explorer",
"url": "https://explorer.galadriel.com",
"standard": "none"
}
],
"faucets": [
"https://docs.galadriel.com/faucet"
],
"infoURL": "https://galadriel.com",
"name": "Galadriel Testnet",
"nativeCurrency": {
"name": "Galadriel Testnet token",
"symbol": "GAL",
"decimals": 18
},
"networkId": 696969,
"rpc": [
"https://696969.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://testnet.galadriel.com"
],
"shortName": "galadriel-testnet",
"slug": "galadriel-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 70341,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser1957 Testnet",
"nativeCurrency": {
"name": "QaUser1957 Testnet Token",
"symbol": "AKI",
"decimals": 18
},
"networkId": 70341,
"redFlags": [],
"rpc": [
"https://70341.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser1957 Testnet",
"slug": "qauser1957-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 72877,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser4 Testnet",
"nativeCurrency": {
"name": "QaUser4 Testnet Token",
"symbol": "ZAG",
"decimals": 18
},
"networkId": 72877,
"redFlags": [],
"rpc": [
"https://72877.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser4 Testnet",
"slug": "qauser4-testnet-qauser4 testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 73677,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser9318 Testnet",
"nativeCurrency": {
"name": "QaUser9318 Testnet Token",
"symbol": "XUK",
"decimals": 18
},
"networkId": 73677,
"redFlags": [],
"rpc": [
"https://73677.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser9318 Testnet",
"slug": "qauser9318-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 77552,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser3673 Testnet",
"nativeCurrency": {
"name": "QaUser3673 Testnet Token",
"symbol": "YSI",
"decimals": 18
},
"networkId": 77552,
"redFlags": [],
"rpc": [
"https://77552.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser3673 Testnet",
"slug": "qauser3673-testnet",
"testnet": true
} as const satisfies Chain;
+38
View File
@@ -0,0 +1,38 @@
import type { Chain } from "../src/types";
export default {
"chain": "Polygon",
"chainId": 80002,
"explorers": [
{
"name": "polygonamoy",
"url": "https://www.oklink.com/amoy",
"standard": "EIP3091"
}
],
"faucets": [
"https://faucet.polygon.technology/"
],
"features": [],
"icon": {
"url": "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/polygon/512.png",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://polygon.technology/",
"name": "Polygon Amoy Testnet",
"nativeCurrency": {
"name": "MATIC",
"symbol": "MATIC",
"decimals": 18
},
"networkId": 80002,
"redFlags": [],
"rpc": [
"https://80002.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc-amoy.polygon.technology"
],
"shortName": "polygonamoy",
"slug": "polygon-amoy-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 80719,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser4301 Testnet",
"nativeCurrency": {
"name": "QaUser4301 Testnet Token",
"symbol": "NHU",
"decimals": 18
},
"networkId": 80719,
"redFlags": [],
"rpc": [
"https://80719.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser4301 Testnet",
"slug": "qauser4301-testnet",
"testnet": true
} as const satisfies Chain;
+51
View File
@@ -0,0 +1,51 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 810180,
"explorers": [
{
"name": "zkLink Nova Block Explorer",
"url": "https://explorer.zklink.io",
"standard": "EIP3091",
"icon": {
"url": "ipfs://bafkreiaj7b6pdekv3rjuta5wsdvmfdcsat2jftjgozape7wvmyj6d3vjcm",
"width": 512,
"height": 512,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://bafkreiaj7b6pdekv3rjuta5wsdvmfdcsat2jftjgozape7wvmyj6d3vjcm",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://zklink.io",
"name": "zkLink Nova Mainnet",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 810180,
"parent": {
"type": "L2",
"chain": "eip155-59144",
"bridges": [
{
"url": "https://portal.zklink.io"
}
]
},
"rpc": [
"https://810180.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://rpc.zklink.io",
"wss://rpc.zklink.io"
],
"shortName": "zklink-nova",
"slip44": 1,
"slug": "zklink-nova",
"testnet": false
} as const satisfies Chain;
+51
View File
@@ -0,0 +1,51 @@
import type { Chain } from "../src/types";
export default {
"chain": "ETH",
"chainId": 810182,
"explorers": [
{
"name": "zkLink Nova Block Explorer",
"url": "https://goerli.explorer.zklink.io",
"standard": "EIP3091",
"icon": {
"url": "ipfs://bafkreiaj7b6pdekv3rjuta5wsdvmfdcsat2jftjgozape7wvmyj6d3vjcm",
"width": 512,
"height": 512,
"format": "png"
}
}
],
"faucets": [],
"icon": {
"url": "ipfs://bafkreiaj7b6pdekv3rjuta5wsdvmfdcsat2jftjgozape7wvmyj6d3vjcm",
"width": 512,
"height": 512,
"format": "png"
},
"infoURL": "https://zklink.io",
"name": "zkLink Nova Goerli Testnet",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"networkId": 810182,
"parent": {
"type": "L2",
"chain": "eip155-59140",
"bridges": [
{
"url": "https://goerli.portal.zklink.io"
}
]
},
"rpc": [
"https://810182.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://goerli.rpc.zklink.io",
"wss://goerli.rpc.zklink.io"
],
"shortName": "zklink-nova-goerli",
"slip44": 1,
"slug": "zklink-nova-goerli-testnet",
"testnet": true
} as const satisfies Chain;
+12 -3
View File
@@ -3,10 +3,21 @@ export default {
"chain": "MEER",
"chainId": 813,
"explorers": [
{
"name": "meerscan",
"url": "https://qng.qitmeer.io",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmWSbMuCwQzhBB6GRLYqZ87n5cnpzpYCehCAMMQmUXj4mm",
"width": 512,
"height": 512,
"format": "png"
}
},
{
"name": "meerscan",
"url": "https://qng.meerscan.io",
"standard": "none",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmWSbMuCwQzhBB6GRLYqZ87n5cnpzpYCehCAMMQmUXj4mm",
"width": 512,
@@ -36,8 +47,6 @@ export default {
"https://evm-dataseed2.meerscan.io",
"https://evm-dataseed3.meerscan.io",
"https://evm-dataseed.meerscan.com",
"https://evm-dataseed1.meerscan.com",
"https://evm-dataseed2.meerscan.com",
"https://qng.rpc.qitmeer.io",
"https://mainnet.meerlabs.com",
"https://rpc.dimai.ai",
+2 -2
View File
@@ -5,8 +5,8 @@ export default {
"explorers": [
{
"name": "meerscan testnet",
"url": "https://qng-testnet.meerscan.io",
"standard": "none",
"url": "https://testnet-qng.qitmeer.io",
"standard": "EIP3091",
"icon": {
"url": "ipfs://QmWSbMuCwQzhBB6GRLYqZ87n5cnpzpYCehCAMMQmUXj4mm",
"width": 512,
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 81573,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QIS0311 Testnet",
"nativeCurrency": {
"name": "QIS0311 Testnet Token",
"symbol": "MVD",
"decimals": 18
},
"networkId": 81573,
"redFlags": [],
"rpc": [
"https://81573.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QIS0311 Testnet",
"slug": "qis0311-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 93017,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QIS0313 Testnet",
"nativeCurrency": {
"name": "QIS0313 Testnet Token",
"symbol": "NCG",
"decimals": 18
},
"networkId": 93017,
"redFlags": [],
"rpc": [
"https://93017.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QIS0313 Testnet",
"slug": "qis0313-testnet",
"testnet": true
} as const satisfies Chain;
+30
View File
@@ -0,0 +1,30 @@
import type { Chain } from "../src/types";
export default {
"chain": "Avalanche",
"chainId": 9872,
"explorers": [],
"faucets": [],
"features": [],
"icon": {
"url": "https://images.ctfassets.net/9bazykntljf6/62CceHSYsRS4D9fgDSkLRB/877cb8f26954e1743ff535fd7fdaf78f/avacloud-placeholder.svg",
"width": 256,
"height": 256,
"format": "svg"
},
"infoURL": "https://avacloud.io",
"name": "QaUser0507 Testnet",
"nativeCurrency": {
"name": "QaUser0507 Testnet Token",
"symbol": "KQA",
"decimals": 18
},
"networkId": 9872,
"redFlags": [],
"rpc": [
"https://9872.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"
],
"shortName": "QaUser0507 Testnet",
"slug": "qauser0507-testnet",
"testnet": true
} as const satisfies Chain;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/chains",
"version": "0.1.76",
"version": "0.1.80",
"main": "dist/thirdweb-dev-chains.cjs.js",
"module": "dist/thirdweb-dev-chains.esm.js",
"exports": {
+1 -1
View File
@@ -96,7 +96,7 @@ ${exports.join("\n")}
export * from "./types";
export * from "./utils";
export * from "./async";
export const defaultChains = [c1, c5, c8453, c84531, c137, c80001, c42161, c421613, c10, c420, c56, c97, c250, c4002, c43114, c43113, c1337];
export const defaultChains = [c1, c11155111, c8453, c84532, c137, c80001, c42161, c421614, c10, c11155420, c56, c97, c250, c4002, c43114, c43113, c1337];
\/**
* @deprecated use \`fetchChains()\` instead
File diff suppressed because one or more lines are too long
+78
View File
@@ -1,5 +1,83 @@
# thirdweb
## 0.13.52
### Patch Changes
- Updated dependencies [[`c494db8`](https://github.com/thirdweb-dev/js/commit/c494db87cbfa4b6fc4013abb01936e86a4350ea8), [`f0250a7`](https://github.com/thirdweb-dev/js/commit/f0250a77cdbfa3b72e8dbf0ff345219a032e42b0), [`c67b287`](https://github.com/thirdweb-dev/js/commit/c67b2877643afdfb503b41a2b5d21e18dbff15f2), [`7ac4e6b`](https://github.com/thirdweb-dev/js/commit/7ac4e6ba4ee947c76f35b1b95927d7772edf6454), [`d4be647`](https://github.com/thirdweb-dev/js/commit/d4be6479db3fec6b4891e5ca89487b4e703eb9cf)]:
- @thirdweb-dev/chains@0.1.80
- @thirdweb-dev/sdk@4.0.47
- @thirdweb-dev/wallets@2.4.22
- @thirdweb-dev/auth@4.1.44
## 0.13.51
### Patch Changes
- Updated dependencies [[`846a350`](https://github.com/thirdweb-dev/js/commit/846a3503fe4a8d39e92dd318470cefefd3b94c69), [`2e01627`](https://github.com/thirdweb-dev/js/commit/2e01627c998a49a1dd41041f3743a28488c92697)]:
- @thirdweb-dev/sdk@4.0.46
- @thirdweb-dev/chains@0.1.79
- @thirdweb-dev/wallets@2.4.21
- @thirdweb-dev/auth@4.1.43
## 0.13.50
### Patch Changes
- Updated dependencies [[`a2002d1`](https://github.com/thirdweb-dev/js/commit/a2002d16376c41fffa59daccfd98856aba90a627)]:
- @thirdweb-dev/sdk@4.0.45
- @thirdweb-dev/wallets@2.4.20
- @thirdweb-dev/auth@4.1.42
## 0.13.49
### Patch Changes
- Updated dependencies [[`b2be63a`](https://github.com/thirdweb-dev/js/commit/b2be63ada466ea1784d680ae6244ac047a190103)]:
- @thirdweb-dev/sdk@4.0.44
- @thirdweb-dev/wallets@2.4.19
- @thirdweb-dev/auth@4.1.41
## 0.13.48
### Patch Changes
- Updated dependencies [[`cabfc29`](https://github.com/thirdweb-dev/js/commit/cabfc29119f25a78010f59f766bdcb8c392afa2d), [`173777a`](https://github.com/thirdweb-dev/js/commit/173777ade4ea59cde1c6f25a4654d48b277be9ad)]:
- @thirdweb-dev/wallets@2.4.18
- @thirdweb-dev/sdk@4.0.43
- @thirdweb-dev/auth@4.1.40
## 0.13.47
### Patch Changes
- Updated dependencies [[`c894270`](https://github.com/thirdweb-dev/js/commit/c894270401850575d1a4df73e16198177b46477a), [`332a145`](https://github.com/thirdweb-dev/js/commit/332a14552bf95e13e5220b1bd73414f000088568), [`c6b025e`](https://github.com/thirdweb-dev/js/commit/c6b025e84451341f6f48c0a7c4b5f06b8e49d792)]:
- @thirdweb-dev/wallets@2.4.17
- @thirdweb-dev/sdk@4.0.42
- @thirdweb-dev/auth@4.1.39
## 0.13.46
### Patch Changes
- Updated dependencies [[`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6), [`588897d`](https://github.com/thirdweb-dev/js/commit/588897d1b04e6c63da13639aeb47ca701308e1b2), [`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6)]:
- @thirdweb-dev/auth@4.1.38
- @thirdweb-dev/chains@0.1.78
- @thirdweb-dev/wallets@2.4.16
- @thirdweb-dev/sdk@4.0.41
## 0.13.45
### Patch Changes
- [#2400](https://github.com/thirdweb-dev/js/pull/2400) [`ef76a96`](https://github.com/thirdweb-dev/js/commit/ef76a96c2dda21e28195371fd48e57350721b717) Thanks [@kumaryash90](https://github.com/kumaryash90)! - "Option to link external libraries"
- Updated dependencies [[`74a92dc`](https://github.com/thirdweb-dev/js/commit/74a92dcb7dc4be7d03bcb8b7211e87016f52a81f), [`047fbe2`](https://github.com/thirdweb-dev/js/commit/047fbe2918808cbc8fded90104458b6e38d1207d)]:
- @thirdweb-dev/wallets@2.4.15
- @thirdweb-dev/chains@0.1.77
- @thirdweb-dev/auth@4.1.37
- @thirdweb-dev/sdk@4.0.40
## 0.13.44
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "thirdweb",
"main": "dist/cli/index.js",
"version": "0.13.44",
"version": "0.13.52",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
+13
View File
@@ -20,6 +20,7 @@ import { generate } from "../generate/command";
import { findPackageInstallation } from "../helpers/detect-local-packages";
import { install } from "../install";
import { upload } from "../storage/command";
import { parseLinkLibOption } from "../common/link-lib-helper";
const main = async () => {
// eslint-disable-next-line turbo/no-undeclared-env-vars
@@ -331,6 +332,12 @@ const main = async () => {
"Deploy a dynamic smart contract made up of extensions to blockchains",
)
.option("--zksync", "Deploy on ZKSync")
.option(
"--link-lib <library:address...>",
"Specify library names and addresses",
parseLinkLibOption,
[],
)
.option("-k, --key <key>", "API secret key to authorize usage")
.action(async (options) => {
let secretKey = "";
@@ -370,6 +377,12 @@ const main = async () => {
.option("--dry-run", "dry run (skip actually publishing)")
.option("-d, --debug", "show debug logs")
.option("--ci", "Continuous Integration mode")
.option(
"--link-lib <library:address...>",
"Specify library names and addresses",
parseLinkLibOption,
[],
)
.option("-k, --key <key>", "API secret key to authorize usage")
.action(async (options) => {
let secretKey = "";
@@ -0,0 +1,43 @@
import { utils } from "ethers";
import { isAddress } from "ethers/lib/utils";
export interface Link {
library: string;
address: string;
}
// Custom array option parser for --link-lib
export function parseLinkLibOption(
value: string,
previousValue: Link[] | undefined,
): Link[] {
const links = previousValue || [];
const [library, address] = value.split(":");
if (!isAddress(address)) {
throw new Error(`Invalid address ${address} `);
}
links.push({ library, address });
return links;
}
// replace placeholder in bytecode with library address
export function linkLibrary(
bytecode: string,
libraries: {
[key: string]: string;
} = {},
): string {
let linkedBytecode = bytecode;
for (const [key, address] of Object.entries(libraries)) {
const placeholder = `__\$${utils
.solidityKeccak256(["string"], [key])
.slice(2, 36)}\$__`;
const formattedAddress = utils
.getAddress(address)
.toLowerCase()
.replace("0x", "");
linkedBytecode = linkedBytecode.replaceAll(placeholder, formattedAddress);
}
return linkedBytecode;
}
+1
View File
@@ -41,5 +41,6 @@ export default async function build(
projectPath: path,
clean: options.clean,
zksync: options.zksync,
linkLib: options.linkLib,
});
}
+26 -2
View File
@@ -1,4 +1,5 @@
import { findFiles } from "../../common/file-helper";
import { Link, linkLibrary } from "../../common/link-lib-helper";
import { hasForge } from "../../create/helpers/has-forge";
import { execute } from "../helpers/exec";
import { logger } from "../helpers/logger";
@@ -43,6 +44,24 @@ export class FoundryBuilder extends BaseBuilder {
const files: string[] = [];
findFiles(outPath, /^.*(?<!metadata)\.json$/, files);
const libraries: { [key: string]: string } = {};
if (Array.isArray(options.linkLib) && options.linkLib.length > 0) {
for (let i = 0; i < files.length; i++) {
const file = files[i];
const contractName = basename(file, ".json");
const contractJsonFile = readFileSync(file, "utf-8");
const contractInfo = JSON.parse(contractJsonFile);
options.linkLib.forEach((link: Link) => {
if (contractName === link.library) {
const key = `${contractInfo.ast.absolutePath}:${link.library}`;
libraries[key] = link.address;
}
});
}
logger.debug(`Found libraries to link: ${JSON.stringify(libraries)}`);
}
for (let i = 0; i < files.length; i++) {
const file = files[i];
const contractName = basename(file, ".json");
@@ -76,8 +95,13 @@ export class FoundryBuilder extends BaseBuilder {
continue;
}
const bytecode = contractInfo.bytecode.object;
const deployedBytecode = contractInfo.deployedBytecode.object;
let bytecode = contractInfo.bytecode.object;
let deployedBytecode = contractInfo.deployedBytecode.object;
// link external libraries if any
bytecode = linkLibrary(bytecode, libraries);
deployedBytecode = linkLibrary(deployedBytecode, libraries);
const parsedMetadata = contractInfo.metadata;
const metadata =
contractInfo.rawMetadata ||
+24 -3
View File
@@ -1,4 +1,5 @@
import { findFiles } from "../../common/file-helper";
import { Link, linkLibrary } from "../../common/link-lib-helper";
import { execute } from "../helpers/exec";
import { logger } from "../helpers/logger";
import { ContractPayload } from "../interfaces/ContractPayload";
@@ -85,6 +86,22 @@ export class HardhatBuilder extends BaseBuilder {
const contractBuildOutputs = buildJson.output.contracts;
const libraries: { [key: string]: string } = {};
if (Array.isArray(options.linkLib) && options.linkLib.length > 0) {
for (const [contractPath, contractInfos] of Object.entries(
contractBuildOutputs,
)) {
const contractNames = Object.keys(contractInfos as any);
options.linkLib.forEach((link: Link) => {
if (contractNames.includes(link.library)) {
const key = `${contractPath}:${link.library}`;
libraries[key] = link.address;
}
});
}
logger.debug(`Found libraries to link: ${JSON.stringify(libraries)}`);
}
for (const [contractPath, contractInfos] of Object.entries(
contractBuildOutputs,
)) {
@@ -109,9 +126,13 @@ export class HardhatBuilder extends BaseBuilder {
continue;
}
const bytecode = info.evm.bytecode.object;
const deployedBytecode =
info.evm.deployedBytecode?.object || bytecode;
let bytecode = info.evm.bytecode.object;
let deployedBytecode = info.evm.deployedBytecode?.object || bytecode;
// link external libraries if any
bytecode = linkLibrary(bytecode, libraries);
deployedBytecode = linkLibrary(deployedBytecode, libraries);
const { metadata, abi } = info;
const meta = metadata.solc_metadata
@@ -1,3 +1,4 @@
import { Link } from "../../common/link-lib-helper";
import { ContractPayload } from "./ContractPayload";
export type CompileOptions = {
@@ -5,6 +6,7 @@ export type CompileOptions = {
projectPath: string;
name: string;
zksync?: boolean;
linkLib?: Link[];
};
export interface IBuilder {
+6
View File
@@ -1,5 +1,11 @@
# @thirdweb-dev/contracts-js
## 1.3.17
### Patch Changes
- [#2459](https://github.com/thirdweb-dev/js/pull/2459) [`7ac4e6b`](https://github.com/thirdweb-dev/js/commit/7ac4e6ba4ee947c76f35b1b95927d7772edf6454) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Contracts version 3.11.1
## 1.3.16
### Patch Changes
+10 -11
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/contracts-js",
"version": "1.3.16",
"version": "1.3.17",
"main": "dist/thirdweb-dev-contracts-js.cjs.js",
"module": "dist/thirdweb-dev-contracts-js.esm.js",
"exports": {
@@ -95,7 +95,6 @@
"./dist/abis/IClaimCondition_V1.json": "./dist/abis/IClaimCondition_V1.json",
"./dist/abis/IERC1155.json": "./dist/abis/IERC1155.json",
"./dist/abis/IStaking1155.json": "./dist/abis/IStaking1155.json",
"./dist/abis/Math.json": "./dist/abis/Math.json",
"./dist/abis/IRoyaltyEngineV1.json": "./dist/abis/IRoyaltyEngineV1.json",
"./dist/abis/DelayedRevealStorage.json": "./dist/abis/DelayedRevealStorage.json",
"./dist/abis/ISignatureMintERC1155.json": "./dist/abis/ISignatureMintERC1155.json",
@@ -106,7 +105,6 @@
"./dist/abis/IERC1155Receiver.json": "./dist/abis/IERC1155Receiver.json",
"./dist/abis/IERC4906.json": "./dist/abis/IERC4906.json",
"./dist/abis/ERC2771ContextLogic.json": "./dist/abis/ERC2771ContextLogic.json",
"./dist/abis/TWBitMaps.json": "./dist/abis/TWBitMaps.json",
"./dist/abis/IERC2981.json": "./dist/abis/IERC2981.json",
"./dist/abis/ILazyMintWithTier.json": "./dist/abis/ILazyMintWithTier.json",
"./dist/abis/ERC721SignatureMint.json": "./dist/abis/ERC721SignatureMint.json",
@@ -129,11 +127,9 @@
"./dist/abis/AirdropERC721.json": "./dist/abis/AirdropERC721.json",
"./dist/abis/IDropSinglePhase.json": "./dist/abis/IDropSinglePhase.json",
"./dist/abis/zora_IERC721Drop.json": "./dist/abis/zora_IERC721Drop.json",
"./dist/abis/TWStringSet.json": "./dist/abis/TWStringSet.json",
"./dist/abis/InitStorage.json": "./dist/abis/InitStorage.json",
"./dist/abis/IDropSinglePhase1155.json": "./dist/abis/IDropSinglePhase1155.json",
"./dist/abis/AccountCore.json": "./dist/abis/AccountCore.json",
"./dist/abis/TWStorageSlot.json": "./dist/abis/TWStorageSlot.json",
"./dist/abis/TWMinimalFactory.json": "./dist/abis/TWMinimalFactory.json",
"./dist/abis/TWRegistry.json": "./dist/abis/TWRegistry.json",
"./dist/abis/OpenEditionERC721.json": "./dist/abis/OpenEditionERC721.json",
@@ -155,8 +151,8 @@
"./dist/abis/Proxy.json": "./dist/abis/Proxy.json",
"./dist/abis/ERC1967Proxy.json": "./dist/abis/ERC1967Proxy.json",
"./dist/abis/IRoyaltyPayments.json": "./dist/abis/IRoyaltyPayments.json",
"./dist/abis/IERC721AQueryable.json": "./dist/abis/IERC721AQueryable.json",
"./dist/abis/BaseRouter.json": "./dist/abis/BaseRouter.json",
"./dist/abis/TWAddress.json": "./dist/abis/TWAddress.json",
"./dist/abis/EvolvingNFT.json": "./dist/abis/EvolvingNFT.json",
"./dist/abis/ContractMetadata.json": "./dist/abis/ContractMetadata.json",
"./dist/abis/IOffers.json": "./dist/abis/IOffers.json",
@@ -200,7 +196,6 @@
"./dist/abis/IEntryPoint.json": "./dist/abis/IEntryPoint.json",
"./dist/abis/EnglishAuctionsStorage.json": "./dist/abis/EnglishAuctionsStorage.json",
"./dist/abis/IDropERC721_V3.json": "./dist/abis/IDropERC721_V3.json",
"./dist/abis/EIP712.json": "./dist/abis/EIP712.json",
"./dist/abis/DelayedReveal.json": "./dist/abis/DelayedReveal.json",
"./dist/abis/IAccount.json": "./dist/abis/IAccount.json",
"./dist/abis/OffersStorage.json": "./dist/abis/OffersStorage.json",
@@ -218,6 +213,7 @@
"./dist/abis/DynamicAccount.json": "./dist/abis/DynamicAccount.json",
"./dist/abis/LoyaltyCard.json": "./dist/abis/LoyaltyCard.json",
"./dist/abis/IClaimCondition.json": "./dist/abis/IClaimCondition.json",
"./dist/abis/StorageSlot.json": "./dist/abis/StorageSlot.json",
"./dist/abis/IStaking721.json": "./dist/abis/IStaking721.json",
"./dist/abis/IEnglishAuctions.json": "./dist/abis/IEnglishAuctions.json",
"./dist/abis/TWMultichainRegistry.json": "./dist/abis/TWMultichainRegistry.json",
@@ -234,7 +230,6 @@
"./dist/abis/IAirdropERC1155.json": "./dist/abis/IAirdropERC1155.json",
"./dist/abis/OffersLogic.json": "./dist/abis/OffersLogic.json",
"./dist/abis/Marketplace.json": "./dist/abis/Marketplace.json",
"./dist/abis/TWStrings.json": "./dist/abis/TWStrings.json",
"./dist/abis/DirectListingsStorage.json": "./dist/abis/DirectListingsStorage.json",
"./dist/abis/TieredDrop.json": "./dist/abis/TieredDrop.json",
"./dist/abis/ERC1155Receiver.json": "./dist/abis/ERC1155Receiver.json",
@@ -245,6 +240,7 @@
"./dist/abis/PermissionsInit.json": "./dist/abis/PermissionsInit.json",
"./dist/abis/Account.json": "./dist/abis/Account.json",
"./dist/abis/ERC20Base.json": "./dist/abis/ERC20Base.json",
"./dist/abis/Address.json": "./dist/abis/Address.json",
"./dist/abis/INFTStake.json": "./dist/abis/INFTStake.json",
"./dist/abis/BytesLib.json": "./dist/abis/BytesLib.json",
"./dist/abis/LazyMintStorage.json": "./dist/abis/LazyMintStorage.json",
@@ -309,6 +305,7 @@
"./dist/abis/ERC6551BytecodeLib.json": "./dist/abis/ERC6551BytecodeLib.json",
"./dist/abis/TWMultichainRegistryStorage.json": "./dist/abis/TWMultichainRegistryStorage.json",
"./dist/abis/ForwarderEOAOnly.json": "./dist/abis/ForwarderEOAOnly.json",
"./dist/abis/Strings.json": "./dist/abis/Strings.json",
"./dist/abis/TokenStore.json": "./dist/abis/TokenStore.json",
"./dist/abis/TokenBundle.json": "./dist/abis/TokenBundle.json",
"./dist/abis/IPaymaster.json": "./dist/abis/IPaymaster.json",
@@ -336,8 +333,10 @@
"./dist/abis/IMultiwrap.json": "./dist/abis/IMultiwrap.json",
"./dist/abis/BurnToClaimDrop721Storage.json": "./dist/abis/BurnToClaimDrop721Storage.json",
"./dist/abis/IBurnableERC721.json": "./dist/abis/IBurnableERC721.json",
"./dist/abis/OpenEditionERC721FlatFee.json": "./dist/abis/OpenEditionERC721FlatFee.json",
"./dist/abis/AccountPermissionsStorage.json": "./dist/abis/AccountPermissionsStorage.json",
"./dist/abis/FeeType.json": "./dist/abis/FeeType.json",
"./dist/abis/ERC721AQueryable.json": "./dist/abis/ERC721AQueryable.json",
"./dist/abis/Split.json": "./dist/abis/Split.json",
"./dist/abis/IERC20Metadata.json": "./dist/abis/IERC20Metadata.json",
"./dist/abis/EditionStake.json": "./dist/abis/EditionStake.json",
@@ -354,12 +353,11 @@
"./dist/abis/IPlatformFee.json": "./dist/abis/IPlatformFee.json",
"./dist/abis/Base64.json": "./dist/abis/Base64.json",
"./dist/abis/ProxyForUpgradeable.json": "./dist/abis/ProxyForUpgradeable.json",
"./dist/abis/Helpers.json": "./dist/abis/Helpers.json",
"./dist/abis/StringSet.json": "./dist/abis/StringSet.json",
"./dist/abis/VRFV2WrapperConsumerBase.json": "./dist/abis/VRFV2WrapperConsumerBase.json",
"./dist/abis/ITokenERC1155.json": "./dist/abis/ITokenERC1155.json",
"./dist/abis/BatchMintMetadata.json": "./dist/abis/BatchMintMetadata.json",
"./dist/abis/NFTMetadata.json": "./dist/abis/NFTMetadata.json",
"./dist/abis/ERC20Permit.json": "./dist/abis/ERC20Permit.json",
"./dist/abis/IAppURI.json": "./dist/abis/IAppURI.json",
"./dist/abis/ERC1155DelayedReveal.json": "./dist/abis/ERC1155DelayedReveal.json",
"./dist/abis/BatchMintMetadata_V1.json": "./dist/abis/BatchMintMetadata_V1.json",
@@ -386,6 +384,7 @@
"./dist/abis/Ownable.json": "./dist/abis/Ownable.json",
"./dist/abis/ERC721Base.json": "./dist/abis/ERC721Base.json",
"./dist/abis/OperatorFilterToggleStorage.json": "./dist/abis/OperatorFilterToggleStorage.json",
"./dist/abis/BitMaps.json": "./dist/abis/BitMaps.json",
"./dist/abis/NFTStake.json": "./dist/abis/NFTStake.json",
"./dist/abis/ContractMetadataStorage.json": "./dist/abis/ContractMetadataStorage.json",
"./dist/abis/DropERC20_V2.json": "./dist/abis/DropERC20_V2.json",
@@ -423,7 +422,7 @@
"license": "Apache-2.0",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/contracts-js",
"dependencies": {
"@thirdweb-dev/contracts": "3.10.3"
"@thirdweb-dev/contracts": "3.11.2"
},
"devDependencies": {
"@babel/preset-env": "^7.23.8",
+76
View File
@@ -1,5 +1,81 @@
# @thirdweb-dev/react-core
## 4.4.20
### Patch Changes
- Updated dependencies [[`c494db8`](https://github.com/thirdweb-dev/js/commit/c494db87cbfa4b6fc4013abb01936e86a4350ea8), [`f0250a7`](https://github.com/thirdweb-dev/js/commit/f0250a77cdbfa3b72e8dbf0ff345219a032e42b0), [`c67b287`](https://github.com/thirdweb-dev/js/commit/c67b2877643afdfb503b41a2b5d21e18dbff15f2), [`7ac4e6b`](https://github.com/thirdweb-dev/js/commit/7ac4e6ba4ee947c76f35b1b95927d7772edf6454), [`d4be647`](https://github.com/thirdweb-dev/js/commit/d4be6479db3fec6b4891e5ca89487b4e703eb9cf)]:
- @thirdweb-dev/chains@0.1.80
- @thirdweb-dev/sdk@4.0.47
- @thirdweb-dev/wallets@2.4.22
- @thirdweb-dev/auth@4.1.44
## 4.4.19
### Patch Changes
- Updated dependencies [[`846a350`](https://github.com/thirdweb-dev/js/commit/846a3503fe4a8d39e92dd318470cefefd3b94c69), [`2e01627`](https://github.com/thirdweb-dev/js/commit/2e01627c998a49a1dd41041f3743a28488c92697)]:
- @thirdweb-dev/sdk@4.0.46
- @thirdweb-dev/chains@0.1.79
- @thirdweb-dev/wallets@2.4.21
- @thirdweb-dev/auth@4.1.43
## 4.4.18
### Patch Changes
- Updated dependencies [[`a2002d1`](https://github.com/thirdweb-dev/js/commit/a2002d16376c41fffa59daccfd98856aba90a627)]:
- @thirdweb-dev/sdk@4.0.45
- @thirdweb-dev/wallets@2.4.20
- @thirdweb-dev/auth@4.1.42
## 4.4.17
### Patch Changes
- Updated dependencies [[`b2be63a`](https://github.com/thirdweb-dev/js/commit/b2be63ada466ea1784d680ae6244ac047a190103)]:
- @thirdweb-dev/sdk@4.0.44
- @thirdweb-dev/wallets@2.4.19
- @thirdweb-dev/auth@4.1.41
## 4.4.16
### Patch Changes
- Updated dependencies [[`cabfc29`](https://github.com/thirdweb-dev/js/commit/cabfc29119f25a78010f59f766bdcb8c392afa2d), [`173777a`](https://github.com/thirdweb-dev/js/commit/173777ade4ea59cde1c6f25a4654d48b277be9ad)]:
- @thirdweb-dev/wallets@2.4.18
- @thirdweb-dev/sdk@4.0.43
- @thirdweb-dev/auth@4.1.40
## 4.4.15
### Patch Changes
- Updated dependencies [[`c894270`](https://github.com/thirdweb-dev/js/commit/c894270401850575d1a4df73e16198177b46477a), [`332a145`](https://github.com/thirdweb-dev/js/commit/332a14552bf95e13e5220b1bd73414f000088568), [`c6b025e`](https://github.com/thirdweb-dev/js/commit/c6b025e84451341f6f48c0a7c4b5f06b8e49d792)]:
- @thirdweb-dev/wallets@2.4.17
- @thirdweb-dev/sdk@4.0.42
- @thirdweb-dev/auth@4.1.39
## 4.4.14
### Patch Changes
- Updated dependencies [[`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6), [`588897d`](https://github.com/thirdweb-dev/js/commit/588897d1b04e6c63da13639aeb47ca701308e1b2), [`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6)]:
- @thirdweb-dev/auth@4.1.38
- @thirdweb-dev/chains@0.1.78
- @thirdweb-dev/wallets@2.4.16
- @thirdweb-dev/sdk@4.0.41
## 4.4.13
### Patch Changes
- Updated dependencies [[`74a92dc`](https://github.com/thirdweb-dev/js/commit/74a92dcb7dc4be7d03bcb8b7211e87016f52a81f), [`047fbe2`](https://github.com/thirdweb-dev/js/commit/047fbe2918808cbc8fded90104458b6e38d1207d)]:
- @thirdweb-dev/wallets@2.4.15
- @thirdweb-dev/chains@0.1.77
- @thirdweb-dev/auth@4.1.37
- @thirdweb-dev/sdk@4.0.40
## 4.4.12
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-core",
"version": "4.4.12",
"version": "4.4.20",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
Binary file not shown.
+16
View File
@@ -1,5 +1,21 @@
# @thirdweb-dev/react-native-compat
## 0.7.17
## 0.7.16
## 0.7.15
## 0.7.14
## 0.7.13
## 0.7.12
## 0.7.11
## 0.7.10
## 0.7.9
## 0.7.8
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@thirdweb-dev/react-native-compat",
"description": "Shims for Thirdweb in React Native Projects",
"version": "0.7.9",
"version": "0.7.17",
"author": "thirdweb eng <[email protected]>",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
"license": "Apache-2.0",
+76
View File
@@ -1,5 +1,81 @@
# @thirdweb-dev/react-native
## 0.7.17
### Patch Changes
- Updated dependencies [[`c494db8`](https://github.com/thirdweb-dev/js/commit/c494db87cbfa4b6fc4013abb01936e86a4350ea8), [`f0250a7`](https://github.com/thirdweb-dev/js/commit/f0250a77cdbfa3b72e8dbf0ff345219a032e42b0), [`c67b287`](https://github.com/thirdweb-dev/js/commit/c67b2877643afdfb503b41a2b5d21e18dbff15f2), [`7ac4e6b`](https://github.com/thirdweb-dev/js/commit/7ac4e6ba4ee947c76f35b1b95927d7772edf6454), [`d4be647`](https://github.com/thirdweb-dev/js/commit/d4be6479db3fec6b4891e5ca89487b4e703eb9cf)]:
- @thirdweb-dev/chains@0.1.80
- @thirdweb-dev/sdk@4.0.47
- @thirdweb-dev/react-core@4.4.20
- @thirdweb-dev/wallets@2.4.22
## 0.7.16
### Patch Changes
- Updated dependencies [[`846a350`](https://github.com/thirdweb-dev/js/commit/846a3503fe4a8d39e92dd318470cefefd3b94c69), [`2e01627`](https://github.com/thirdweb-dev/js/commit/2e01627c998a49a1dd41041f3743a28488c92697)]:
- @thirdweb-dev/sdk@4.0.46
- @thirdweb-dev/chains@0.1.79
- @thirdweb-dev/react-core@4.4.19
- @thirdweb-dev/wallets@2.4.21
## 0.7.15
### Patch Changes
- Updated dependencies [[`a2002d1`](https://github.com/thirdweb-dev/js/commit/a2002d16376c41fffa59daccfd98856aba90a627)]:
- @thirdweb-dev/sdk@4.0.45
- @thirdweb-dev/react-core@4.4.18
- @thirdweb-dev/wallets@2.4.20
## 0.7.14
### Patch Changes
- Updated dependencies [[`b2be63a`](https://github.com/thirdweb-dev/js/commit/b2be63ada466ea1784d680ae6244ac047a190103)]:
- @thirdweb-dev/sdk@4.0.44
- @thirdweb-dev/react-core@4.4.17
- @thirdweb-dev/wallets@2.4.19
## 0.7.13
### Patch Changes
- Updated dependencies [[`cabfc29`](https://github.com/thirdweb-dev/js/commit/cabfc29119f25a78010f59f766bdcb8c392afa2d), [`173777a`](https://github.com/thirdweb-dev/js/commit/173777ade4ea59cde1c6f25a4654d48b277be9ad)]:
- @thirdweb-dev/wallets@2.4.18
- @thirdweb-dev/sdk@4.0.43
- @thirdweb-dev/react-core@4.4.16
## 0.7.12
### Patch Changes
- Updated dependencies [[`c894270`](https://github.com/thirdweb-dev/js/commit/c894270401850575d1a4df73e16198177b46477a), [`332a145`](https://github.com/thirdweb-dev/js/commit/332a14552bf95e13e5220b1bd73414f000088568), [`c6b025e`](https://github.com/thirdweb-dev/js/commit/c6b025e84451341f6f48c0a7c4b5f06b8e49d792)]:
- @thirdweb-dev/wallets@2.4.17
- @thirdweb-dev/sdk@4.0.42
- @thirdweb-dev/react-core@4.4.15
## 0.7.11
### Patch Changes
- Updated dependencies [[`588897d`](https://github.com/thirdweb-dev/js/commit/588897d1b04e6c63da13639aeb47ca701308e1b2), [`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6)]:
- @thirdweb-dev/chains@0.1.78
- @thirdweb-dev/wallets@2.4.16
- @thirdweb-dev/react-core@4.4.14
- @thirdweb-dev/sdk@4.0.41
## 0.7.10
### Patch Changes
- Updated dependencies [[`74a92dc`](https://github.com/thirdweb-dev/js/commit/74a92dcb7dc4be7d03bcb8b7211e87016f52a81f), [`047fbe2`](https://github.com/thirdweb-dev/js/commit/047fbe2918808cbc8fded90104458b6e38d1207d)]:
- @thirdweb-dev/wallets@2.4.15
- @thirdweb-dev/chains@0.1.77
- @thirdweb-dev/react-core@4.4.13
- @thirdweb-dev/sdk@4.0.40
## 0.7.9
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react-native",
"version": "0.7.9",
"version": "0.7.17",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
Binary file not shown.
+78
View File
@@ -1,5 +1,83 @@
# @thirdweb-dev/react
## 4.4.20
### Patch Changes
- Updated dependencies [[`c494db8`](https://github.com/thirdweb-dev/js/commit/c494db87cbfa4b6fc4013abb01936e86a4350ea8), [`f0250a7`](https://github.com/thirdweb-dev/js/commit/f0250a77cdbfa3b72e8dbf0ff345219a032e42b0), [`c67b287`](https://github.com/thirdweb-dev/js/commit/c67b2877643afdfb503b41a2b5d21e18dbff15f2), [`7ac4e6b`](https://github.com/thirdweb-dev/js/commit/7ac4e6ba4ee947c76f35b1b95927d7772edf6454), [`d4be647`](https://github.com/thirdweb-dev/js/commit/d4be6479db3fec6b4891e5ca89487b4e703eb9cf)]:
- @thirdweb-dev/chains@0.1.80
- @thirdweb-dev/sdk@4.0.47
- @thirdweb-dev/react-core@4.4.20
- @thirdweb-dev/wallets@2.4.22
## 4.4.19
### Patch Changes
- Updated dependencies [[`846a350`](https://github.com/thirdweb-dev/js/commit/846a3503fe4a8d39e92dd318470cefefd3b94c69), [`2e01627`](https://github.com/thirdweb-dev/js/commit/2e01627c998a49a1dd41041f3743a28488c92697)]:
- @thirdweb-dev/sdk@4.0.46
- @thirdweb-dev/chains@0.1.79
- @thirdweb-dev/react-core@4.4.19
- @thirdweb-dev/wallets@2.4.21
## 4.4.18
### Patch Changes
- Updated dependencies [[`a2002d1`](https://github.com/thirdweb-dev/js/commit/a2002d16376c41fffa59daccfd98856aba90a627)]:
- @thirdweb-dev/sdk@4.0.45
- @thirdweb-dev/react-core@4.4.18
- @thirdweb-dev/wallets@2.4.20
## 4.4.17
### Patch Changes
- Updated dependencies [[`b2be63a`](https://github.com/thirdweb-dev/js/commit/b2be63ada466ea1784d680ae6244ac047a190103)]:
- @thirdweb-dev/sdk@4.0.44
- @thirdweb-dev/react-core@4.4.17
- @thirdweb-dev/wallets@2.4.19
## 4.4.16
### Patch Changes
- [#2447](https://github.com/thirdweb-dev/js/pull/2447) [`8382330`](https://github.com/thirdweb-dev/js/commit/838233075a4d0897f57570f0f5eb041464838973) Thanks [@MananTank](https://github.com/MananTank)! - Fix multiple renders of EmbeddedWallet social Login screen after connection
- Updated dependencies [[`cabfc29`](https://github.com/thirdweb-dev/js/commit/cabfc29119f25a78010f59f766bdcb8c392afa2d), [`173777a`](https://github.com/thirdweb-dev/js/commit/173777ade4ea59cde1c6f25a4654d48b277be9ad)]:
- @thirdweb-dev/wallets@2.4.18
- @thirdweb-dev/sdk@4.0.43
- @thirdweb-dev/react-core@4.4.16
## 4.4.15
### Patch Changes
- Updated dependencies [[`c894270`](https://github.com/thirdweb-dev/js/commit/c894270401850575d1a4df73e16198177b46477a), [`332a145`](https://github.com/thirdweb-dev/js/commit/332a14552bf95e13e5220b1bd73414f000088568), [`c6b025e`](https://github.com/thirdweb-dev/js/commit/c6b025e84451341f6f48c0a7c4b5f06b8e49d792)]:
- @thirdweb-dev/wallets@2.4.17
- @thirdweb-dev/sdk@4.0.42
- @thirdweb-dev/react-core@4.4.15
## 4.4.14
### Patch Changes
- Updated dependencies [[`588897d`](https://github.com/thirdweb-dev/js/commit/588897d1b04e6c63da13639aeb47ca701308e1b2), [`862905e`](https://github.com/thirdweb-dev/js/commit/862905e161a091c15eb9b054cfcca0e5d2879fd6)]:
- @thirdweb-dev/chains@0.1.78
- @thirdweb-dev/wallets@2.4.16
- @thirdweb-dev/react-core@4.4.14
- @thirdweb-dev/sdk@4.0.41
## 4.4.13
### Patch Changes
- Updated dependencies [[`74a92dc`](https://github.com/thirdweb-dev/js/commit/74a92dcb7dc4be7d03bcb8b7211e87016f52a81f), [`047fbe2`](https://github.com/thirdweb-dev/js/commit/047fbe2918808cbc8fded90104458b6e38d1207d)]:
- @thirdweb-dev/wallets@2.4.15
- @thirdweb-dev/chains@0.1.77
- @thirdweb-dev/react-core@4.4.13
- @thirdweb-dev/sdk@4.0.40
## 4.4.12
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
"version": "4.4.12",
"version": "4.4.20",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
"author": "thirdweb eng <[email protected]>",
"license": "Apache-2.0",
@@ -3,7 +3,7 @@ import {
EmbeddedWallet,
EmbeddedWalletOauthStrategy,
} from "@thirdweb-dev/wallets";
import { useEffect, useState } from "react";
import { useEffect, useRef, useState } from "react";
import { Spacer } from "../../../components/Spacer";
import { Spinner } from "../../../components/Spinner";
import { Container, ModalHeader } from "../../../components/basic";
@@ -33,7 +33,6 @@ export const EmbeddedWalletSocialLogin = (
const socialLogin = async () => {
try {
console.log("socialLogin");
const embeddedWallet = createWalletInstance();
setConnectionStatus("connecting");
const socialWindow = openOauthSignInWindow(props.strategy, themeObj);
@@ -63,13 +62,19 @@ export const EmbeddedWalletSocialLogin = (
}
};
const closeModal = props.connected;
const onConnect = props.connected;
const onConnectCalled = useRef(false);
useEffect(() => {
if (connectionStatus === "connected") {
closeModal();
if (onConnectCalled.current) {
return;
}
}, [connectionStatus, closeModal]);
if (connectionStatus === "connected") {
onConnect();
onConnectCalled.current = true;
}
}, [connectionStatus, onConnect]);
return (
<Container animate="fadein" flex="column" fullHeight>
Binary file not shown.
+65
View File
@@ -1,5 +1,70 @@
# @thirdweb-dev/sdk
## 4.0.47
### Patch Changes
- [#2490](https://github.com/thirdweb-dev/js/pull/2490) [`f0250a7`](https://github.com/thirdweb-dev/js/commit/f0250a77cdbfa3b72e8dbf0ff345219a032e42b0) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Remove maxPriorityPerGas minimum
- [#2481](https://github.com/thirdweb-dev/js/pull/2481) [`c67b287`](https://github.com/thirdweb-dev/js/commit/c67b2877643afdfb503b41a2b5d21e18dbff15f2) Thanks [@kumaryash90](https://github.com/kumaryash90)! - ZkSync contract verification
- [#2459](https://github.com/thirdweb-dev/js/pull/2459) [`7ac4e6b`](https://github.com/thirdweb-dev/js/commit/7ac4e6ba4ee947c76f35b1b95927d7772edf6454) Thanks [@kumaryash90](https://github.com/kumaryash90)! - Contracts version 3.11.1
- [#2332](https://github.com/thirdweb-dev/js/pull/2332) [`d4be647`](https://github.com/thirdweb-dev/js/commit/d4be6479db3fec6b4891e5ca89487b4e703eb9cf) Thanks [@farhanW3](https://github.com/farhanW3)! - added domainSeparatorVersion SDK Options for relayers
- Updated dependencies [[`c494db8`](https://github.com/thirdweb-dev/js/commit/c494db87cbfa4b6fc4013abb01936e86a4350ea8), [`7ac4e6b`](https://github.com/thirdweb-dev/js/commit/7ac4e6ba4ee947c76f35b1b95927d7772edf6454)]:
- @thirdweb-dev/chains@0.1.80
- @thirdweb-dev/contracts-js@1.3.17
## 4.0.46
### Patch Changes
- [#2483](https://github.com/thirdweb-dev/js/pull/2483) [`846a350`](https://github.com/thirdweb-dev/js/commit/846a3503fe4a8d39e92dd318470cefefd3b94c69) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Min maxPriorityFeePerGas enforcement
- Updated dependencies [[`2e01627`](https://github.com/thirdweb-dev/js/commit/2e01627c998a49a1dd41041f3743a28488c92697)]:
- @thirdweb-dev/chains@0.1.79
## 4.0.45
### Patch Changes
- [#2469](https://github.com/thirdweb-dev/js/pull/2469) [`a2002d1`](https://github.com/thirdweb-dev/js/commit/a2002d16376c41fffa59daccfd98856aba90a627) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Better return type for getProofsForAllowListEntry
## 4.0.44
### Patch Changes
- [#2457](https://github.com/thirdweb-dev/js/pull/2457) [`b2be63a`](https://github.com/thirdweb-dev/js/commit/b2be63ada466ea1784d680ae6244ac047a190103) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Handle l2 gas estimations when forcing gasLimit
## 4.0.43
### Patch Changes
- [#2443](https://github.com/thirdweb-dev/js/pull/2443) [`cabfc29`](https://github.com/thirdweb-dev/js/commit/cabfc29119f25a78010f59f766bdcb8c392afa2d) Thanks [@0xFirekeeper](https://github.com/0xFirekeeper)! - [Smart Wallet] Use bundler eth_getUserOperationReceipt instead of rpc eth_getLogs, remove polygon gas station error logs
- [#2455](https://github.com/thirdweb-dev/js/pull/2455) [`173777a`](https://github.com/thirdweb-dev/js/commit/173777ade4ea59cde1c6f25a4654d48b277be9ad) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Update optimism SDK to fix the pnpm preinstall issue
## 4.0.42
### Patch Changes
- [#2441](https://github.com/thirdweb-dev/js/pull/2441) [`c6b025e`](https://github.com/thirdweb-dev/js/commit/c6b025e84451341f6f48c0a7c4b5f06b8e49d792) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Handle L1 fees for OP chains in `estimateGasCost()`
## 4.0.41
### Patch Changes
- Updated dependencies [[`588897d`](https://github.com/thirdweb-dev/js/commit/588897d1b04e6c63da13639aeb47ca701308e1b2)]:
- @thirdweb-dev/chains@0.1.78
## 4.0.40
### Patch Changes
- Updated dependencies [[`047fbe2`](https://github.com/thirdweb-dev/js/commit/047fbe2918808cbc8fded90104458b6e38d1207d)]:
- @thirdweb-dev/chains@0.1.77
## 4.0.39
### Patch Changes
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/sdk",
"version": "4.0.39",
"version": "4.0.47",
"description": "The main thirdweb SDK.",
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
"license": "Apache-2.0",
@@ -134,6 +134,7 @@
}
},
"dependencies": {
"@eth-optimism/sdk": "3.2.2",
"@thirdweb-dev/chains": "workspace:*",
"@thirdweb-dev/contracts-js": "workspace:*",
"@thirdweb-dev/crypto": "workspace:*",
+1 -1
View File
@@ -27,7 +27,7 @@ export function getAnalyticsHeaders() {
"x-sdk-os": globals.x_sdk_os,
"x-sdk-name": globals.x_sdk_name,
"x-sdk-platform": globals.x_sdk_platform,
"x-bundle-id": globals.app_bundle_id,
...(globals.app_bundle_id ? { "x-bundle-id": globals.app_bundle_id } : {}),
};
}
+1 -4
View File
@@ -33,8 +33,6 @@ import { overrideRecipientAddress } from "./override-recipient-address";
* @returns
* @internal
*/
/* eslint-disable @typescript-eslint/no-unused-vars */
// TODO: Update function interface: Remove unused param
export async function getDeployArguments<
TContractType extends PrebuiltContractType,
>(
@@ -42,9 +40,8 @@ export async function getDeployArguments<
metadata: z.input<DeploySchemaForPrebuiltContractType<TContractType>>,
contractURI: string,
signer: Signer,
storage: ThirdwebStorage,
): Promise<any[]> {
const signerAddress = await signer.getAddress();
const signerAddress = metadata.defaultAdmin || (await signer.getAddress());
const trustedForwarders: string[] = [];
// add any custom forwarders passed in
+42 -3
View File
@@ -1,6 +1,17 @@
import { ChainId } from "../constants/chains/ChainId";
import { BigNumber, utils, providers } from "ethers";
import { Mumbai, Polygon, Flag, FlagTestnet } from "@thirdweb-dev/chains";
import {
Mumbai,
Polygon,
Flag,
FlagTestnet,
Optimism,
OpSepoliaTestnet,
Base,
BaseSepoliaTestnet,
Zora,
ZoraSepoliaTestnet,
} from "@thirdweb-dev/chains";
type FeeData = {
maxFeePerGas: null | BigNumber;
@@ -99,6 +110,34 @@ export async function getGasPrice(
return txGasPrice;
}
export async function estimateTransactionCost(
provider: providers.Provider,
tx: providers.TransactionRequest,
) {
const chainId = (await provider.getNetwork()).chainId;
let l1GasCost = BigNumber.from(0);
if (isOpStackChain(chainId)) {
const { asL2Provider } = await import("@eth-optimism/sdk");
const l2RpcProvider = asL2Provider(provider);
l1GasCost = await l2RpcProvider.estimateL1GasCost(tx);
}
const gasLimit = tx.gasLimit || (await provider.estimateGas(tx));
const gasPrice = await getGasPrice(provider);
const gasCost = BigNumber.from(gasLimit).mul(gasPrice);
return gasCost.add(l1GasCost);
}
function isOpStackChain(chainId: number) {
return (
chainId === Optimism.chainId ||
chainId === OpSepoliaTestnet.chainId ||
chainId === Base.chainId ||
chainId === BaseSepoliaTestnet.chainId ||
chainId === Zora.chainId ||
chainId === ZoraSepoliaTestnet.chainId
);
}
/**
* @internal
*/
@@ -148,8 +187,8 @@ export async function getPolygonGasPriorityFee(
const fixedFee = parseFloat(priorityFee).toFixed(9);
return utils.parseUnits(fixedFee, "gwei");
}
} catch (e) {
console.error("failed to fetch gas", e);
} catch {
// if the gas station is down, return the default gas fee
}
return getDefaultGasFee(chainId);
}
+4 -2
View File
@@ -130,6 +130,7 @@ export async function signDAIPermit(
allowed = true,
deadline?: BigNumberish,
nonce?: BigNumberish,
domainSeparatorVersion?: string,
) {
const [name, chainId, signerNonce] = await Promise.all([
getTokenName(signer, currencyAddress),
@@ -138,7 +139,7 @@ export async function signDAIPermit(
]);
const domain = await getChainDomainSeperator(signer, {
name,
version: "1",
version: domainSeparatorVersion || "1",
chainId,
verifyingContract: currencyAddress,
});
@@ -190,6 +191,7 @@ export async function signEIP2612Permit(
value: BigNumberish,
deadline?: BigNumberish,
nonce?: BigNumberish,
domainSeparatorVersion?: string,
) {
const [name, chainId, signerNonce] = await Promise.all([
getTokenName(signer, currencyAddress),
@@ -198,7 +200,7 @@ export async function signEIP2612Permit(
]);
const domain = await getChainDomainSeperator(signer, {
name,
version: "1",
version: domainSeparatorVersion || "1",
chainId,
verifyingContract: currencyAddress,
});
+3 -3
View File
@@ -91,9 +91,9 @@ export async function getProofsForAllowListEntry(
tokenDecimals: number = 18,
version: SnapshotFormatVersion = SnapshotFormatVersion.V1,
) {
return merkleTree.getProof(
hashAllowListEntry(snapshotEntry, tokenDecimals, version),
);
return merkleTree
.getProof(hashAllowListEntry(snapshotEntry, tokenDecimals, version))
.map((value) => "0x" + value.data.toString("hex"));
}
/**
+1 -1
View File
@@ -257,7 +257,7 @@ export function getProviderFromRpcUrl(
typeof globalThis !== "undefined" && "APP_BUNDLE_ID" in globalThis
? ((globalThis as any).APP_BUNDLE_ID as string)
: undefined;
if (!rpcUrl.includes("bundleId")) {
if (!rpcUrl.includes("bundleId") && bundleId) {
rpcUrl = rpcUrl + (bundleId ? `?bundleId=${bundleId}` : "");
}
}
@@ -267,7 +267,8 @@ export class DropClaimConditions<
} catch (err: any) {
if (
includesErrorMessage(err, "!CONDITION") ||
includesErrorMessage(err, "no active mint condition")
includesErrorMessage(err, "no active mint condition") ||
includesErrorMessage(err, "DropNoActiveCondition")
) {
reasons.push(ClaimEligibility.NoClaimConditionSet);
return reasons;
@@ -386,20 +387,24 @@ export class DropClaimConditions<
} catch (e: any) {
console.warn(
"Merkle proof verification failed:",
"reason" in e ? e.reason : e,
"reason" in e ? e.reason || e.errorName : e,
);
const reason = (e as any).reason;
const reason = (e as any).reason || (e as any).errorName;
switch (reason) {
case "!Qty":
case "DropClaimExceedLimit":
reasons.push(ClaimEligibility.OverMaxClaimablePerWallet);
break;
case "!PriceOrCurrency":
case "DropClaimInvalidTokenPrice":
reasons.push(ClaimEligibility.WrongPriceOrCurrency);
break;
case "!MaxSupply":
case "DropClaimExceedMaxSupply":
reasons.push(ClaimEligibility.NotEnoughSupply);
break;
case "cant claim yet":
case "DropClaimNotStarted":
reasons.push(ClaimEligibility.ClaimPhaseNotStarted);
break;
default: {
@@ -256,7 +256,8 @@ export class DropErc1155ClaimConditions<
} catch (err: any) {
if (
includesErrorMessage(err, "!CONDITION") ||
includesErrorMessage(err, "no active mint condition")
includesErrorMessage(err, "no active mint condition") ||
includesErrorMessage(err, "DropNoActiveCondition")
) {
reasons.push(ClaimEligibility.NoClaimConditionSet);
return reasons;
@@ -374,20 +375,24 @@ export class DropErc1155ClaimConditions<
} catch (e: any) {
console.warn(
"Merkle proof verification failed:",
"reason" in e ? e.reason : e,
"reason" in e ? e.reason || e.errorName : e,
);
const reason = (e as any).reason;
const reason = (e as any).reason || (e as any).errorName;
switch (reason) {
case "!Qty":
case "DropClaimExceedLimit":
reasons.push(ClaimEligibility.OverMaxClaimablePerWallet);
break;
case "!PriceOrCurrency":
case "DropClaimInvalidTokenPrice":
reasons.push(ClaimEligibility.WrongPriceOrCurrency);
break;
case "!MaxSupply":
case "DropClaimExceedMaxSupply":
reasons.push(ClaimEligibility.NotEnoughSupply);
break;
case "cant claim yet":
case "DropClaimNotStarted":
reasons.push(ClaimEligibility.ClaimPhaseNotStarted);
break;
default: {
@@ -1,3 +1,5 @@
import { toEther } from "../../common/currency/toEther";
import { estimateTransactionCost } from "../../common/gas-price";
import { ContractWrapper } from "./internal/contract-wrapper";
import { BaseContract, BigNumber, utils } from "ethers";
@@ -35,11 +37,11 @@ export class GasCostEstimator<TContract extends BaseContract> {
fn: keyof TContract["functions"] | (string & {}),
args: Parameters<TContract["functions"][typeof fn]> | any[],
): Promise<string> {
const [price, gasUnits] = await Promise.all([
this.contractWrapper.getProvider().getGasPrice(),
this.contractWrapper.estimateGas(fn, args),
]);
return utils.formatEther(gasUnits.mul(price));
const gasCost = await estimateTransactionCost(
this.contractWrapper.getProvider(),
await this.contractWrapper.populateTransaction(fn, args),
);
return toEther(gasCost);
}
/**
@@ -192,6 +192,13 @@ export class ContractWrapper<
return this.writeContract.estimateGas[fn as string](...args);
}
public async populateTransaction(
fn: keyof TContract["functions"],
args: any[],
): Promise<providers.TransactionRequest> {
return this.writeContract.populateTransaction[fn as string](...args);
}
/**
* @internal
*/
@@ -781,6 +788,7 @@ export class ContractWrapper<
transaction.from,
spender,
amount,
this.options.gasless.engine.domainSeparatorVersion,
);
const message = {
@@ -1099,6 +1107,7 @@ export class ContractWrapper<
transaction.from,
spender,
amount,
this.options.gasless.openzeppelin.domainSeparatorVersion,
);
const { r, s, v } = utils.splitSignature(sig);
@@ -88,9 +88,8 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
onExecute?: () => void,
): Promise<Transaction<Address>> => {
const contract = PREBUILT_CONTRACTS_MAP[contractType];
const metadata = await contract.schema.deploy.parseAsync(
contractMetadata,
);
const metadata =
await contract.schema.deploy.parseAsync(contractMetadata);
// TODO: is there any special pre-processing we need to do before uploading?
const contractURI = await this.storage.upload(metadata);
@@ -119,7 +118,6 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
metadata,
contractURI,
signer,
this.storage,
);
const encodedFunc = Contract.getInterface(ABI).encodeFunctionData(
@@ -311,9 +309,8 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
];
case TokenDropInitializer.contractType:
case TokenInitializer.contractType:
const erc20metadata = await TokenInitializer.schema.deploy.parseAsync(
metadata,
);
const erc20metadata =
await TokenInitializer.schema.deploy.parseAsync(metadata);
return [
signerAddress,
erc20metadata.name,
@@ -331,9 +328,8 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
erc20metadata.platform_fee_basis_points,
];
case VoteInitializer.contractType:
const voteMetadata = await VoteInitializer.schema.deploy.parseAsync(
metadata,
);
const voteMetadata =
await VoteInitializer.schema.deploy.parseAsync(metadata);
return [
voteMetadata.name,
contractURI,
@@ -345,9 +341,8 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
voteMetadata.voting_quorum_fraction,
];
case SplitInitializer.contractType:
const splitsMetadata = await SplitInitializer.schema.deploy.parseAsync(
metadata,
);
const splitsMetadata =
await SplitInitializer.schema.deploy.parseAsync(metadata);
return [
signerAddress,
contractURI,
@@ -382,9 +377,8 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
marketplaceV3Metadata.platform_fee_basis_points,
];
case PackInitializer.contractType:
const packsMetadata = await PackInitializer.schema.deploy.parseAsync(
metadata,
);
const packsMetadata =
await PackInitializer.schema.deploy.parseAsync(metadata);
return [
signerAddress,
packsMetadata.name,
@@ -1,11 +1,13 @@
import { TransactionError, parseRevertReason } from "../../common/error";
import { getDefaultGasOverrides, getGasPrice } from "../../common/gas-price";
import {
estimateTransactionCost,
getDefaultGasOverrides,
getGasPrice,
} from "../../common/gas-price";
import {
fetchContractMetadataFromAddress,
getContractMetadataFromCache,
} from "../../common/metadata-resolver";
import { fetchSourceFilesFromMetadata } from "../../common/fetchSourceFilesFromMetadata";
import { ContractSource } from "../../schema/contracts/custom";
import { SDKOptionsOutput } from "../../schema/sdk-options";
import type {
DeployTransactionOptions,
@@ -165,6 +167,10 @@ abstract class TransactionContext {
}
public abstract estimateGasLimit(): Promise<BigNumber>;
public abstract estimateGasCost(): Promise<{
ether: string;
wei: BigNumber;
}>;
/**
* Set a multiple to multiply the gas limit by
@@ -187,22 +193,6 @@ abstract class TransactionContext {
}
}
/**
* Estimate the total gas cost of this transaction (in both ether and wei)
*/
public async estimateGasCost() {
const [gasLimit, gasPrice] = await Promise.all([
this.estimateGasLimit(),
this.getGasPrice(),
]);
const gasCost = gasLimit.mul(gasPrice);
return {
ether: utils.formatEther(gasCost),
wei: gasCost,
};
}
/**
* Calculates the gas price for transactions (adding a 10% tip buffer)
*/
@@ -427,6 +417,20 @@ export class Transaction<
}
}
/**
* Estimate the total gas cost of this transaction (in both ether and wei)
*/
public async estimateGasCost() {
const gasCost = await estimateTransactionCost(
this.provider,
await this.populateTransaction(),
);
return {
ether: utils.formatEther(gasCost),
wei: gasCost,
};
}
/**
* Send the transaction without waiting for it to be mined.
*/
@@ -660,7 +664,6 @@ export class Transaction<
const reason = parseRevertReason(error);
// Get contract sources for stack trace
let sources: ContractSource[] | undefined = undefined;
let contractName: string | undefined = undefined;
try {
const chainId = (await provider.getNetwork()).chainId;
@@ -672,10 +675,6 @@ export class Transaction<
if (metadata?.name) {
contractName = metadata.name;
}
if (metadata?.metadata.sources) {
sources = await fetchSourceFilesFromMetadata(metadata, this.storage);
}
} catch (err) {
// no-op
}
@@ -692,7 +691,6 @@ export class Transaction<
value,
hash,
contractName,
sources,
},
error,
);
@@ -755,6 +753,20 @@ export class DeployTransaction extends TransactionContext {
}
}
async estimateGasCost() {
const gasOverrides = await this.getGasOverrides();
const overrides: CallOverrides = { ...gasOverrides, ...this.overrides };
const populatedTx = this.factory.getDeployTransaction(
...this.args,
overrides,
);
const gasCost = await estimateTransactionCost(this.provider, populatedTx);
return {
ether: utils.formatEther(gasCost),
wei: gasCost,
};
}
async send(): Promise<ContractTransaction> {
try {
const populatedTx = await this.populateTransaction();
@@ -1106,6 +1118,7 @@ async function enginePrepareRequest(
transaction.from,
spender,
amount,
gaslessOptions.engine.domainSeparatorVersion,
);
const message = {
@@ -1295,6 +1308,7 @@ async function defenderPrepareRequest(
transaction.from,
spender,
amount,
gaslessOptions.openzeppelin.domainSeparatorVersion,
);
const { r, s, v } = utils.splitSignature(sig);
+3 -4
View File
@@ -1604,7 +1604,6 @@ export class ContractDeployer extends RPCConnectionHandler {
parsedMetadata,
contractURI,
signer,
this.storage,
);
// fetch the publish URI from the ContractPublisher contract
@@ -1650,7 +1649,7 @@ export class ContractDeployer extends RPCConnectionHandler {
publisherAddress: AddressOrEns,
contractName: string,
constructorParams: any[],
version: string = "latest",
version = "latest",
options?: DeployOptions,
): Promise<DeployTransaction> => {
const publishedContract = await this.fetchPublishedContractFromPolygon(
@@ -1688,7 +1687,7 @@ export class ContractDeployer extends RPCConnectionHandler {
contractName: string,
constructorParams: any[],
publisherAddress: string = THIRDWEB_DEPLOYER,
contractVersion: string = "latest",
contractVersion = "latest",
saltForCreate2?: string,
): Promise<string> {
const signer = this.getSigner();
@@ -1719,7 +1718,7 @@ export class ContractDeployer extends RPCConnectionHandler {
contractName: string,
constructorParams: any[],
publisherAddress: string = THIRDWEB_DEPLOYER,
contractVersion: string = "latest",
contractVersion = "latest",
saltForCreate2?: string,
): Promise<string> {
const provider = this.getProvider();
@@ -18,6 +18,7 @@ export const CommonContractSchema = /* @__PURE__ */ (() =>
external_link: z.string().optional(),
app_uri: z.string().optional(),
social_urls: z.record(z.string()).optional(),
defaultAdmin: AddressOrEnsSchema.optional(),
})
.catchall(z.unknown()))();

Some files were not shown because too many files have changed in this diff Show More