@@ -12,7 +12,11 @@ The `ThirdwebContract.Write` method allows you to execute transactions that alte
1212## Usage
1313
1414``` csharp
15- var transactionReceipt = await contract .Write (wallet , contract , " methodName" , weiValue , parameters );
15+ // Static
16+ var receipt = await ThirdwebContract .Write (wallet , contract , " transfer" , weiValue , toAddress , amount );
17+
18+ // Extension
19+ var transactionReceipt = await contract .Write (wallet , " methodName" , weiValue , parameters );
1620```
1721
1822<Details summary = " Parameters" >
@@ -21,10 +25,6 @@ var transactionReceipt = await contract.Write(wallet, contract, "methodName", we
2125
2226An instance of ` IThirdwebWallet ` . This represents the signer of the transaction, which can be any type of wallet provider.
2327
24- ### contract (required)
25-
26- An instance of ` ThirdwebContract ` . Represents the smart contract you wish to interact with.
27-
2828### methodName (required)
2929
3030The name of the smart contract method you intend to call. Must be a ` string ` .
@@ -57,9 +57,6 @@ string contractAddress = "0x..."; // Your contract address
5757var client = ThirdwebClient .Create (secretKey : " yourSecretKey" );
5858var contract = await ThirdwebContract .Create (client , contractAddress , chainId );
5959
60- // The wallet that signs and sends the transaction
61- var wallet = await PrivateKeyWallet .Create (client , " yourPrivateKeyHex" );
62-
6360// Assuming transfer takes an address and an amount as parameters
6461string toAddress = " 0x..." ;
6562BigInteger amount = new BigInteger (1000 ); // The amount to transfer
@@ -68,7 +65,7 @@ BigInteger amount = new BigInteger(1000); // The amount to transfer
6865BigInteger weiValue = BigInteger .Zero ;
6966
7067// Executing the transfer
71- var receipt = await contract .Write (wallet , contract , " transfer" , weiValue , toAddress , amount );
68+ var receipt = await contract .Write (wallet , " transfer" , weiValue , toAddress , amount );
7269Console .WriteLine ($" Transaction receipt: {receipt }" );
7370```
7471
0 commit comments