thirdweb 5.111.9 → 5.111.11-nightly-eb1a9c3c3e670290e28ad86e14ddae4c7cf7455d-20251112000353
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/bridge/Webhook.js +62 -1
- package/dist/cjs/bridge/Webhook.js.map +1 -1
- package/dist/cjs/cli/commands/stylus/create.js +48 -0
- package/dist/cjs/cli/commands/stylus/create.js.map +1 -1
- package/dist/cjs/extensions/modules/common/installPublishedModule.js +26 -9
- package/dist/cjs/extensions/modules/common/installPublishedModule.js.map +1 -1
- package/dist/cjs/extensions/prebuilts/deploy-published.js +1 -1
- package/dist/cjs/extensions/prebuilts/deploy-published.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/TokenAndChain.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js +2 -2
- package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js +7 -2
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +5 -5
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js +20 -44
- package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-chain.js +10 -2
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-chain.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-token-ui.js +94 -48
- package/dist/cjs/react/web/ui/Bridge/swap-widget/select-token-ui.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js +6 -8
- package/dist/cjs/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/Spacer.js +1 -0
- package/dist/cjs/react/web/ui/components/Spacer.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/bridge/Webhook.js +62 -1
- package/dist/esm/bridge/Webhook.js.map +1 -1
- package/dist/esm/cli/commands/stylus/create.js +48 -0
- package/dist/esm/cli/commands/stylus/create.js.map +1 -1
- package/dist/esm/extensions/modules/common/installPublishedModule.js +26 -9
- package/dist/esm/extensions/modules/common/installPublishedModule.js.map +1 -1
- package/dist/esm/extensions/prebuilts/deploy-published.js +1 -1
- package/dist/esm/extensions/prebuilts/deploy-published.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +1 -1
- package/dist/esm/react/web/ui/Bridge/common/TokenAndChain.js +1 -1
- package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js +2 -2
- package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js +7 -2
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +5 -5
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js +23 -47
- package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +4 -4
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-chain.js +10 -2
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-chain.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-token-ui.js +95 -49
- package/dist/esm/react/web/ui/Bridge/swap-widget/select-token-ui.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js +6 -8
- package/dist/esm/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/Spacer.js +1 -0
- package/dist/esm/react/web/ui/components/Spacer.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/scripts/bridge-widget.js +100 -100
- package/dist/types/bridge/Webhook.d.ts +22 -1
- package/dist/types/bridge/Webhook.d.ts.map +1 -1
- package/dist/types/cli/commands/stylus/create.d.ts.map +1 -1
- package/dist/types/extensions/modules/common/installPublishedModule.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/TokenBalanceRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-success/PaymentReceipt.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/select-chain.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/select-token-ui.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/CopyIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/Spacer.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/bridge/Webhook.test.ts +157 -0
- package/src/bridge/Webhook.ts +107 -0
- package/src/cli/commands/stylus/create.ts +49 -0
- package/src/contract/deployment/deploy-dynamic.test.ts +35 -39
- package/src/extensions/dynamic-contracts/write/installPublishedExtension.test.ts +40 -44
- package/src/extensions/dynamic-contracts/write/uninstallExtension.test.ts +1 -2
- package/src/extensions/modules/common/installPublishedModule.ts +28 -9
- package/src/extensions/prebuilts/deploy-published.ts +1 -1
- package/src/react/web/ui/Bridge/TransactionPayment.tsx +1 -1
- package/src/react/web/ui/Bridge/common/TokenAndChain.tsx +1 -1
- package/src/react/web/ui/Bridge/common/TokenBalanceRow.tsx +11 -10
- package/src/react/web/ui/Bridge/common/selected-token-button.tsx +11 -1
- package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +9 -7
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +1 -1
- package/src/react/web/ui/Bridge/payment-success/PaymentReceipt.tsx +92 -115
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +4 -6
- package/src/react/web/ui/Bridge/swap-widget/select-chain.tsx +18 -3
- package/src/react/web/ui/Bridge/swap-widget/select-token-ui.tsx +186 -118
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +5 -3
- package/src/react/web/ui/components/CopyIcon.tsx +8 -9
- package/src/react/web/ui/components/Spacer.tsx +1 -0
- package/src/version.ts +1 -1
|
@@ -11,54 +11,50 @@ import { sendTransaction } from "../../../transaction/actions/send-transaction.j
|
|
|
11
11
|
import { installPublishedExtension } from "./installPublishedExtension.js";
|
|
12
12
|
|
|
13
13
|
describe.runIf(process.env.TW_SECRET_KEY)("install extension", () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
chain: ANVIL_CHAIN,
|
|
21
|
-
client: TEST_CLIENT,
|
|
22
|
-
});
|
|
14
|
+
it.sequential("should install extension to a dynamic contract", async () => {
|
|
15
|
+
await deployCloneFactory({
|
|
16
|
+
account: TEST_ACCOUNT_A,
|
|
17
|
+
chain: ANVIL_CHAIN,
|
|
18
|
+
client: TEST_CLIENT,
|
|
19
|
+
});
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
const deployed = await deployPublishedContract({
|
|
22
|
+
account: TEST_ACCOUNT_A,
|
|
23
|
+
chain: ANVIL_CHAIN,
|
|
24
|
+
client: TEST_CLIENT,
|
|
25
|
+
contractId: "EvolvingNFT",
|
|
26
|
+
contractParams: {
|
|
27
|
+
contractURI: "",
|
|
28
|
+
defaultAdmin: TEST_ACCOUNT_A.address,
|
|
29
|
+
name: "Evolving nft",
|
|
30
|
+
royaltyBps: 0n,
|
|
31
|
+
royaltyRecipient: TEST_ACCOUNT_A.address,
|
|
32
|
+
saleRecipient: TEST_ACCOUNT_A.address,
|
|
33
|
+
symbol: "ENFT",
|
|
34
|
+
trustedForwarders: [],
|
|
35
|
+
},
|
|
36
|
+
});
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
const contract = getContract({
|
|
39
|
+
address: deployed,
|
|
40
|
+
chain: ANVIL_CHAIN,
|
|
41
|
+
client: TEST_CLIENT,
|
|
42
|
+
});
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
const transaction = installPublishedExtension({
|
|
45
|
+
account: TEST_ACCOUNT_A,
|
|
46
|
+
contract,
|
|
47
|
+
extensionName: "DirectListingsLogic",
|
|
48
|
+
});
|
|
52
49
|
|
|
53
|
-
|
|
50
|
+
await sendTransaction({ account: TEST_ACCOUNT_A, transaction });
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
const extensions = await readContract({
|
|
53
|
+
contract,
|
|
54
|
+
method: resolveMethod("getAllExtensions"),
|
|
55
|
+
params: [],
|
|
56
|
+
});
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
58
|
+
expect(extensions.length).toEqual(4);
|
|
59
|
+
});
|
|
64
60
|
});
|
|
@@ -11,8 +11,7 @@ import { deployPublishedContract } from "../../prebuilts/deploy-published.js";
|
|
|
11
11
|
import { uninstallExtension } from "./uninstallExtension.js";
|
|
12
12
|
|
|
13
13
|
describe.runIf(process.env.TW_SECRET_KEY)("uninstall extension", () => {
|
|
14
|
-
|
|
15
|
-
it.skip.sequential(
|
|
14
|
+
it.sequential(
|
|
16
15
|
"should uninstall extension from a dynamic contract",
|
|
17
16
|
async () => {
|
|
18
17
|
await deployCloneFactory({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ThirdwebContract } from "../../../contract/contract.js";
|
|
2
2
|
import { getOrDeployInfraForPublishedContract } from "../../../contract/deployment/utils/bootstrap.js";
|
|
3
3
|
import type { Account } from "../../../wallets/interfaces/wallet.js";
|
|
4
|
+
import { deployPublishedContract } from "../../prebuilts/deploy-published.js";
|
|
4
5
|
import { installModule } from "../__generated__/IModularCore/write/installModule.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -49,17 +50,35 @@ export function installPublishedModule(options: InstallPublishedModuleOptions) {
|
|
|
49
50
|
|
|
50
51
|
return installModule({
|
|
51
52
|
asyncParams: async () => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
let implementationAddress: string;
|
|
54
|
+
|
|
55
|
+
if (moduleName.toLowerCase().includes("stylus")) {
|
|
56
|
+
// TODO: switch to deterministic / create2 when available
|
|
57
|
+
|
|
58
|
+
implementationAddress = await deployPublishedContract({
|
|
59
|
+
account,
|
|
60
|
+
chain: contract.chain,
|
|
61
|
+
client: contract.client,
|
|
62
|
+
contractParams: constructorParams,
|
|
63
|
+
contractId: moduleName,
|
|
64
|
+
publisher,
|
|
65
|
+
});
|
|
66
|
+
} else {
|
|
67
|
+
const deployedModule = await getOrDeployInfraForPublishedContract({
|
|
68
|
+
account,
|
|
69
|
+
chain: contract.chain,
|
|
70
|
+
client: contract.client,
|
|
71
|
+
constructorParams,
|
|
72
|
+
contractId: moduleName,
|
|
73
|
+
publisher,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
implementationAddress = deployedModule.implementationContract
|
|
77
|
+
.address as string;
|
|
78
|
+
}
|
|
60
79
|
return {
|
|
61
80
|
data: moduleData || "0x",
|
|
62
|
-
moduleContract:
|
|
81
|
+
moduleContract: implementationAddress,
|
|
63
82
|
};
|
|
64
83
|
},
|
|
65
84
|
contract,
|
|
@@ -215,7 +215,7 @@ export async function deployContractfromDeployMetadata(
|
|
|
215
215
|
if (
|
|
216
216
|
deployMetadata.routerType === "dynamic" &&
|
|
217
217
|
deployMetadata.defaultExtensions &&
|
|
218
|
-
!isZkSyncChain(chain)
|
|
218
|
+
!(await isZkSyncChain(chain))
|
|
219
219
|
) {
|
|
220
220
|
for (const e of deployMetadata.defaultExtensions) {
|
|
221
221
|
await getOrDeployInfraForPublishedContract({
|
|
@@ -68,18 +68,9 @@ export function TokenBalanceRow({
|
|
|
68
68
|
overflow: "hidden",
|
|
69
69
|
}}
|
|
70
70
|
>
|
|
71
|
-
<
|
|
72
|
-
currency={currency}
|
|
73
|
-
chain={chain}
|
|
74
|
-
client={client}
|
|
71
|
+
<Text
|
|
75
72
|
color="primaryText"
|
|
76
73
|
size="sm"
|
|
77
|
-
token={token}
|
|
78
|
-
tokenAmount={amount}
|
|
79
|
-
/>
|
|
80
|
-
<Text
|
|
81
|
-
color="secondaryText"
|
|
82
|
-
size="xs"
|
|
83
74
|
style={{
|
|
84
75
|
overflow: "hidden",
|
|
85
76
|
textOverflow: "ellipsis",
|
|
@@ -91,6 +82,16 @@ export function TokenBalanceRow({
|
|
|
91
82
|
minimumFractionDigits: 0,
|
|
92
83
|
})} ${token.symbol}`}
|
|
93
84
|
</Text>
|
|
85
|
+
|
|
86
|
+
<FiatValue
|
|
87
|
+
currency={currency}
|
|
88
|
+
chain={chain}
|
|
89
|
+
client={client}
|
|
90
|
+
color="secondaryText"
|
|
91
|
+
size="sm"
|
|
92
|
+
token={token}
|
|
93
|
+
tokenAmount={amount}
|
|
94
|
+
/>
|
|
94
95
|
</Container>
|
|
95
96
|
</Container>
|
|
96
97
|
</StyledButton>
|
|
@@ -100,13 +100,23 @@ export function SelectedTokenButton(props: {
|
|
|
100
100
|
}}
|
|
101
101
|
>
|
|
102
102
|
<Img
|
|
103
|
-
src={props.chain?.icon}
|
|
103
|
+
src={props.chain?.icon || ""}
|
|
104
104
|
client={props.client}
|
|
105
105
|
width={iconSize.sm}
|
|
106
106
|
height={iconSize.sm}
|
|
107
107
|
style={{
|
|
108
108
|
borderRadius: radius.full,
|
|
109
109
|
}}
|
|
110
|
+
fallback={
|
|
111
|
+
<Container
|
|
112
|
+
style={{
|
|
113
|
+
background: `linear-gradient(45deg, white, ${theme.colors.accentText})`,
|
|
114
|
+
borderRadius: radius.full,
|
|
115
|
+
width: `${iconSize.sm}px`,
|
|
116
|
+
height: `${iconSize.sm}px`,
|
|
117
|
+
}}
|
|
118
|
+
/>
|
|
119
|
+
}
|
|
110
120
|
/>
|
|
111
121
|
</Container>
|
|
112
122
|
)}
|
|
@@ -63,7 +63,7 @@ export function PaymentOverview(props: {
|
|
|
63
63
|
<WalletRow
|
|
64
64
|
address={sender}
|
|
65
65
|
client={props.client}
|
|
66
|
-
iconSize="
|
|
66
|
+
iconSize="lg"
|
|
67
67
|
textSize="sm"
|
|
68
68
|
/>
|
|
69
69
|
</Container>
|
|
@@ -91,13 +91,14 @@ export function PaymentOverview(props: {
|
|
|
91
91
|
py="sm"
|
|
92
92
|
style={{ justifyContent: "space-between" }}
|
|
93
93
|
>
|
|
94
|
+
{/* left */}
|
|
94
95
|
<Container center="y" flex="row" gap="sm">
|
|
95
96
|
{getFiatCurrencyIcon({
|
|
96
97
|
currency: props.paymentMethod.currency,
|
|
97
98
|
size: "lg",
|
|
98
99
|
})}
|
|
99
100
|
<Container center="y" flex="column" gap="3xs">
|
|
100
|
-
<Text color="primaryText" size="sm"
|
|
101
|
+
<Text color="primaryText" size="sm" weight={500}>
|
|
101
102
|
{props.paymentMethod.currency}
|
|
102
103
|
</Text>
|
|
103
104
|
<Text color="secondaryText" size="xs">
|
|
@@ -106,7 +107,8 @@ export function PaymentOverview(props: {
|
|
|
106
107
|
</Text>
|
|
107
108
|
</Container>
|
|
108
109
|
</Container>
|
|
109
|
-
|
|
110
|
+
{/* right */}
|
|
111
|
+
<Text color="primaryText" size="sm">
|
|
110
112
|
{props.fromAmount}
|
|
111
113
|
</Text>
|
|
112
114
|
</Container>
|
|
@@ -136,11 +138,12 @@ export function PaymentOverview(props: {
|
|
|
136
138
|
<WalletRow
|
|
137
139
|
address={props.receiver}
|
|
138
140
|
client={props.client}
|
|
139
|
-
iconSize="
|
|
141
|
+
iconSize="lg"
|
|
140
142
|
textSize="sm"
|
|
141
143
|
/>
|
|
142
144
|
</Container>
|
|
143
145
|
)}
|
|
146
|
+
|
|
144
147
|
{props.modeInfo.mode === "direct_payment" && (
|
|
145
148
|
<Container
|
|
146
149
|
center="y"
|
|
@@ -150,7 +153,7 @@ export function PaymentOverview(props: {
|
|
|
150
153
|
style={{ justifyContent: "space-between" }}
|
|
151
154
|
>
|
|
152
155
|
<Container center="y" flex="column" gap="3xs" style={{ flex: 1 }}>
|
|
153
|
-
<Text color="primaryText" size="sm"
|
|
156
|
+
<Text color="primaryText" size="sm" weight={500}>
|
|
154
157
|
{props.metadata.title || "Payment"}
|
|
155
158
|
</Text>
|
|
156
159
|
{props.metadata.description && (
|
|
@@ -173,7 +176,6 @@ export function PaymentOverview(props: {
|
|
|
173
176
|
size="sm"
|
|
174
177
|
token={props.toToken}
|
|
175
178
|
tokenAmount={props.modeInfo.paymentInfo.amount}
|
|
176
|
-
weight={600}
|
|
177
179
|
/>
|
|
178
180
|
<Text color="secondaryText" size="xs">
|
|
179
181
|
{props.modeInfo.paymentInfo.amount} {props.toToken.symbol}
|
|
@@ -285,7 +287,7 @@ const TransactionOverViewCompact = (props: {
|
|
|
285
287
|
style={{ justifyContent: "space-between" }}
|
|
286
288
|
>
|
|
287
289
|
<Container center="y" flex="column" gap="3xs" style={{ flex: 1 }}>
|
|
288
|
-
<Text color="primaryText" size="sm"
|
|
290
|
+
<Text color="primaryText" size="sm" weight={500}>
|
|
289
291
|
{props.metadata.title || "Transaction"}
|
|
290
292
|
</Text>
|
|
291
293
|
{props.metadata.description && (
|