Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c97e51b855 | ||
|
|
e10173bf8a | ||
|
|
dbfa73d75a | ||
|
|
1b1212d9fb | ||
|
|
065f85bf71 | ||
|
|
09bafa9aeb | ||
|
|
fe30c88cc3 | ||
|
|
3a9538259c | ||
|
|
0c730e57e0 | ||
|
|
33c9f6b1ab | ||
|
|
2346396bdf | ||
|
|
de5ebc9093 | ||
|
|
42c4c33d30 |
@@ -1,5 +1,12 @@
|
||||
# @thirdweb-dev/auth
|
||||
|
||||
## 4.1.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
|
||||
- @thirdweb-dev/wallets@2.3.0
|
||||
|
||||
## 4.1.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/auth",
|
||||
"version": "4.1.16",
|
||||
"version": "4.1.17",
|
||||
"main": "dist/thirdweb-dev-auth.cjs.js",
|
||||
"module": "dist/thirdweb-dev-auth.esm.js",
|
||||
"browser": {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# thirdweb
|
||||
|
||||
## 0.13.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
|
||||
- @thirdweb-dev/wallets@2.3.0
|
||||
- @thirdweb-dev/auth@4.1.17
|
||||
|
||||
## 0.13.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "thirdweb",
|
||||
"main": "dist/cli/index.js",
|
||||
"version": "0.13.24",
|
||||
"version": "0.13.25",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/cli",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @thirdweb-dev/react-core
|
||||
|
||||
## 4.1.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
|
||||
- @thirdweb-dev/wallets@2.3.0
|
||||
- @thirdweb-dev/auth@4.1.17
|
||||
|
||||
## 4.1.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-core",
|
||||
"version": "4.1.14",
|
||||
"version": "4.1.15",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-core",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -3,9 +3,7 @@ import type {
|
||||
AirdropInput,
|
||||
Amount,
|
||||
Erc721,
|
||||
Erc721Mintable,
|
||||
Erc1155,
|
||||
Erc1155Mintable,
|
||||
ListingType,
|
||||
NFTMetadataInput,
|
||||
Price,
|
||||
@@ -150,9 +148,9 @@ export type MintNFTParams = {
|
||||
*
|
||||
*/
|
||||
export type MintNFTReturnType<TContract> = TContract extends Erc721
|
||||
? Awaited<ReturnType<Erc721Mintable["to"]>>
|
||||
? Awaited<ReturnType<Erc721["mintTo"]>>
|
||||
: TContract extends Erc1155
|
||||
? Awaited<ReturnType<Erc1155Mintable["to"]>>
|
||||
? Awaited<ReturnType<Erc1155["mintTo"]>>
|
||||
: never;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# @thirdweb-dev/react-native-compat
|
||||
|
||||
## 0.5.0
|
||||
|
||||
## 0.4.14
|
||||
|
||||
## 0.4.13
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native-compat",
|
||||
"description": "Shims for Thirdweb in React Native Projects",
|
||||
"version": "0.4.14",
|
||||
"version": "0.5.0",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native-compat",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @thirdweb-dev/react-native
|
||||
|
||||
## 0.5.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#2018](https://github.com/thirdweb-dev/js/pull/2018) [`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba) Thanks [@iketw](https://github.com/iketw)! - Enforces passing an encryption key for custom jwt auth
|
||||
|
||||
```typescript
|
||||
const embedded = useEmbeddedWallet();
|
||||
|
||||
embedded.connect({
|
||||
jwt: "<token>",
|
||||
encryptionKey: "<my-key>",
|
||||
strategy: "jwt",
|
||||
});
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#2072](https://github.com/thirdweb-dev/js/pull/2072) [`2346396b`](https://github.com/thirdweb-dev/js/commit/2346396bdffeed169cdfc15839bfb42d87f24303) Thanks [@iketw](https://github.com/iketw)! - Adds analytics nonce to embedded wallet
|
||||
|
||||
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
|
||||
- @thirdweb-dev/[email protected]
|
||||
- @thirdweb-dev/[email protected]
|
||||
|
||||
## 0.4.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react-native",
|
||||
"version": "0.4.14",
|
||||
"version": "0.5.0",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react-native",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -29,6 +29,7 @@ import {
|
||||
EWS_VERSION_HEADER,
|
||||
ROUTE_AUTH_JWT_CALLBACK,
|
||||
ROUTE_HEADLESS_OAUTH_LOGIN,
|
||||
THIRDWEB_SESSION_NONCE_HEADER,
|
||||
} from "./helpers/constants";
|
||||
import { AuthOptions, OauthOption, VerifiedTokenResponse } from "../types";
|
||||
import { InAppBrowser } from "react-native-inappbrowser-reborn";
|
||||
@@ -38,6 +39,7 @@ import {
|
||||
reactNativePackageVersion,
|
||||
} from "../../../../utils/version";
|
||||
import { BUNDLE_ID_HEADER } from "../../../../constants/headers";
|
||||
import { ANALYTICS } from "./helpers/analytics";
|
||||
|
||||
export async function sendVerificationEmail(options: {
|
||||
email: string;
|
||||
@@ -189,6 +191,7 @@ export async function socialLogin(oauthOptions: OauthOption, clientId: string) {
|
||||
headers: {
|
||||
[EWS_VERSION_HEADER]: reactNativePackageVersion,
|
||||
[BUNDLE_ID_HEADER]: appBundleId,
|
||||
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -271,6 +274,7 @@ export async function customJwt(authOptions: AuthOptions, clientId: string) {
|
||||
"Content-Type": "application/json",
|
||||
[EWS_VERSION_HEADER]: reactNativePackageVersion,
|
||||
[BUNDLE_ID_HEADER]: appBundleId,
|
||||
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
jwt: jwt,
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { getRandomString } from "./getRandomValues";
|
||||
|
||||
export const ANALYTICS = {
|
||||
nonce: getRandomString(16),
|
||||
};
|
||||
+5
@@ -8,6 +8,7 @@ import {
|
||||
ROUTE_VALIDATE_USER_MANAGED_OTP,
|
||||
ROUTE_IS_VALID_USER_MANAGED_OTP,
|
||||
EWS_VERSION_HEADER,
|
||||
THIRDWEB_SESSION_NONCE_HEADER,
|
||||
} from "../constants";
|
||||
import { getAuthTokenClient } from "../storage/local";
|
||||
import {
|
||||
@@ -24,6 +25,7 @@ import {
|
||||
reactNativePackageVersion,
|
||||
} from "../../../../../../utils/version";
|
||||
import { BUNDLE_ID_HEADER } from "../../../../../../constants/headers";
|
||||
import { ANALYTICS } from "../analytics";
|
||||
|
||||
const EMBEDDED_WALLET_TOKEN_HEADER = "embedded-wallet-token";
|
||||
const PAPER_CLIENT_ID_HEADER = "x-thirdweb-client-id";
|
||||
@@ -31,6 +33,7 @@ const HEADERS = {
|
||||
"Content-Type": "application/json",
|
||||
[BUNDLE_ID_HEADER]: appBundleId,
|
||||
[EWS_VERSION_HEADER]: reactNativePackageVersion,
|
||||
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
|
||||
};
|
||||
|
||||
export const verifyClientId = async (clientId: string) => {
|
||||
@@ -68,6 +71,7 @@ export const authFetchEmbeddedWalletUser = async (
|
||||
[BUNDLE_ID_HEADER]: appBundleId,
|
||||
[PAPER_CLIENT_ID_HEADER]: clientId,
|
||||
[EWS_VERSION_HEADER]: reactNativePackageVersion,
|
||||
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
|
||||
}
|
||||
: {
|
||||
Authorization: `Bearer ${EMBEDDED_WALLET_TOKEN_HEADER}:${
|
||||
@@ -76,6 +80,7 @@ export const authFetchEmbeddedWalletUser = async (
|
||||
[BUNDLE_ID_HEADER]: appBundleId,
|
||||
[PAPER_CLIENT_ID_HEADER]: clientId,
|
||||
[EWS_VERSION_HEADER]: reactNativePackageVersion,
|
||||
[THIRDWEB_SESSION_NONCE_HEADER]: ANALYTICS.nonce,
|
||||
};
|
||||
return fetch(url, params);
|
||||
};
|
||||
|
||||
+1
-8
@@ -4,7 +4,7 @@ import {
|
||||
COGNITO_APP_CLIENT_ID,
|
||||
COGNITO_USER_POOL_ID,
|
||||
} from "../constants";
|
||||
import { getRandomValues } from "../getRandomValues";
|
||||
import { getRandomString } from "../getRandomValues";
|
||||
|
||||
Amplify.configure({
|
||||
Auth: {
|
||||
@@ -25,13 +25,6 @@ export async function cognitoEmailSignUp(email: string, clientId: string) {
|
||||
await Auth.signOut();
|
||||
}
|
||||
|
||||
function getRandomString(bytes: number) {
|
||||
const randomValues = getRandomValues(new Uint8Array(bytes));
|
||||
return Array.from(randomValues)
|
||||
.map((nr) => nr.toString(16).padStart(2, "0"))
|
||||
.join("");
|
||||
}
|
||||
|
||||
export async function cognitoEmailSignIn(email: string, clientId: string) {
|
||||
const cognitoUser = await Auth.signIn(`${email}:email:${clientId}`);
|
||||
return cognitoUser;
|
||||
|
||||
+2
-26
@@ -128,14 +128,12 @@ async function getRecoveryCode(
|
||||
RecoveryShareManagement.CLOUD_MANAGED
|
||||
) {
|
||||
if (storedToken.authProvider === AuthProvider.CUSTOM_JWT) {
|
||||
// derive sub here
|
||||
const code = extractSubFromJwt(storedToken.jwtToken);
|
||||
if (!code) {
|
||||
if (!recoveryCode) {
|
||||
throw new Error(
|
||||
`GetRecoveryCode error: ${ErrorMessages.missingRecoveryCode}`,
|
||||
);
|
||||
}
|
||||
return code;
|
||||
return recoveryCode;
|
||||
} else {
|
||||
try {
|
||||
const code = await getCognitoRecoveryPassword(clientId);
|
||||
@@ -156,25 +154,3 @@ async function getRecoveryCode(
|
||||
throw new Error("Invalid recovery share management option");
|
||||
}
|
||||
}
|
||||
|
||||
function extractSubFromJwt(jwtToken: string): string | undefined {
|
||||
const parts = jwtToken.split(".");
|
||||
if (parts.length !== 3) {
|
||||
throw new Error("Invalid JWT format.");
|
||||
}
|
||||
|
||||
const encodedPayload = parts[1];
|
||||
if (!encodedPayload) {
|
||||
throw new Error("Invalid JWT format.");
|
||||
}
|
||||
const decodedPayload = Buffer.from(encodedPayload, "base64").toString("utf8");
|
||||
|
||||
try {
|
||||
const payloadObject = JSON.parse(decodedPayload);
|
||||
if (payloadObject && payloadObject.sub) {
|
||||
return payloadObject.sub;
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error("Error parsing JWT payload as JSON.");
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -13,6 +13,7 @@ export const RECOVERY_SHARE_INDEX = RECOVERY_SHARE_ID - 1;
|
||||
export const AWS_REGION = "us-west-2";
|
||||
|
||||
export const EWS_VERSION_HEADER = "x-embedded-wallet-version";
|
||||
export const THIRDWEB_SESSION_NONCE_HEADER = "x-session-nonce";
|
||||
|
||||
export const COGNITO_USER_POOL_ID = "us-west-2_UFwLcZIpq";
|
||||
export const COGNITO_APP_CLIENT_ID = "2e02ha2ce6du13ldk8pai4h3d0";
|
||||
|
||||
+7
@@ -11,3 +11,10 @@ export function getRandomValues<T extends IntArrayBufferView>(array: T): T {
|
||||
// @ts-ignore getRandomValues is polyfilled
|
||||
return crypto.getRandomValues(array);
|
||||
}
|
||||
|
||||
export function getRandomString(bytes: number) {
|
||||
const randomValues = getRandomValues(new Uint8Array(bytes));
|
||||
return Array.from(randomValues)
|
||||
.map((nr) => nr.toString(16).padStart(2, "0"))
|
||||
.join("");
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ type SocialAuthParams = {
|
||||
type JwtAuthParams = {
|
||||
strategy: "jwt";
|
||||
jwt: string;
|
||||
encryptionKey?: string;
|
||||
encryptionKey: string;
|
||||
};
|
||||
|
||||
// this is the input to 'authenticate'
|
||||
|
||||
@@ -13,6 +13,8 @@ import {
|
||||
import { EMAIL_WALLET_ICON } from "../../../assets/svgs";
|
||||
import { WalletMeta } from "@thirdweb-dev/wallets/dist/declarations/src/evm/wallets/base";
|
||||
import { AUTH_OPTIONS_ICONS } from "../../types/embedded-wallet";
|
||||
import { getRandomString } from "../../connectors/embedded-wallet/embedded/helpers/getRandomValues";
|
||||
import { ANALYTICS } from "../../connectors/embedded-wallet/embedded/helpers/analytics";
|
||||
|
||||
export type EmbeddedWalletOptions = WalletOptions<
|
||||
EmbeddedWalletAdditionalOptions & WalletConnectReceiverConfig
|
||||
@@ -103,6 +105,7 @@ export class EmbeddedWallet extends AbstractClientWallet<
|
||||
|
||||
onDisconnect = () => {
|
||||
this.removeListeners();
|
||||
ANALYTICS.nonce = getRandomString(16);
|
||||
};
|
||||
|
||||
onChange = async (payload: any) => {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @thirdweb-dev/react
|
||||
|
||||
## 4.1.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`33c9f6b1`](https://github.com/thirdweb-dev/js/commit/33c9f6b1ab3e65187b2c49c083412d39a1334bba), [`de5ebc90`](https://github.com/thirdweb-dev/js/commit/de5ebc9093aaf5fc08bc0d2d414138b520fe17fe), [`e10173bf`](https://github.com/thirdweb-dev/js/commit/e10173bf8aeaaabdb45231109b4da0c52c91b9da), [`09bafa9a`](https://github.com/thirdweb-dev/js/commit/09bafa9aebadb01641214747148c67d0b39c1275)]:
|
||||
- @thirdweb-dev/wallets@2.3.0
|
||||
- @thirdweb-dev/react-core@4.1.15
|
||||
|
||||
## 4.1.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@thirdweb-dev/react",
|
||||
"version": "4.1.14",
|
||||
"version": "4.1.15",
|
||||
"repository": "https://github.com/thirdweb-dev/js/tree/main/packages/react",
|
||||
"author": "thirdweb eng <[email protected]>",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getRpcUrl(network: string, clientId?: string) {
|
||||
return `https://${network}.rpc.thirdweb.com/${clientId || ""}`;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
let alreadyChecked = false;
|
||||
export function checkClientIdOrSecretKey(message: string, clientId?: string, secretKey?: string) {
|
||||
if (alreadyChecked) {
|
||||
return;
|
||||
}
|
||||
alreadyChecked = true;
|
||||
|
||||
if (clientId || secretKey) {
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function checkClientIdOrSecretKey(
|
||||
message: string,
|
||||
clientId?: string,
|
||||
secretKey?: string,
|
||||
) {
|
||||
if (alreadyChecked) {
|
||||
return;
|
||||
}
|
||||
alreadyChecked = true;
|
||||
|
||||
console.warn(message);
|
||||
}
|
||||
if (clientId || secretKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.warn(message);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { GENERATED_ABI } from "@thirdweb-dev/generated-abis";
|
||||
import { ContractInterface } from "ethers/lib/ethers";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getCachedAbiForContract(
|
||||
address: string,
|
||||
): ContractInterface | undefined {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getSaltHash } from "./getSaltHash";
|
||||
/**
|
||||
* Pre-compute a contract's deployment address for a CREATE2 deployment.
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @param bytecode - Creation bytecode of the contract to deploy
|
||||
* @param encodedArgs - Abi-encoded constructor params
|
||||
* @param create2FactoryAddress - The create2 factory address to use
|
||||
|
||||
@@ -23,6 +23,9 @@ import { extractConstructorParamsFromAbi } from "../feature-detection/extractCon
|
||||
import { caches } from "./caches";
|
||||
import { getRoyaltyEngineV1ByChainId } from "../../constants/royaltyEngine";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function computeDeploymentInfo(
|
||||
contractType: DeployedContractType,
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const CREATE2_FACTORY_BYTECODE =
|
||||
"0x604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const SIGNATURE = {
|
||||
v: 27,
|
||||
r: "0x2222222222222222222222222222222222222222222222222222222222222222",
|
||||
@@ -7,9 +13,18 @@ export const SIGNATURE = {
|
||||
};
|
||||
export const COMMON_FACTORY = "0x4e59b44847b379578588920cA78FbF26c0B4956C"; // for pre-eip-155 supporting chains
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const GAS_LIMIT_FOR_DEPLOYER = 5000000;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const DEPLOYER_BYTECODE =
|
||||
"0x60806040526040516107f33803806107f383398101604081905261002291610359565b805160005b818110156100c157828181518110610041576100416104c9565b6020026020010151600001516001600160a01b03163b600014156100af576100ad838281518110610074576100746104c9565b602002602001015160200151848381518110610092576100926104c9565b6020026020010151604001516100c960201b6100091760201c565b505b806100b9816104df565b915050610027565b505050610557565b606061011183836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061011860201b60201c565b9392505050565b6060610127848460008561012f565b949350505050565b6060824710156101955760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084015b60405180910390fd5b6001600160a01b0385163b6101ec5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161018c565b600080866001600160a01b031685876040516102089190610508565b60006040518083038185875af1925050503d8060008114610245576040519150601f19603f3d011682016040523d82523d6000602084013e61024a565b606091505b50909250905061025b828286610266565b979650505050505050565b60608315610275575081610111565b8251156102855782518084602001fd5b8160405162461bcd60e51b815260040161018c9190610524565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b03811182821017156102d7576102d761029f565b60405290565b604051601f8201601f191681016001600160401b03811182821017156103055761030561029f565b604052919050565b80516001600160a01b038116811461032457600080fd5b919050565b60005b8381101561034457818101518382015260200161032c565b83811115610353576000848401525b50505050565b6000602080838503121561036c57600080fd5b82516001600160401b038082111561038357600080fd5b818501915085601f83011261039757600080fd5b8151818111156103a9576103a961029f565b8060051b6103b88582016102dd565b91825283810185019185810190898411156103d257600080fd5b86860192505b838310156104bc578251858111156103f05760008081fd5b86016060601f19828d0381018213156104095760008081fd5b6104116102b5565b61041c8b850161030d565b8152604061042b81860161030d565b828d01529284015192898411156104425760008081fd5b83850194508e603f86011261045957600093508384fd5b8b85015193508984111561046f5761046f61029f565b61047f8c84601f870116016102dd565b92508383528e818587010111156104965760008081fd5b6104a5848d8501838801610329565b8101919091528452505091860191908601906103d8565b9998505050505050505050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561050157634e487b7160e01b600052601160045260246000fd5b5060010190565b6000825161051a818460208701610329565b9190910192915050565b6020815260008251806020840152610543816040850160208701610329565b601f01601f19169190910160400192915050565b61028d806105666000396000f3fe6080604052600080fd5b606061004b83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c65640000815250610052565b9392505050565b60606100618484600085610069565b949350505050565b6060824710156100cf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084015b60405180910390fd5b6001600160a01b0385163b6101265760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016100c6565b600080866001600160a01b031685876040516101429190610208565b60006040518083038185875af1925050503d806000811461017f576040519150601f19603f3d011682016040523d82523d6000602084013e610184565b606091505b509150915061019482828661019f565b979650505050505050565b606083156101ae57508161004b565b8251156101be5782518084602001fd5b8160405162461bcd60e51b81526004016100c69190610224565b60005b838110156101f35781810151838201526020016101db565b83811115610202576000848401525b50505050565b6000825161021a8184602087016101d8565b9190910192915050565b60208152600082518060208401526102438160408501602087016101d8565b601f01601f1916919091016040019291505056fea26469706673582212200b524eb8ceaafe6c603273ee859fddbc2d6f1b7860c3d853dcf6f129f9d9371364736f6c634300080c0033";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const DEPLOYER_ABI = [
|
||||
{
|
||||
inputs: [
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { BigNumber, utils } from "ethers";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function convertParamValues(
|
||||
constructorParamTypes: string[],
|
||||
constructorParamValues: any[],
|
||||
|
||||
@@ -2,6 +2,9 @@ import { PrecomputedDeploymentTransaction } from "../../types/any-evm/deploy-dat
|
||||
import { GAS_LIMIT_FOR_DEPLOYER } from "./constants";
|
||||
import { estimateGasForDeploy } from "./estimateGasForDeploy";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function createTransactionBatches(
|
||||
transactions: PrecomputedDeploymentTransaction[],
|
||||
upperGasLimit: number = GAS_LIMIT_FOR_DEPLOYER,
|
||||
|
||||
@@ -8,7 +8,7 @@ import { isContractDeployed } from "./isContractDeployed";
|
||||
* Deploy a contract at a deterministic address, using Create2 method
|
||||
* Address depends on the Create2 factory address.
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
*
|
||||
* @param signer - The signer to use
|
||||
* @param bytecode - The bytecode to deploy
|
||||
|
||||
@@ -13,7 +13,7 @@ import { getInitBytecodeWithSalt } from "./getInitBytecodeWithSalt";
|
||||
* Deploy a contract at a deterministic address, using Create2 method
|
||||
* Address depends on the Create2 factory address.
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
*
|
||||
* @param signer - The signer to use
|
||||
* @param bytecode - The bytecode to deploy
|
||||
|
||||
@@ -4,6 +4,9 @@ import type { DeployOptions } from "../../types/deploy/deploy-options";
|
||||
import { DEPLOYER_ABI, DEPLOYER_BYTECODE } from "./constants";
|
||||
import { createTransactionBatches } from "./createTransactionBatches";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function deployWithThrowawayDeployer(
|
||||
signer: Signer,
|
||||
transactions: PrecomputedDeploymentTransaction[],
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { utils } from "ethers";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function estimateGasForDeploy(initCode: string) {
|
||||
let gasLimit =
|
||||
utils
|
||||
|
||||
@@ -5,6 +5,9 @@ import type { DeployMetadata } from "../../types/deploy/deploy-options";
|
||||
|
||||
const deployMetadataCache: Record<string, any> = {};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function fetchAndCacheDeployMetadata(
|
||||
publishMetadataUri: string,
|
||||
storage: ThirdwebStorage,
|
||||
|
||||
@@ -13,6 +13,9 @@ import { PublishedContractSchema } from "../../schema/contracts/custom";
|
||||
|
||||
export const THIRDWEB_DEPLOYER = "0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function fetchPublishedContractFromPolygon(
|
||||
publisherAddress: AddressOrEns,
|
||||
contractName: string,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { getKeylessTxn } from "./getKeylessTxn";
|
||||
|
||||
/**
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @param transaction - Unsigned transaction object
|
||||
* @param signature - Signature bytes
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@ import { providers } from "ethers";
|
||||
/**
|
||||
* Check if a contract exists at the given address
|
||||
*
|
||||
* @internal
|
||||
* @public
|
||||
* @param address - The address to check
|
||||
* @param provider - The provider to use
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../../constants/currency";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { Address } from "../../schema/shared/Address";
|
||||
import type { Price } from "../../types/currency";
|
||||
import { BigNumberish, CallOverrides } from "ethers";
|
||||
|
||||
@@ -9,6 +9,9 @@ import {
|
||||
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||
import type { providers } from "ethers";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function fetchSnapshotEntryForAddress(
|
||||
address: string,
|
||||
merkleRoot: string,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import type {
|
||||
ClaimCondition,
|
||||
ClaimVerification,
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import type { IERC20 } from "@thirdweb-dev/contracts-js";
|
||||
import { BigNumber, utils, type BigNumberish } from "ethers";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function approveErc20Allowance(
|
||||
contractToApprove: ContractWrapper<any>,
|
||||
currencyAddress: string,
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { NATIVE_TOKEN_ADDRESS } from "../../constants/currency";
|
||||
import { isNativeToken } from "./isNativeToken";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function cleanCurrencyAddress(currencyAddress: string): string {
|
||||
if (isNativeToken(currencyAddress)) {
|
||||
return NATIVE_TOKEN_ADDRESS;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import type { IERC20 } from "@thirdweb-dev/contracts-js";
|
||||
import { BigNumber } from "ethers";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function hasERC20Allowance(
|
||||
contractToApprove: ContractWrapper<any>,
|
||||
currencyAddress: string,
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { BigNumber, utils } from "ethers";
|
||||
import { AmountSchema } from "../../../core/schema/shared";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { Amount } from "../../types/currency";
|
||||
import { BaseERC20 } from "../../types/eips";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function normalizeAmount(
|
||||
contractWrapper: ContractWrapper<BaseERC20>,
|
||||
amount: Amount,
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import type { IERC20 } from "@thirdweb-dev/contracts-js";
|
||||
import { BigNumber } from "ethers";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { isNativeToken } from "./isNativeToken";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function setErc20Allowance(
|
||||
contractToApprove: ContractWrapper<any>,
|
||||
value: BigNumber,
|
||||
|
||||
@@ -11,6 +11,9 @@ let provider: providers.Provider | undefined;
|
||||
|
||||
const ENS_CACHE = new Map<string, Promise<CachedEns>>();
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function resolveEns(
|
||||
ens: string,
|
||||
depth = 0,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FeatureName } from "../../constants/contract-features";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { AbiSchema } from "../../schema/contracts/custom";
|
||||
import { BaseContract } from "ethers";
|
||||
import { isExtensionEnabled } from "./isFeatureEnabled";
|
||||
|
||||
@@ -31,6 +31,9 @@ export function detectFeatures(
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function detectFeaturesFromBytecode(
|
||||
bytecode: string,
|
||||
features: Record<string, Feature> = SUPPORTED_FEATURES,
|
||||
|
||||
@@ -20,6 +20,9 @@ export function getAllDetectedFeatures(abi: AbiInput): FeatureWithEnabled[] {
|
||||
return features;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getAllDetectedExtensionsFromBytecode(
|
||||
bytecode: string,
|
||||
): FeatureWithEnabled[] {
|
||||
@@ -28,6 +31,9 @@ export function getAllDetectedExtensionsFromBytecode(
|
||||
return features;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function constructAbiFromBytecode(bytecode: string): AbiInput {
|
||||
let extensions = getAllDetectedExtensionsFromBytecode(bytecode);
|
||||
// special deduping for ERC721 and ERC20
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import type { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import type { BaseContract } from "ethers";
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,9 @@ export function hasMatchingAbi(
|
||||
return intersection.length === interfaceFn.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function matchesAbiFromBytecode(
|
||||
contractBytecode: string,
|
||||
featureAbis: readonly AbiInput[],
|
||||
|
||||
@@ -10,6 +10,7 @@ import { detectFeatures } from "./detectFeatures";
|
||||
* @deprecated use isExtensionEnabled instead
|
||||
* @param abi - The abi to check
|
||||
* @param featureName - The feature name to check
|
||||
* @internal
|
||||
*/
|
||||
export function isFeatureEnabled(
|
||||
abi: AbiInput,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { AbiInput, AbiSchema } from "../../schema/contracts/custom";
|
||||
import { BaseContract } from "ethers";
|
||||
import { hasMatchingAbi } from "./hasMatchingAbi";
|
||||
|
||||
@@ -15,6 +15,9 @@ export async function resolveContractUriFromAddress(
|
||||
return extractIPFSHashFromBytecode(bytecode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function resolveContractUriAndBytecode(
|
||||
address: string,
|
||||
provider: providers.Provider,
|
||||
|
||||
@@ -28,6 +28,9 @@ export async function fetchContractMetadata(
|
||||
return formatCompilerMetadata(metadata);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function formatCompilerMetadata(metadata: any): PublishedMetadata {
|
||||
const abi = AbiSchema.parse(metadata.output.abi);
|
||||
const compilationTarget = metadata.settings.compilationTarget;
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
InterfaceId_IERC1155,
|
||||
InterfaceId_IERC721,
|
||||
} from "../constants/contract";
|
||||
import { ContractWrapper } from "../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../core/classes/internal/contract-wrapper";
|
||||
import { fetchCurrencyValue } from "./currency/fetchCurrencyValue";
|
||||
import { NewDirectListing } from "../types/marketplace/NewDirectListing";
|
||||
import { NewAuctionListing } from "../types/marketplace/NewAuctionListing";
|
||||
|
||||
@@ -32,6 +32,9 @@ function putInCache(
|
||||
metadataCache[getCacheKey(address, chainId)] = metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getContractMetadataFromCache(
|
||||
address: string,
|
||||
chainId: number,
|
||||
@@ -96,6 +99,9 @@ export async function fetchContractMetadataFromAddress(
|
||||
return metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function fetchContractMetadataFromBytecode(
|
||||
address: Address,
|
||||
chainId: number,
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
getAllExtensionsAbi,
|
||||
getAllPluginsAbi,
|
||||
} from "../../constants/thirdweb-features";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { Abi, AbiSchema } from "../../schema/contracts/custom";
|
||||
import { SDKOptions } from "../../schema/sdk-options";
|
||||
import { isExtensionEnabled } from "../feature-detection/isFeatureEnabled";
|
||||
|
||||
@@ -58,6 +58,9 @@ export function isIncrementalVersion(current: string, next: string) {
|
||||
return eqMajor && eqMinor && nextSemver.patch > currentSemver.patch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function isDowngradeVersion(current: string, next: string) {
|
||||
const currentSemver = toSemver(current);
|
||||
const nextSemver = toSemver(next);
|
||||
|
||||
@@ -79,6 +79,9 @@ export function getChainProvider(
|
||||
return getProviderFromRpcUrl(rpcUrl, sdkOptions, chainId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getChainIdFromNetwork(
|
||||
network: ChainOrRpcUrl,
|
||||
options: SDKOptionsOutput,
|
||||
@@ -109,6 +112,9 @@ export function getChainIdFromNetwork(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export async function getChainIdOrName(
|
||||
network: NetworkInput,
|
||||
): Promise<number | string> {
|
||||
@@ -134,6 +140,7 @@ export async function getChainIdOrName(
|
||||
|
||||
/**
|
||||
* Check whether a NetworkInput value is a Chain config (naively, without parsing)
|
||||
* @internal
|
||||
*/
|
||||
export function isChainConfig(
|
||||
network: NetworkInput,
|
||||
|
||||
@@ -60,6 +60,9 @@ type InitalizeParams = [
|
||||
options?: SDKOptions,
|
||||
];
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const EditionDropInitializer = {
|
||||
name: "DropERC1155" as const,
|
||||
contractType: prebuiltContractTypes["edition-drop"],
|
||||
@@ -106,6 +109,9 @@ export const EditionDropInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const EditionInitializer = {
|
||||
name: "TokenERC1155" as const,
|
||||
contractType: prebuiltContractTypes["edition"],
|
||||
@@ -146,6 +152,9 @@ export const EditionInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const MarketplaceInitializer = {
|
||||
name: "Marketplace" as const,
|
||||
contractType: prebuiltContractTypes.marketplace,
|
||||
@@ -187,6 +196,9 @@ export const MarketplaceInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const MarketplaceV3Initializer = {
|
||||
name: "MarketplaceV3" as const,
|
||||
contractType: prebuiltContractTypes["marketplace-v3"],
|
||||
@@ -256,6 +268,9 @@ export const MarketplaceV3Initializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const MultiwrapInitializer = {
|
||||
name: "Multiwrap" as const,
|
||||
contractType: prebuiltContractTypes.multiwrap,
|
||||
@@ -295,6 +310,9 @@ export const MultiwrapInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const NFTCollectionInitializer = {
|
||||
name: "TokenERC721" as const,
|
||||
contractType: prebuiltContractTypes["nft-collection"],
|
||||
@@ -336,6 +354,9 @@ export const NFTCollectionInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const NFTDropInitializer = {
|
||||
name: "DropERC721" as const,
|
||||
contractType: prebuiltContractTypes["nft-drop"],
|
||||
@@ -382,6 +403,9 @@ export const NFTDropInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const PackInitializer = {
|
||||
name: "Pack" as const,
|
||||
contractType: prebuiltContractTypes["pack"],
|
||||
@@ -424,6 +448,9 @@ export const PackInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const SignatureDropInitializer = {
|
||||
name: "SignatureDrop" as const,
|
||||
contractType: prebuiltContractTypes["signature-drop"],
|
||||
@@ -474,6 +501,9 @@ export const SignatureDropInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const SplitInitializer = {
|
||||
name: "Split" as const,
|
||||
contractType: prebuiltContractTypes["split"],
|
||||
@@ -514,6 +544,9 @@ export const SplitInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TokenDropInitializer = {
|
||||
name: "DropERC20" as const,
|
||||
contractType: prebuiltContractTypes["token-drop"],
|
||||
@@ -558,6 +591,9 @@ export const TokenDropInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const TokenInitializer = {
|
||||
name: "TokenERC20" as const,
|
||||
contractType: prebuiltContractTypes.token,
|
||||
@@ -598,6 +634,9 @@ export const TokenInitializer = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const VoteInitializer = {
|
||||
name: "VoteERC20" as const,
|
||||
contractType: prebuiltContractTypes.vote,
|
||||
@@ -666,6 +705,9 @@ export const PREBUILT_CONTRACTS_MAP = /* @__PURE__ */ {
|
||||
[prebuiltContractTypes.vote]: VoteInitializer,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const PREBUILT_CONTRACTS_APPURI_MAP = /* @__PURE__ */ {
|
||||
[prebuiltContractTypes["edition-drop"]]:
|
||||
"ipfs://QmNm3wRzpKYWo1SRtJfgfxtvudp5p2nXD6EttcsQJHwTmk",
|
||||
@@ -695,6 +737,9 @@ const SmartContract = {
|
||||
roles: ALL_ROLES,
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export const CONTRACTS_MAP = /* @__PURE__ */ {
|
||||
...PREBUILT_CONTRACTS_MAP,
|
||||
[SmartContract.contractType]: SmartContract,
|
||||
@@ -710,6 +755,9 @@ export function getContractTypeForRemoteName(name: string): ContractType {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getContractName(
|
||||
type: PrebuiltContractType,
|
||||
): string | undefined {
|
||||
@@ -718,28 +766,47 @@ export function getContractName(
|
||||
)?.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type PrebuiltContractsMap = typeof PREBUILT_CONTRACTS_MAP;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type PrebuiltContractsInstances = {
|
||||
[K in keyof PrebuiltContractsMap]: Awaited<
|
||||
ReturnType<(typeof PREBUILT_CONTRACTS_MAP)[K]["initialize"]>
|
||||
>;
|
||||
};
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type ContractsMap = typeof CONTRACTS_MAP;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type ValidContractInstance =
|
||||
| Awaited<ReturnType<ContractsMap[keyof PrebuiltContractsMap]["initialize"]>>
|
||||
| SmartContractType;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type SchemaForPrebuiltContractType<
|
||||
TContractType extends PrebuiltContractType,
|
||||
> = PrebuiltContractsMap[TContractType]["schema"];
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type ContractForPrebuiltContractType<
|
||||
TContractType extends PrebuiltContractType,
|
||||
> = PrebuiltContractsInstances[TContractType];
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type ContractType = keyof ContractsMap;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type DeploySchemaForPrebuiltContractType<
|
||||
TContractType extends PrebuiltContractType,
|
||||
> = SchemaForPrebuiltContractType<TContractType>["deploy"];
|
||||
|
||||
@@ -14,10 +14,10 @@ import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../../core/classes/contract-royalty";
|
||||
import { ContractPrimarySale } from "../../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { DropErc1155ClaimConditions } from "../../core/classes/drop-erc1155-claim-conditions";
|
||||
import { DropErc1155History } from "../../core/classes/drop-erc1155-history";
|
||||
import { StandardErc1155 } from "../../core/classes/erc-1155-standard";
|
||||
import { DropErc1155History } from "../../core/classes/internal/erc1155/drop-erc1155-history";
|
||||
import { StandardErc1155 } from "../../core/classes/internal/erc1155/erc-1155-standard";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { NetworkInput, TransactionResultWithId } from "../../core/types";
|
||||
@@ -42,14 +42,15 @@ import { NFT_BASE_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "edition-drop");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.erc1155 instead
|
||||
*/
|
||||
export class EditionDrop extends StandardErc1155<PrebuiltEditionDrop> {
|
||||
private static contractRoles = NFT_BASE_CONTRACT_ROLES;
|
||||
|
||||
public abi: Abi;
|
||||
public sales: ContractPrimarySale;
|
||||
public platformFees: ContractPlatformFee<PrebuiltEditionDrop>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public encoder: ContractEncoder<PrebuiltEditionDrop>;
|
||||
public estimator: GasCostEstimator<PrebuiltEditionDrop>;
|
||||
public events: ContractEvents<PrebuiltEditionDrop>;
|
||||
@@ -117,7 +118,7 @@ export class EditionDrop extends StandardErc1155<PrebuiltEditionDrop> {
|
||||
|
||||
public history: DropErc1155History;
|
||||
public interceptor: ContractInterceptor<PrebuiltEditionDrop>;
|
||||
public owner: ContractOwner<PrebuiltEditionDrop>;
|
||||
public owner: ContractOwner;
|
||||
|
||||
constructor(
|
||||
network: NetworkInput,
|
||||
|
||||
@@ -15,9 +15,9 @@ import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../../core/classes/contract-royalty";
|
||||
import { ContractPrimarySale } from "../../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { Erc1155SignatureMintable } from "../../core/classes/erc-1155-signature-mintable";
|
||||
import { StandardErc1155 } from "../../core/classes/erc-1155-standard";
|
||||
import { StandardErc1155 } from "../../core/classes/internal/erc1155/erc-1155-standard";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { NetworkInput, TransactionResultWithId } from "../../core/types";
|
||||
@@ -41,7 +41,8 @@ import { NFT_BASE_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "edition");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.erc1155 instead
|
||||
*/
|
||||
export class Edition extends StandardErc1155<TokenERC1155> {
|
||||
static contractRoles = NFT_BASE_CONTRACT_ROLES;
|
||||
@@ -57,7 +58,7 @@ export class Edition extends StandardErc1155<TokenERC1155> {
|
||||
(typeof Edition.contractRoles)[number]
|
||||
>;
|
||||
public sales: ContractPrimarySale;
|
||||
public platformFees: ContractPlatformFee<TokenERC1155>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public encoder: ContractEncoder<TokenERC1155>;
|
||||
public estimator: GasCostEstimator<TokenERC1155>;
|
||||
public events: ContractEvents<TokenERC1155>;
|
||||
@@ -98,7 +99,7 @@ export class Edition extends StandardErc1155<TokenERC1155> {
|
||||
*/
|
||||
public signature: Erc1155SignatureMintable;
|
||||
public interceptor: ContractInterceptor<TokenERC1155>;
|
||||
public owner: ContractOwner<TokenERC1155>;
|
||||
public owner: ContractOwner;
|
||||
|
||||
constructor(
|
||||
network: NetworkInput,
|
||||
|
||||
@@ -18,10 +18,10 @@ import { ContractInterceptor } from "../../core/classes/contract-interceptor";
|
||||
import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { MarketplaceAuction } from "../../core/classes/marketplace-auction";
|
||||
import { MarketplaceDirect } from "../../core/classes/marketplace-direct";
|
||||
import { MarketplaceAuction } from "../../core/classes/internal/marketplace/marketplace-auction";
|
||||
import { MarketplaceDirect } from "../../core/classes/internal/marketplace/marketplace-direct";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { UpdateableNetwork } from "../../core/interfaces/contract";
|
||||
import { NetworkInput } from "../../core/types";
|
||||
@@ -50,7 +50,8 @@ import { Offer } from "../../types/marketplace/Offer";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "marketplace");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.directListings / contract.auctions / contract.offers instead
|
||||
*/
|
||||
export class Marketplace implements UpdateableNetwork {
|
||||
static contractRoles = MARKETPLACE_CONTRACT_ROLES;
|
||||
@@ -62,7 +63,7 @@ export class Marketplace implements UpdateableNetwork {
|
||||
public encoder: ContractEncoder<MarketplaceContract>;
|
||||
public events: ContractEvents<MarketplaceContract>;
|
||||
public estimator: GasCostEstimator<MarketplaceContract>;
|
||||
public platformFees: ContractPlatformFee<MarketplaceContract>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public metadata: ContractMetadata<
|
||||
MarketplaceContract,
|
||||
typeof MarketplaceContractSchema
|
||||
|
||||
@@ -20,7 +20,7 @@ import { ContractInterceptor } from "../../core/classes/contract-interceptor";
|
||||
import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { MarketplaceV3DirectListings } from "../../core/classes/marketplacev3-direct-listings";
|
||||
import { MarketplaceV3EnglishAuctions } from "../../core/classes/marketplacev3-english-auction";
|
||||
@@ -46,7 +46,8 @@ import { MARKETPLACE_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "marketplace");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.directListings / contract.auctions / contract.offers instead
|
||||
*/
|
||||
export class MarketplaceV3 implements UpdateableNetwork {
|
||||
static contractRoles = MARKETPLACE_CONTRACT_ROLES;
|
||||
@@ -58,7 +59,7 @@ export class MarketplaceV3 implements UpdateableNetwork {
|
||||
public encoder: ContractEncoder<MarketplaceV3Contract>;
|
||||
public events: ContractEvents<MarketplaceV3Contract>;
|
||||
public estimator: GasCostEstimator<MarketplaceV3Contract>;
|
||||
public platformFees: ContractPlatformFee<MarketplaceV3Contract>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public metadata: ContractMetadata<
|
||||
MarketplaceV3Contract,
|
||||
typeof MarketplaceContractSchema
|
||||
|
||||
@@ -20,8 +20,8 @@ import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractOwner } from "../../core/classes/contract-owner";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../../core/classes/contract-royalty";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { StandardErc721 } from "../../core/classes/erc-721-standard";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { StandardErc721 } from "../../core/classes/internal/erc721/erc-721-standard";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { NetworkInput, TransactionResultWithId } from "../../core/types";
|
||||
@@ -52,6 +52,7 @@ import { MULTIWRAP_CONTRACT_ROLES } from "../contractRoles";
|
||||
*
|
||||
* @beta
|
||||
*/
|
||||
// TODO create extension wrappers for this
|
||||
export class Multiwrap extends StandardErc721<MultiwrapContract> {
|
||||
static contractRoles = MULTIWRAP_CONTRACT_ROLES;
|
||||
|
||||
@@ -90,7 +91,7 @@ export class Multiwrap extends StandardErc721<MultiwrapContract> {
|
||||
MultiwrapContract,
|
||||
typeof MultiwrapContractSchema
|
||||
>;
|
||||
public owner: ContractOwner<MultiwrapContract>;
|
||||
public owner: ContractOwner;
|
||||
|
||||
constructor(
|
||||
network: NetworkInput,
|
||||
|
||||
@@ -14,8 +14,8 @@ import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../../core/classes/contract-royalty";
|
||||
import { ContractPrimarySale } from "../../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { StandardErc721 } from "../../core/classes/erc-721-standard";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { StandardErc721 } from "../../core/classes/internal/erc721/erc-721-standard";
|
||||
import { Erc721WithQuantitySignatureMintable } from "../../core/classes/erc-721-with-quantity-signature-mintable";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
@@ -39,7 +39,8 @@ import { NFT_BASE_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "nft-collection");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.erc721 instead
|
||||
*/
|
||||
export class NFTCollection extends StandardErc721<TokenERC721> {
|
||||
static contractRoles = NFT_BASE_CONTRACT_ROLES;
|
||||
@@ -59,7 +60,7 @@ export class NFTCollection extends StandardErc721<TokenERC721> {
|
||||
public estimator: GasCostEstimator<TokenERC721>;
|
||||
public events: ContractEvents<TokenERC721>;
|
||||
public sales: ContractPrimarySale;
|
||||
public platformFees: ContractPlatformFee<TokenERC721>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
/**
|
||||
* Configure royalties
|
||||
* @remarks Set your own royalties for the entire contract or per token
|
||||
@@ -81,7 +82,7 @@ export class NFTCollection extends StandardErc721<TokenERC721> {
|
||||
TokenERC721,
|
||||
typeof TokenErc721ContractSchema
|
||||
>;
|
||||
public owner: ContractOwner<TokenERC721>;
|
||||
public owner: ContractOwner;
|
||||
|
||||
/**
|
||||
* Signature Minting
|
||||
|
||||
@@ -18,10 +18,10 @@ import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../../core/classes/contract-royalty";
|
||||
import { ContractPrimarySale } from "../../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { DelayedReveal } from "../../core/classes/delayed-reveal";
|
||||
import { DropClaimConditions } from "../../core/classes/drop-claim-conditions";
|
||||
import { StandardErc721 } from "../../core/classes/erc-721-standard";
|
||||
import { StandardErc721 } from "../../core/classes/internal/erc721/erc-721-standard";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { NetworkInput, TransactionResultWithId } from "../../core/types";
|
||||
@@ -47,7 +47,8 @@ import { NFT_BASE_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "nft-drop");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.erc721 instead
|
||||
*/
|
||||
export class NFTDrop extends StandardErc721<PrebuiltNFTDrop> {
|
||||
static contractRoles = NFT_BASE_CONTRACT_ROLES;
|
||||
@@ -61,7 +62,7 @@ export class NFTDrop extends StandardErc721<PrebuiltNFTDrop> {
|
||||
>;
|
||||
public app: ContractAppURI<PrebuiltNFTDrop>;
|
||||
public sales: ContractPrimarySale;
|
||||
public platformFees: ContractPlatformFee<PrebuiltNFTDrop>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public events: ContractEvents<PrebuiltNFTDrop>;
|
||||
public roles: ContractRoles<
|
||||
PrebuiltNFTDrop,
|
||||
@@ -154,7 +155,7 @@ export class NFTDrop extends StandardErc721<PrebuiltNFTDrop> {
|
||||
*/
|
||||
public checkout: PaperCheckout<PrebuiltNFTDrop>;
|
||||
|
||||
public owner: ContractOwner<PrebuiltNFTDrop>;
|
||||
public owner: ContractOwner;
|
||||
|
||||
constructor(
|
||||
network: NetworkInput,
|
||||
|
||||
@@ -37,8 +37,8 @@ import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractOwner } from "../../core/classes/contract-owner";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../../core/classes/contract-royalty";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { StandardErc1155 } from "../../core/classes/erc-1155-standard";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { StandardErc1155 } from "../../core/classes/internal/erc1155/erc-1155-standard";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { PackVRF } from "../../core/classes/pack-vrf";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
@@ -71,6 +71,7 @@ import { PACK_CONTRACT_ROLES } from "../contractRoles";
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
// TODO create extension wrappers
|
||||
export class Pack extends StandardErc1155<PackContract> {
|
||||
static contractRoles = PACK_CONTRACT_ROLES;
|
||||
|
||||
@@ -107,7 +108,7 @@ export class Pack extends StandardErc1155<PackContract> {
|
||||
*/
|
||||
public interceptor: ContractInterceptor<PackContract>;
|
||||
|
||||
public owner: ContractOwner<PackContract>;
|
||||
public owner: ContractOwner;
|
||||
|
||||
private _vrf?: PackVRF;
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../../core/classes/contract-royalty";
|
||||
import { ContractPrimarySale } from "../../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { DelayedReveal } from "../../core/classes/delayed-reveal";
|
||||
import { DropClaimConditions } from "../../core/classes/drop-claim-conditions";
|
||||
import { StandardErc721 } from "../../core/classes/erc-721-standard";
|
||||
import { StandardErc721 } from "../../core/classes/internal/erc721/erc-721-standard";
|
||||
import { Erc721WithQuantitySignatureMintable } from "../../core/classes/erc-721-with-quantity-signature-mintable";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
@@ -51,13 +51,14 @@ import { NFT_BASE_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "signature-drop");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.erc721 instead
|
||||
*/
|
||||
export class SignatureDrop extends StandardErc721<SignatureDropContract> {
|
||||
static contractRoles = NFT_BASE_CONTRACT_ROLES;
|
||||
|
||||
public abi: Abi;
|
||||
public owner: ContractOwner<SignatureDropContract>;
|
||||
public owner: ContractOwner;
|
||||
public encoder: ContractEncoder<SignatureDropContract>;
|
||||
public estimator: GasCostEstimator<SignatureDropContract>;
|
||||
public metadata: ContractMetadata<
|
||||
@@ -66,7 +67,7 @@ export class SignatureDrop extends StandardErc721<SignatureDropContract> {
|
||||
>;
|
||||
public app: ContractAppURI<SignatureDropContract>;
|
||||
public sales: ContractPrimarySale;
|
||||
public platformFees: ContractPlatformFee<SignatureDropContract>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public events: ContractEvents<SignatureDropContract>;
|
||||
public roles: ContractRoles<
|
||||
SignatureDropContract,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { ContractEvents } from "../../core/classes/contract-events";
|
||||
import { ContractInterceptor } from "../../core/classes/contract-interceptor";
|
||||
import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { UpdateableNetwork } from "../../core/interfaces/contract";
|
||||
@@ -41,6 +41,7 @@ import { ADMIN_ROLE } from "../contractRoles";
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
// TODO create extension wrappers for this
|
||||
export class Split implements UpdateableNetwork {
|
||||
static contractRoles = ADMIN_ROLE;
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractPrimarySale } from "../../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { DropClaimConditions } from "../../core/classes/drop-claim-conditions";
|
||||
import { StandardErc20 } from "../../core/classes/erc-20-standard";
|
||||
import { StandardErc20 } from "../../core/classes/internal/erc20/erc-20-standard";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { NetworkInput } from "../../core/types";
|
||||
@@ -37,7 +37,8 @@ import { TOKEN_DROP_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const sdk = new ThirdwebSDK("{{chainName}}");
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "token-drop");
|
||||
* ```
|
||||
*
|
||||
* @internal
|
||||
* @deprecated use contract.erc20 instead
|
||||
*/
|
||||
export class TokenDrop extends StandardErc20<PrebuiltTokenDrop> {
|
||||
static contractRoles = TOKEN_DROP_CONTRACT_ROLES;
|
||||
@@ -55,7 +56,7 @@ export class TokenDrop extends StandardErc20<PrebuiltTokenDrop> {
|
||||
public encoder: ContractEncoder<PrebuiltTokenDrop>;
|
||||
public estimator: GasCostEstimator<PrebuiltTokenDrop>;
|
||||
public sales: ContractPrimarySale;
|
||||
public platformFees: ContractPlatformFee<PrebuiltTokenDrop>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public events: ContractEvents<PrebuiltTokenDrop>;
|
||||
/**
|
||||
* Configure claim conditions
|
||||
|
||||
@@ -12,10 +12,10 @@ import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractPlatformFee } from "../../core/classes/contract-platform-fee";
|
||||
import { ContractRoles } from "../../core/classes/contract-roles";
|
||||
import { ContractPrimarySale } from "../../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { TokenERC20History } from "../../core/classes/erc-20-history";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { TokenERC20History } from "../../core/classes/internal/erc20/erc-20-history";
|
||||
import { Erc20SignatureMintable } from "../../core/classes/erc-20-signature-mintable";
|
||||
import { StandardErc20 } from "../../core/classes/erc-20-standard";
|
||||
import { StandardErc20 } from "../../core/classes/internal/erc20/erc-20-standard";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { NetworkInput } from "../../core/types";
|
||||
@@ -40,7 +40,8 @@ import { NFT_BASE_CONTRACT_ROLES } from "../contractRoles";
|
||||
* const contract = await sdk.getContract("{{contract_address}}", "token");
|
||||
* ```
|
||||
*
|
||||
* @public
|
||||
* @internal
|
||||
* @deprecated use contract.erc20 instead
|
||||
*/
|
||||
export class Token extends StandardErc20<TokenERC20> {
|
||||
static contractRoles = NFT_BASE_CONTRACT_ROLES;
|
||||
@@ -57,7 +58,7 @@ export class Token extends StandardErc20<TokenERC20> {
|
||||
public estimator: GasCostEstimator<TokenERC20>;
|
||||
public history: TokenERC20History;
|
||||
public events: ContractEvents<TokenERC20>;
|
||||
public platformFees: ContractPlatformFee<TokenERC20>;
|
||||
public platformFees: ContractPlatformFee;
|
||||
public sales: ContractPrimarySale;
|
||||
/**
|
||||
* Signature Minting
|
||||
|
||||
@@ -17,7 +17,7 @@ import { ContractEncoder } from "../../core/classes/contract-encoder";
|
||||
import { ContractEvents } from "../../core/classes/contract-events";
|
||||
import { ContractInterceptor } from "../../core/classes/contract-interceptor";
|
||||
import { ContractMetadata } from "../../core/classes/contract-metadata";
|
||||
import { ContractWrapper } from "../../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../../core/classes/internal/contract-wrapper";
|
||||
import { GasCostEstimator } from "../../core/classes/gas-cost-estimator";
|
||||
import { Transaction } from "../../core/classes/transactions";
|
||||
import { UpdateableNetwork } from "../../core/interfaces/contract";
|
||||
@@ -50,6 +50,7 @@ import { VoteType } from "../../enums/vote/Vote";
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
// TODO create extension wrappers for this
|
||||
export class Vote implements UpdateableNetwork {
|
||||
private contractWrapper: ContractWrapper<VoteERC20>;
|
||||
private storage: ThirdwebStorage;
|
||||
|
||||
@@ -57,7 +57,7 @@ import { ContractPublishedMetadata } from "../core/classes/contract-published-me
|
||||
import { ContractRoles } from "../core/classes/contract-roles";
|
||||
import { ContractRoyalty } from "../core/classes/contract-royalty";
|
||||
import { ContractPrimarySale } from "../core/classes/contract-sales";
|
||||
import { ContractWrapper } from "../core/classes/contract-wrapper";
|
||||
import { ContractWrapper } from "../core/classes/internal/contract-wrapper";
|
||||
import { Erc1155 } from "../core/classes/erc-1155";
|
||||
import { Erc20 } from "../core/classes/erc-20";
|
||||
import { Erc721 } from "../core/classes/erc-721";
|
||||
@@ -94,17 +94,17 @@ import { ExtensionManager } from "../core/classes/extension-manager";
|
||||
* // call any function in your contract
|
||||
* await contract.call("myCustomFunction", [param1, param2]);
|
||||
*
|
||||
* // if your contract follows the ERC721 standard, contract.nft will be present
|
||||
* const allNFTs = await contract.erc721.query.all()
|
||||
* // if your contract follows an ERC standard, contract.ercXYZ will be present
|
||||
* const allNFTs = await contract.erc721.getAll()
|
||||
*
|
||||
* // if your contract extends IMintableERC721, contract.nft.mint() will be available
|
||||
* // if your contract extends a particular contract extension, the corresponding function will be available
|
||||
* const tx = await contract.erc721.mint({
|
||||
* name: "Cool NFT",
|
||||
* image: readFileSync("some_image.png"),
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @beta
|
||||
* @public
|
||||
*/
|
||||
export class SmartContract<
|
||||
TContract extends BaseContractInterface = BaseContract,
|
||||
@@ -118,7 +118,7 @@ export class SmartContract<
|
||||
public interceptor: ContractInterceptor<TContract>;
|
||||
public encoder: ContractEncoder<TContract>;
|
||||
public estimator: GasCostEstimator<TContract>;
|
||||
public publishedMetadata: ContractPublishedMetadata<TContract>;
|
||||
public publishedMetadata: ContractPublishedMetadata;
|
||||
public metadata: ContractMetadata<BaseContract, typeof CustomContractSchema>;
|
||||
|
||||
get abi(): Abi {
|
||||
@@ -149,14 +149,14 @@ export class SmartContract<
|
||||
/**
|
||||
* Handle platform fees
|
||||
*/
|
||||
get platformFees(): ContractPlatformFee<IPlatformFee> {
|
||||
get platformFees(): ContractPlatformFee {
|
||||
return assertEnabled(this.detectPlatformFees(), FEATURE_PLATFORM_FEE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set and get the owner of the contract
|
||||
*/
|
||||
get owner(): ContractOwner<Ownable> {
|
||||
get owner(): ContractOwner {
|
||||
return assertEnabled(this.detectOwnable(), FEATURE_OWNER);
|
||||
}
|
||||
|
||||
@@ -352,12 +352,12 @@ export class SmartContract<
|
||||
* const isAccountDeployed = await contract.accountFactory.isAccountDeployed(admin, extraData);
|
||||
* ```
|
||||
*/
|
||||
get accountFactory(): AccountFactory<IAccountFactory> {
|
||||
get accountFactory(): AccountFactory {
|
||||
return assertEnabled(this.detectAccountFactory(), FEATURE_ACCOUNT_FACTORY);
|
||||
}
|
||||
|
||||
// TODO documentation
|
||||
get account(): Account<IAccountCore> {
|
||||
get account(): Account {
|
||||
return assertEnabled(this.detectAccount(), FEATURE_ACCOUNT);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,20 @@ import { isContractDeployed } from "../../common/any-evm-utils/isContractDeploye
|
||||
import { buildTransactionFunction } from "../../common/transactions";
|
||||
import { TransactionResultWithAddress } from "../types";
|
||||
import { ContractEvents } from "./contract-events";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TO BE REMOVED IN V4
|
||||
export class AccountFactory<TContract extends IAccountFactory>
|
||||
implements DetectableFeature
|
||||
{
|
||||
/**
|
||||
* Interact with ERC-4337 account factory contracts
|
||||
* @remarks Exposes useful functions available on the account factory contract.
|
||||
* @example
|
||||
* ```javascript
|
||||
* const contract = await sdk.getContract("{{contract_address}}");
|
||||
* await contract.accountFactory.predictAccountAddress(walletAddress);
|
||||
* ```
|
||||
* @public
|
||||
*/
|
||||
export class AccountFactory implements DetectableFeature {
|
||||
featureName = FEATURE_ACCOUNT_FACTORY.name;
|
||||
private contractWrapper: ContractWrapper<IAccountFactory>;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
FEATURE_ACCOUNT_PERMISSIONS,
|
||||
} from "../../constants/thirdweb-features";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
|
||||
import type { IAccountCore } from "@thirdweb-dev/contracts-js";
|
||||
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
|
||||
@@ -13,14 +13,21 @@ import {
|
||||
SignerWithPermissions,
|
||||
} from "../../types/account";
|
||||
import { buildTransactionFunction } from "../../common/transactions";
|
||||
import { AccountPermissions } from "./account-permissions";
|
||||
import { AccountPermissions } from "./internal/erc4337/account-permissions";
|
||||
import { detectContractFeature } from "../../common/feature-detection/detectContractFeature";
|
||||
import { assertEnabled } from "../../common/feature-detection/assertEnabled";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TO BE REMOVED IN V4
|
||||
export class Account<TContract extends IAccountCore>
|
||||
implements DetectableFeature
|
||||
{
|
||||
/**
|
||||
* Interact with ERC-4337 accounts
|
||||
* @remarks Exposes useful functions available on account contracts.
|
||||
* @example
|
||||
* ```javascript
|
||||
* const contract = await sdk.getContract("{{contract_address}}");
|
||||
* await contract.account.getAllAdminsAndSigners();
|
||||
* ```
|
||||
* @public
|
||||
*/
|
||||
export class Account implements DetectableFeature {
|
||||
featureName = FEATURE_ACCOUNT.name;
|
||||
private contractWrapper: ContractWrapper<IAccountCore>;
|
||||
private accountPermissions: AccountPermissions | undefined;
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
Airdrop1155Output,
|
||||
} from "../../types/airdrop/airdrop";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ import { buildTransactionFunction } from "../../common/transactions";
|
||||
import { FEATURE_AIRDROP_ERC20 } from "../../constants/thirdweb-features";
|
||||
import { Address } from "../../schema/shared/Address";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
import { Airdrop20Content, Airdrop20Output } from "../../types/airdrop/airdrop";
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
Airdrop721Output,
|
||||
} from "../../types/airdrop/airdrop";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ import { FEATURE_APPURI } from "../../constants/thirdweb-features";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { TransactionResult } from "../types";
|
||||
import { ContractMetadata } from "./contract-metadata";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { BaseContract, utils } from "ethers";
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { BaseContract, Event, providers, utils } from "ethers";
|
||||
import type EventEmitter from "eventemitter3";
|
||||
import { EventType } from "../../constants/events";
|
||||
import type { ContractEvent, EventQueryOptions } from "../../types/events";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
|
||||
/**
|
||||
* Listen to Contract events in real time
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { BaseContract, CallOverrides } from "ethers";
|
||||
|
||||
/**
|
||||
* Allows overriding transaction behavior for this contract
|
||||
* @public
|
||||
* @internal
|
||||
*/
|
||||
export class ContractInterceptor<TContract extends BaseContract> {
|
||||
private contractWrapper;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { buildTransactionFunction } from "../../common/transactions";
|
||||
import { FEATURE_METADATA } from "../../constants/thirdweb-features";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { TransactionResult } from "../types";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,17 +4,14 @@ import { buildTransactionFunction } from "../../common/transactions";
|
||||
import { FEATURE_OWNER } from "../../constants/thirdweb-features";
|
||||
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
* Encodes and decodes Contract functions
|
||||
* @public
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TO BE REMOVED IN V4
|
||||
export class ContractOwner<TContract extends Ownable>
|
||||
implements DetectableFeature
|
||||
{
|
||||
export class ContractOwner implements DetectableFeature {
|
||||
featureName = FEATURE_OWNER.name;
|
||||
private contractWrapper;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { buildTransactionFunction } from "../../common/transactions";
|
||||
import { FEATURE_PLATFORM_FEE } from "../../constants/thirdweb-features";
|
||||
import { CommonPlatformFeeSchema } from "../../schema/contracts/common";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
@@ -21,10 +21,7 @@ import { Transaction } from "./transactions";
|
||||
* ```
|
||||
* @public
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TO BE REMOVED IN V4
|
||||
export class ContractPlatformFee<TContract extends IPlatformFee>
|
||||
implements DetectableFeature
|
||||
{
|
||||
export class ContractPlatformFee implements DetectableFeature {
|
||||
featureName = FEATURE_PLATFORM_FEE.name;
|
||||
private contractWrapper;
|
||||
|
||||
|
||||
@@ -10,15 +10,14 @@ import {
|
||||
ContractSource,
|
||||
PublishedMetadata,
|
||||
} from "../../schema/contracts/custom";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { fetchSourceFilesFromMetadata } from "../../common/fetchSourceFilesFromMetadata";
|
||||
|
||||
/**
|
||||
* Handles publish metadata for a contract
|
||||
* @internal
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- TO BE REMOVED IN V4
|
||||
export class ContractPublishedMetadata<TContract extends BaseContract> {
|
||||
export class ContractPublishedMetadata {
|
||||
private contractWrapper;
|
||||
private storage: ThirdwebStorage;
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ import {
|
||||
import { SDKOptions } from "../../schema/sdk-options";
|
||||
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
|
||||
import { NetworkInput, TransactionResult } from "../types";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { RPCConnectionHandler } from "./rpc-connection-handler";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { RPCConnectionHandler } from "./internal/rpc-connection-handler";
|
||||
import { Transaction } from "./transactions";
|
||||
import { fetchAndCacheDeployMetadata } from "../../common/any-evm-utils/fetchAndCacheDeployMetadata";
|
||||
import { fetchPublishedContractFromPolygon } from "../../common/any-evm-utils/fetchPublishedContractFromPolygon";
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Address } from "../../schema/shared/Address";
|
||||
import { AddressOrEns } from "../../schema/shared/AddressOrEnsSchema";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractEncoder } from "./contract-encoder";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { TransactionResult } from "../types";
|
||||
import { ContractEncoder } from "./contract-encoder";
|
||||
import { ContractMetadata, IGenericSchemaType } from "./contract-metadata";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ import { buildTransactionFunction } from "../../common/transactions";
|
||||
import { FEATURE_PRIMARY_SALE } from "../../constants/thirdweb-features";
|
||||
import { Address } from "../../schema/shared/Address";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import { verify } from "../../common/verification";
|
||||
import { SDKOptions } from "../../schema/sdk-options";
|
||||
import { ConstructorParamMap } from "../../types/any-evm/deploy-data";
|
||||
import { NetworkInput } from "../types";
|
||||
import { RPCConnectionHandler } from "./rpc-connection-handler";
|
||||
import { RPCConnectionHandler } from "./internal/rpc-connection-handler";
|
||||
import { ThirdwebStorage } from "@thirdweb-dev/storage";
|
||||
import invariant from "tiny-invariant";
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from "../../types/eips";
|
||||
import type { UploadProgressEvent } from "../../types/events";
|
||||
import type { TransactionResultWithId } from "../types";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,7 +53,7 @@ import {
|
||||
} from "../../types/eips";
|
||||
import { ContractEncoder } from "./contract-encoder";
|
||||
import { ContractMetadata } from "./contract-metadata";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
import { ClaimEligibility } from "../../enums/ClaimEligibility";
|
||||
|
||||
@@ -931,7 +931,7 @@ export class DropClaimConditions<
|
||||
});
|
||||
}
|
||||
|
||||
isNewSinglePhaseDrop(
|
||||
private isNewSinglePhaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<DropSinglePhase> {
|
||||
return (
|
||||
@@ -946,7 +946,7 @@ export class DropClaimConditions<
|
||||
);
|
||||
}
|
||||
|
||||
isNewMultiphaseDrop(
|
||||
private isNewMultiphaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<Drop> {
|
||||
return (
|
||||
@@ -955,7 +955,7 @@ export class DropClaimConditions<
|
||||
);
|
||||
}
|
||||
|
||||
isLegacySinglePhaseDrop(
|
||||
private isLegacySinglePhaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<DropSinglePhase_V1> {
|
||||
return (
|
||||
@@ -970,7 +970,7 @@ export class DropClaimConditions<
|
||||
);
|
||||
}
|
||||
|
||||
isLegacyMultiPhaseDrop(
|
||||
private isLegacyMultiPhaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<DropERC721_V3 | DropERC20_V2> {
|
||||
return (
|
||||
|
||||
@@ -47,7 +47,7 @@ import {
|
||||
} from "../../types/eips";
|
||||
import { ContractEncoder } from "./contract-encoder";
|
||||
import { ContractMetadata } from "./contract-metadata";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
import { ClaimEligibility } from "../../enums/ClaimEligibility";
|
||||
|
||||
@@ -972,7 +972,7 @@ export class DropErc1155ClaimConditions<
|
||||
});
|
||||
}
|
||||
|
||||
isNewSinglePhaseDrop(
|
||||
private isNewSinglePhaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<DropSinglePhase1155> {
|
||||
return detectContractFeature<DropSinglePhase1155>(
|
||||
@@ -981,7 +981,7 @@ export class DropErc1155ClaimConditions<
|
||||
);
|
||||
}
|
||||
|
||||
isNewMultiphaseDrop(
|
||||
private isNewMultiphaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<Drop1155> {
|
||||
return detectContractFeature<Drop1155>(
|
||||
@@ -990,7 +990,7 @@ export class DropErc1155ClaimConditions<
|
||||
);
|
||||
}
|
||||
|
||||
isLegacySinglePhaseDrop(
|
||||
private isLegacySinglePhaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<DropSinglePhase1155_V1> {
|
||||
return detectContractFeature<DropSinglePhase1155_V1>(
|
||||
@@ -999,7 +999,7 @@ export class DropErc1155ClaimConditions<
|
||||
);
|
||||
}
|
||||
|
||||
isLegacyMultiPhaseDrop(
|
||||
private isLegacyMultiPhaseDrop(
|
||||
contractWrapper: ContractWrapper<any>,
|
||||
): contractWrapper is ContractWrapper<DropERC1155_V2> {
|
||||
return detectContractFeature<DropERC1155_V2>(
|
||||
|
||||
@@ -30,7 +30,7 @@ import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { TransactionResultWithId } from "../types";
|
||||
import { ContractEncoder } from "./contract-encoder";
|
||||
import { ContractRoles } from "./contract-roles";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,17 +54,17 @@ import type { UploadProgressEvent } from "../../types/events";
|
||||
import { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { UpdateableNetwork } from "../interfaces/contract";
|
||||
import { NetworkInput, TransactionResultWithId } from "../types";
|
||||
import { ContractWrapper } from "./contract-wrapper";
|
||||
import { ERC1155Claimable } from "./erc-1155-claimable";
|
||||
import { Erc1155ClaimableWithConditions } from "./erc-1155-claimable-with-conditions";
|
||||
import { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { ERC1155Claimable } from "./internal/erc1155/erc-1155-claimable";
|
||||
import { Erc1155ClaimableWithConditions } from "./internal/erc1155/erc-1155-claimable-with-conditions";
|
||||
import { Erc1155SignatureMintable } from "./erc-1155-signature-mintable";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
import { ContractEncoder } from "./contract-encoder";
|
||||
import { Erc1155Burnable } from "./erc-1155-burnable";
|
||||
import { Erc1155Enumerable } from "./erc-1155-enumerable";
|
||||
import { Erc1155LazyMintable } from "./erc-1155-lazy-mintable";
|
||||
import { Erc1155Mintable } from "./erc-1155-mintable";
|
||||
import { Erc1155Burnable } from "./internal/erc1155/erc-1155-burnable";
|
||||
import { Erc1155Enumerable } from "./internal/erc1155/erc-1155-enumerable";
|
||||
import { Erc1155LazyMintable } from "./internal/erc1155/erc-1155-lazy-mintable";
|
||||
import { Erc1155Mintable } from "./internal/erc1155/erc-1155-mintable";
|
||||
|
||||
/**
|
||||
* Standard ERC1155 NFT functions
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
import type { DetectableFeature } from "../interfaces/DetectableFeature";
|
||||
import { ContractEncoder } from "./contract-encoder";
|
||||
import { ContractRoles } from "./contract-roles";
|
||||
import type { ContractWrapper } from "./contract-wrapper";
|
||||
import type { ContractWrapper } from "./internal/contract-wrapper";
|
||||
import { Transaction } from "./transactions";
|
||||
|
||||
/**
|
||||
@@ -213,7 +213,7 @@ export class Erc20SignatureMintable implements DetectableFeature {
|
||||
FilledSignaturePayload20[],
|
||||
] = await Promise.all([
|
||||
this.contractWrapper.getChainID(),
|
||||
this.contractWrapper.read("name", []), // ERC20Permit (EIP-712) spec differs from signature mint 721, 1155.
|
||||
this.contractWrapper.read("name", []), // ERC20Permit (EIP-712) spec differs from signature mint 721, 1155.
|
||||
Promise.all(
|
||||
payloadsToSign.map((m) => Signature20PayloadInput.parseAsync(m)),
|
||||
),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user