Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
836be52724 | ||
|
|
9f993dcc1e | ||
|
|
61760a180f | ||
|
|
a3f3e160e0 | ||
|
|
b1190914a9 | ||
|
|
e79a952061 | ||
|
|
480ed721d1 | ||
|
|
42c7436827 | ||
|
|
16e9e8b64d | ||
|
|
23ab897e32 | ||
|
|
6fcdec7c12 |
@@ -1,5 +1,19 @@
|
||||
# @thirdweb-dev/auth
|
||||
|
||||
## 4.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`9f993dcc`](https://github.com/thirdweb-dev/js/commit/9f993dcc1e60cc087850b8fb9ce09524073ce0b5)]:
|
||||
- @thirdweb-dev/wallets@2.1.4
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/auth",
|
||||
"version": "4.1.5",
|
||||
"version": "4.1.7",
|
||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||
"browser": {
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# thirdweb
|
||||
|
||||
## 0.13.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`9f993dcc`](https://github.com/thirdweb-dev/js/commit/9f993dcc1e60cc087850b8fb9ce09524073ce0b5)]:
|
||||
- @thirdweb-dev/wallets@2.1.4
|
||||
- @thirdweb-dev/auth@4.1.7
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "thirdweb",
|
||||
"main": "dist/cli/index.js",
|
||||
"version": "0.13.13",
|
||||
"version": "0.13.15",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
extends: ["thirdweb"],
|
||||
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
||||
rules: {
|
||||
"tsdoc/syntax": "warn",
|
||||
"tsdoc/syntax": "error",
|
||||
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @thirdweb-dev/react-core
|
||||
|
||||
## 4.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`9f993dcc`](https://github.com/thirdweb-dev/js/commit/9f993dcc1e60cc087850b8fb9ce09524073ce0b5)]:
|
||||
- @thirdweb-dev/wallets@2.1.4
|
||||
- @thirdweb-dev/auth@4.1.7
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-core",
|
||||
"version": "4.1.3",
|
||||
"version": "4.1.5",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -335,7 +335,7 @@ export function ThirdwebWalletProvider(
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
console.error("Failed to auto connect wallet");
|
||||
console.error("Failed to auto connect personal wallet");
|
||||
console.error(e);
|
||||
setConnectionStatus("disconnected");
|
||||
return;
|
||||
@@ -366,9 +366,14 @@ export function ThirdwebWalletProvider(
|
||||
} catch (e) {
|
||||
console.error("Failed to auto connect wallet");
|
||||
console.error(e);
|
||||
lastConnectedWalletStorage.removeItem(
|
||||
LAST_CONNECTED_WALLET_STORAGE_KEY,
|
||||
);
|
||||
if (
|
||||
e instanceof Error &&
|
||||
e.message === autoConnectTimeoutErrorMessage
|
||||
) {
|
||||
lastConnectedWalletStorage.removeItem(
|
||||
LAST_CONNECTED_WALLET_STORAGE_KEY,
|
||||
);
|
||||
}
|
||||
setConnectionStatus("disconnected");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,10 @@ export function useTotalCirculatingSupply(
|
||||
const { erc721, erc1155 } = getErcs(contract);
|
||||
|
||||
return useQueryWithNetwork<BigNumber>(
|
||||
cacheKeys.contract.nft.query.totalCirculatingSupply(contractAddress),
|
||||
cacheKeys.contract.nft.query.totalCirculatingSupply(
|
||||
contractAddress,
|
||||
tokenId ?? undefined,
|
||||
),
|
||||
async () => {
|
||||
requiredParamInvariant(contract, "No Contract instance provided");
|
||||
|
||||
|
||||
@@ -182,10 +182,12 @@ export const cacheKeys = {
|
||||
),
|
||||
totalCirculatingSupply: (
|
||||
contractAddress: RequiredParam<ContractAddress>,
|
||||
tokenId?: BigNumberish,
|
||||
) =>
|
||||
createContractCacheKey(contractAddress, [
|
||||
"query",
|
||||
"totalCirculatingSupply",
|
||||
tokenId ?? "0",
|
||||
]),
|
||||
totalCount: (contractAddress: RequiredParam<ContractAddress>) =>
|
||||
createContractCacheKey(contractAddress, ["query", "totalCount"]),
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# @thirdweb-dev/react-native-compat
|
||||
|
||||
## 0.4.5
|
||||
|
||||
## 0.4.4
|
||||
|
||||
## 0.4.3
|
||||
|
||||
## 0.4.2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native-compat",
|
||||
"description": "Shims for Thirdweb in React Native Projects",
|
||||
"version": "0.4.3",
|
||||
"version": "0.4.5",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
extends: ["thirdweb"],
|
||||
plugins: ["i18next", "eslint-plugin-tsdoc"],
|
||||
rules: {
|
||||
"tsdoc/syntax": "warn",
|
||||
"tsdoc/syntax": "error",
|
||||
"i18next/no-literal-string": 2,
|
||||
},
|
||||
settings: {
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# @thirdweb-dev/react-native
|
||||
|
||||
## 0.4.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`9f993dcc`](https://github.com/thirdweb-dev/js/commit/9f993dcc1e60cc087850b8fb9ce09524073ce0b5)]:
|
||||
- @thirdweb-dev/wallets@2.1.4
|
||||
- @thirdweb-dev/react-core@4.1.5
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native",
|
||||
"version": "0.4.3",
|
||||
"version": "0.4.5",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
extends: ["thirdweb", "plugin:i18next/recommended"],
|
||||
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
||||
rules: {
|
||||
"tsdoc/syntax": "warn",
|
||||
"tsdoc/syntax": "error",
|
||||
"@next/next/no-img-element": "off",
|
||||
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||
"i18next/no-literal-string": 2,
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# @thirdweb-dev/react
|
||||
|
||||
## 4.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`9f993dcc`](https://github.com/thirdweb-dev/js/commit/9f993dcc1e60cc087850b8fb9ce09524073ce0b5)]:
|
||||
- @thirdweb-dev/wallets@2.1.4
|
||||
- @thirdweb-dev/react-core@4.1.5
|
||||
|
||||
## 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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react",
|
||||
"version": "4.1.3",
|
||||
"version": "4.1.5",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -20,6 +20,15 @@ import { useScreenContext } from "../../ConnectWallet/Modal/screen";
|
||||
import { PaperGoogleLogin } from "./PaperGoogleLogin";
|
||||
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 = (
|
||||
_config?: PaperConfig,
|
||||
): WalletConfig<PaperWallet> => {
|
||||
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
extends: ["thirdweb"],
|
||||
plugins: ["better-tree-shaking", "eslint-plugin-tsdoc"],
|
||||
rules: {
|
||||
"tsdoc/syntax": "warn",
|
||||
"tsdoc/syntax": "error",
|
||||
"better-tree-shaking/no-top-level-side-effects": "error",
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# @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
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/sdk",
|
||||
"version": "4.0.12",
|
||||
"version": "4.0.13",
|
||||
"description": "The main thirdweb SDK.",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/sdk",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
||||
/**
|
||||
*
|
||||
* @internal
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param create2Factory
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @param create2Factory - The create2 factory to use
|
||||
*/
|
||||
export async function computeCloneFactoryAddress(
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -5,9 +5,9 @@ import { getSaltHash } from "./getSaltHash";
|
||||
* Pre-compute a contract's deployment address for a CREATE2 deployment.
|
||||
*
|
||||
* @public
|
||||
* @param bytecode: Creation bytecode of the contract to deploy
|
||||
* @param encodedArgs: Abi-encoded constructor params
|
||||
* @param create2FactoryAddress
|
||||
* @param bytecode - Creation bytecode of the contract to deploy
|
||||
* @param encodedArgs - Abi-encoded constructor params
|
||||
* @param create2FactoryAddress - The create2 factory address to use
|
||||
*/
|
||||
export function computeDeploymentAddress(
|
||||
bytecode: string,
|
||||
|
||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
||||
/**
|
||||
*
|
||||
* @internal
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param create2Factory
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @param create2Factory - The create2 factory to use
|
||||
*/
|
||||
export async function computeEOAForwarderAddress(
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
||||
/**
|
||||
*
|
||||
* @internal
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param create2Factory
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @param create2Factory - The create2 factory to use
|
||||
*/
|
||||
export async function computeForwarderAddress(
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -6,9 +6,9 @@ import { computeDeploymentInfo } from "./computeDeploymentInfo";
|
||||
/**
|
||||
*
|
||||
* @internal
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param create2Factory
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @param create2Factory - The create2 factory to use
|
||||
*/
|
||||
export async function computeNativeTokenAddress(
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -10,10 +10,10 @@ import { isContractDeployed } from "./isContractDeployed";
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @param signer
|
||||
* @param bytecode
|
||||
* @param encodedArgs
|
||||
* @param create2FactoryAddress
|
||||
* @param signer - The signer to use
|
||||
* @param bytecode - The bytecode to deploy
|
||||
* @param encodedArgs - The encoded constructor args to use
|
||||
* @param create2FactoryAddress - The create2 factory address to use
|
||||
*/
|
||||
export async function deployContractDeterministic(
|
||||
signer: Signer,
|
||||
|
||||
@@ -15,10 +15,10 @@ import { getInitBytecodeWithSalt } from "./getInitBytecodeWithSalt";
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @param type signer
|
||||
* @param bytecode
|
||||
* @param encodedArgs
|
||||
* @param create2FactoryAddress
|
||||
* @param signer - The signer to use
|
||||
* @param bytecode - The bytecode to deploy
|
||||
* @param encodedArgs - The encoded constructor args to use
|
||||
* @param create2FactoryAddress - The create2 factory address to use
|
||||
*/
|
||||
export async function deployContractDeterministicRaw(
|
||||
signer: Signer,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { getCreate2FactoryDeploymentInfo } from "./getCreate2FactoryDeploymentIn
|
||||
* Ref: https://github.com/Arachnid/deterministic-deployment-proxy
|
||||
*
|
||||
* @public
|
||||
* @param signer
|
||||
* @param signer - The signer to use
|
||||
*/
|
||||
export async function deployCreate2Factory(
|
||||
signer: Signer,
|
||||
|
||||
@@ -24,11 +24,11 @@ import { AbiInput } from "../../schema/contracts/custom";
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @param bytecode
|
||||
* @param abi
|
||||
* @param signer
|
||||
* @param constructorArgs
|
||||
* @param saltForCreate2
|
||||
* @param bytecode - The bytecode to deploy
|
||||
* @param abi - The abi to use
|
||||
* @param signer - The signer to use
|
||||
* @param constructorArgs - The constructor args to use
|
||||
* @param saltForCreate2 - The salt to use
|
||||
*/
|
||||
export async function directDeployDeterministic(
|
||||
bytecode: string,
|
||||
@@ -115,11 +115,11 @@ export async function directDeployDeterministic(
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @param publishMetadataUri
|
||||
* @param signer
|
||||
* @param storage
|
||||
* @param constructorArgs
|
||||
* @param saltForCreate2
|
||||
* @param publishMetadataUri - The metadata uri to use
|
||||
* @param signer - The signer to use
|
||||
* @param storage - The storage to use
|
||||
* @param constructorArgs - The constructor args to use
|
||||
* @param saltForCreate2 - The salt to use
|
||||
*/
|
||||
export async function directDeployDeterministicWithUri(
|
||||
publishMetadataUri: string,
|
||||
@@ -153,16 +153,16 @@ export async function directDeployDeterministicWithUri(
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @param contractName
|
||||
* @param publisherAddress
|
||||
* @param contractVersion
|
||||
* @param constructorArgs
|
||||
* @param signer
|
||||
* @param storage
|
||||
* @param clientId
|
||||
* @param secretKey
|
||||
* @param constructorArgs
|
||||
* @param saltForCreate2
|
||||
* @param contractName - The name of the contract to deploy
|
||||
* @param publisherAddress - The publisher address to use
|
||||
* @param contractVersion - The contract version to use
|
||||
* @param constructorArgs - The constructor args to use
|
||||
* @param signer - The signer to use
|
||||
* @param storage - The storage to use
|
||||
* @param clientId - The client id to use
|
||||
* @param secretKey - The secret key to use
|
||||
* @param constructorArgs - The constructor args to use
|
||||
* @param saltForCreate2 - The salt to use
|
||||
*/
|
||||
export async function directDeployDeterministicPublished(
|
||||
contractName: string,
|
||||
|
||||
@@ -11,7 +11,7 @@ import { getCreate2FactoryDeploymentInfo } from "./getCreate2FactoryDeploymentIn
|
||||
* https://github.com/Arachnid/deterministic-deployment-proxy/blob/master/source/deterministic-deployment-proxy.yul
|
||||
*
|
||||
* @internal
|
||||
* @param provider
|
||||
* @param provider - The provider to use
|
||||
*/
|
||||
export async function getCreate2FactoryAddress(
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -6,8 +6,8 @@ import { getKeylessTxn } from "./getKeylessTxn";
|
||||
/**
|
||||
*
|
||||
* @public
|
||||
* @param transaction: Unsigned transaction object
|
||||
* @param signature: Signature bytes
|
||||
* @param transaction - Unsigned transaction object
|
||||
* @param signature - Signature bytes
|
||||
*/
|
||||
export function getCreate2FactoryDeploymentInfo(
|
||||
chainId: number,
|
||||
|
||||
@@ -23,10 +23,10 @@ import invariant from "tiny-invariant";
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @param metadataUri
|
||||
* @param storage
|
||||
* @param provider
|
||||
* @param create2Factory
|
||||
* @param metadataUri - The metadata uri to use
|
||||
* @param storage - The storage to use
|
||||
* @param provider - The provider to use
|
||||
* @param create2Factory - The create2 factory to use
|
||||
*/
|
||||
export async function getDeploymentInfo(
|
||||
metadataUri: string,
|
||||
|
||||
+3
-3
@@ -15,9 +15,9 @@ import { getDeploymentInfo } from "./getDeploymentInfo";
|
||||
/**
|
||||
*
|
||||
* @internal
|
||||
* @param contractName
|
||||
* @param chainId
|
||||
* @param storage
|
||||
* @param contractName - The name of the contract to predict the address for
|
||||
* @param chainId - The chain id to use
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function getEncodedConstructorParamsForThirdwebContract(
|
||||
contractName: string,
|
||||
|
||||
@@ -7,8 +7,8 @@ import { getSaltHash } from "./getSaltHash";
|
||||
* This hex data is intended to be sent to the CREATE2 factory address
|
||||
*
|
||||
* @internal
|
||||
* @param bytecode: Creation bytecode of the contract to deploy
|
||||
* @param encodedArgs: Abi-encoded constructor params
|
||||
* @param bytecode - Creation bytecode of the contract to deploy
|
||||
* @param encodedArgs - Abi-encoded constructor params
|
||||
*/
|
||||
export function getInitBytecodeWithSalt(
|
||||
bytecode: string,
|
||||
|
||||
@@ -5,8 +5,8 @@ import { KeylessTransaction } from "../../types/any-evm/deploy-data";
|
||||
* Generate a transaction to be sent with a keyless signer.
|
||||
*
|
||||
* @public
|
||||
* @param transaction: Unsigned transaction object
|
||||
* @param signature: Signature bytes
|
||||
* @param transaction - Unsigned transaction object
|
||||
* @param signature - Signature bytes
|
||||
*/
|
||||
export function getKeylessTxn(
|
||||
transaction: UnsignedTransaction,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { utils } from "ethers";
|
||||
* Note: Salt component is generated by appending `tw` (thirdweb) to the bytecode
|
||||
*
|
||||
* @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 {
|
||||
const bytecodePrefixed = bytecode.startsWith("0x")
|
||||
|
||||
@@ -7,10 +7,10 @@ import { predictThirdwebContractAddress } from "./predictThirdwebContractAddress
|
||||
/**
|
||||
*
|
||||
* @public
|
||||
* @param contractName
|
||||
* @param chainId
|
||||
* @param storage
|
||||
* @param clientId
|
||||
* @param contractName - The name of the contract to predict the address for
|
||||
* @param chainId - The chain id to use
|
||||
* @param storage - The storage to use
|
||||
* @param clientId - The client id to use
|
||||
*/
|
||||
export async function getThirdwebContractAddress(
|
||||
contractName: string,
|
||||
|
||||
@@ -4,8 +4,8 @@ import { providers } from "ethers";
|
||||
* Check if a contract exists at the given address
|
||||
*
|
||||
* @internal
|
||||
* @param address
|
||||
* @param provider
|
||||
* @param address - The address to check
|
||||
* @param provider - The provider to use
|
||||
*/
|
||||
export async function isContractDeployed(
|
||||
address: string,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { matchError } from "../any-evm-constants";
|
||||
* Ref: https://eips.ethereum.org/EIPS/eip-155
|
||||
*
|
||||
* @internal
|
||||
* @param provider
|
||||
* @param provider - The provider to use
|
||||
*/
|
||||
export async function isEIP155Enforced(
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -13,9 +13,9 @@ import { fetchAndCacheDeployMetadata } from "./fetchAndCacheDeployMetadata";
|
||||
/**
|
||||
*
|
||||
* @public
|
||||
* @param contractName
|
||||
* @param chainId
|
||||
* @param storage
|
||||
* @param contractName - The name of the contract to predict the address for
|
||||
* @param chainId - The chain id to use
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function predictThirdwebContractAddress(
|
||||
contractName: string,
|
||||
|
||||
@@ -3,8 +3,8 @@ import { utils, constants } from "ethers";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param quantity
|
||||
* @param tokenDecimals
|
||||
* @param quantity - The quantity to convert
|
||||
* @param tokenDecimals - The token decimals to use
|
||||
*/
|
||||
export function convertQuantityToBigNumber(
|
||||
quantity: Quantity,
|
||||
|
||||
@@ -2,8 +2,8 @@ import { type BigNumberish, constants, utils } from "ethers";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param bn
|
||||
* @param tokenDecimals
|
||||
* @param bn - The big number to convert
|
||||
* @param tokenDecimals - The token decimals to use
|
||||
*/
|
||||
export function convertToReadableQuantity(
|
||||
bn: BigNumberish,
|
||||
|
||||
@@ -7,9 +7,9 @@ import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param merkleRoot
|
||||
* @param merkleMetadata
|
||||
* @param storage
|
||||
* @param merkleRoot - The merkle root to fetch the snapshot for
|
||||
* @param merkleMetadata - The merkle metadata to use
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function fetchSnapshot(
|
||||
merkleRoot: string,
|
||||
|
||||
@@ -36,11 +36,11 @@ function compare(a: BigNumberish, b: BigNumberish) {
|
||||
/**
|
||||
* @internal
|
||||
* Decorates claim conditions with merkle roots from snapshots if present
|
||||
* @param claimConditionInputs
|
||||
* @param tokenDecimals
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param snapshotFormatVersion
|
||||
* @param claimConditionInputs - The claim conditions to process
|
||||
* @param tokenDecimals - The token decimals to use
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @param snapshotFormatVersion - The snapshot format version to use
|
||||
*/
|
||||
export async function processSnapshotData(
|
||||
claimConditionInputs: ClaimConditionInput[],
|
||||
@@ -76,10 +76,10 @@ export async function processSnapshotData(
|
||||
|
||||
/**
|
||||
* Converts a local SDK model to contract model
|
||||
* @param c
|
||||
* @param tokenDecimals
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param c - The condition input
|
||||
* @param tokenDecimals - The token decimals to use
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @internal
|
||||
*/
|
||||
async function convertToContractModel(
|
||||
@@ -123,11 +123,11 @@ async function convertToContractModel(
|
||||
|
||||
/**
|
||||
* Create and uploads snapshots + converts claim conditions to contract format
|
||||
* @param claimConditionInputs
|
||||
* @param tokenDecimals
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param snapshotFormatVersion
|
||||
* @param claimConditionInputs - The claim conditions to process
|
||||
* @param tokenDecimals - The token decimals to use
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @param snapshotFormatVersion - The snapshot format version to use
|
||||
* @internal
|
||||
*/
|
||||
export async function processClaimConditionInputs(
|
||||
|
||||
@@ -11,12 +11,12 @@ import { convertToReadableQuantity } from "./convertToReadableQuantity";
|
||||
|
||||
/**
|
||||
* Transforms a contract model to local model
|
||||
* @param pm
|
||||
* @param tokenDecimals
|
||||
* @param provider
|
||||
* @param merkleMetadata
|
||||
* @param storage
|
||||
* @param shouldDownloadSnapshot
|
||||
* @param pm - The contract model to transform
|
||||
* @param tokenDecimals - The token decimals to use
|
||||
* @param provider - The provider to use
|
||||
* @param merkleMetadata - The merkle metadata to use
|
||||
* @param storage - The storage to use
|
||||
* @param shouldDownloadSnapshot - Whether to download the snapshot
|
||||
* @internal
|
||||
*/
|
||||
export async function transformResultToClaimCondition(
|
||||
|
||||
@@ -10,9 +10,9 @@ import { utils } from "ethers";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param index
|
||||
* @param claimConditionInput
|
||||
* @param existingConditions
|
||||
* @param index - The index of the condition to update
|
||||
* @param claimConditionInput - The input claim condition to update
|
||||
* @param existingConditions - The existing claim conditions
|
||||
*/
|
||||
export async function updateExistingClaimConditions(
|
||||
index: number,
|
||||
|
||||
@@ -6,8 +6,8 @@ import { isNativeToken } from "./isNativeToken";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param provider
|
||||
* @param asset
|
||||
* @param provider - The provider to use
|
||||
* @param asset - The asset to fetch the metadata for
|
||||
* @returns
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -4,9 +4,9 @@ import { fetchCurrencyMetadata } from "./fetchCurrencyMetadata";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param providerOrSigner
|
||||
* @param asset
|
||||
* @param price
|
||||
* @param providerOrSigner - The provider or signer to use
|
||||
* @param asset - The asset to fetch the value for
|
||||
* @param price - The price to fetch the value for
|
||||
* @returns
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -5,9 +5,9 @@ import { fetchCurrencyMetadata } from "./fetchCurrencyMetadata";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param provider
|
||||
* @param inputPrice
|
||||
* @param currencyAddress
|
||||
* @param provider - The provider to use
|
||||
* @param inputPrice - The input price to normalize
|
||||
* @param currencyAddress - The currency address to normalize the price for
|
||||
* @returns
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -26,9 +26,9 @@ import type {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param contractType
|
||||
* @param metadata
|
||||
* @param contractURI
|
||||
* @param contractType - The contract type to get deploy arguments for
|
||||
* @param metadata - The metadata to get deploy arguments for
|
||||
* @param contractURI - The contract URI to get deploy arguments for
|
||||
* @returns
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -441,8 +441,8 @@ function parseMessageParts(regex: RegExp, raw: string): string {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param err
|
||||
* @param message
|
||||
* @param err - The error to check
|
||||
* @param message - The message to check for
|
||||
*/
|
||||
export function includesErrorMessage(err: any, message: string): boolean {
|
||||
if (!err) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import { ExtensionNotImplementedError } from "../error";
|
||||
/**
|
||||
* Checks whether the given DetectableFeature is defined
|
||||
* @internal
|
||||
* @param namespace The namespace to check
|
||||
* @param feature The corresponding feature
|
||||
* @param namespace - The namespace to check
|
||||
* @param feature - The corresponding feature
|
||||
*/
|
||||
export function assertEnabled<T extends DetectableFeature>(
|
||||
namespace: T | undefined,
|
||||
|
||||
@@ -7,8 +7,8 @@ import { isExtensionEnabled } from "./isFeatureEnabled";
|
||||
/**
|
||||
* Type guard for contractWrappers depending on passed feature name
|
||||
* @internal
|
||||
* @param contractWrapper
|
||||
* @param featureName
|
||||
* @param contractWrapper - The contract wrapper to check
|
||||
* @param featureName - The feature name to check
|
||||
*/
|
||||
export function detectContractFeature<T extends 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
|
||||
* @internal
|
||||
* @param abi
|
||||
* @param features
|
||||
* @param abi - The abi to detect features in
|
||||
* @param features - The features to detect
|
||||
* @returns the nested struct of all features and whether they're detected in the abi
|
||||
*/
|
||||
export function detectFeatures(
|
||||
@@ -51,8 +51,8 @@ export function detectFeaturesFromBytecode(
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param abi
|
||||
* @param feature
|
||||
* @param abi - The abi to check
|
||||
* @param feature - The feature to check
|
||||
*/
|
||||
function matchesAbiInterface(abi: AbiInput, feature: Feature): boolean {
|
||||
// returns true if all the functions in `interfaceToMatch` are found in `contract` (removing any duplicates)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* @internal
|
||||
* @param name
|
||||
* @param metadata
|
||||
* @param type
|
||||
* @param name - The name of the function to extract the comment from
|
||||
* @param metadata - The metadata to extract the comment from
|
||||
* @param type - The type of the function to extract the comment from
|
||||
*/
|
||||
export function extractCommentFromMetadata(
|
||||
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
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -3,8 +3,8 @@ import { extractCommentFromMetadata } from "./extractCommentFromMetadata";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param abi
|
||||
* @param metadata
|
||||
* @param abi - The abi to extract events from
|
||||
* @param metadata - The metadata to extract comments from
|
||||
*/
|
||||
export function extractEventsFromAbi(
|
||||
abi: AbiInput,
|
||||
|
||||
@@ -2,8 +2,8 @@ import { AbiInput, AbiSchema } from "../../schema/contracts/custom";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param abi
|
||||
* @param functionName
|
||||
* @param abi - The abi to extract params from
|
||||
* @param functionName - The function name to extract params from
|
||||
* @returns
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -5,8 +5,8 @@ import { fetchPreDeployMetadata } from "./fetchPreDeployMetadata";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param predeployMetadataUri
|
||||
* @param storage
|
||||
* @param predeployMetadataUri - The predeploy metadata URI to fetch
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function extractFunctions(
|
||||
predeployMetadataUri: string,
|
||||
|
||||
@@ -4,8 +4,8 @@ import { extractCommentFromMetadata } from "./extractCommentFromMetadata";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param abi
|
||||
* @param metadata
|
||||
* @param abi - The abi to extract functions from
|
||||
* @param metadata - The metadata to extract comments from
|
||||
*/
|
||||
export function extractFunctionsFromAbi(
|
||||
abi: AbiInput,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { hexToBytes } from "./hexToBytes";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param bytecode
|
||||
* @param bytecode - The bytecode to extract the IPFS hash from
|
||||
*/
|
||||
export function extractIPFSHashFromBytecode(
|
||||
bytecode: string,
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @internal
|
||||
* @param bytecode
|
||||
* @param bytecode - The bytecode to check
|
||||
*/
|
||||
export function extractMinimalProxyImplementationAddress(
|
||||
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)
|
||||
* @internal
|
||||
* @param publishMetadataUri
|
||||
* @param storage
|
||||
* @param publishMetadataUri - The publish metadata URI to fetch
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function fetchExtendedReleaseMetadata(
|
||||
publishMetadataUri: string,
|
||||
|
||||
@@ -9,8 +9,8 @@ import { fetchRawPredeployMetadata } from "./fetchRawPredeployMetadata";
|
||||
/**
|
||||
* Fetch the metadata coming from CLI, this is before deploying or releasing the contract.
|
||||
* @internal
|
||||
* @param publishMetadataUri
|
||||
* @param storage
|
||||
* @param publishMetadataUri - The publish metadata URI to fetch
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function fetchPreDeployMetadata(
|
||||
publishMetadataUri: string,
|
||||
|
||||
@@ -3,8 +3,8 @@ import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param publishMetadataUri
|
||||
* @param storage
|
||||
* @param publishMetadataUri - The publish metadata URI to fetch
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function fetchRawPredeployMetadata(
|
||||
publishMetadataUri: string,
|
||||
|
||||
@@ -3,8 +3,8 @@ import type { BaseContract } from "ethers";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param contractWrapper
|
||||
* @param functionName
|
||||
* @param contractWrapper - The contract wrapper to check
|
||||
* @param functionName - The function name to check
|
||||
*/
|
||||
export function hasFunction<TContract extends BaseContract>(
|
||||
functionName: string,
|
||||
|
||||
@@ -4,8 +4,8 @@ import { extractFunctionsFromAbi } from "./extractFunctionsFromAbi";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param contractAbi
|
||||
* @param featureAbis
|
||||
* @param contractAbi - The abi to check
|
||||
* @param featureAbis - The feature abi to check
|
||||
* @returns
|
||||
*/
|
||||
export function hasMatchingAbi(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @internal
|
||||
* @param hex
|
||||
* @param hex - The hex string to convert to bytes
|
||||
*/
|
||||
export function hexToBytes(hex: string | number) {
|
||||
hex = hex.toString(16);
|
||||
@@ -20,7 +20,7 @@ export function hexToBytes(hex: string | number) {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param hex
|
||||
* @param hex - The hex string to check
|
||||
*/
|
||||
function isHexStrict(hex: string | number) {
|
||||
return (
|
||||
|
||||
@@ -8,8 +8,8 @@ import { detectFeatures } from "./detectFeatures";
|
||||
/**
|
||||
* Checks whether the given ABI supports a given feature
|
||||
* @deprecated use isExtensionEnabled instead
|
||||
* @param abi
|
||||
* @param featureName
|
||||
* @param abi - The abi to check
|
||||
* @param featureName - The feature name to check
|
||||
*/
|
||||
export function isFeatureEnabled(
|
||||
abi: AbiInput,
|
||||
@@ -22,8 +22,8 @@ export function isFeatureEnabled(
|
||||
/**
|
||||
* Checks whether the given ABI supports a given extension
|
||||
* @public
|
||||
* @param abi
|
||||
* @param featureName
|
||||
* @param abi - The abi to check
|
||||
* @param featureName - The feature name to check
|
||||
*/
|
||||
export function isExtensionEnabled(abi: AbiInput, featureName: 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
|
||||
* @internal
|
||||
* @param features
|
||||
* @param featureName
|
||||
* @param features - The feature map to search
|
||||
* @param featureName - The feature name to search for
|
||||
*/
|
||||
function _featureEnabled(
|
||||
features: Record<string, FeatureWithEnabled>,
|
||||
|
||||
@@ -5,8 +5,8 @@ import { hasMatchingAbi } from "./hasMatchingAbi";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param contractWrapper
|
||||
* @param abi
|
||||
* @param contractWrapper - The contract wrapper to check
|
||||
* @param abi - The abi to check
|
||||
* @returns
|
||||
*/
|
||||
export function matchesPrebuiltAbi<T extends BaseContract>(
|
||||
|
||||
@@ -4,8 +4,8 @@ import { extractMinimalProxyImplementationAddress } from "./extractMinimalProxyI
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param address
|
||||
* @param provider
|
||||
* @param address - the contract address
|
||||
* @param provider - RPC provider
|
||||
*/
|
||||
export async function resolveContractUriFromAddress(
|
||||
address: string,
|
||||
@@ -25,8 +25,8 @@ export async function resolveContractUriAndBytecode(
|
||||
|
||||
/**
|
||||
* Resolve the implementation address of a proxy contract and its bytecode
|
||||
* @param address the contract address
|
||||
* @param provider RPC provider
|
||||
* @param address - the contract address
|
||||
* @param provider - RPC provider
|
||||
* @returns the implementation address and its bytecode
|
||||
*/
|
||||
export async function resolveImplementation(
|
||||
|
||||
@@ -9,8 +9,8 @@ const CONTRACT_METADATA_TIMEOUT_SEC = 2;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param compilerMetadataUri
|
||||
* @param storage
|
||||
* @param compilerMetadataUri - The compiler metadata URI to fetch
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function fetchContractMetadata(
|
||||
compilerMetadataUri: string,
|
||||
@@ -25,6 +25,10 @@ export async function fetchContractMetadata(
|
||||
`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 compilationTarget = metadata.settings.compilationTarget;
|
||||
const targets = Object.keys(compilationTarget);
|
||||
|
||||
@@ -3,8 +3,8 @@ import type { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param publishedMetadata
|
||||
* @param storage
|
||||
* @param publishedMetadata - The published metadata to fetch the sources for
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
|
||||
export async function fetchSourceFilesFromMetadata(
|
||||
|
||||
@@ -94,11 +94,11 @@ export async function isTokenApprovedForTransfer(
|
||||
/**
|
||||
* Checks if the marketplace is approved to make transfers on the assetContract
|
||||
* If not, it tries to set the approval.
|
||||
* @param contractWrapper
|
||||
* @param marketplaceAddress
|
||||
* @param assetContract
|
||||
* @param tokenId
|
||||
* @param from
|
||||
* @param contractWrapper - The contract wrapper to use
|
||||
* @param marketplaceAddress - The address of the marketplace contract
|
||||
* @param assetContract - The address of the asset contract.
|
||||
* @param tokenId - The token id of the token.
|
||||
* @param from - The address of the account that owns the token.
|
||||
*/
|
||||
export async function handleTokenApproval(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
@@ -227,7 +227,7 @@ export function validateNewListingParam(
|
||||
* Maps a contract offer to the strict interface
|
||||
*
|
||||
* @internal
|
||||
* @param offer
|
||||
* @param offer - The offer to map
|
||||
* @returns - An `Offer` object
|
||||
*/
|
||||
export async function mapOffer(
|
||||
|
||||
@@ -3,13 +3,19 @@ import { Address } from "../schema/shared/Address";
|
||||
import { resolveContractUriAndBytecode } from "./feature-detection/resolveContractUriFromAddress";
|
||||
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||
import { Contract, providers } from "ethers";
|
||||
import { fetchContractMetadata } from "./fetchContractMetadata";
|
||||
import {
|
||||
fetchContractMetadata,
|
||||
formatCompilerMetadata,
|
||||
} from "./fetchContractMetadata";
|
||||
import { getMultichainRegistryAddress } from "../constants/addresses/getMultichainRegistryAddress";
|
||||
import { getChainProvider } from "../constants/urls";
|
||||
import type { TWMultichainRegistryLogic } from "@thirdweb-dev/contracts-js";
|
||||
import { constructAbiFromBytecode } from "./feature-detection/getAllDetectedFeatures";
|
||||
import { SDKOptions } from "../schema/sdk-options";
|
||||
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
|
||||
const metadataCache: Record<string, PublishedMetadata> = {};
|
||||
@@ -33,9 +39,9 @@ function getFromCache(address: string, chainId: number) {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param address
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param address - The address to fetch the metadata for
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
*/
|
||||
export async function fetchContractMetadataFromAddress(
|
||||
address: Address,
|
||||
@@ -50,6 +56,51 @@ export async function fetchContractMetadataFromAddress(
|
||||
}
|
||||
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
|
||||
const [ipfsData, registryData] = await Promise.all([
|
||||
resolveContractUriAndBytecode(address, provider).catch(() => undefined),
|
||||
@@ -97,13 +148,6 @@ export async function fetchContractMetadataFromAddress(
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -135,9 +179,9 @@ async function getMetadataUriFromMultichainRegistry(
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param address
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param address - The address to fetch the metadata for
|
||||
* @param provider - The provider to use
|
||||
* @param storage - The storage to use
|
||||
* @returns
|
||||
*/
|
||||
export async function fetchAbiFromAddress(
|
||||
@@ -160,3 +204,7 @@ export async function fetchAbiFromAddress(
|
||||
}
|
||||
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
|
||||
/**
|
||||
* @internal
|
||||
* @param contractAddress
|
||||
* @param provider
|
||||
* @param tokenId
|
||||
* @param storage
|
||||
* @param contractAddress - the contract address
|
||||
* @param provider - the provider to use
|
||||
* @param tokenId - the token id
|
||||
* @param storage - the storage to use
|
||||
*/
|
||||
export async function fetchTokenMetadataForContract(
|
||||
contractAddress: string,
|
||||
@@ -154,8 +154,8 @@ export async function fetchTokenMetadataForContract(
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param metadata
|
||||
* @param storage
|
||||
* @param metadata - the metadata to upload
|
||||
* @param storage - the storage to use
|
||||
*/
|
||||
export async function uploadOrExtractURI(
|
||||
metadata: NFTMetadataOrUri,
|
||||
@@ -170,12 +170,12 @@ export async function uploadOrExtractURI(
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param metadatas
|
||||
* @param storage
|
||||
* @param startNumber
|
||||
* @param contractAddress
|
||||
* @param signerAddress
|
||||
* @param options
|
||||
* @param metadatas - the metadata to upload
|
||||
* @param storage - the storage to use
|
||||
* @param startNumber - the number to start the file names at
|
||||
* @param contractAddress - the contract address
|
||||
* @param signerAddress - the signer address
|
||||
* @param options - options
|
||||
*/
|
||||
export async function uploadOrExtractURIs(
|
||||
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
|
||||
* @param snapshotInput - the list of addresses to hash
|
||||
* @param tokenDecimals - the token decimals
|
||||
* @param provider
|
||||
* @param provider - the provider to use
|
||||
* @param storage - the storage to upload to
|
||||
* @param snapshotFormatVersion
|
||||
* @param snapshotFormatVersion - the snapshot format version
|
||||
* @returns the generated snapshot and URI
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@@ -47,11 +47,11 @@ const RequestStatus = {
|
||||
* storage // this could be used from the SDK instance, e.g. sdk.storage
|
||||
* );
|
||||
* ```
|
||||
* @param contractName
|
||||
* @param chainId
|
||||
* @param explorerAPIUrl
|
||||
* @param explorerAPIKey
|
||||
* @param storage
|
||||
* @param contractName - Name of the contract to verify
|
||||
* @param chainId - Chain ID of the network
|
||||
* @param explorerAPIUrl - Explorer API URL
|
||||
* @param explorerAPIKey - Explorer API Key
|
||||
* @param storage - Storage instance
|
||||
*/
|
||||
export async function verifyThirdwebPrebuiltImplementation(
|
||||
contractName: string,
|
||||
@@ -117,11 +117,11 @@ export async function verifyThirdwebPrebuiltImplementation(
|
||||
* storage // this could be used from the SDK instance, e.g. sdk.storage
|
||||
* );
|
||||
* ```
|
||||
* @param contractAddress
|
||||
* @param chainId
|
||||
* @param explorerAPIUrl
|
||||
* @param explorerAPIKey
|
||||
* @param storage
|
||||
* @param contractAddress - Address of the contract to verify
|
||||
* @param chainId - Chain ID of the network
|
||||
* @param explorerAPIUrl - Explorer API URL
|
||||
* @param explorerAPIKey - Explorer API Key
|
||||
* @param storage - Storage instance
|
||||
*/
|
||||
export async function verify(
|
||||
contractAddress: string,
|
||||
@@ -236,9 +236,9 @@ export async function verify(
|
||||
* @internal
|
||||
*
|
||||
* Check status of the contract submitted for verification to the explorer
|
||||
* @param explorerAPIUrl
|
||||
* @param explorerAPIKey
|
||||
* @param guid
|
||||
* @param explorerAPIUrl - Explorer API URL
|
||||
* @param explorerAPIKey - Explorer API Key
|
||||
* @param guid - GUID of the contract verification
|
||||
*/
|
||||
export async function checkVerificationStatus(
|
||||
explorerAPIUrl: string,
|
||||
@@ -271,12 +271,12 @@ export async function checkVerificationStatus(
|
||||
* @internal
|
||||
*
|
||||
* Check if the contract is already verified on etherscan
|
||||
* @param contractAddress
|
||||
* @param chainId
|
||||
* @param explorerAPIUrl
|
||||
* @param explorerAPIKey
|
||||
* ClientId get from https://thirdweb.com/create-api-key
|
||||
* @param clientId
|
||||
* @param contractAddress - Address of the contract to verify
|
||||
* @param chainId - Chain ID of the network
|
||||
* @param explorerAPIUrl - Explorer API URL
|
||||
* @param explorerAPIKey - Explorer API Key
|
||||
*
|
||||
* @param clientId - Client ID: Get from https://thirdweb.com/create-api-key
|
||||
*/
|
||||
export async function isVerifiedOnEtherscan(
|
||||
contractAddress: string,
|
||||
@@ -320,12 +320,12 @@ export async function isVerifiedOnEtherscan(
|
||||
* @internal
|
||||
*
|
||||
* Fetch the deploy transaction from the given contract address and extract the encoded constructor parameters
|
||||
* @param explorerAPIUrl
|
||||
* @param explorerAPIKey
|
||||
* @param contractAddress
|
||||
* @param abi
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param explorerAPIUrl - Explorer API URL
|
||||
* @param explorerAPIKey - Explorer API Key
|
||||
* @param contractAddress - Address of the contract to verify
|
||||
* @param abi - ABI of the contract to verify
|
||||
* @param provider - Provider instance
|
||||
* @param storage - Storage instance
|
||||
*/
|
||||
async function fetchConstructorParams(
|
||||
explorerAPIUrl: string,
|
||||
@@ -441,9 +441,9 @@ async function fetchConstructorParams(
|
||||
* @internal
|
||||
*
|
||||
* Fetches the Publish metadata on the ContractPublisher registry (on polygon) for the given contract address (on any chain)
|
||||
* @param contractAddress
|
||||
* @param provider
|
||||
* @param storage
|
||||
* @param contractAddress - Address of the contract to verify
|
||||
* @param provider - Provider instance
|
||||
* @param storage - Storage instance
|
||||
* @returns
|
||||
*/
|
||||
async function fetchDeployBytecodeFromPublishedContractMetadata(
|
||||
|
||||
@@ -15,7 +15,7 @@ export type Semver = {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param version
|
||||
* @param version - The version to convert to a Semver
|
||||
*/
|
||||
export function toSemver(version: string): Semver {
|
||||
if (version.length > MAX_LENGTH) {
|
||||
@@ -41,8 +41,8 @@ export function toSemver(version: string): Semver {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param current
|
||||
* @param next
|
||||
* @param current - The current version
|
||||
* @param next - The next version
|
||||
*/
|
||||
export function isIncrementalVersion(current: string, next: string) {
|
||||
const currentSemver = toSemver(current);
|
||||
|
||||
@@ -4,8 +4,8 @@ import { SUPPORTED_CHAIN_ID } from "../chains/SUPPORTED_CHAIN_ID";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param chainId
|
||||
* @param contractType
|
||||
* @param chainId - The chainId to get the approved implementation for
|
||||
* @param contractType - The contract type to get the approved implementation for
|
||||
*/
|
||||
export function getApprovedImplementation(
|
||||
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
|
||||
*/
|
||||
export const PREBUILT_CONTRACTS_MAP = /* @__PURE__ */ {
|
||||
|
||||
@@ -389,9 +389,9 @@ export class NFTDrop extends StandardErc721<PrebuiltNFTDrop> {
|
||||
/**
|
||||
* 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.
|
||||
* @param destinationAddress
|
||||
* @param quantity
|
||||
* @param checkERC20Allowance
|
||||
* @param destinationAddress - Address you want to send the token to
|
||||
* @param quantity - 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
|
||||
*
|
||||
* @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.
|
||||
* 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 quantity
|
||||
* @param checkERC20Allowance
|
||||
* @param destinationAddress - Address you want to send the token to
|
||||
* @param quantity - 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
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* @example
|
||||
* ```javascript
|
||||
* ```javascript
|
||||
* const tx = await contract.accountFactory.createAccount(admin, extraData);
|
||||
* const receipt = tx.receipt();
|
||||
* const accountAddress = tx.address;
|
||||
|
||||
@@ -705,8 +705,8 @@ export class AccountPermissions implements DetectableFeature {
|
||||
* - Add new scoped :check:
|
||||
* - Remove current scoped :check:
|
||||
* - Update current scoped :check:
|
||||
* - Current admin -> new scoped :check:
|
||||
* - Current scoped -> new admin :check:
|
||||
* - Current admin - new scoped :check:
|
||||
* - Current scoped - new admin :check:
|
||||
**/
|
||||
|
||||
// No duplicate signers in input!
|
||||
|
||||
@@ -67,9 +67,9 @@ export class Airdrop1155<T extends IAirdropERC1155 | AirdropERC1155>
|
||||
* // - array containing failed drops, if any
|
||||
*
|
||||
* ```
|
||||
* @param tokenAddress
|
||||
* @param tokenOwner
|
||||
* @param contents
|
||||
* @param tokenAddress - Address of the ERC1155 token being airdropped
|
||||
* @param tokenOwner - Address of the owner of the tokens being airdropped
|
||||
* @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)
|
||||
* @twfeature AirdropERC1155
|
||||
|
||||
@@ -59,9 +59,9 @@ export class Airdrop20<T extends IAirdropERC20 | AirdropERC20>
|
||||
* // - array containing failed drops, if any
|
||||
*
|
||||
* ```
|
||||
* @param tokenAddress
|
||||
* @param tokenOwner
|
||||
* @param contents
|
||||
* @param tokenAddress - Address of the ERC20 token being airdropped
|
||||
* @param tokenOwner - Address of the owner of the tokens being airdropped
|
||||
* @param contents - Array of airdrop contents
|
||||
*
|
||||
* @returns an array of recipients for who the airdrop failed (empty means all transfers were successful)
|
||||
* @twfeature AirdropERC20
|
||||
|
||||
@@ -62,9 +62,9 @@ export class Airdrop721<T extends IAirdropERC721 | AirdropERC721>
|
||||
* // - array containing failed drops, if any
|
||||
*
|
||||
* ```
|
||||
* @param tokenAddress
|
||||
* @param tokenOwner
|
||||
* @param contents
|
||||
* @param tokenAddress - Address of the ERC721 token being airdropped
|
||||
* @param tokenOwner - Address of the owner of the tokens being airdropped
|
||||
* @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)
|
||||
* @twfeature AirdropERC721
|
||||
|
||||
@@ -80,7 +80,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param metadataUri
|
||||
* @param metadataUri - URI of the contract metadata
|
||||
*/
|
||||
public async extractConstructorParams(
|
||||
metadataUri: string,
|
||||
@@ -90,7 +90,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param predeployMetadataUri
|
||||
* @param predeployMetadataUri - URI of the predeploy metadata
|
||||
*/
|
||||
public async extractFunctions(
|
||||
predeployMetadataUri: string,
|
||||
@@ -100,7 +100,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param predeployUri
|
||||
* @param predeployUri - URI of the predeploy metadata
|
||||
*/
|
||||
public async fetchCompilerMetadataFromPredeployURI(
|
||||
predeployUri: string,
|
||||
@@ -110,8 +110,8 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param prepublishUri
|
||||
* @param publisherAddress
|
||||
* @param prepublishUri - URI of the prepublish metadata
|
||||
* @param publisherAddress - Address of the publisher
|
||||
*/
|
||||
public async fetchPrePublishMetadata(
|
||||
prepublishUri: string,
|
||||
@@ -137,7 +137,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param address
|
||||
* @param address - Address of the contract
|
||||
*/
|
||||
public async fetchCompilerMetadataFromAddress(
|
||||
address: AddressOrEns,
|
||||
@@ -154,7 +154,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
/**
|
||||
* @internal
|
||||
* Get the full information about a published contract
|
||||
* @param contract
|
||||
* @param contract - Published contract
|
||||
*/
|
||||
public async fetchPublishedContractInfo(
|
||||
contract: PublishedContract,
|
||||
@@ -170,7 +170,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param publishedMetadataUri
|
||||
* @param publishedMetadataUri - URI of the published metadata
|
||||
*/
|
||||
public async fetchFullPublishMetadata(
|
||||
publishedMetadataUri: string,
|
||||
@@ -182,7 +182,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
* @internal
|
||||
* // 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
|
||||
* @param compilerMetadataUri
|
||||
* @param compilerMetadataUri - URI of the compiler metadata
|
||||
*/
|
||||
public async resolvePublishMetadataFromCompilerMetadata(
|
||||
compilerMetadataUri: string,
|
||||
@@ -219,7 +219,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* Fetch all sources for a contract from its address
|
||||
* @param address
|
||||
* @param address - Address of the contract
|
||||
*/
|
||||
public async fetchContractSourcesFromAddress(
|
||||
address: AddressOrEns,
|
||||
@@ -233,7 +233,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* Fetch ABI from a contract, or undefined if not found
|
||||
* @param address
|
||||
* @param address - Address of the contract
|
||||
*/
|
||||
public async fetchContractAbiFromAddress(
|
||||
address: AddressOrEns,
|
||||
@@ -249,7 +249,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param profileMetadata
|
||||
* @param profileMetadata - Profile metadata
|
||||
*/
|
||||
updatePublisherProfile = /* @__PURE__ */ buildTransactionFunction(
|
||||
async (profileMetadata: ProfileMetadataInput) => {
|
||||
@@ -268,7 +268,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param publisherAddress
|
||||
* @param publisherAddress - Address of the publisher
|
||||
*/
|
||||
public async getPublisherProfile(
|
||||
publisherAddress: AddressOrEns,
|
||||
@@ -287,7 +287,7 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param publisherAddress
|
||||
* @param publisherAddress - Address of the publisher
|
||||
*/
|
||||
public async getAll(
|
||||
publisherAddress: AddressOrEns,
|
||||
@@ -314,8 +314,8 @@ export class ContractPublisher extends RPCConnectionHandler {
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param publisherAddress
|
||||
* @param contractId
|
||||
* @param publisherAddress - Address of the publisher
|
||||
* @param contractId - ID of the contract
|
||||
*/
|
||||
public async getAllVersions(
|
||||
publisherAddress: AddressOrEns,
|
||||
|
||||
@@ -51,9 +51,9 @@ export class ContractVerifier extends RPCConnectionHandler {
|
||||
* explorerAPIKey,
|
||||
* );
|
||||
* ```
|
||||
* @param contractName
|
||||
* @param explorerAPIUrl
|
||||
* @param explorerAPIKey
|
||||
* @param contractName - Name of the contract to verify
|
||||
* @param explorerAPIUrl - Explorer API URL
|
||||
* @param explorerAPIKey - Explorer API key
|
||||
*/
|
||||
public async verifyThirdwebContract(
|
||||
contractName: string,
|
||||
@@ -105,9 +105,9 @@ export class ContractVerifier extends RPCConnectionHandler {
|
||||
* explorerAPIKey,
|
||||
* );
|
||||
* ```
|
||||
* @param contractAddress
|
||||
* @param explorerAPIUrl
|
||||
* @param explorerAPIKey
|
||||
* @param contractAddress - Address of the contract to verify
|
||||
* @param explorerAPIUrl - Explorer API URL
|
||||
* @param explorerAPIKey - Explorer API key
|
||||
*/
|
||||
public async verifyContract(
|
||||
contractAddress: string,
|
||||
|
||||
@@ -189,8 +189,8 @@ export class ContractWrapper<
|
||||
|
||||
/**
|
||||
*
|
||||
* @param functionName The function name on the contract to call
|
||||
* @param args The arguments to be passed to the functionName
|
||||
* @param functionName - The function name on the contract to call
|
||||
* @param args - The arguments to be passed to the functionName
|
||||
* @returns The return value of the function call
|
||||
*/
|
||||
public async read<
|
||||
|
||||
@@ -554,7 +554,7 @@ export class DropClaimConditions<
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public async getSupplyClaimedByWallet(
|
||||
@@ -892,9 +892,9 @@ export class DropClaimConditions<
|
||||
/**
|
||||
* 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.
|
||||
* @param destinationAddress
|
||||
* @param quantity
|
||||
* @param options
|
||||
* @param destinationAddress - The address to claim to
|
||||
* @param quantity - The quantity to claim
|
||||
* @param options - Options to override the claim transaction
|
||||
*
|
||||
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
||||
*/
|
||||
|
||||
@@ -538,7 +538,7 @@ export class DropErc1155ClaimConditions<
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public async getSupplyClaimedByWallet(
|
||||
|
||||
@@ -89,7 +89,7 @@ export class Erc20ClaimableWithConditions implements DetectableFeature {
|
||||
* @param destinationAddress - Address you want to send the token to
|
||||
* @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 claimData
|
||||
* @param claimData - Optional, data to pass to the claim function
|
||||
* @returns - The transaction receipt
|
||||
*/
|
||||
to = /* @__PURE__ */ buildTransactionFunction(
|
||||
|
||||
@@ -531,7 +531,7 @@ export class Erc20<
|
||||
* @param destinationAddress - Address you want to send the token to
|
||||
* @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 claimData
|
||||
* @param claimData - Optional, claim data
|
||||
* @returns - The transaction receipt
|
||||
* @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1
|
||||
*/
|
||||
@@ -562,7 +562,7 @@ export class Erc20<
|
||||
* @param destinationAddress - Address you want to send the token to
|
||||
* @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 claimData
|
||||
* @param claimData - Optional, claim data
|
||||
* @returns - The transaction receipt
|
||||
* @twfeature ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1
|
||||
*/
|
||||
@@ -638,7 +638,7 @@ export class Erc20<
|
||||
/**
|
||||
* returns the wei amount from a token amount
|
||||
* @internal
|
||||
* @param amount
|
||||
* @param amount - The token amount
|
||||
*/
|
||||
public async normalizeAmount(amount: Amount): Promise<BigNumber> {
|
||||
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 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
|
||||
*/
|
||||
to = /* @__PURE__ */ buildTransactionFunction(
|
||||
|
||||
@@ -815,7 +815,7 @@ export class Erc721<
|
||||
*
|
||||
* @param destinationAddress - Address you want to send the token to
|
||||
* @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
|
||||
* @twfeature ERC721ClaimCustom | ERC721ClaimPhasesV2 | ERC721ClaimPhasesV1 | ERC721ClaimConditionsV2 | ERC721ClaimConditionsV1 | ERC721ClaimZora
|
||||
*/
|
||||
@@ -848,9 +848,9 @@ export class Erc721<
|
||||
/**
|
||||
* 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.
|
||||
* @param destinationAddress
|
||||
* @param quantity
|
||||
* @param options
|
||||
* @param destinationAddress - Address you want to send the token to
|
||||
* @param quantity - Quantity of the tokens you want to claim
|
||||
* @param options - optional claim options
|
||||
*
|
||||
* @deprecated Use `contract.erc721.claim.prepare(...args)` instead
|
||||
* @twfeature ERC721ClaimCustom | ERC721ClaimPhasesV2 | ERC721ClaimPhasesV1 | ERC721ClaimConditionsV2 | ERC721ClaimConditionsV1
|
||||
|
||||
@@ -214,9 +214,9 @@ export class ContractFactory extends ContractWrapper<TWFactory> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param contractType
|
||||
* @param metadata
|
||||
* @param contractURI
|
||||
* @param contractType - the contract type to deploy
|
||||
* @param metadata - the metadata for the contract
|
||||
* @param contractURI - the contract URI
|
||||
* @returns
|
||||
* @internal
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user