Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1119f63a47 | ||
|
|
32908b7683 | ||
|
|
6a4aab0b8a |
@@ -1,5 +1,12 @@
|
|||||||
# @thirdweb-dev/auth
|
# @thirdweb-dev/auth
|
||||||
|
|
||||||
|
## 3.0.18
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/wallets@0.2.19
|
||||||
|
|
||||||
## 3.0.17
|
## 3.0.17
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/auth",
|
"name": "@thirdweb-dev/auth",
|
||||||
"version": "3.0.17",
|
"version": "3.0.18",
|
||||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||||
"browser": {
|
"browser": {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# @thirdweb-dev/chains
|
# @thirdweb-dev/chains
|
||||||
|
|
||||||
|
## 0.1.15
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#990](https://github.com/thirdweb-dev/js/pull/990) [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - updated chains
|
||||||
|
|
||||||
## 0.1.14
|
## 0.1.14
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default {
|
|||||||
"chain": "IRIShub",
|
"chain": "IRIShub",
|
||||||
"rpc": [
|
"rpc": [
|
||||||
"https://irishub-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
"https://irishub-testnet.rpc.thirdweb.com/${THIRDWEB_API_KEY}",
|
||||||
"http://34.80.202.172:8545"
|
"https://evmrpc.nyancat.irisnet.org"
|
||||||
],
|
],
|
||||||
"features": [
|
"features": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default {
|
|||||||
"explorers": [
|
"explorers": [
|
||||||
{
|
{
|
||||||
"name": "blockexplorer",
|
"name": "blockexplorer",
|
||||||
"url": "https://explorer.camino.foundation",
|
"url": "https://suite.camino.network/explorer",
|
||||||
"standard": "none"
|
"standard": "none"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/chains",
|
"name": "@thirdweb-dev/chains",
|
||||||
"version": "0.1.14",
|
"version": "0.1.15",
|
||||||
"main": "dist/thirdweb-dev-chains.cjs.js",
|
"main": "dist/thirdweb-dev-chains.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-chains.esm.js",
|
"module": "dist/thirdweb-dev-chains.esm.js",
|
||||||
"browser": {
|
"browser": {
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
# thirdweb
|
# thirdweb
|
||||||
|
|
||||||
|
## 0.10.15
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`32908b76`](https://github.com/thirdweb-dev/js/commit/32908b76832c60e91a0a6e40dbdb1c8f56e9e5be), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.14
|
||||||
|
- @thirdweb-dev/chains@0.1.15
|
||||||
|
|
||||||
## 0.10.14
|
## 0.10.14
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "thirdweb",
|
"name": "thirdweb",
|
||||||
"main": "dist/cli/index.js",
|
"main": "dist/cli/index.js",
|
||||||
"version": "0.10.14",
|
"version": "0.10.15",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# @thirdweb-dev/react-core
|
# @thirdweb-dev/react-core
|
||||||
|
|
||||||
|
## 3.11.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`32908b76`](https://github.com/thirdweb-dev/js/commit/32908b76832c60e91a0a6e40dbdb1c8f56e9e5be), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.14
|
||||||
|
- @thirdweb-dev/wallets@0.2.19
|
||||||
|
- @thirdweb-dev/chains@0.1.15
|
||||||
|
|
||||||
## 3.11.10
|
## 3.11.10
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-core",
|
"name": "@thirdweb-dev/react-core",
|
||||||
"version": "3.11.10",
|
"version": "3.11.11",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# @thirdweb-dev/react-native-compat
|
# @thirdweb-dev/react-native-compat
|
||||||
|
|
||||||
|
## 0.2.11
|
||||||
|
|
||||||
## 0.2.10
|
## 0.2.10
|
||||||
|
|
||||||
## 0.2.9
|
## 0.2.9
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native-compat",
|
"name": "@thirdweb-dev/react-native-compat",
|
||||||
"description": "Shims for Thirdweb in React Native Projects",
|
"description": "Shims for Thirdweb in React Native Projects",
|
||||||
"version": "0.2.10",
|
"version": "0.2.11",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
# @thirdweb-dev/react-native
|
# @thirdweb-dev/react-native
|
||||||
|
|
||||||
|
## 0.2.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`32908b76`](https://github.com/thirdweb-dev/js/commit/32908b76832c60e91a0a6e40dbdb1c8f56e9e5be), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.14
|
||||||
|
- @thirdweb-dev/wallets@0.2.19
|
||||||
|
- @thirdweb-dev/chains@0.1.15
|
||||||
|
- @thirdweb-dev/react-core@3.11.11
|
||||||
|
|
||||||
## 0.2.10
|
## 0.2.10
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native",
|
"name": "@thirdweb-dev/react-native",
|
||||||
"version": "0.2.10",
|
"version": "0.2.11",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
# @thirdweb-dev/react
|
# @thirdweb-dev/react
|
||||||
|
|
||||||
|
## 3.11.11
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`32908b76`](https://github.com/thirdweb-dev/js/commit/32908b76832c60e91a0a6e40dbdb1c8f56e9e5be), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.14
|
||||||
|
- @thirdweb-dev/wallets@0.2.19
|
||||||
|
- @thirdweb-dev/chains@0.1.15
|
||||||
|
- @thirdweb-dev/react-core@3.11.11
|
||||||
|
|
||||||
## 3.11.10
|
## 3.11.10
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react",
|
"name": "@thirdweb-dev/react",
|
||||||
"version": "3.11.10",
|
"version": "3.11.11",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||||
"author": "thirdweb eng <[email protected]>",
|
"author": "thirdweb eng <[email protected]>",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# @thirdweb-dev/sdk
|
# @thirdweb-dev/sdk
|
||||||
|
|
||||||
|
## 3.10.14
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#992](https://github.com/thirdweb-dev/js/pull/992) [`32908b76`](https://github.com/thirdweb-dev/js/commit/32908b76832c60e91a0a6e40dbdb1c8f56e9e5be) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Add alias for extension detection functions
|
||||||
|
|
||||||
|
- Updated dependencies [[`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/chains@0.1.15
|
||||||
|
|
||||||
## 3.10.13
|
## 3.10.13
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/sdk",
|
"name": "@thirdweb-dev/sdk",
|
||||||
"version": "3.10.13",
|
"version": "3.10.14",
|
||||||
"description": "The main thirdweb SDK.",
|
"description": "The main thirdweb SDK.",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
ExtensionWithEnabled,
|
||||||
Feature,
|
Feature,
|
||||||
FeatureName,
|
FeatureName,
|
||||||
FeatureWithEnabled,
|
FeatureWithEnabled,
|
||||||
@@ -8,7 +9,6 @@ import { ContractWrapper } from "../core/classes/contract-wrapper";
|
|||||||
import { DetectableFeature } from "../core/interfaces/DetectableFeature";
|
import { DetectableFeature } from "../core/interfaces/DetectableFeature";
|
||||||
import { decode } from "../lib/cbor-decode.js";
|
import { decode } from "../lib/cbor-decode.js";
|
||||||
import {
|
import {
|
||||||
Abi,
|
|
||||||
AbiEvent,
|
AbiEvent,
|
||||||
AbiFunction,
|
AbiFunction,
|
||||||
AbiInput,
|
AbiInput,
|
||||||
@@ -484,7 +484,7 @@ export async function fetchExtendedReleaseMetadata(
|
|||||||
* @returns the nested struct of all features and whether they're detected in the abi
|
* @returns the nested struct of all features and whether they're detected in the abi
|
||||||
*/
|
*/
|
||||||
export function detectFeatures(
|
export function detectFeatures(
|
||||||
abi: Abi,
|
abi: AbiInput,
|
||||||
features: Record<string, Feature> = SUPPORTED_FEATURES,
|
features: Record<string, Feature> = SUPPORTED_FEATURES,
|
||||||
): Record<string, FeatureWithEnabled> {
|
): Record<string, FeatureWithEnabled> {
|
||||||
const results: Record<string, FeatureWithEnabled> = {};
|
const results: Record<string, FeatureWithEnabled> = {};
|
||||||
@@ -523,29 +523,56 @@ function extractFeatures(
|
|||||||
* Return all the detected features in the abi
|
* Return all the detected features in the abi
|
||||||
* @param abi - parsed array of abi entries
|
* @param abi - parsed array of abi entries
|
||||||
* @returns array of all detected extensions with full information on each feature
|
* @returns array of all detected extensions with full information on each feature
|
||||||
* @public
|
* @internal
|
||||||
|
* @deprecated use getAllDetectedExtensions instead
|
||||||
*/
|
*/
|
||||||
export function getAllDetectedFeatures(abi: Abi): FeatureWithEnabled[] {
|
export function getAllDetectedFeatures(abi: AbiInput): FeatureWithEnabled[] {
|
||||||
const features: FeatureWithEnabled[] = [];
|
const features: FeatureWithEnabled[] = [];
|
||||||
extractFeatures(detectFeatures(abi), features);
|
extractFeatures(detectFeatures(abi), features);
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all the detected extensions in the abi
|
||||||
|
* @param abi - parsed array of abi entries
|
||||||
|
* @returns array of all detected extensions with full information on each feature
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export function getAllDetectedExtensions(
|
||||||
|
abi: AbiInput,
|
||||||
|
): ExtensionWithEnabled[] {
|
||||||
|
return getAllDetectedFeatures(abi).map((f) => ({
|
||||||
|
...f,
|
||||||
|
extensions: f.features,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return all the detected features names in the abi
|
* Return all the detected features names in the abi
|
||||||
* @param abi - parsed array of abi entries
|
* @param abi - parsed array of abi entries
|
||||||
* @returns array of all detected features names
|
* @returns array of all detected features names
|
||||||
* @public
|
* @internal
|
||||||
|
* @deprecated use getAllExtensionNames instead
|
||||||
*/
|
*/
|
||||||
export function getAllDetectedFeatureNames(abi: Abi): string[] {
|
export function getAllDetectedFeatureNames(abi: AbiInput): string[] {
|
||||||
const features: FeatureWithEnabled[] = [];
|
const features: FeatureWithEnabled[] = [];
|
||||||
extractFeatures(detectFeatures(abi), features);
|
extractFeatures(detectFeatures(abi), features);
|
||||||
return features.map((f) => f.name);
|
return features.map((f) => f.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all the detected extension names in the abi
|
||||||
|
* @param abi - parsed array of abi entries
|
||||||
|
* @returns array of all detected features names
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export function getAllDetectedExtensionNames(abi: AbiInput): string[] {
|
||||||
|
return getAllDetectedFeatureNames(abi);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the given ABI supports a given feature
|
* Checks whether the given ABI supports a given feature
|
||||||
* @internal
|
* @deprecated use isExtensionEnabled instead
|
||||||
* @param abi
|
* @param abi
|
||||||
* @param featureName
|
* @param featureName
|
||||||
*/
|
*/
|
||||||
@@ -553,11 +580,20 @@ export function isFeatureEnabled(
|
|||||||
abi: AbiInput,
|
abi: AbiInput,
|
||||||
featureName: FeatureName,
|
featureName: FeatureName,
|
||||||
): boolean {
|
): boolean {
|
||||||
const parsedAbi = AbiSchema.parse(abi || []);
|
const features = detectFeatures(abi);
|
||||||
const features = detectFeatures(parsedAbi);
|
|
||||||
return _featureEnabled(features, featureName);
|
return _featureEnabled(features, featureName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the given ABI supports a given extension
|
||||||
|
* @public
|
||||||
|
* @param abi
|
||||||
|
* @param featureName
|
||||||
|
*/
|
||||||
|
export function isExtensionEnabled(abi: AbiInput, featureName: FeatureName) {
|
||||||
|
return isFeatureEnabled(abi, featureName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the given DetectableFeature is defined
|
* Checks whether the given DetectableFeature is defined
|
||||||
* @internal
|
* @internal
|
||||||
|
|||||||
@@ -125,11 +125,13 @@ export type Feature =
|
|||||||
| typeof FEATURE_OFFERS
|
| typeof FEATURE_OFFERS
|
||||||
| typeof FEATURE_SMART_WALLET
|
| typeof FEATURE_SMART_WALLET
|
||||||
| typeof FEATURE_SMART_WALLET_FACTORY;
|
| typeof FEATURE_SMART_WALLET_FACTORY;
|
||||||
|
export type Extension = Feature;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export type FeatureName = Feature["name"];
|
export type FeatureName = Feature["name"];
|
||||||
|
export type ExtensionName = Feature["name"];
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
@@ -137,6 +139,10 @@ export type FeatureWithEnabled = Feature & {
|
|||||||
features: Record<string, FeatureWithEnabled>;
|
features: Record<string, FeatureWithEnabled>;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
};
|
};
|
||||||
|
export type ExtensionWithEnabled = Extension & {
|
||||||
|
extensions: Record<string, FeatureWithEnabled>;
|
||||||
|
enabled: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ export * from "./contract";
|
|||||||
export * from "./currency";
|
export * from "./currency";
|
||||||
export * from "./events";
|
export * from "./events";
|
||||||
export * from "./urls";
|
export * from "./urls";
|
||||||
|
export * from "./contract-features";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
ChainId,
|
ChainId,
|
||||||
getAllDetectedFeatureNames,
|
getAllDetectedExtensionNames,
|
||||||
isFeatureEnabled,
|
isExtensionEnabled,
|
||||||
resolveContractUriFromAddress,
|
resolveContractUriFromAddress,
|
||||||
ThirdwebSDK,
|
ThirdwebSDK,
|
||||||
} from "../../src/evm";
|
} from "../../src/evm";
|
||||||
@@ -75,34 +75,36 @@ describe("Publishing", async () => {
|
|||||||
|
|
||||||
it("should extract features", async () => {
|
it("should extract features", async () => {
|
||||||
expect(
|
expect(
|
||||||
isFeatureEnabled(TokenERC721__factory.abi, "ERC721Enumerable"),
|
isExtensionEnabled(TokenERC721__factory.abi, "ERC721Enumerable"),
|
||||||
).to.eq(true);
|
).to.eq(true);
|
||||||
expect(isFeatureEnabled(TokenERC721__factory.abi, "ERC721Mintable")).to.eq(
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
expect(
|
expect(
|
||||||
isFeatureEnabled(TokenERC721__factory.abi, "ERC721BatchMintable"),
|
isExtensionEnabled(TokenERC721__factory.abi, "ERC721Mintable"),
|
||||||
|
).to.eq(true);
|
||||||
|
expect(
|
||||||
|
isExtensionEnabled(TokenERC721__factory.abi, "ERC721BatchMintable"),
|
||||||
).to.eq(true);
|
).to.eq(true);
|
||||||
|
|
||||||
// Drop
|
// Drop
|
||||||
expect(
|
expect(
|
||||||
isFeatureEnabled(DropERC721__factory.abi, "ERC721ClaimPhasesV2"),
|
isExtensionEnabled(DropERC721__factory.abi, "ERC721ClaimPhasesV2"),
|
||||||
).to.eq(true);
|
).to.eq(true);
|
||||||
expect(isFeatureEnabled(DropERC721__factory.abi, "ERC721Supply")).to.eq(
|
expect(isExtensionEnabled(DropERC721__factory.abi, "ERC721Supply")).to.eq(
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
expect(isFeatureEnabled(DropERC721__factory.abi, "ERC721Mintable")).to.eq(
|
expect(isExtensionEnabled(DropERC721__factory.abi, "ERC721Mintable")).to.eq(
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should extract all features", async () => {
|
it("should extract all features", async () => {
|
||||||
const tokenFeatures = getAllDetectedFeatureNames(TokenERC721__factory.abi);
|
const tokenFeatures = getAllDetectedExtensionNames(
|
||||||
|
TokenERC721__factory.abi,
|
||||||
|
);
|
||||||
expect(tokenFeatures).to.contain("ERC721Enumerable");
|
expect(tokenFeatures).to.contain("ERC721Enumerable");
|
||||||
expect(getAllDetectedFeatureNames(DropERC721__factory.abi)).to.contain(
|
expect(getAllDetectedExtensionNames(DropERC721__factory.abi)).to.contain(
|
||||||
"ERC721ClaimPhasesV2",
|
"ERC721ClaimPhasesV2",
|
||||||
);
|
);
|
||||||
expect(getAllDetectedFeatureNames(DropERC721_V3__factory.abi)).to.contain(
|
expect(getAllDetectedExtensionNames(DropERC721_V3__factory.abi)).to.contain(
|
||||||
"ERC721ClaimPhasesV1",
|
"ERC721ClaimPhasesV1",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# @thirdweb-dev/unity-js-bridge
|
# @thirdweb-dev/unity-js-bridge
|
||||||
|
|
||||||
|
## 0.2.29
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`32908b76`](https://github.com/thirdweb-dev/js/commit/32908b76832c60e91a0a6e40dbdb1c8f56e9e5be), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.14
|
||||||
|
- @thirdweb-dev/wallets@0.2.19
|
||||||
|
- @thirdweb-dev/auth@3.0.18
|
||||||
|
|
||||||
## 0.2.28
|
## 0.2.28
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/unity-js-bridge",
|
"name": "@thirdweb-dev/unity-js-bridge",
|
||||||
"version": "0.2.28",
|
"version": "0.2.29",
|
||||||
"main": "dist/thirdweb-unity-bridge.js",
|
"main": "dist/thirdweb-unity-bridge.js",
|
||||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
|
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/unity-js-bridge",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
# @thirdweb-dev/wallets
|
# @thirdweb-dev/wallets
|
||||||
|
|
||||||
|
## 0.2.19
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#990](https://github.com/thirdweb-dev/js/pull/990) [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Fix loadOrCreate for LocalWalletNode
|
||||||
|
|
||||||
|
- Updated dependencies [[`32908b76`](https://github.com/thirdweb-dev/js/commit/32908b76832c60e91a0a6e40dbdb1c8f56e9e5be), [`6a4aab0b`](https://github.com/thirdweb-dev/js/commit/6a4aab0b8a2e0f6ff1b47992a3c1e5426a74f7ff)]:
|
||||||
|
- @thirdweb-dev/sdk@3.10.14
|
||||||
|
- @thirdweb-dev/chains@0.1.15
|
||||||
|
|
||||||
## 0.2.18
|
## 0.2.18
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/wallets",
|
"name": "@thirdweb-dev/wallets",
|
||||||
"version": "0.2.18",
|
"version": "0.2.19",
|
||||||
"main": "dist/thirdweb-dev-wallets.cjs.js",
|
"main": "dist/thirdweb-dev-wallets.cjs.js",
|
||||||
"module": "dist/thirdweb-dev-wallets.esm.js",
|
"module": "dist/thirdweb-dev-wallets.esm.js",
|
||||||
"types": "dist/thirdweb-dev-wallets.cjs.d.ts",
|
"types": "dist/thirdweb-dev-wallets.cjs.d.ts",
|
||||||
@@ -204,13 +204,6 @@
|
|||||||
},
|
},
|
||||||
"default": "./evm/wallets/wallet-connect-v1/dist/thirdweb-dev-wallets-evm-wallets-wallet-connect-v1.cjs.js"
|
"default": "./evm/wallets/wallet-connect-v1/dist/thirdweb-dev-wallets-evm-wallets-wallet-connect-v1.cjs.js"
|
||||||
},
|
},
|
||||||
"./evm/wallets/local-walllet-node": {
|
|
||||||
"module": {
|
|
||||||
"browser": "./evm/wallets/local-walllet-node/dist/thirdweb-dev-wallets-evm-wallets-local-walllet-node.browser.esm.js",
|
|
||||||
"default": "./evm/wallets/local-walllet-node/dist/thirdweb-dev-wallets-evm-wallets-local-walllet-node.esm.js"
|
|
||||||
},
|
|
||||||
"default": "./evm/wallets/local-walllet-node/dist/thirdweb-dev-wallets-evm-wallets-local-walllet-node.cjs.js"
|
|
||||||
},
|
|
||||||
"./evm/wallets/aws-secrets-manager": {
|
"./evm/wallets/aws-secrets-manager": {
|
||||||
"module": {
|
"module": {
|
||||||
"browser": "./evm/wallets/aws-secrets-manager/dist/thirdweb-dev-wallets-evm-wallets-aws-secrets-manager.browser.esm.js",
|
"browser": "./evm/wallets/aws-secrets-manager/dist/thirdweb-dev-wallets-evm-wallets-aws-secrets-manager.browser.esm.js",
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export class AccountAPI extends BaseAccountAPI {
|
|||||||
|
|
||||||
async getAccountInitCode(): Promise<string> {
|
async getAccountInitCode(): Promise<string> {
|
||||||
const factory = await this.getFactoryContract();
|
const factory = await this.getFactoryContract();
|
||||||
console.log("AccountAPI - Creating account via factory");
|
console.log("Deploying smart wallet via factory");
|
||||||
const localSigner = await this.params.localSigner.getAddress();
|
const localSigner = await this.params.localSigner.getAddress();
|
||||||
const tx = await this.params.factoryInfo.createAccount(
|
const tx = await this.params.factoryInfo.createAccount(
|
||||||
factory,
|
factory,
|
||||||
@@ -57,12 +57,12 @@ export class AccountAPI extends BaseAccountAPI {
|
|||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
console.log(
|
console.log(
|
||||||
"Cost to create account: ",
|
"Cost to deploy smart wallet: ",
|
||||||
(await tx.estimateGasCost()).ether,
|
(await tx.estimateGasCost()).ether,
|
||||||
"ETH",
|
"ETH",
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Cost to create account: unknown", e);
|
console.error("Cost to deploy smart wallet: unknown", e);
|
||||||
}
|
}
|
||||||
return hexConcat([factory.getAddress(), tx.encode()]);
|
return hexConcat([factory.getAddress(), tx.encode()]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { ethers, providers } from "ethers";
|
import { ethers, providers } from "ethers";
|
||||||
|
|
||||||
import { Bytes, Signer } from "ethers";
|
import { Bytes, Signer } from "ethers";
|
||||||
import { UserOperationStruct } from "@account-abstraction/contracts";
|
|
||||||
import { ClientConfig } from "@account-abstraction/sdk";
|
import { ClientConfig } from "@account-abstraction/sdk";
|
||||||
import { BaseAccountAPI } from "./base-api";
|
import { BaseAccountAPI } from "./base-api";
|
||||||
import { ERC4337EthersProvider } from "./erc4337-provider";
|
import { ERC4337EthersProvider } from "./erc4337-provider";
|
||||||
@@ -132,9 +131,4 @@ export class ERC4337EthersSigner extends Signer {
|
|||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
throw new Error("not implemented");
|
throw new Error("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
async signUserOperation(userOperation: UserOperationStruct): Promise<string> {
|
|
||||||
const message = await this.smartAccountAPI.getUserOpHash(userOperation);
|
|
||||||
return await this.originalSigner.signMessage(message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -338,12 +338,12 @@ export class LocalWallet extends AbstractClientWallet<
|
|||||||
async getSavedData(storage?: AsyncStorage): Promise<WalletData | null> {
|
async getSavedData(storage?: AsyncStorage): Promise<WalletData | null> {
|
||||||
const _storage = storage || this.#storage;
|
const _storage = storage || this.#storage;
|
||||||
|
|
||||||
|
try {
|
||||||
const savedDataStr = await _storage.getItem(STORAGE_KEY_WALLET_DATA);
|
const savedDataStr = await _storage.getItem(STORAGE_KEY_WALLET_DATA);
|
||||||
if (!savedDataStr) {
|
if (!savedDataStr) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const savedData = JSON.parse(savedDataStr);
|
const savedData = JSON.parse(savedDataStr);
|
||||||
if (!savedData) {
|
if (!savedData) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
import { WalletOptions } from "..";
|
|
||||||
import { AsyncJsonFileStorage } from "../../core/AsyncJsonFileStorage";
|
|
||||||
import { LocalWallet, LocalWalletOptions } from "./local-wallet";
|
|
||||||
|
|
||||||
export class LocalWalletNode extends LocalWallet {
|
|
||||||
constructor(
|
|
||||||
options?: WalletOptions<LocalWalletOptions> & { storageJsonFile?: string },
|
|
||||||
) {
|
|
||||||
const storage = new AsyncJsonFileStorage(
|
|
||||||
options?.storageJsonFile || "./wallet.json",
|
|
||||||
);
|
|
||||||
super({ storage, ...options });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user