thirdweb 5.64.0-nightly-e6e994479fb8386b1740de4170f33446f038f2b1-20241024000332 → 5.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/extensions/erc1155/write/mintAdditionalSupplyTo.js +1 -6
- package/dist/cjs/extensions/erc1155/write/mintAdditionalSupplyTo.js.map +1 -1
- package/dist/cjs/react/core/utils/walletIcon.js +7 -7
- package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
- package/dist/cjs/react/native/ui/components/WalletImage.js +3 -1
- package/dist/cjs/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js +0 -3
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletTypeRowButton.js +1 -4
- package/dist/cjs/react/web/ui/ConnectWallet/WalletTypeRowButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/EmailIcon.js +12 -0
- package/dist/cjs/react/web/ui/ConnectWallet/icons/EmailIcon.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/icons/FingerPrintIcon.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/FingerPrintIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/GuestIcon.js +12 -0
- package/dist/cjs/react/web/ui/ConnectWallet/icons/GuestIcon.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/icons/OutlineWalletIcon.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/OutlineWalletIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/PhoneIcon.js +12 -0
- package/dist/cjs/react/web/ui/ConnectWallet/icons/PhoneIcon.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +5 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js +34 -9
- package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +1 -1
- package/dist/cjs/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js +1 -1
- package/dist/cjs/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js +29 -12
- package/dist/cjs/react/web/wallets/in-app/WalletAuth.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +16 -6
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/en.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/cjs/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-auth-options.js +5 -0
- package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-auth-options.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/cjs/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/cjs/wallets/types.js +1 -0
- package/dist/cjs/wallets/types.js.map +1 -1
- package/dist/esm/exports/pay.js +0 -1
- package/dist/esm/exports/pay.js.map +1 -1
- package/dist/esm/exports/react.js +0 -5
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +0 -2
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/exports/thirdweb.js +0 -1
- package/dist/esm/exports/thirdweb.js.map +1 -1
- package/dist/esm/exports/wallets/embedded.js +0 -1
- package/dist/esm/exports/wallets/embedded.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.js +0 -1
- package/dist/esm/exports/wallets/in-app.js.map +1 -1
- package/dist/esm/exports/wallets/in-app.native.js +0 -1
- package/dist/esm/exports/wallets/in-app.native.js.map +1 -1
- package/dist/esm/exports/wallets.js +0 -1
- package/dist/esm/exports/wallets.js.map +1 -1
- package/dist/esm/exports/wallets.native.js +0 -1
- package/dist/esm/exports/wallets.native.js.map +1 -1
- package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyTo.js +1 -6
- package/dist/esm/extensions/erc1155/write/mintAdditionalSupplyTo.js.map +1 -1
- package/dist/esm/react/core/utils/walletIcon.js +3 -3
- package/dist/esm/react/core/utils/walletIcon.js.map +1 -1
- package/dist/esm/react/native/ui/components/WalletImage.js +3 -1
- package/dist/esm/react/native/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js +0 -3
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletTypeRowButton.js +2 -5
- package/dist/esm/react/web/ui/ConnectWallet/WalletTypeRowButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/EmailIcon.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/icons/EmailIcon.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/icons/FingerPrintIcon.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/FingerPrintIcon.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/GuestIcon.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/icons/GuestIcon.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/icons/OutlineWalletIcon.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/OutlineWalletIcon.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/PhoneIcon.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/icons/PhoneIcon.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +5 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js +34 -9
- package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js +1 -1
- package/dist/esm/react/web/wallets/ecosystem/EcosystemWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js +1 -1
- package/dist/esm/react/web/wallets/in-app/InAppWalletConnectUI.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js +29 -12
- package/dist/esm/react/web/wallets/in-app/WalletAuth.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +17 -7
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/de.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/en.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/es.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/fr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/ja.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/kr.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/tl.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/locale/vi.js +1 -0
- package/dist/esm/react/web/wallets/shared/locale/vi.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-auth-options.js +5 -0
- package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-auth-options.js.map +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js +1 -1
- package/dist/esm/wallets/in-app/core/authentication/getLoginPath.js.map +1 -1
- package/dist/esm/wallets/types.js +1 -0
- package/dist/esm/wallets/types.js.map +1 -1
- package/dist/types/exports/pay.d.ts +1 -1
- package/dist/types/exports/pay.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +3 -3
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +1 -1
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/exports/thirdweb.d.ts +1 -1
- package/dist/types/exports/thirdweb.d.ts.map +1 -1
- package/dist/types/exports/wallets/embedded.d.ts +1 -1
- package/dist/types/exports/wallets/embedded.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.d.ts +1 -1
- package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
- package/dist/types/exports/wallets/in-app.native.d.ts +1 -1
- package/dist/types/exports/wallets/in-app.native.d.ts.map +1 -1
- package/dist/types/exports/wallets.d.ts +1 -1
- package/dist/types/exports/wallets.d.ts.map +1 -1
- package/dist/types/exports/wallets.native.d.ts +1 -1
- package/dist/types/exports/wallets.native.d.ts.map +1 -1
- package/dist/types/extensions/erc1155/write/mintAdditionalSupplyTo.d.ts.map +1 -1
- package/dist/types/react/core/utils/walletIcon.d.ts +0 -3
- package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/MenuButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletTypeRowButton.d.ts +2 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletTypeRowButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/icons/EmailIcon.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/EmailIcon.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/GuestIcon.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/GuestIcon.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/PhoneIcon.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/PhoneIcon.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/types.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts +1 -0
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +3 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/de.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/en.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/es.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts +1 -0
- package/dist/types/react/web/wallets/shared/locale/vi.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/ecosystem/get-ecosystem-wallet-auth-options.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts +2 -2
- package/dist/types/wallets/in-app/core/authentication/getLoginPath.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
- package/dist/types/wallets/types.d.ts +1 -1
- package/dist/types/wallets/types.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/exports/pay.ts +3 -3
- package/src/exports/react.native.ts +3 -3
- package/src/exports/react.ts +5 -5
- package/src/exports/thirdweb.ts +3 -3
- package/src/exports/wallets/embedded.ts +1 -1
- package/src/exports/wallets/in-app.native.ts +1 -1
- package/src/exports/wallets/in-app.ts +1 -1
- package/src/exports/wallets.native.ts +1 -1
- package/src/exports/wallets.ts +1 -1
- package/src/extensions/erc1155/drop1155.test.ts +164 -34
- package/src/extensions/erc1155/drops/read/getActiveClaimCondition.test.ts +0 -90
- package/src/extensions/erc1155/write/mintAdditionalSupplyTo.ts +1 -7
- package/src/extensions/prebuilts/deploy-erc1155.test.ts +5 -5
- package/src/extensions/prebuilts/deploy-pack.test.ts +4 -2
- package/src/react/core/utils/walletIcon.ts +3 -3
- package/src/react/native/ui/components/WalletImage.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/MenuButton.tsx +0 -3
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx +4 -17
- package/src/react/web/ui/ConnectWallet/icons/EmailIcon.tsx +30 -0
- package/src/react/web/ui/ConnectWallet/icons/FingerPrintIcon.tsx +9 -9
- package/src/react/web/ui/ConnectWallet/icons/GuestIcon.tsx +24 -0
- package/src/react/web/ui/ConnectWallet/icons/OutlineWalletIcon.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/icons/PhoneIcon.tsx +32 -0
- package/src/react/web/ui/ConnectWallet/icons/types.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx +10 -1
- package/src/react/web/ui/components/WalletImage.tsx +48 -21
- package/src/react/web/wallets/ecosystem/EcosystemWalletConnectUI.tsx +1 -0
- package/src/react/web/wallets/in-app/InAppWalletConnectUI.tsx +1 -0
- package/src/react/web/wallets/in-app/WalletAuth.tsx +34 -12
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +30 -14
- package/src/react/web/wallets/shared/locale/de.ts +1 -0
- package/src/react/web/wallets/shared/locale/en.ts +1 -0
- package/src/react/web/wallets/shared/locale/es.ts +1 -0
- package/src/react/web/wallets/shared/locale/fr.ts +1 -0
- package/src/react/web/wallets/shared/locale/ja.ts +1 -0
- package/src/react/web/wallets/shared/locale/kr.ts +1 -0
- package/src/react/web/wallets/shared/locale/tl.ts +1 -0
- package/src/react/web/wallets/shared/locale/types.ts +1 -0
- package/src/react/web/wallets/shared/locale/vi.ts +1 -0
- package/src/version.ts +1 -1
- package/src/wallets/ecosystem/get-ecosystem-wallet-auth-options.ts +6 -0
- package/src/wallets/in-app/core/authentication/getLoginPath.ts +4 -4
- package/src/wallets/in-app/core/authentication/types.ts +1 -1
- package/src/wallets/types.ts +1 -0
- package/src/extensions/erc1155/drops/write/claimTo.test.ts +0 -185
- package/src/extensions/erc1155/drops/write/updateMetadata.test.ts +0 -54
@@ -40,5 +40,11 @@ export async function getEcosystemOptions(
|
|
40
40
|
);
|
41
41
|
}
|
42
42
|
|
43
|
+
// siwe is the auth option in the backend, but we want to use wallet as the auth option in the frontend
|
44
|
+
if (data.authOptions?.includes("siwe")) {
|
45
|
+
data.authOptions = data.authOptions.filter((o: string) => o !== "siwe");
|
46
|
+
data.authOptions.push("wallet");
|
47
|
+
}
|
48
|
+
|
43
49
|
return data ?? null;
|
44
50
|
}
|
@@ -3,8 +3,8 @@ import { getThirdwebBaseUrl } from "../../../../utils/domains.js";
|
|
3
3
|
import { type AuthOption, authOptions } from "../../../../wallets/types.js";
|
4
4
|
import type { Ecosystem } from "../wallet/types.js";
|
5
5
|
|
6
|
-
const getLoginOptionRoute = (option: AuthOption
|
7
|
-
if (!authOptions.includes(option as AuthOption)
|
6
|
+
const getLoginOptionRoute = (option: AuthOption) => {
|
7
|
+
if (!authOptions.includes(option as AuthOption)) {
|
8
8
|
throw new Error(`Unknown auth option ${option}`);
|
9
9
|
}
|
10
10
|
switch (option) {
|
@@ -22,7 +22,7 @@ export const getLoginUrl = ({
|
|
22
22
|
mode = "popup",
|
23
23
|
redirectUrl,
|
24
24
|
}: {
|
25
|
-
authOption: AuthOption
|
25
|
+
authOption: AuthOption;
|
26
26
|
client: ThirdwebClient;
|
27
27
|
ecosystem?: Ecosystem;
|
28
28
|
mode?: "popup" | "redirect" | "window";
|
@@ -60,7 +60,7 @@ export const getLoginCallbackUrl = ({
|
|
60
60
|
client,
|
61
61
|
ecosystem,
|
62
62
|
}: {
|
63
|
-
authOption: AuthOption
|
63
|
+
authOption: AuthOption;
|
64
64
|
client: ThirdwebClient;
|
65
65
|
ecosystem?: Ecosystem;
|
66
66
|
}): string => {
|
package/src/wallets/types.ts
CHANGED
@@ -1,185 +0,0 @@
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
2
|
-
import { ANVIL_CHAIN } from "~test/chains.js";
|
3
|
-
import { TEST_CLIENT } from "~test/test-clients.js";
|
4
|
-
import { TEST_ACCOUNT_A, TEST_ACCOUNT_B } from "~test/test-wallets.js";
|
5
|
-
|
6
|
-
import { TEST_CONTRACT_URI } from "~test/ipfs-uris.js";
|
7
|
-
import { NATIVE_TOKEN_ADDRESS } from "../../../../constants/addresses.js";
|
8
|
-
import { getContract } from "../../../../contract/contract.js";
|
9
|
-
import { deployERC20Contract } from "../../../../extensions/prebuilts/deploy-erc20.js";
|
10
|
-
import { deployERC1155Contract } from "../../../../extensions/prebuilts/deploy-erc1155.js";
|
11
|
-
import { sendAndConfirmTransaction } from "../../../../transaction/actions/send-and-confirm-transaction.js";
|
12
|
-
import { totalSupply } from "../../__generated__/IERC1155/read/totalSupply.js";
|
13
|
-
import { lazyMint } from "../../write/lazyMint.js";
|
14
|
-
import { claimTo } from "./claimTo.js";
|
15
|
-
import { setClaimConditions } from "./setClaimConditions.js";
|
16
|
-
|
17
|
-
const account = TEST_ACCOUNT_A;
|
18
|
-
const client = TEST_CLIENT;
|
19
|
-
const chain = ANVIL_CHAIN;
|
20
|
-
|
21
|
-
describe.runIf(process.env.TW_SECRET_KEY)("erc1155 claimTo extension", () => {
|
22
|
-
it("should claim the nft", async () => {
|
23
|
-
const address = await deployERC1155Contract({
|
24
|
-
client,
|
25
|
-
chain,
|
26
|
-
account,
|
27
|
-
type: "DropERC1155",
|
28
|
-
params: {
|
29
|
-
name: "Edition Drop",
|
30
|
-
contractURI: TEST_CONTRACT_URI,
|
31
|
-
},
|
32
|
-
});
|
33
|
-
const contract = getContract({
|
34
|
-
address,
|
35
|
-
client,
|
36
|
-
chain,
|
37
|
-
});
|
38
|
-
const lazyMintTx = lazyMint({ contract, nfts: [{ name: "token 0" }] });
|
39
|
-
await sendAndConfirmTransaction({ transaction: lazyMintTx, account });
|
40
|
-
const setClaimTx = setClaimConditions({
|
41
|
-
contract,
|
42
|
-
tokenId: 0n,
|
43
|
-
phases: [
|
44
|
-
{
|
45
|
-
maxClaimableSupply: 100n,
|
46
|
-
maxClaimablePerWallet: 100n,
|
47
|
-
currencyAddress: NATIVE_TOKEN_ADDRESS,
|
48
|
-
price: 0.1,
|
49
|
-
startTime: new Date(),
|
50
|
-
},
|
51
|
-
],
|
52
|
-
});
|
53
|
-
await sendAndConfirmTransaction({ transaction: setClaimTx, account });
|
54
|
-
|
55
|
-
const transaction = claimTo({
|
56
|
-
contract,
|
57
|
-
tokenId: 0n,
|
58
|
-
quantity: 1n,
|
59
|
-
to: account.address,
|
60
|
-
});
|
61
|
-
await sendAndConfirmTransaction({ transaction, account });
|
62
|
-
const supplyCount = await totalSupply({ contract, id: 0n });
|
63
|
-
expect(supplyCount).toBe(1n);
|
64
|
-
});
|
65
|
-
|
66
|
-
it("should claim with allowlist", async () => {
|
67
|
-
const address = await deployERC1155Contract({
|
68
|
-
client,
|
69
|
-
chain,
|
70
|
-
account,
|
71
|
-
type: "DropERC1155",
|
72
|
-
params: {
|
73
|
-
name: "Edition Drop",
|
74
|
-
contractURI: TEST_CONTRACT_URI,
|
75
|
-
},
|
76
|
-
});
|
77
|
-
const contract = getContract({
|
78
|
-
address,
|
79
|
-
client,
|
80
|
-
chain,
|
81
|
-
});
|
82
|
-
const lazyMintTx = lazyMint({ contract, nfts: [{ name: "token 0" }] });
|
83
|
-
await sendAndConfirmTransaction({ transaction: lazyMintTx, account });
|
84
|
-
const setClaimTx = setClaimConditions({
|
85
|
-
contract,
|
86
|
-
tokenId: 0n,
|
87
|
-
phases: [
|
88
|
-
{
|
89
|
-
maxClaimableSupply: 100n,
|
90
|
-
maxClaimablePerWallet: 5n,
|
91
|
-
currencyAddress: NATIVE_TOKEN_ADDRESS,
|
92
|
-
price: 0.06,
|
93
|
-
startTime: new Date(),
|
94
|
-
overrideList: [
|
95
|
-
{
|
96
|
-
address: TEST_ACCOUNT_B.address,
|
97
|
-
maxClaimable: "50",
|
98
|
-
price: "0.3",
|
99
|
-
currencyAddress: NATIVE_TOKEN_ADDRESS,
|
100
|
-
},
|
101
|
-
],
|
102
|
-
},
|
103
|
-
],
|
104
|
-
});
|
105
|
-
await sendAndConfirmTransaction({ transaction: setClaimTx, account });
|
106
|
-
|
107
|
-
const transaction = claimTo({
|
108
|
-
contract,
|
109
|
-
tokenId: 0n,
|
110
|
-
quantity: 50n,
|
111
|
-
to: TEST_ACCOUNT_B.address,
|
112
|
-
});
|
113
|
-
await sendAndConfirmTransaction({ transaction, account: TEST_ACCOUNT_B });
|
114
|
-
const supplyCount = await totalSupply({ contract, id: 0n });
|
115
|
-
expect(supplyCount).toBe(50n);
|
116
|
-
});
|
117
|
-
|
118
|
-
/**
|
119
|
-
* This is to document the behavior where one can claim without paying if the claiming address
|
120
|
-
* is the same as the PrimaryRecipientAddress, because of this Solidity code:
|
121
|
-
* ```solidity
|
122
|
-
* // CurrencyTransferLib.sol
|
123
|
-
* function safeTransferERC20(address _currency, address _from, address _to, uint256 _amount) internal {
|
124
|
-
* if (_from == _to) {
|
125
|
-
* return;
|
126
|
-
* }
|
127
|
-
* ...
|
128
|
-
* }
|
129
|
-
* ```
|
130
|
-
*/
|
131
|
-
it("address that is the same with PrimaryFeeRecipient can claim without paying ERC20", async () => {
|
132
|
-
const tokenAddress = await deployERC20Contract({
|
133
|
-
client,
|
134
|
-
chain,
|
135
|
-
account,
|
136
|
-
type: "TokenERC20",
|
137
|
-
params: {
|
138
|
-
name: "token20",
|
139
|
-
contractURI: TEST_CONTRACT_URI,
|
140
|
-
},
|
141
|
-
});
|
142
|
-
const address = await deployERC1155Contract({
|
143
|
-
client,
|
144
|
-
chain,
|
145
|
-
account,
|
146
|
-
type: "DropERC1155",
|
147
|
-
params: {
|
148
|
-
name: "Edition Drop",
|
149
|
-
contractURI: TEST_CONTRACT_URI,
|
150
|
-
saleRecipient: account.address,
|
151
|
-
},
|
152
|
-
});
|
153
|
-
const contract = getContract({
|
154
|
-
address,
|
155
|
-
client,
|
156
|
-
chain,
|
157
|
-
});
|
158
|
-
const lazyMintTx = lazyMint({ contract, nfts: [{ name: "token 0" }] });
|
159
|
-
await sendAndConfirmTransaction({ transaction: lazyMintTx, account });
|
160
|
-
const setClaimTx = setClaimConditions({
|
161
|
-
contract,
|
162
|
-
tokenId: 0n,
|
163
|
-
phases: [
|
164
|
-
{
|
165
|
-
maxClaimableSupply: 100n,
|
166
|
-
maxClaimablePerWallet: 100n,
|
167
|
-
currencyAddress: tokenAddress,
|
168
|
-
price: 1000,
|
169
|
-
startTime: new Date(),
|
170
|
-
},
|
171
|
-
],
|
172
|
-
});
|
173
|
-
await sendAndConfirmTransaction({ transaction: setClaimTx, account });
|
174
|
-
|
175
|
-
const transaction = claimTo({
|
176
|
-
contract,
|
177
|
-
tokenId: 0n,
|
178
|
-
quantity: 1n,
|
179
|
-
to: account.address,
|
180
|
-
});
|
181
|
-
await sendAndConfirmTransaction({ transaction, account });
|
182
|
-
const supplyCount = await totalSupply({ contract, id: 0n });
|
183
|
-
expect(supplyCount).toBe(1n);
|
184
|
-
});
|
185
|
-
});
|
@@ -1,54 +0,0 @@
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
2
|
-
import { ANVIL_CHAIN } from "~test/chains.js";
|
3
|
-
import { TEST_CLIENT } from "~test/test-clients.js";
|
4
|
-
import { TEST_ACCOUNT_A } from "~test/test-wallets.js";
|
5
|
-
|
6
|
-
import { TEST_CONTRACT_URI } from "~test/ipfs-uris.js";
|
7
|
-
import { getContract } from "../../../../contract/contract.js";
|
8
|
-
import { deployERC1155Contract } from "../../../../extensions/prebuilts/deploy-erc1155.js";
|
9
|
-
import { sendAndConfirmTransaction } from "../../../../transaction/actions/send-and-confirm-transaction.js";
|
10
|
-
import { getNFTs } from "../../read/getNFTs.js";
|
11
|
-
import { lazyMint } from "../../write/lazyMint.js";
|
12
|
-
import { updateMetadata } from "./updateMetadata.js";
|
13
|
-
|
14
|
-
const account = TEST_ACCOUNT_A;
|
15
|
-
const client = TEST_CLIENT;
|
16
|
-
const chain = ANVIL_CHAIN;
|
17
|
-
describe.runIf(process.env.TW_SECRET_KEY)("updateMetadata ERC1155", () => {
|
18
|
-
it("should update metadata", async () => {
|
19
|
-
const address = await deployERC1155Contract({
|
20
|
-
client,
|
21
|
-
chain,
|
22
|
-
account,
|
23
|
-
type: "DropERC1155",
|
24
|
-
params: {
|
25
|
-
name: "Edition Drop",
|
26
|
-
contractURI: TEST_CONTRACT_URI,
|
27
|
-
},
|
28
|
-
});
|
29
|
-
const contract = getContract({
|
30
|
-
address,
|
31
|
-
client,
|
32
|
-
chain,
|
33
|
-
});
|
34
|
-
const lazyMintTx = lazyMint({
|
35
|
-
contract,
|
36
|
-
nfts: [{ name: "token 0" }, { name: "token 1" }, { name: "token 2" }],
|
37
|
-
});
|
38
|
-
await sendAndConfirmTransaction({ transaction: lazyMintTx, account });
|
39
|
-
|
40
|
-
const updateTx = updateMetadata({
|
41
|
-
contract,
|
42
|
-
targetTokenId: 1n,
|
43
|
-
newMetadata: { name: "token 1 - updated" },
|
44
|
-
});
|
45
|
-
await sendAndConfirmTransaction({ transaction: updateTx, account });
|
46
|
-
|
47
|
-
const nfts = await getNFTs({ contract });
|
48
|
-
|
49
|
-
expect(nfts.length).toBe(3);
|
50
|
-
expect(nfts[0]?.metadata.name).toBe("token 0");
|
51
|
-
expect(nfts[1]?.metadata.name).toBe("token 1 - updated");
|
52
|
-
expect(nfts[2]?.metadata.name).toBe("token 2");
|
53
|
-
});
|
54
|
-
});
|