Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61760a180f | ||
|
|
a3f3e160e0 | ||
|
|
b1190914a9 | ||
|
|
e79a952061 | ||
|
|
480ed721d1 | ||
|
|
42c7436827 | ||
|
|
16e9e8b64d | ||
|
|
23ab897e32 | ||
|
|
6fcdec7c12 |
@@ -1,5 +1,12 @@
|
|||||||
# @thirdweb-dev/auth
|
# @thirdweb-dev/auth
|
||||||
|
|
||||||
|
## 4.1.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`42c74368`](https://github.com/thirdweb-dev/js/commit/42c743682739de77c264c11cc1692ed752f929a6), [`480ed721`](https://github.com/thirdweb-dev/js/commit/480ed721d1c736049fa8b6ee4cbdbdf3cce18abd), [`16e9e8b6`](https://github.com/thirdweb-dev/js/commit/16e9e8b64d7d1a97a5b32fc855479e992b7ed3a8), [`b1190914`](https://github.com/thirdweb-dev/js/commit/b1190914a97a9c4d9019c4ce8ee49ad345aed18c)]:
|
||||||
|
- @thirdweb-dev/wallets@2.1.3
|
||||||
|
|
||||||
## 4.1.5
|
## 4.1.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/auth",
|
"name": "@thirdweb-dev/auth",
|
||||||
"version": "4.1.5",
|
"version": "4.1.6",
|
||||||
"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,15 @@
|
|||||||
# thirdweb
|
# thirdweb
|
||||||
|
|
||||||
|
## 0.13.14
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`23ab897e`](https://github.com/thirdweb-dev/js/commit/23ab897e329cdd5b316fbe554ea0f64add91f2b4), [`a3f3e160`](https://github.com/thirdweb-dev/js/commit/a3f3e160e07328655a4f0332f41f4edd210a1a8a), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`42c74368`](https://github.com/thirdweb-dev/js/commit/42c743682739de77c264c11cc1692ed752f929a6), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`480ed721`](https://github.com/thirdweb-dev/js/commit/480ed721d1c736049fa8b6ee4cbdbdf3cce18abd), [`16e9e8b6`](https://github.com/thirdweb-dev/js/commit/16e9e8b64d7d1a97a5b32fc855479e992b7ed3a8), [`b1190914`](https://github.com/thirdweb-dev/js/commit/b1190914a97a9c4d9019c4ce8ee49ad345aed18c)]:
|
||||||
|
- @thirdweb-dev/sdk@4.0.13
|
||||||
|
- @thirdweb-dev/storage@2.0.4
|
||||||
|
- @thirdweb-dev/wallets@2.1.3
|
||||||
|
- @thirdweb-dev/auth@4.1.6
|
||||||
|
|
||||||
## 0.13.13
|
## 0.13.13
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "thirdweb",
|
"name": "thirdweb",
|
||||||
"main": "dist/cli/index.js",
|
"main": "dist/cli/index.js",
|
||||||
"version": "0.13.13",
|
"version": "0.13.14",
|
||||||
"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",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module.exports = {
|
|||||||
extends: ["thirdweb"],
|
extends: ["thirdweb"],
|
||||||
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
||||||
rules: {
|
rules: {
|
||||||
"tsdoc/syntax": "warn",
|
"tsdoc/syntax": "error",
|
||||||
"better-tree-shaking/no-top-level-side-effects": "error",
|
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
# @thirdweb-dev/react-core
|
# @thirdweb-dev/react-core
|
||||||
|
|
||||||
|
## 4.1.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1951](https://github.com/thirdweb-dev/js/pull/1951) [`e79a9520`](https://github.com/thirdweb-dev/js/commit/e79a95206116ea09de0126fdbe30fb4413fdff28) Thanks [@kien-ngo](https://github.com/kien-ngo)! - Fix caching issue with useTotalCirculatingSupply
|
||||||
|
|
||||||
|
- [#1944](https://github.com/thirdweb-dev/js/pull/1944) [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5) Thanks [@iketw](https://github.com/iketw)! - Adds tsdoc warnings to enforce a common comments format
|
||||||
|
|
||||||
|
- [#1950](https://github.com/thirdweb-dev/js/pull/1950) [`b1190914`](https://github.com/thirdweb-dev/js/commit/b1190914a97a9c4d9019c4ce8ee49ad345aed18c) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Smart Wallet autoconnect fixes and performance improvements
|
||||||
|
|
||||||
|
- Updated dependencies [[`23ab897e`](https://github.com/thirdweb-dev/js/commit/23ab897e329cdd5b316fbe554ea0f64add91f2b4), [`a3f3e160`](https://github.com/thirdweb-dev/js/commit/a3f3e160e07328655a4f0332f41f4edd210a1a8a), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`42c74368`](https://github.com/thirdweb-dev/js/commit/42c743682739de77c264c11cc1692ed752f929a6), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`480ed721`](https://github.com/thirdweb-dev/js/commit/480ed721d1c736049fa8b6ee4cbdbdf3cce18abd), [`16e9e8b6`](https://github.com/thirdweb-dev/js/commit/16e9e8b64d7d1a97a5b32fc855479e992b7ed3a8), [`b1190914`](https://github.com/thirdweb-dev/js/commit/b1190914a97a9c4d9019c4ce8ee49ad345aed18c)]:
|
||||||
|
- @thirdweb-dev/sdk@4.0.13
|
||||||
|
- @thirdweb-dev/storage@2.0.4
|
||||||
|
- @thirdweb-dev/wallets@2.1.3
|
||||||
|
- @thirdweb-dev/auth@4.1.6
|
||||||
|
|
||||||
## 4.1.3
|
## 4.1.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-core",
|
"name": "@thirdweb-dev/react-core",
|
||||||
"version": "4.1.3",
|
"version": "4.1.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ export function ThirdwebWalletProvider(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to auto connect wallet");
|
console.error("Failed to auto connect personal wallet");
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setConnectionStatus("disconnected");
|
setConnectionStatus("disconnected");
|
||||||
return;
|
return;
|
||||||
@@ -366,9 +366,14 @@ export function ThirdwebWalletProvider(
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to auto connect wallet");
|
console.error("Failed to auto connect wallet");
|
||||||
console.error(e);
|
console.error(e);
|
||||||
lastConnectedWalletStorage.removeItem(
|
if (
|
||||||
LAST_CONNECTED_WALLET_STORAGE_KEY,
|
e instanceof Error &&
|
||||||
);
|
e.message === autoConnectTimeoutErrorMessage
|
||||||
|
) {
|
||||||
|
lastConnectedWalletStorage.removeItem(
|
||||||
|
LAST_CONNECTED_WALLET_STORAGE_KEY,
|
||||||
|
);
|
||||||
|
}
|
||||||
setConnectionStatus("disconnected");
|
setConnectionStatus("disconnected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,7 +193,10 @@ export function useTotalCirculatingSupply(
|
|||||||
const { erc721, erc1155 } = getErcs(contract);
|
const { erc721, erc1155 } = getErcs(contract);
|
||||||
|
|
||||||
return useQueryWithNetwork<BigNumber>(
|
return useQueryWithNetwork<BigNumber>(
|
||||||
cacheKeys.contract.nft.query.totalCirculatingSupply(contractAddress),
|
cacheKeys.contract.nft.query.totalCirculatingSupply(
|
||||||
|
contractAddress,
|
||||||
|
tokenId ?? undefined,
|
||||||
|
),
|
||||||
async () => {
|
async () => {
|
||||||
requiredParamInvariant(contract, "No Contract instance provided");
|
requiredParamInvariant(contract, "No Contract instance provided");
|
||||||
|
|
||||||
|
|||||||
@@ -182,10 +182,12 @@ export const cacheKeys = {
|
|||||||
),
|
),
|
||||||
totalCirculatingSupply: (
|
totalCirculatingSupply: (
|
||||||
contractAddress: RequiredParam<ContractAddress>,
|
contractAddress: RequiredParam<ContractAddress>,
|
||||||
|
tokenId?: BigNumberish,
|
||||||
) =>
|
) =>
|
||||||
createContractCacheKey(contractAddress, [
|
createContractCacheKey(contractAddress, [
|
||||||
"query",
|
"query",
|
||||||
"totalCirculatingSupply",
|
"totalCirculatingSupply",
|
||||||
|
tokenId ?? "0",
|
||||||
]),
|
]),
|
||||||
totalCount: (contractAddress: RequiredParam<ContractAddress>) =>
|
totalCount: (contractAddress: RequiredParam<ContractAddress>) =>
|
||||||
createContractCacheKey(contractAddress, ["query", "totalCount"]),
|
createContractCacheKey(contractAddress, ["query", "totalCount"]),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# @thirdweb-dev/react-native-compat
|
# @thirdweb-dev/react-native-compat
|
||||||
|
|
||||||
|
## 0.4.4
|
||||||
|
|
||||||
## 0.4.3
|
## 0.4.3
|
||||||
|
|
||||||
## 0.4.2
|
## 0.4.2
|
||||||
|
|||||||
@@ -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.4.3",
|
"version": "0.4.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module.exports = {
|
|||||||
extends: ["thirdweb"],
|
extends: ["thirdweb"],
|
||||||
plugins: ["i18next", "eslint-plugin-tsdoc"],
|
plugins: ["i18next", "eslint-plugin-tsdoc"],
|
||||||
rules: {
|
rules: {
|
||||||
"tsdoc/syntax": "warn",
|
"tsdoc/syntax": "error",
|
||||||
"i18next/no-literal-string": 2,
|
"i18next/no-literal-string": 2,
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# @thirdweb-dev/react-native
|
# @thirdweb-dev/react-native
|
||||||
|
|
||||||
|
## 0.4.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1944](https://github.com/thirdweb-dev/js/pull/1944) [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5) Thanks [@iketw](https://github.com/iketw)! - Adds tsdoc warnings to enforce a common comments format
|
||||||
|
|
||||||
|
- Updated dependencies [[`23ab897e`](https://github.com/thirdweb-dev/js/commit/23ab897e329cdd5b316fbe554ea0f64add91f2b4), [`a3f3e160`](https://github.com/thirdweb-dev/js/commit/a3f3e160e07328655a4f0332f41f4edd210a1a8a), [`e79a9520`](https://github.com/thirdweb-dev/js/commit/e79a95206116ea09de0126fdbe30fb4413fdff28), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`42c74368`](https://github.com/thirdweb-dev/js/commit/42c743682739de77c264c11cc1692ed752f929a6), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`480ed721`](https://github.com/thirdweb-dev/js/commit/480ed721d1c736049fa8b6ee4cbdbdf3cce18abd), [`16e9e8b6`](https://github.com/thirdweb-dev/js/commit/16e9e8b64d7d1a97a5b32fc855479e992b7ed3a8), [`b1190914`](https://github.com/thirdweb-dev/js/commit/b1190914a97a9c4d9019c4ce8ee49ad345aed18c)]:
|
||||||
|
- @thirdweb-dev/sdk@4.0.13
|
||||||
|
- @thirdweb-dev/react-core@4.1.4
|
||||||
|
- @thirdweb-dev/storage@2.0.4
|
||||||
|
- @thirdweb-dev/wallets@2.1.3
|
||||||
|
|
||||||
## 0.4.3
|
## 0.4.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react-native",
|
"name": "@thirdweb-dev/react-native",
|
||||||
"version": "0.4.3",
|
"version": "0.4.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module.exports = {
|
|||||||
extends: ["thirdweb", "plugin:i18next/recommended"],
|
extends: ["thirdweb", "plugin:i18next/recommended"],
|
||||||
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
||||||
rules: {
|
rules: {
|
||||||
"tsdoc/syntax": "warn",
|
"tsdoc/syntax": "error",
|
||||||
"@next/next/no-img-element": "off",
|
"@next/next/no-img-element": "off",
|
||||||
"better-tree-shaking/no-top-level-side-effects": "error",
|
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||||
"i18next/no-literal-string": 2,
|
"i18next/no-literal-string": 2,
|
||||||
|
|||||||
@@ -1,5 +1,18 @@
|
|||||||
# @thirdweb-dev/react
|
# @thirdweb-dev/react
|
||||||
|
|
||||||
|
## 4.1.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1944](https://github.com/thirdweb-dev/js/pull/1944) [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5) Thanks [@iketw](https://github.com/iketw)! - Adds tsdoc warnings to enforce a common comments format
|
||||||
|
|
||||||
|
- [#1948](https://github.com/thirdweb-dev/js/pull/1948) [`42c74368`](https://github.com/thirdweb-dev/js/commit/42c743682739de77c264c11cc1692ed752f929a6) Thanks [@iketw](https://github.com/iketw)! - Deprecates PaperWallet in favor of EmbeddedWallet
|
||||||
|
|
||||||
|
- Updated dependencies [[`23ab897e`](https://github.com/thirdweb-dev/js/commit/23ab897e329cdd5b316fbe554ea0f64add91f2b4), [`a3f3e160`](https://github.com/thirdweb-dev/js/commit/a3f3e160e07328655a4f0332f41f4edd210a1a8a), [`e79a9520`](https://github.com/thirdweb-dev/js/commit/e79a95206116ea09de0126fdbe30fb4413fdff28), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`42c74368`](https://github.com/thirdweb-dev/js/commit/42c743682739de77c264c11cc1692ed752f929a6), [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`480ed721`](https://github.com/thirdweb-dev/js/commit/480ed721d1c736049fa8b6ee4cbdbdf3cce18abd), [`16e9e8b6`](https://github.com/thirdweb-dev/js/commit/16e9e8b64d7d1a97a5b32fc855479e992b7ed3a8), [`b1190914`](https://github.com/thirdweb-dev/js/commit/b1190914a97a9c4d9019c4ce8ee49ad345aed18c)]:
|
||||||
|
- @thirdweb-dev/sdk@4.0.13
|
||||||
|
- @thirdweb-dev/react-core@4.1.4
|
||||||
|
- @thirdweb-dev/wallets@2.1.3
|
||||||
|
|
||||||
## 4.1.3
|
## 4.1.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/react",
|
"name": "@thirdweb-dev/react",
|
||||||
"version": "4.1.3",
|
"version": "4.1.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -20,6 +20,15 @@ import { useScreenContext } from "../../ConnectWallet/Modal/screen";
|
|||||||
import { PaperGoogleLogin } from "./PaperGoogleLogin";
|
import { PaperGoogleLogin } from "./PaperGoogleLogin";
|
||||||
import { emailIcon } from "../../ConnectWallet/icons/dataUris";
|
import { emailIcon } from "../../ConnectWallet/icons/dataUris";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paper Wallet
|
||||||
|
*
|
||||||
|
* @param _config - Options available to create a paper wallet
|
||||||
|
* @returns The WalletConfig<PaperWallet> object
|
||||||
|
*
|
||||||
|
* @deprecated We have deprecated PaperWallet in favor of our {@link EmbeddedWallet} which adds support for more sign in methods.
|
||||||
|
* Learn more here: https://portal.thirdweb.com/embedded-wallet
|
||||||
|
*/
|
||||||
export const paperWallet = (
|
export const paperWallet = (
|
||||||
_config?: PaperConfig,
|
_config?: PaperConfig,
|
||||||
): WalletConfig<PaperWallet> => {
|
): WalletConfig<PaperWallet> => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module.exports = {
|
|||||||
extends: ["thirdweb"],
|
extends: ["thirdweb"],
|
||||||
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
||||||
rules: {
|
rules: {
|
||||||
"tsdoc/syntax": "warn",
|
"tsdoc/syntax": "error",
|
||||||
"better-tree-shaking/no-top-level-side-effects": "error",
|
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||||
"no-restricted-imports": [
|
"no-restricted-imports": [
|
||||||
"error",
|
"error",
|
||||||
|
|||||||
@@ -1,5 +1,23 @@
|
|||||||
# @thirdweb-dev/sdk
|
# @thirdweb-dev/sdk
|
||||||
|
|
||||||
|
## 4.0.13
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- [#1947](https://github.com/thirdweb-dev/js/pull/1947) [`23ab897e`](https://github.com/thirdweb-dev/js/commit/23ab897e329cdd5b316fbe554ea0f64add91f2b4) Thanks [@adam-maj](https://github.com/adam-maj)! - Add support for EIP-2612 permit to engine relayer
|
||||||
|
|
||||||
|
- [#1936](https://github.com/thirdweb-dev/js/pull/1936) [`a3f3e160`](https://github.com/thirdweb-dev/js/commit/a3f3e160e07328655a4f0332f41f4edd210a1a8a) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Improvements for auto resolving contracts:
|
||||||
|
|
||||||
|
- ~10x performance improvements using shared caching layer at the edge
|
||||||
|
- auto resolves any verified contract on etherscan on supported chains
|
||||||
|
|
||||||
|
- [#1944](https://github.com/thirdweb-dev/js/pull/1944) [`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5) Thanks [@iketw](https://github.com/iketw)! - Fixes all tsdoc comments warnings
|
||||||
|
|
||||||
|
- [#1949](https://github.com/thirdweb-dev/js/pull/1949) [`480ed721`](https://github.com/thirdweb-dev/js/commit/480ed721d1c736049fa8b6ee4cbdbdf3cce18abd) Thanks [@iketw](https://github.com/iketw)! - Enforces the tsdoc/syntax rule
|
||||||
|
|
||||||
|
- Updated dependencies [[`6fcdec7c`](https://github.com/thirdweb-dev/js/commit/6fcdec7c12e4a3c0d10f3a67771e19cfad5c8ab5), [`480ed721`](https://github.com/thirdweb-dev/js/commit/480ed721d1c736049fa8b6ee4cbdbdf3cce18abd)]:
|
||||||
|
- @thirdweb-dev/storage@2.0.4
|
||||||
|
|
||||||
## 4.0.12
|
## 4.0.12
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@thirdweb-dev/sdk",
|
"name": "@thirdweb-dev/sdk",
|
||||||
"version": "4.0.12",
|
"version": "4.0.13",
|
||||||
"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",
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param create2Factory
|
* @param create2Factory - The create2 factory to use
|
||||||
*/
|
*/
|
||||||
export async function computeCloneFactoryAddress(
|
export async function computeCloneFactoryAddress(
|
||||||
provider: providers.Provider,
|
provider: providers.Provider,
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import { getSaltHash } from "./getSaltHash";
|
|||||||
* Pre-compute a contract's deployment address for a CREATE2 deployment.
|
* Pre-compute a contract's deployment address for a CREATE2 deployment.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param bytecode: Creation bytecode of the contract to deploy
|
* @param bytecode - Creation bytecode of the contract to deploy
|
||||||
* @param encodedArgs: Abi-encoded constructor params
|
* @param encodedArgs - Abi-encoded constructor params
|
||||||
* @param create2FactoryAddress
|
* @param create2FactoryAddress - The create2 factory address to use
|
||||||
*/
|
*/
|
||||||
export function computeDeploymentAddress(
|
export function computeDeploymentAddress(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param create2Factory
|
* @param create2Factory - The create2 factory to use
|
||||||
*/
|
*/
|
||||||
export async function computeEOAForwarderAddress(
|
export async function computeEOAForwarderAddress(
|
||||||
provider: providers.Provider,
|
provider: providers.Provider,
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param create2Factory
|
* @param create2Factory - The create2 factory to use
|
||||||
*/
|
*/
|
||||||
export async function computeForwarderAddress(
|
export async function computeForwarderAddress(
|
||||||
provider: providers.Provider,
|
provider: providers.Provider,
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param create2Factory
|
* @param create2Factory - The create2 factory to use
|
||||||
*/
|
*/
|
||||||
export async function computeNativeTokenAddress(
|
export async function computeNativeTokenAddress(
|
||||||
provider: providers.Provider,
|
provider: providers.Provider,
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import { isContractDeployed } from "./isContractDeployed";
|
|||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*
|
*
|
||||||
* @param signer
|
* @param signer - The signer to use
|
||||||
* @param bytecode
|
* @param bytecode - The bytecode to deploy
|
||||||
* @param encodedArgs
|
* @param encodedArgs - The encoded constructor args to use
|
||||||
* @param create2FactoryAddress
|
* @param create2FactoryAddress - The create2 factory address to use
|
||||||
*/
|
*/
|
||||||
export async function deployContractDeterministic(
|
export async function deployContractDeterministic(
|
||||||
signer: Signer,
|
signer: Signer,
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ import { getInitBytecodeWithSalt } from "./getInitBytecodeWithSalt";
|
|||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*
|
*
|
||||||
* @param type signer
|
* @param signer - The signer to use
|
||||||
* @param bytecode
|
* @param bytecode - The bytecode to deploy
|
||||||
* @param encodedArgs
|
* @param encodedArgs - The encoded constructor args to use
|
||||||
* @param create2FactoryAddress
|
* @param create2FactoryAddress - The create2 factory address to use
|
||||||
*/
|
*/
|
||||||
export async function deployContractDeterministicRaw(
|
export async function deployContractDeterministicRaw(
|
||||||
signer: Signer,
|
signer: Signer,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { getCreate2FactoryDeploymentInfo } from "./getCreate2FactoryDeploymentIn
|
|||||||
* Ref: https://github.com/Arachnid/deterministic-deployment-proxy
|
* Ref: https://github.com/Arachnid/deterministic-deployment-proxy
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param signer
|
* @param signer - The signer to use
|
||||||
*/
|
*/
|
||||||
export async function deployCreate2Factory(
|
export async function deployCreate2Factory(
|
||||||
signer: Signer,
|
signer: Signer,
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ import { AbiInput } from "../../schema/contracts/custom";
|
|||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*
|
*
|
||||||
* @param bytecode
|
* @param bytecode - The bytecode to deploy
|
||||||
* @param abi
|
* @param abi - The abi to use
|
||||||
* @param signer
|
* @param signer - The signer to use
|
||||||
* @param constructorArgs
|
* @param constructorArgs - The constructor args to use
|
||||||
* @param saltForCreate2
|
* @param saltForCreate2 - The salt to use
|
||||||
*/
|
*/
|
||||||
export async function directDeployDeterministic(
|
export async function directDeployDeterministic(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
@@ -115,11 +115,11 @@ export async function directDeployDeterministic(
|
|||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*
|
*
|
||||||
* @param publishMetadataUri
|
* @param publishMetadataUri - The metadata uri to use
|
||||||
* @param signer
|
* @param signer - The signer to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param constructorArgs
|
* @param constructorArgs - The constructor args to use
|
||||||
* @param saltForCreate2
|
* @param saltForCreate2 - The salt to use
|
||||||
*/
|
*/
|
||||||
export async function directDeployDeterministicWithUri(
|
export async function directDeployDeterministicWithUri(
|
||||||
publishMetadataUri: string,
|
publishMetadataUri: string,
|
||||||
@@ -153,16 +153,16 @@ export async function directDeployDeterministicWithUri(
|
|||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
*
|
*
|
||||||
* @param contractName
|
* @param contractName - The name of the contract to deploy
|
||||||
* @param publisherAddress
|
* @param publisherAddress - The publisher address to use
|
||||||
* @param contractVersion
|
* @param contractVersion - The contract version to use
|
||||||
* @param constructorArgs
|
* @param constructorArgs - The constructor args to use
|
||||||
* @param signer
|
* @param signer - The signer to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param clientId
|
* @param clientId - The client id to use
|
||||||
* @param secretKey
|
* @param secretKey - The secret key to use
|
||||||
* @param constructorArgs
|
* @param constructorArgs - The constructor args to use
|
||||||
* @param saltForCreate2
|
* @param saltForCreate2 - The salt to use
|
||||||
*/
|
*/
|
||||||
export async function directDeployDeterministicPublished(
|
export async function directDeployDeterministicPublished(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { getCreate2FactoryDeploymentInfo } from "./getCreate2FactoryDeploymentIn
|
|||||||
* https://github.com/Arachnid/deterministic-deployment-proxy/blob/master/source/deterministic-deployment-proxy.yul
|
* https://github.com/Arachnid/deterministic-deployment-proxy/blob/master/source/deterministic-deployment-proxy.yul
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
*/
|
*/
|
||||||
export async function getCreate2FactoryAddress(
|
export async function getCreate2FactoryAddress(
|
||||||
provider: providers.Provider,
|
provider: providers.Provider,
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import { getKeylessTxn } from "./getKeylessTxn";
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param transaction: Unsigned transaction object
|
* @param transaction - Unsigned transaction object
|
||||||
* @param signature: Signature bytes
|
* @param signature - Signature bytes
|
||||||
*/
|
*/
|
||||||
export function getCreate2FactoryDeploymentInfo(
|
export function getCreate2FactoryDeploymentInfo(
|
||||||
chainId: number,
|
chainId: number,
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ import invariant from "tiny-invariant";
|
|||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*
|
*
|
||||||
* @param metadataUri
|
* @param metadataUri - The metadata uri to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param create2Factory
|
* @param create2Factory - The create2 factory to use
|
||||||
*/
|
*/
|
||||||
export async function getDeploymentInfo(
|
export async function getDeploymentInfo(
|
||||||
metadataUri: string,
|
metadataUri: string,
|
||||||
|
|||||||
+3
-3
@@ -15,9 +15,9 @@ import { getDeploymentInfo } from "./getDeploymentInfo";
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param contractName
|
* @param contractName - The name of the contract to predict the address for
|
||||||
* @param chainId
|
* @param chainId - The chain id to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function getEncodedConstructorParamsForThirdwebContract(
|
export async function getEncodedConstructorParamsForThirdwebContract(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { getSaltHash } from "./getSaltHash";
|
|||||||
* This hex data is intended to be sent to the CREATE2 factory address
|
* This hex data is intended to be sent to the CREATE2 factory address
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param bytecode: Creation bytecode of the contract to deploy
|
* @param bytecode - Creation bytecode of the contract to deploy
|
||||||
* @param encodedArgs: Abi-encoded constructor params
|
* @param encodedArgs - Abi-encoded constructor params
|
||||||
*/
|
*/
|
||||||
export function getInitBytecodeWithSalt(
|
export function getInitBytecodeWithSalt(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { KeylessTransaction } from "../../types/any-evm/deploy-data";
|
|||||||
* Generate a transaction to be sent with a keyless signer.
|
* Generate a transaction to be sent with a keyless signer.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param transaction: Unsigned transaction object
|
* @param transaction - Unsigned transaction object
|
||||||
* @param signature: Signature bytes
|
* @param signature - Signature bytes
|
||||||
*/
|
*/
|
||||||
export function getKeylessTxn(
|
export function getKeylessTxn(
|
||||||
transaction: UnsignedTransaction,
|
transaction: UnsignedTransaction,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { utils } from "ethers";
|
|||||||
* Note: Salt component is generated by appending `tw` (thirdweb) to the bytecode
|
* Note: Salt component is generated by appending `tw` (thirdweb) to the bytecode
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param bytecode: Creation bytecode of the contract to deploy
|
* @param bytecode - Creation bytecode of the contract to deploy
|
||||||
*/
|
*/
|
||||||
export function getSaltHash(bytecode: string): string {
|
export function getSaltHash(bytecode: string): string {
|
||||||
const bytecodePrefixed = bytecode.startsWith("0x")
|
const bytecodePrefixed = bytecode.startsWith("0x")
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import { predictThirdwebContractAddress } from "./predictThirdwebContractAddress
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param contractName
|
* @param contractName - The name of the contract to predict the address for
|
||||||
* @param chainId
|
* @param chainId - The chain id to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param clientId
|
* @param clientId - The client id to use
|
||||||
*/
|
*/
|
||||||
export async function getThirdwebContractAddress(
|
export async function getThirdwebContractAddress(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { providers } from "ethers";
|
|||||||
* Check if a contract exists at the given address
|
* Check if a contract exists at the given address
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param address
|
* @param address - The address to check
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
*/
|
*/
|
||||||
export async function isContractDeployed(
|
export async function isContractDeployed(
|
||||||
address: string,
|
address: string,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { matchError } from "../any-evm-constants";
|
|||||||
* Ref: https://eips.ethereum.org/EIPS/eip-155
|
* Ref: https://eips.ethereum.org/EIPS/eip-155
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
*/
|
*/
|
||||||
export async function isEIP155Enforced(
|
export async function isEIP155Enforced(
|
||||||
provider: providers.Provider,
|
provider: providers.Provider,
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import { fetchAndCacheDeployMetadata } from "./fetchAndCacheDeployMetadata";
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param contractName
|
* @param contractName - The name of the contract to predict the address for
|
||||||
* @param chainId
|
* @param chainId - The chain id to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function predictThirdwebContractAddress(
|
export async function predictThirdwebContractAddress(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { utils, constants } from "ethers";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param quantity
|
* @param quantity - The quantity to convert
|
||||||
* @param tokenDecimals
|
* @param tokenDecimals - The token decimals to use
|
||||||
*/
|
*/
|
||||||
export function convertQuantityToBigNumber(
|
export function convertQuantityToBigNumber(
|
||||||
quantity: Quantity,
|
quantity: Quantity,
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { type BigNumberish, constants, utils } from "ethers";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param bn
|
* @param bn - The big number to convert
|
||||||
* @param tokenDecimals
|
* @param tokenDecimals - The token decimals to use
|
||||||
*/
|
*/
|
||||||
export function convertToReadableQuantity(
|
export function convertToReadableQuantity(
|
||||||
bn: BigNumberish,
|
bn: BigNumberish,
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param merkleRoot
|
* @param merkleRoot - The merkle root to fetch the snapshot for
|
||||||
* @param merkleMetadata
|
* @param merkleMetadata - The merkle metadata to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function fetchSnapshot(
|
export async function fetchSnapshot(
|
||||||
merkleRoot: string,
|
merkleRoot: string,
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ function compare(a: BigNumberish, b: BigNumberish) {
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* Decorates claim conditions with merkle roots from snapshots if present
|
* Decorates claim conditions with merkle roots from snapshots if present
|
||||||
* @param claimConditionInputs
|
* @param claimConditionInputs - The claim conditions to process
|
||||||
* @param tokenDecimals
|
* @param tokenDecimals - The token decimals to use
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param snapshotFormatVersion
|
* @param snapshotFormatVersion - The snapshot format version to use
|
||||||
*/
|
*/
|
||||||
export async function processSnapshotData(
|
export async function processSnapshotData(
|
||||||
claimConditionInputs: ClaimConditionInput[],
|
claimConditionInputs: ClaimConditionInput[],
|
||||||
@@ -76,10 +76,10 @@ export async function processSnapshotData(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a local SDK model to contract model
|
* Converts a local SDK model to contract model
|
||||||
* @param c
|
* @param c - The condition input
|
||||||
* @param tokenDecimals
|
* @param tokenDecimals - The token decimals to use
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
async function convertToContractModel(
|
async function convertToContractModel(
|
||||||
@@ -123,11 +123,11 @@ async function convertToContractModel(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create and uploads snapshots + converts claim conditions to contract format
|
* Create and uploads snapshots + converts claim conditions to contract format
|
||||||
* @param claimConditionInputs
|
* @param claimConditionInputs - The claim conditions to process
|
||||||
* @param tokenDecimals
|
* @param tokenDecimals - The token decimals to use
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param snapshotFormatVersion
|
* @param snapshotFormatVersion - The snapshot format version to use
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export async function processClaimConditionInputs(
|
export async function processClaimConditionInputs(
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ import { convertToReadableQuantity } from "./convertToReadableQuantity";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transforms a contract model to local model
|
* Transforms a contract model to local model
|
||||||
* @param pm
|
* @param pm - The contract model to transform
|
||||||
* @param tokenDecimals
|
* @param tokenDecimals - The token decimals to use
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param merkleMetadata
|
* @param merkleMetadata - The merkle metadata to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @param shouldDownloadSnapshot
|
* @param shouldDownloadSnapshot - Whether to download the snapshot
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export async function transformResultToClaimCondition(
|
export async function transformResultToClaimCondition(
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import { utils } from "ethers";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param index
|
* @param index - The index of the condition to update
|
||||||
* @param claimConditionInput
|
* @param claimConditionInput - The input claim condition to update
|
||||||
* @param existingConditions
|
* @param existingConditions - The existing claim conditions
|
||||||
*/
|
*/
|
||||||
export async function updateExistingClaimConditions(
|
export async function updateExistingClaimConditions(
|
||||||
index: number,
|
index: number,
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import { isNativeToken } from "./isNativeToken";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param asset
|
* @param asset - The asset to fetch the metadata for
|
||||||
* @returns
|
* @returns
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { fetchCurrencyMetadata } from "./fetchCurrencyMetadata";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param providerOrSigner
|
* @param providerOrSigner - The provider or signer to use
|
||||||
* @param asset
|
* @param asset - The asset to fetch the value for
|
||||||
* @param price
|
* @param price - The price to fetch the value for
|
||||||
* @returns
|
* @returns
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import { fetchCurrencyMetadata } from "./fetchCurrencyMetadata";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param inputPrice
|
* @param inputPrice - The input price to normalize
|
||||||
* @param currencyAddress
|
* @param currencyAddress - The currency address to normalize the price for
|
||||||
* @returns
|
* @returns
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ import type {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param contractType
|
* @param contractType - The contract type to get deploy arguments for
|
||||||
* @param metadata
|
* @param metadata - The metadata to get deploy arguments for
|
||||||
* @param contractURI
|
* @param contractURI - The contract URI to get deploy arguments for
|
||||||
* @returns
|
* @returns
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -441,8 +441,8 @@ function parseMessageParts(regex: RegExp, raw: string): string {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param err
|
* @param err - The error to check
|
||||||
* @param message
|
* @param message - The message to check for
|
||||||
*/
|
*/
|
||||||
export function includesErrorMessage(err: any, message: string): boolean {
|
export function includesErrorMessage(err: any, message: string): boolean {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { ExtensionNotImplementedError } from "../error";
|
|||||||
/**
|
/**
|
||||||
* Checks whether the given DetectableFeature is defined
|
* Checks whether the given DetectableFeature is defined
|
||||||
* @internal
|
* @internal
|
||||||
* @param namespace The namespace to check
|
* @param namespace - The namespace to check
|
||||||
* @param feature The corresponding feature
|
* @param feature - The corresponding feature
|
||||||
*/
|
*/
|
||||||
export function assertEnabled<T extends DetectableFeature>(
|
export function assertEnabled<T extends DetectableFeature>(
|
||||||
namespace: T | undefined,
|
namespace: T | undefined,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { isExtensionEnabled } from "./isFeatureEnabled";
|
|||||||
/**
|
/**
|
||||||
* Type guard for contractWrappers depending on passed feature name
|
* Type guard for contractWrappers depending on passed feature name
|
||||||
* @internal
|
* @internal
|
||||||
* @param contractWrapper
|
* @param contractWrapper - The contract wrapper to check
|
||||||
* @param featureName
|
* @param featureName - The feature name to check
|
||||||
*/
|
*/
|
||||||
export function detectContractFeature<T extends BaseContract>(
|
export function detectContractFeature<T extends BaseContract>(
|
||||||
contractWrapper: ContractWrapper<BaseContract>,
|
contractWrapper: ContractWrapper<BaseContract>,
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import { hasMatchingAbi, matchesAbiFromBytecode } from "./hasMatchingAbi";
|
|||||||
/**
|
/**
|
||||||
* Processes ALL supported features and sets whether the passed in abi supports each individual feature
|
* Processes ALL supported features and sets whether the passed in abi supports each individual feature
|
||||||
* @internal
|
* @internal
|
||||||
* @param abi
|
* @param abi - The abi to detect features in
|
||||||
* @param features
|
* @param features - The features to detect
|
||||||
* @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(
|
||||||
@@ -51,8 +51,8 @@ export function detectFeaturesFromBytecode(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param abi
|
* @param abi - The abi to check
|
||||||
* @param feature
|
* @param feature - The feature to check
|
||||||
*/
|
*/
|
||||||
function matchesAbiInterface(abi: AbiInput, feature: Feature): boolean {
|
function matchesAbiInterface(abi: AbiInput, feature: Feature): boolean {
|
||||||
// returns true if all the functions in `interfaceToMatch` are found in `contract` (removing any duplicates)
|
// returns true if all the functions in `interfaceToMatch` are found in `contract` (removing any duplicates)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param name
|
* @param name - The name of the function to extract the comment from
|
||||||
* @param metadata
|
* @param metadata - The metadata to extract the comment from
|
||||||
* @param type
|
* @param type - The type of the function to extract the comment from
|
||||||
*/
|
*/
|
||||||
export function extractCommentFromMetadata(
|
export function extractCommentFromMetadata(
|
||||||
name: string | undefined,
|
name: string | undefined,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { AbiInput, AbiSchema } from "../../schema/contracts/custom";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param abi
|
* @param abi - The abi to extract constructor params from
|
||||||
* @returns
|
* @returns
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { extractCommentFromMetadata } from "./extractCommentFromMetadata";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param abi
|
* @param abi - The abi to extract events from
|
||||||
* @param metadata
|
* @param metadata - The metadata to extract comments from
|
||||||
*/
|
*/
|
||||||
export function extractEventsFromAbi(
|
export function extractEventsFromAbi(
|
||||||
abi: AbiInput,
|
abi: AbiInput,
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { AbiInput, AbiSchema } from "../../schema/contracts/custom";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param abi
|
* @param abi - The abi to extract params from
|
||||||
* @param functionName
|
* @param functionName - The function name to extract params from
|
||||||
* @returns
|
* @returns
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { fetchPreDeployMetadata } from "./fetchPreDeployMetadata";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param predeployMetadataUri
|
* @param predeployMetadataUri - The predeploy metadata URI to fetch
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function extractFunctions(
|
export async function extractFunctions(
|
||||||
predeployMetadataUri: string,
|
predeployMetadataUri: string,
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { extractCommentFromMetadata } from "./extractCommentFromMetadata";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param abi
|
* @param abi - The abi to extract functions from
|
||||||
* @param metadata
|
* @param metadata - The metadata to extract comments from
|
||||||
*/
|
*/
|
||||||
export function extractFunctionsFromAbi(
|
export function extractFunctionsFromAbi(
|
||||||
abi: AbiInput,
|
abi: AbiInput,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { hexToBytes } from "./hexToBytes";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param bytecode
|
* @param bytecode - The bytecode to extract the IPFS hash from
|
||||||
*/
|
*/
|
||||||
export function extractIPFSHashFromBytecode(
|
export function extractIPFSHashFromBytecode(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param bytecode
|
* @param bytecode - The bytecode to check
|
||||||
*/
|
*/
|
||||||
export function extractMinimalProxyImplementationAddress(
|
export function extractMinimalProxyImplementationAddress(
|
||||||
bytecode: string,
|
bytecode: string,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
|||||||
/**
|
/**
|
||||||
* Fetch and parse the full metadata AFTER publishing a contract, with all the extra information (version, readme, etc)
|
* Fetch and parse the full metadata AFTER publishing a contract, with all the extra information (version, readme, etc)
|
||||||
* @internal
|
* @internal
|
||||||
* @param publishMetadataUri
|
* @param publishMetadataUri - The publish metadata URI to fetch
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function fetchExtendedReleaseMetadata(
|
export async function fetchExtendedReleaseMetadata(
|
||||||
publishMetadataUri: string,
|
publishMetadataUri: string,
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import { fetchRawPredeployMetadata } from "./fetchRawPredeployMetadata";
|
|||||||
/**
|
/**
|
||||||
* Fetch the metadata coming from CLI, this is before deploying or releasing the contract.
|
* Fetch the metadata coming from CLI, this is before deploying or releasing the contract.
|
||||||
* @internal
|
* @internal
|
||||||
* @param publishMetadataUri
|
* @param publishMetadataUri - The publish metadata URI to fetch
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function fetchPreDeployMetadata(
|
export async function fetchPreDeployMetadata(
|
||||||
publishMetadataUri: string,
|
publishMetadataUri: string,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param publishMetadataUri
|
* @param publishMetadataUri - The publish metadata URI to fetch
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function fetchRawPredeployMetadata(
|
export async function fetchRawPredeployMetadata(
|
||||||
publishMetadataUri: string,
|
publishMetadataUri: string,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import type { BaseContract } from "ethers";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param contractWrapper
|
* @param contractWrapper - The contract wrapper to check
|
||||||
* @param functionName
|
* @param functionName - The function name to check
|
||||||
*/
|
*/
|
||||||
export function hasFunction<TContract extends BaseContract>(
|
export function hasFunction<TContract extends BaseContract>(
|
||||||
functionName: string,
|
functionName: string,
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { extractFunctionsFromAbi } from "./extractFunctionsFromAbi";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param contractAbi
|
* @param contractAbi - The abi to check
|
||||||
* @param featureAbis
|
* @param featureAbis - The feature abi to check
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function hasMatchingAbi(
|
export function hasMatchingAbi(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param hex
|
* @param hex - The hex string to convert to bytes
|
||||||
*/
|
*/
|
||||||
export function hexToBytes(hex: string | number) {
|
export function hexToBytes(hex: string | number) {
|
||||||
hex = hex.toString(16);
|
hex = hex.toString(16);
|
||||||
@@ -20,7 +20,7 @@ export function hexToBytes(hex: string | number) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param hex
|
* @param hex - The hex string to check
|
||||||
*/
|
*/
|
||||||
function isHexStrict(hex: string | number) {
|
function isHexStrict(hex: string | number) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { detectFeatures } from "./detectFeatures";
|
|||||||
/**
|
/**
|
||||||
* Checks whether the given ABI supports a given feature
|
* Checks whether the given ABI supports a given feature
|
||||||
* @deprecated use isExtensionEnabled instead
|
* @deprecated use isExtensionEnabled instead
|
||||||
* @param abi
|
* @param abi - The abi to check
|
||||||
* @param featureName
|
* @param featureName - The feature name to check
|
||||||
*/
|
*/
|
||||||
export function isFeatureEnabled(
|
export function isFeatureEnabled(
|
||||||
abi: AbiInput,
|
abi: AbiInput,
|
||||||
@@ -22,8 +22,8 @@ export function isFeatureEnabled(
|
|||||||
/**
|
/**
|
||||||
* Checks whether the given ABI supports a given extension
|
* Checks whether the given ABI supports a given extension
|
||||||
* @public
|
* @public
|
||||||
* @param abi
|
* @param abi - The abi to check
|
||||||
* @param featureName
|
* @param featureName - The feature name to check
|
||||||
*/
|
*/
|
||||||
export function isExtensionEnabled(abi: AbiInput, featureName: FeatureName) {
|
export function isExtensionEnabled(abi: AbiInput, featureName: FeatureName) {
|
||||||
return isFeatureEnabled(abi, featureName);
|
return isFeatureEnabled(abi, featureName);
|
||||||
@@ -32,8 +32,8 @@ export function isExtensionEnabled(abi: AbiInput, featureName: FeatureName) {
|
|||||||
/**
|
/**
|
||||||
* Searches the feature map for featureName and returns whether its enabled
|
* Searches the feature map for featureName and returns whether its enabled
|
||||||
* @internal
|
* @internal
|
||||||
* @param features
|
* @param features - The feature map to search
|
||||||
* @param featureName
|
* @param featureName - The feature name to search for
|
||||||
*/
|
*/
|
||||||
function _featureEnabled(
|
function _featureEnabled(
|
||||||
features: Record<string, FeatureWithEnabled>,
|
features: Record<string, FeatureWithEnabled>,
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { hasMatchingAbi } from "./hasMatchingAbi";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param contractWrapper
|
* @param contractWrapper - The contract wrapper to check
|
||||||
* @param abi
|
* @param abi - The abi to check
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function matchesPrebuiltAbi<T extends BaseContract>(
|
export function matchesPrebuiltAbi<T extends BaseContract>(
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { extractMinimalProxyImplementationAddress } from "./extractMinimalProxyI
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param address
|
* @param address - the contract address
|
||||||
* @param provider
|
* @param provider - RPC provider
|
||||||
*/
|
*/
|
||||||
export async function resolveContractUriFromAddress(
|
export async function resolveContractUriFromAddress(
|
||||||
address: string,
|
address: string,
|
||||||
@@ -25,8 +25,8 @@ export async function resolveContractUriAndBytecode(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve the implementation address of a proxy contract and its bytecode
|
* Resolve the implementation address of a proxy contract and its bytecode
|
||||||
* @param address the contract address
|
* @param address - the contract address
|
||||||
* @param provider RPC provider
|
* @param provider - RPC provider
|
||||||
* @returns the implementation address and its bytecode
|
* @returns the implementation address and its bytecode
|
||||||
*/
|
*/
|
||||||
export async function resolveImplementation(
|
export async function resolveImplementation(
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ const CONTRACT_METADATA_TIMEOUT_SEC = 2;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param compilerMetadataUri
|
* @param compilerMetadataUri - The compiler metadata URI to fetch
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function fetchContractMetadata(
|
export async function fetchContractMetadata(
|
||||||
compilerMetadataUri: string,
|
compilerMetadataUri: string,
|
||||||
@@ -25,6 +25,10 @@ export async function fetchContractMetadata(
|
|||||||
`Could not resolve metadata for contract at ${compilerMetadataUri}`,
|
`Could not resolve metadata for contract at ${compilerMetadataUri}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return formatCompilerMetadata(metadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatCompilerMetadata(metadata: any): PublishedMetadata {
|
||||||
const abi = AbiSchema.parse(metadata.output.abi);
|
const abi = AbiSchema.parse(metadata.output.abi);
|
||||||
const compilationTarget = metadata.settings.compilationTarget;
|
const compilationTarget = metadata.settings.compilationTarget;
|
||||||
const targets = Object.keys(compilationTarget);
|
const targets = Object.keys(compilationTarget);
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import type { ThirdwebStorage } from "@thirdweb-dev/storage";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param publishedMetadata
|
* @param publishedMetadata - The published metadata to fetch the sources for
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export async function fetchSourceFilesFromMetadata(
|
export async function fetchSourceFilesFromMetadata(
|
||||||
|
|||||||
@@ -94,11 +94,11 @@ export async function isTokenApprovedForTransfer(
|
|||||||
/**
|
/**
|
||||||
* Checks if the marketplace is approved to make transfers on the assetContract
|
* Checks if the marketplace is approved to make transfers on the assetContract
|
||||||
* If not, it tries to set the approval.
|
* If not, it tries to set the approval.
|
||||||
* @param contractWrapper
|
* @param contractWrapper - The contract wrapper to use
|
||||||
* @param marketplaceAddress
|
* @param marketplaceAddress - The address of the marketplace contract
|
||||||
* @param assetContract
|
* @param assetContract - The address of the asset contract.
|
||||||
* @param tokenId
|
* @param tokenId - The token id of the token.
|
||||||
* @param from
|
* @param from - The address of the account that owns the token.
|
||||||
*/
|
*/
|
||||||
export async function handleTokenApproval(
|
export async function handleTokenApproval(
|
||||||
contractWrapper: ContractWrapper<any>,
|
contractWrapper: ContractWrapper<any>,
|
||||||
@@ -227,7 +227,7 @@ export function validateNewListingParam(
|
|||||||
* Maps a contract offer to the strict interface
|
* Maps a contract offer to the strict interface
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param offer
|
* @param offer - The offer to map
|
||||||
* @returns - An `Offer` object
|
* @returns - An `Offer` object
|
||||||
*/
|
*/
|
||||||
export async function mapOffer(
|
export async function mapOffer(
|
||||||
|
|||||||
@@ -3,13 +3,19 @@ import { Address } from "../schema/shared/Address";
|
|||||||
import { resolveContractUriAndBytecode } from "./feature-detection/resolveContractUriFromAddress";
|
import { resolveContractUriAndBytecode } from "./feature-detection/resolveContractUriFromAddress";
|
||||||
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||||
import { Contract, providers } from "ethers";
|
import { Contract, providers } from "ethers";
|
||||||
import { fetchContractMetadata } from "./fetchContractMetadata";
|
import {
|
||||||
|
fetchContractMetadata,
|
||||||
|
formatCompilerMetadata,
|
||||||
|
} from "./fetchContractMetadata";
|
||||||
import { getMultichainRegistryAddress } from "../constants/addresses/getMultichainRegistryAddress";
|
import { getMultichainRegistryAddress } from "../constants/addresses/getMultichainRegistryAddress";
|
||||||
import { getChainProvider } from "../constants/urls";
|
import { getChainProvider } from "../constants/urls";
|
||||||
import type { TWMultichainRegistryLogic } from "@thirdweb-dev/contracts-js";
|
import type { TWMultichainRegistryLogic } from "@thirdweb-dev/contracts-js";
|
||||||
import { constructAbiFromBytecode } from "./feature-detection/getAllDetectedFeatures";
|
import { constructAbiFromBytecode } from "./feature-detection/getAllDetectedFeatures";
|
||||||
import { SDKOptions } from "../schema/sdk-options";
|
import { SDKOptions } from "../schema/sdk-options";
|
||||||
import { Polygon } from "@thirdweb-dev/chains";
|
import { Polygon } from "@thirdweb-dev/chains";
|
||||||
|
import { getProcessEnv } from "../../core/utils/process";
|
||||||
|
|
||||||
|
const CONTRACT_RESOLVER_BASE_URL = "https://contract.thirdweb.com/metadata";
|
||||||
|
|
||||||
// Internal static cache
|
// Internal static cache
|
||||||
const metadataCache: Record<string, PublishedMetadata> = {};
|
const metadataCache: Record<string, PublishedMetadata> = {};
|
||||||
@@ -33,9 +39,9 @@ function getFromCache(address: string, chainId: number) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param address
|
* @param address - The address to fetch the metadata for
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
*/
|
*/
|
||||||
export async function fetchContractMetadataFromAddress(
|
export async function fetchContractMetadataFromAddress(
|
||||||
address: Address,
|
address: Address,
|
||||||
@@ -50,6 +56,51 @@ export async function fetchContractMetadataFromAddress(
|
|||||||
}
|
}
|
||||||
let metadata: PublishedMetadata | undefined;
|
let metadata: PublishedMetadata | undefined;
|
||||||
|
|
||||||
|
// try to resolve from DNS first
|
||||||
|
if (!isRunningInTests()) {
|
||||||
|
try {
|
||||||
|
const response = await fetch(
|
||||||
|
`${CONTRACT_RESOLVER_BASE_URL}/${chainId}/${address}`,
|
||||||
|
);
|
||||||
|
if (response.ok) {
|
||||||
|
const resolvedData = await response.json();
|
||||||
|
metadata = formatCompilerMetadata(resolvedData);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// fallback to IPFS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!metadata) {
|
||||||
|
metadata = await fetchContractMetadataFromBytecode(
|
||||||
|
address,
|
||||||
|
chainId,
|
||||||
|
provider,
|
||||||
|
storage,
|
||||||
|
sdkOptions,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!metadata) {
|
||||||
|
throw new Error(
|
||||||
|
`Could not resolve contract. Try importing it by visiting: https://thirdweb.com/${chainId}/${address}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!metadata.isPartialAbi) {
|
||||||
|
putInCache(address, chainId, metadata);
|
||||||
|
}
|
||||||
|
return metadata;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function fetchContractMetadataFromBytecode(
|
||||||
|
address: Address,
|
||||||
|
chainId: number,
|
||||||
|
provider: providers.Provider,
|
||||||
|
storage: ThirdwebStorage,
|
||||||
|
sdkOptions: SDKOptions = {},
|
||||||
|
) {
|
||||||
|
let metadata: PublishedMetadata | undefined;
|
||||||
// we can't race here, because the contract URI might resolve first with a non pinned URI
|
// we can't race here, because the contract URI might resolve first with a non pinned URI
|
||||||
const [ipfsData, registryData] = await Promise.all([
|
const [ipfsData, registryData] = await Promise.all([
|
||||||
resolveContractUriAndBytecode(address, provider).catch(() => undefined),
|
resolveContractUriAndBytecode(address, provider).catch(() => undefined),
|
||||||
@@ -97,13 +148,6 @@ export async function fetchContractMetadataFromAddress(
|
|||||||
return metadata;
|
return metadata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!metadata) {
|
|
||||||
throw new Error(
|
|
||||||
`Could not resolve contract. Try importing it by visiting: https://thirdweb.com/${chainId}/${address}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
putInCache(address, chainId, metadata);
|
|
||||||
return metadata;
|
return metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,9 +179,9 @@ async function getMetadataUriFromMultichainRegistry(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param address
|
* @param address - The address to fetch the metadata for
|
||||||
* @param provider
|
* @param provider - The provider to use
|
||||||
* @param storage
|
* @param storage - The storage to use
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export async function fetchAbiFromAddress(
|
export async function fetchAbiFromAddress(
|
||||||
@@ -160,3 +204,7 @@ export async function fetchAbiFromAddress(
|
|||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isRunningInTests() {
|
||||||
|
return !!getProcessEnv("factoryAddress");
|
||||||
|
}
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ export async function fetchTokenMetadata(
|
|||||||
// Used for marketplace to fetch NFT metadata from contract address + tokenId
|
// Used for marketplace to fetch NFT metadata from contract address + tokenId
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param contractAddress
|
* @param contractAddress - the contract address
|
||||||
* @param provider
|
* @param provider - the provider to use
|
||||||
* @param tokenId
|
* @param tokenId - the token id
|
||||||
* @param storage
|
* @param storage - the storage to use
|
||||||
*/
|
*/
|
||||||
export async function fetchTokenMetadataForContract(
|
export async function fetchTokenMetadataForContract(
|
||||||
contractAddress: string,
|
contractAddress: string,
|
||||||
@@ -154,8 +154,8 @@ export async function fetchTokenMetadataForContract(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param metadata
|
* @param metadata - the metadata to upload
|
||||||
* @param storage
|
* @param storage - the storage to use
|
||||||
*/
|
*/
|
||||||
export async function uploadOrExtractURI(
|
export async function uploadOrExtractURI(
|
||||||
metadata: NFTMetadataOrUri,
|
metadata: NFTMetadataOrUri,
|
||||||
@@ -170,12 +170,12 @@ export async function uploadOrExtractURI(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param metadatas
|
* @param metadatas - the metadata to upload
|
||||||
* @param storage
|
* @param storage - the storage to use
|
||||||
* @param startNumber
|
* @param startNumber - the number to start the file names at
|
||||||
* @param contractAddress
|
* @param contractAddress - the contract address
|
||||||
* @param signerAddress
|
* @param signerAddress - the signer address
|
||||||
* @param options
|
* @param options - options
|
||||||
*/
|
*/
|
||||||
export async function uploadOrExtractURIs(
|
export async function uploadOrExtractURIs(
|
||||||
metadatas: NFTMetadataOrUri[],
|
metadatas: NFTMetadataOrUri[],
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ import { parseSnapshotInputs } from "./parseSnapshotInputs";
|
|||||||
* Create a snapshot (merkle tree) from a list of addresses and uploads it to IPFS
|
* Create a snapshot (merkle tree) from a list of addresses and uploads it to IPFS
|
||||||
* @param snapshotInput - the list of addresses to hash
|
* @param snapshotInput - the list of addresses to hash
|
||||||
* @param tokenDecimals - the token decimals
|
* @param tokenDecimals - the token decimals
|
||||||
* @param provider
|
* @param provider - the provider to use
|
||||||
* @param storage - the storage to upload to
|
* @param storage - the storage to upload to
|
||||||
* @param snapshotFormatVersion
|
* @param snapshotFormatVersion - the snapshot format version
|
||||||
* @returns the generated snapshot and URI
|
* @returns the generated snapshot and URI
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ const RequestStatus = {
|
|||||||
* storage // this could be used from the SDK instance, e.g. sdk.storage
|
* storage // this could be used from the SDK instance, e.g. sdk.storage
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
* @param contractName
|
* @param contractName - Name of the contract to verify
|
||||||
* @param chainId
|
* @param chainId - Chain ID of the network
|
||||||
* @param explorerAPIUrl
|
* @param explorerAPIUrl - Explorer API URL
|
||||||
* @param explorerAPIKey
|
* @param explorerAPIKey - Explorer API Key
|
||||||
* @param storage
|
* @param storage - Storage instance
|
||||||
*/
|
*/
|
||||||
export async function verifyThirdwebPrebuiltImplementation(
|
export async function verifyThirdwebPrebuiltImplementation(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
@@ -117,11 +117,11 @@ export async function verifyThirdwebPrebuiltImplementation(
|
|||||||
* storage // this could be used from the SDK instance, e.g. sdk.storage
|
* storage // this could be used from the SDK instance, e.g. sdk.storage
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
* @param contractAddress
|
* @param contractAddress - Address of the contract to verify
|
||||||
* @param chainId
|
* @param chainId - Chain ID of the network
|
||||||
* @param explorerAPIUrl
|
* @param explorerAPIUrl - Explorer API URL
|
||||||
* @param explorerAPIKey
|
* @param explorerAPIKey - Explorer API Key
|
||||||
* @param storage
|
* @param storage - Storage instance
|
||||||
*/
|
*/
|
||||||
export async function verify(
|
export async function verify(
|
||||||
contractAddress: string,
|
contractAddress: string,
|
||||||
@@ -236,9 +236,9 @@ export async function verify(
|
|||||||
* @internal
|
* @internal
|
||||||
*
|
*
|
||||||
* Check status of the contract submitted for verification to the explorer
|
* Check status of the contract submitted for verification to the explorer
|
||||||
* @param explorerAPIUrl
|
* @param explorerAPIUrl - Explorer API URL
|
||||||
* @param explorerAPIKey
|
* @param explorerAPIKey - Explorer API Key
|
||||||
* @param guid
|
* @param guid - GUID of the contract verification
|
||||||
*/
|
*/
|
||||||
export async function checkVerificationStatus(
|
export async function checkVerificationStatus(
|
||||||
explorerAPIUrl: string,
|
explorerAPIUrl: string,
|
||||||
@@ -271,12 +271,12 @@ export async function checkVerificationStatus(
|
|||||||
* @internal
|
* @internal
|
||||||
*
|
*
|
||||||
* Check if the contract is already verified on etherscan
|
* Check if the contract is already verified on etherscan
|
||||||
* @param contractAddress
|
* @param contractAddress - Address of the contract to verify
|
||||||
* @param chainId
|
* @param chainId - Chain ID of the network
|
||||||
* @param explorerAPIUrl
|
* @param explorerAPIUrl - Explorer API URL
|
||||||
* @param explorerAPIKey
|
* @param explorerAPIKey - Explorer API Key
|
||||||
* ClientId get from https://thirdweb.com/create-api-key
|
*
|
||||||
* @param clientId
|
* @param clientId - Client ID: Get from https://thirdweb.com/create-api-key
|
||||||
*/
|
*/
|
||||||
export async function isVerifiedOnEtherscan(
|
export async function isVerifiedOnEtherscan(
|
||||||
contractAddress: string,
|
contractAddress: string,
|
||||||
@@ -320,12 +320,12 @@ export async function isVerifiedOnEtherscan(
|
|||||||
* @internal
|
* @internal
|
||||||
*
|
*
|
||||||
* Fetch the deploy transaction from the given contract address and extract the encoded constructor parameters
|
* Fetch the deploy transaction from the given contract address and extract the encoded constructor parameters
|
||||||
* @param explorerAPIUrl
|
* @param explorerAPIUrl - Explorer API URL
|
||||||
* @param explorerAPIKey
|
* @param explorerAPIKey - Explorer API Key
|
||||||
* @param contractAddress
|
* @param contractAddress - Address of the contract to verify
|
||||||
* @param abi
|
* @param abi - ABI of the contract to verify
|
||||||
* @param provider
|
* @param provider - Provider instance
|
||||||
* @param storage
|
* @param storage - Storage instance
|
||||||
*/
|
*/
|
||||||
async function fetchConstructorParams(
|
async function fetchConstructorParams(
|
||||||
explorerAPIUrl: string,
|
explorerAPIUrl: string,
|
||||||
@@ -441,9 +441,9 @@ async function fetchConstructorParams(
|
|||||||
* @internal
|
* @internal
|
||||||
*
|
*
|
||||||
* Fetches the Publish metadata on the ContractPublisher registry (on polygon) for the given contract address (on any chain)
|
* Fetches the Publish metadata on the ContractPublisher registry (on polygon) for the given contract address (on any chain)
|
||||||
* @param contractAddress
|
* @param contractAddress - Address of the contract to verify
|
||||||
* @param provider
|
* @param provider - Provider instance
|
||||||
* @param storage
|
* @param storage - Storage instance
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async function fetchDeployBytecodeFromPublishedContractMetadata(
|
async function fetchDeployBytecodeFromPublishedContractMetadata(
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export type Semver = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param version
|
* @param version - The version to convert to a Semver
|
||||||
*/
|
*/
|
||||||
export function toSemver(version: string): Semver {
|
export function toSemver(version: string): Semver {
|
||||||
if (version.length > MAX_LENGTH) {
|
if (version.length > MAX_LENGTH) {
|
||||||
@@ -41,8 +41,8 @@ export function toSemver(version: string): Semver {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param current
|
* @param current - The current version
|
||||||
* @param next
|
* @param next - The next version
|
||||||
*/
|
*/
|
||||||
export function isIncrementalVersion(current: string, next: string) {
|
export function isIncrementalVersion(current: string, next: string) {
|
||||||
const currentSemver = toSemver(current);
|
const currentSemver = toSemver(current);
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import { SUPPORTED_CHAIN_ID } from "../chains/SUPPORTED_CHAIN_ID";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param chainId
|
* @param chainId - The chainId to get the approved implementation for
|
||||||
* @param contractType
|
* @param contractType - The contract type to get the approved implementation for
|
||||||
*/
|
*/
|
||||||
export function getApprovedImplementation(
|
export function getApprovedImplementation(
|
||||||
chainId: SUPPORTED_CHAIN_ID, // TODO use SupportedChainId once we deploy to all chains
|
chainId: SUPPORTED_CHAIN_ID, // TODO use SupportedChainId once we deploy to all chains
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ async function getContractInfo(address: Address, provider: providers.Provider) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a map from contractType -> contract metadata
|
* a map from contractType - contract metadata
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export const PREBUILT_CONTRACTS_MAP = /* @__PURE__ */ {
|
export const PREBUILT_CONTRACTS_MAP = /* @__PURE__ */ {
|
||||||
|
|||||||
@@ -389,9 +389,9 @@ export class NFTDrop extends StandardErc721<PrebuiltNFTDrop> {
|
|||||||
/**
|
/**
|
||||||
* Construct a claim transaction without executing it.
|
* Construct a claim transaction without executing it.
|
||||||
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
||||||
* @param destinationAddress
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param quantity
|
* @param quantity - Quantity of the tokens you want to claim
|
||||||
* @param checkERC20Allowance
|
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
||||||
*
|
*
|
||||||
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -409,9 +409,9 @@ export class SignatureDrop extends StandardErc721<SignatureDropContract> {
|
|||||||
/**
|
/**
|
||||||
* Construct a claim transaction without executing it.
|
* Construct a claim transaction without executing it.
|
||||||
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
||||||
* @param destinationAddress
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param quantity
|
* @param quantity - Quantity of the tokens you want to claim
|
||||||
* @param checkERC20Allowance
|
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
||||||
*
|
*
|
||||||
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export class AccountFactory<TContract extends IAccountFactory>
|
|||||||
* @param extraData - (Optional) Extra data to be passed to the account on creation.
|
* @param extraData - (Optional) Extra data to be passed to the account on creation.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* ```javascript
|
* ```javascript
|
||||||
* const tx = await contract.accountFactory.createAccount(admin, extraData);
|
* const tx = await contract.accountFactory.createAccount(admin, extraData);
|
||||||
* const receipt = tx.receipt();
|
* const receipt = tx.receipt();
|
||||||
* const accountAddress = tx.address;
|
* const accountAddress = tx.address;
|
||||||
|
|||||||
@@ -705,8 +705,8 @@ export class AccountPermissions implements DetectableFeature {
|
|||||||
* - Add new scoped :check:
|
* - Add new scoped :check:
|
||||||
* - Remove current scoped :check:
|
* - Remove current scoped :check:
|
||||||
* - Update current scoped :check:
|
* - Update current scoped :check:
|
||||||
* - Current admin -> new scoped :check:
|
* - Current admin - new scoped :check:
|
||||||
* - Current scoped -> new admin :check:
|
* - Current scoped - new admin :check:
|
||||||
**/
|
**/
|
||||||
|
|
||||||
// No duplicate signers in input!
|
// No duplicate signers in input!
|
||||||
|
|||||||
@@ -67,9 +67,9 @@ export class Airdrop1155<T extends IAirdropERC1155 | AirdropERC1155>
|
|||||||
* // - array containing failed drops, if any
|
* // - array containing failed drops, if any
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* @param tokenAddress
|
* @param tokenAddress - Address of the ERC1155 token being airdropped
|
||||||
* @param tokenOwner
|
* @param tokenOwner - Address of the owner of the tokens being airdropped
|
||||||
* @param contents
|
* @param contents - Array of recipients and tokenIds to airdrop
|
||||||
*
|
*
|
||||||
* @returns an array of recipients for who the airdrop failed (empty means all transfers were successful)
|
* @returns an array of recipients for who the airdrop failed (empty means all transfers were successful)
|
||||||
* @twfeature AirdropERC1155
|
* @twfeature AirdropERC1155
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ export class Airdrop20<T extends IAirdropERC20 | AirdropERC20>
|
|||||||
* // - array containing failed drops, if any
|
* // - array containing failed drops, if any
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* @param tokenAddress
|
* @param tokenAddress - Address of the ERC20 token being airdropped
|
||||||
* @param tokenOwner
|
* @param tokenOwner - Address of the owner of the tokens being airdropped
|
||||||
* @param contents
|
* @param contents - Array of airdrop contents
|
||||||
*
|
*
|
||||||
* @returns an array of recipients for who the airdrop failed (empty means all transfers were successful)
|
* @returns an array of recipients for who the airdrop failed (empty means all transfers were successful)
|
||||||
* @twfeature AirdropERC20
|
* @twfeature AirdropERC20
|
||||||
|
|||||||
@@ -62,9 +62,9 @@ export class Airdrop721<T extends IAirdropERC721 | AirdropERC721>
|
|||||||
* // - array containing failed drops, if any
|
* // - array containing failed drops, if any
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* @param tokenAddress
|
* @param tokenAddress - Address of the ERC721 token being airdropped
|
||||||
* @param tokenOwner
|
* @param tokenOwner - Address of the owner of the tokens being airdropped
|
||||||
* @param contents
|
* @param contents - Array of recipients and tokenIds to airdrop
|
||||||
*
|
*
|
||||||
* @returns an array of recipients for who the airdrop failed (empty means all transfers were successful)
|
* @returns an array of recipients for who the airdrop failed (empty means all transfers were successful)
|
||||||
* @twfeature AirdropERC721
|
* @twfeature AirdropERC721
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param metadataUri
|
* @param metadataUri - URI of the contract metadata
|
||||||
*/
|
*/
|
||||||
public async extractConstructorParams(
|
public async extractConstructorParams(
|
||||||
metadataUri: string,
|
metadataUri: string,
|
||||||
@@ -90,7 +90,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param predeployMetadataUri
|
* @param predeployMetadataUri - URI of the predeploy metadata
|
||||||
*/
|
*/
|
||||||
public async extractFunctions(
|
public async extractFunctions(
|
||||||
predeployMetadataUri: string,
|
predeployMetadataUri: string,
|
||||||
@@ -100,7 +100,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param predeployUri
|
* @param predeployUri - URI of the predeploy metadata
|
||||||
*/
|
*/
|
||||||
public async fetchCompilerMetadataFromPredeployURI(
|
public async fetchCompilerMetadataFromPredeployURI(
|
||||||
predeployUri: string,
|
predeployUri: string,
|
||||||
@@ -110,8 +110,8 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param prepublishUri
|
* @param prepublishUri - URI of the prepublish metadata
|
||||||
* @param publisherAddress
|
* @param publisherAddress - Address of the publisher
|
||||||
*/
|
*/
|
||||||
public async fetchPrePublishMetadata(
|
public async fetchPrePublishMetadata(
|
||||||
prepublishUri: string,
|
prepublishUri: string,
|
||||||
@@ -137,7 +137,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param address
|
* @param address - Address of the contract
|
||||||
*/
|
*/
|
||||||
public async fetchCompilerMetadataFromAddress(
|
public async fetchCompilerMetadataFromAddress(
|
||||||
address: AddressOrEns,
|
address: AddressOrEns,
|
||||||
@@ -154,7 +154,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* Get the full information about a published contract
|
* Get the full information about a published contract
|
||||||
* @param contract
|
* @param contract - Published contract
|
||||||
*/
|
*/
|
||||||
public async fetchPublishedContractInfo(
|
public async fetchPublishedContractInfo(
|
||||||
contract: PublishedContract,
|
contract: PublishedContract,
|
||||||
@@ -170,7 +170,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param publishedMetadataUri
|
* @param publishedMetadataUri - URI of the published metadata
|
||||||
*/
|
*/
|
||||||
public async fetchFullPublishMetadata(
|
public async fetchFullPublishMetadata(
|
||||||
publishedMetadataUri: string,
|
publishedMetadataUri: string,
|
||||||
@@ -182,7 +182,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
* @internal
|
* @internal
|
||||||
* // TODO expose a resolvePublishMetadata(contractAddress, chainId) that handles the dual chain case
|
* // TODO expose a resolvePublishMetadata(contractAddress, chainId) that handles the dual chain case
|
||||||
* // TODO will be easy to do with the multichain pattern of 3.0
|
* // TODO will be easy to do with the multichain pattern of 3.0
|
||||||
* @param compilerMetadataUri
|
* @param compilerMetadataUri - URI of the compiler metadata
|
||||||
*/
|
*/
|
||||||
public async resolvePublishMetadataFromCompilerMetadata(
|
public async resolvePublishMetadataFromCompilerMetadata(
|
||||||
compilerMetadataUri: string,
|
compilerMetadataUri: string,
|
||||||
@@ -219,7 +219,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch all sources for a contract from its address
|
* Fetch all sources for a contract from its address
|
||||||
* @param address
|
* @param address - Address of the contract
|
||||||
*/
|
*/
|
||||||
public async fetchContractSourcesFromAddress(
|
public async fetchContractSourcesFromAddress(
|
||||||
address: AddressOrEns,
|
address: AddressOrEns,
|
||||||
@@ -233,7 +233,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch ABI from a contract, or undefined if not found
|
* Fetch ABI from a contract, or undefined if not found
|
||||||
* @param address
|
* @param address - Address of the contract
|
||||||
*/
|
*/
|
||||||
public async fetchContractAbiFromAddress(
|
public async fetchContractAbiFromAddress(
|
||||||
address: AddressOrEns,
|
address: AddressOrEns,
|
||||||
@@ -249,7 +249,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param profileMetadata
|
* @param profileMetadata - Profile metadata
|
||||||
*/
|
*/
|
||||||
updatePublisherProfile = /* @__PURE__ */ buildTransactionFunction(
|
updatePublisherProfile = /* @__PURE__ */ buildTransactionFunction(
|
||||||
async (profileMetadata: ProfileMetadataInput) => {
|
async (profileMetadata: ProfileMetadataInput) => {
|
||||||
@@ -268,7 +268,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param publisherAddress
|
* @param publisherAddress - Address of the publisher
|
||||||
*/
|
*/
|
||||||
public async getPublisherProfile(
|
public async getPublisherProfile(
|
||||||
publisherAddress: AddressOrEns,
|
publisherAddress: AddressOrEns,
|
||||||
@@ -287,7 +287,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param publisherAddress
|
* @param publisherAddress - Address of the publisher
|
||||||
*/
|
*/
|
||||||
public async getAll(
|
public async getAll(
|
||||||
publisherAddress: AddressOrEns,
|
publisherAddress: AddressOrEns,
|
||||||
@@ -314,8 +314,8 @@ export class ContractPublisher extends RPCConnectionHandler {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
* @param publisherAddress
|
* @param publisherAddress - Address of the publisher
|
||||||
* @param contractId
|
* @param contractId - ID of the contract
|
||||||
*/
|
*/
|
||||||
public async getAllVersions(
|
public async getAllVersions(
|
||||||
publisherAddress: AddressOrEns,
|
publisherAddress: AddressOrEns,
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ export class ContractVerifier extends RPCConnectionHandler {
|
|||||||
* explorerAPIKey,
|
* explorerAPIKey,
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
* @param contractName
|
* @param contractName - Name of the contract to verify
|
||||||
* @param explorerAPIUrl
|
* @param explorerAPIUrl - Explorer API URL
|
||||||
* @param explorerAPIKey
|
* @param explorerAPIKey - Explorer API key
|
||||||
*/
|
*/
|
||||||
public async verifyThirdwebContract(
|
public async verifyThirdwebContract(
|
||||||
contractName: string,
|
contractName: string,
|
||||||
@@ -105,9 +105,9 @@ export class ContractVerifier extends RPCConnectionHandler {
|
|||||||
* explorerAPIKey,
|
* explorerAPIKey,
|
||||||
* );
|
* );
|
||||||
* ```
|
* ```
|
||||||
* @param contractAddress
|
* @param contractAddress - Address of the contract to verify
|
||||||
* @param explorerAPIUrl
|
* @param explorerAPIUrl - Explorer API URL
|
||||||
* @param explorerAPIKey
|
* @param explorerAPIKey - Explorer API key
|
||||||
*/
|
*/
|
||||||
public async verifyContract(
|
public async verifyContract(
|
||||||
contractAddress: string,
|
contractAddress: string,
|
||||||
|
|||||||
@@ -189,8 +189,8 @@ export class ContractWrapper<
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param functionName The function name on the contract to call
|
* @param functionName - The function name on the contract to call
|
||||||
* @param args The arguments to be passed to the functionName
|
* @param args - The arguments to be passed to the functionName
|
||||||
* @returns The return value of the function call
|
* @returns The return value of the function call
|
||||||
*/
|
*/
|
||||||
public async read<
|
public async read<
|
||||||
|
|||||||
@@ -554,7 +554,7 @@ export class DropClaimConditions<
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the total supply claimed by a specific wallet
|
* Get the total supply claimed by a specific wallet
|
||||||
* @param walletAddress the wallet address to check
|
* @param walletAddress - the wallet address to check
|
||||||
* @returns the total supply claimed
|
* @returns the total supply claimed
|
||||||
*/
|
*/
|
||||||
public async getSupplyClaimedByWallet(
|
public async getSupplyClaimedByWallet(
|
||||||
@@ -892,9 +892,9 @@ export class DropClaimConditions<
|
|||||||
/**
|
/**
|
||||||
* Construct a claim transaction without executing it.
|
* Construct a claim transaction without executing it.
|
||||||
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
||||||
* @param destinationAddress
|
* @param destinationAddress - The address to claim to
|
||||||
* @param quantity
|
* @param quantity - The quantity to claim
|
||||||
* @param options
|
* @param options - Options to override the claim transaction
|
||||||
*
|
*
|
||||||
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -538,7 +538,7 @@ export class DropErc1155ClaimConditions<
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the total supply claimed by a specific wallet
|
* Get the total supply claimed by a specific wallet
|
||||||
* @param walletAddress the wallet address to check
|
* @param walletAddress - the wallet address to check
|
||||||
* @returns the total supply claimed
|
* @returns the total supply claimed
|
||||||
*/
|
*/
|
||||||
public async getSupplyClaimedByWallet(
|
public async getSupplyClaimedByWallet(
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export class Erc20ClaimableWithConditions implements DetectableFeature {
|
|||||||
* @param destinationAddress - Address you want to send the token to
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param amount - Quantity of the tokens you want to claim
|
* @param amount - Quantity of the tokens you want to claim
|
||||||
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
||||||
* @param claimData
|
* @param claimData - Optional, data to pass to the claim function
|
||||||
* @returns - The transaction receipt
|
* @returns - The transaction receipt
|
||||||
*/
|
*/
|
||||||
to = /* @__PURE__ */ buildTransactionFunction(
|
to = /* @__PURE__ */ buildTransactionFunction(
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ export class Erc20<
|
|||||||
* @param destinationAddress - Address you want to send the token to
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param amount - Quantity of the tokens you want to claim
|
* @param amount - Quantity of the tokens you want to claim
|
||||||
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
||||||
* @param claimData
|
* @param claimData - Optional, claim data
|
||||||
* @returns - The transaction receipt
|
* @returns - The transaction receipt
|
||||||
* @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1
|
* @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1
|
||||||
*/
|
*/
|
||||||
@@ -562,7 +562,7 @@ export class Erc20<
|
|||||||
* @param destinationAddress - Address you want to send the token to
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param amount - Quantity of the tokens you want to claim
|
* @param amount - Quantity of the tokens you want to claim
|
||||||
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
* @param checkERC20Allowance - Optional, check if the wallet has enough ERC20 allowance to claim the tokens, and if not, approve the transfer
|
||||||
* @param claimData
|
* @param claimData - Optional, claim data
|
||||||
* @returns - The transaction receipt
|
* @returns - The transaction receipt
|
||||||
* @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1
|
* @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1
|
||||||
*/
|
*/
|
||||||
@@ -638,7 +638,7 @@ export class Erc20<
|
|||||||
/**
|
/**
|
||||||
* returns the wei amount from a token amount
|
* returns the wei amount from a token amount
|
||||||
* @internal
|
* @internal
|
||||||
* @param amount
|
* @param amount - The token amount
|
||||||
*/
|
*/
|
||||||
public async normalizeAmount(amount: Amount): Promise<BigNumber> {
|
public async normalizeAmount(amount: Amount): Promise<BigNumber> {
|
||||||
return normalizeAmount(this.contractWrapper, amount);
|
return normalizeAmount(this.contractWrapper, amount);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export class Erc721ClaimableWithConditions implements DetectableFeature {
|
|||||||
*
|
*
|
||||||
* @param destinationAddress - Address you want to send the token to
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param quantity - Quantity of the tokens you want to claim
|
* @param quantity - Quantity of the tokens you want to claim
|
||||||
* @param options
|
* @param options - (optional) Options to configure the claim
|
||||||
* @returns - an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata
|
* @returns - an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata
|
||||||
*/
|
*/
|
||||||
to = /* @__PURE__ */ buildTransactionFunction(
|
to = /* @__PURE__ */ buildTransactionFunction(
|
||||||
|
|||||||
@@ -815,7 +815,7 @@ export class Erc721<
|
|||||||
*
|
*
|
||||||
* @param destinationAddress - Address you want to send the token to
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param quantity - Quantity of the tokens you want to claim
|
* @param quantity - Quantity of the tokens you want to claim
|
||||||
* @param options
|
* @param options - optional claim options
|
||||||
* @returns - an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata
|
* @returns - an array of results containing the id of the token claimed, the transaction receipt and a promise to optionally fetch the nft metadata
|
||||||
* @twfeature ERC721ClaimCustom | ERC721ClaimPhasesV2 | ERC721ClaimPhasesV1 | ERC721ClaimConditionsV2 | ERC721ClaimConditionsV1 | ERC721ClaimZora
|
* @twfeature ERC721ClaimCustom | ERC721ClaimPhasesV2 | ERC721ClaimPhasesV1 | ERC721ClaimConditionsV2 | ERC721ClaimConditionsV1 | ERC721ClaimZora
|
||||||
*/
|
*/
|
||||||
@@ -848,9 +848,9 @@ export class Erc721<
|
|||||||
/**
|
/**
|
||||||
* Construct a claim transaction without executing it.
|
* Construct a claim transaction without executing it.
|
||||||
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
* This is useful for estimating the gas cost of a claim transaction, overriding transaction options and having fine grained control over the transaction execution.
|
||||||
* @param destinationAddress
|
* @param destinationAddress - Address you want to send the token to
|
||||||
* @param quantity
|
* @param quantity - Quantity of the tokens you want to claim
|
||||||
* @param options
|
* @param options - optional claim options
|
||||||
*
|
*
|
||||||
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
||||||
* @twfeature ERC721ClaimCustom | ERC721ClaimPhasesV2 | ERC721ClaimPhasesV1 | ERC721ClaimConditionsV2 | ERC721ClaimConditionsV1
|
* @twfeature ERC721ClaimCustom | ERC721ClaimPhasesV2 | ERC721ClaimPhasesV1 | ERC721ClaimConditionsV2 | ERC721ClaimConditionsV1
|
||||||
|
|||||||
@@ -214,9 +214,9 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param contractType
|
* @param contractType - the contract type to deploy
|
||||||
* @param metadata
|
* @param metadata - the metadata for the contract
|
||||||
* @param contractURI
|
* @param contractURI - the contract URI
|
||||||
* @returns
|
* @returns
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user