You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description="Create and initialize a new backend wallet controlled by thirdweb Engine. These wallets are securely managed by the Engine service and can be used to sign blockchain transactions, deploy contracts, and execute on-chain operations without managing private keys directly."
24
32
)
@@ -66,22 +74,22 @@ def get_all_backend_wallet(
66
74
)
67
75
defget_wallet_balance(
68
76
self,
77
+
chain_id: Annotated[
78
+
str,
79
+
"The numeric blockchain network ID to query (e.g., '1' for Ethereum mainnet, '137' for Polygon). If not provided, uses the default chain ID configured in the Engine instance.",
80
+
],
69
81
backend_wallet_address: Annotated[
70
82
str|None,
71
83
"The Ethereum address of the wallet to check (e.g., '0x1234...'). If not provided, uses the default backend wallet address configured in the Engine instance.",
72
84
] =None,
73
-
chain_id: Annotated[
74
-
str|None,
75
-
"The numeric blockchain network ID to query (e.g., '1' for Ethereum mainnet, '137' for Polygon). If not provided, uses the default chain ID configured in the Engine instance.",
76
-
] =None,
77
85
) ->dict[str, Any]:
78
86
"""Get wallet balance for native or ERC20 tokens."""
description="Send an on-chain transaction from a backend wallet. This powerful function can transfer native currency (ETH, MATIC), ERC20 tokens, or execute any arbitrary contract interaction. The transaction is signed and broadcast to the blockchain automatically by the Engine service."
92
+
description="Send an on-chain transaction. This powerful function can transfer native currency (ETH, MATIC), ERC20 tokens, or execute any arbitrary contract interaction. The transaction is signed and broadcast to the blockchain automatically."
85
93
)
86
94
defsend_transaction(
87
95
self,
@@ -94,28 +102,26 @@ def send_transaction(
94
102
"The amount of native currency to send, specified in wei (e.g., '1000000000000000000' for 1 ETH). For token transfers or contract interactions that don't need to send value, use '0'.",
95
103
],
96
104
data: Annotated[
97
-
str|None,
105
+
str,
98
106
"The hexadecimal transaction data payload for contract interactions (e.g., '0x23b872dd...'). For simple native currency transfers, leave this empty. For ERC20 transfers or contract calls, this contains the ABI-encoded function call.",
99
-
] =None,
107
+
],
108
+
chain_id: Annotated[
109
+
str,
110
+
"The numeric blockchain network ID to send the transaction on (e.g., '1' for Ethereum mainnet, '137' for Polygon). If not provided, uses the default chain ID configured in the Engine instance.",
111
+
],
100
112
backend_wallet_address: Annotated[
101
113
str|None,
102
114
"The sender wallet address to use (must be a wallet created through Engine). If not provided, uses the default backend wallet configured in the Engine instance.",
103
115
] =None,
104
-
chain_id: Annotated[
105
-
str|None,
106
-
"The numeric blockchain network ID to send the transaction on (e.g., '1' for Ethereum mainnet, '137' for Polygon). If not provided, uses the default chain ID configured in the Engine instance.",
"""Get the status of a transaction by queue ID."""
138
-
returnself._get(f"transaction/{queue_id}")
144
+
returnself._get(f"transaction/status/{queue_id}")
139
145
140
146
@tool(
141
147
description="Call a read-only function on a smart contract to query its current state without modifying the blockchain or spending gas. Perfect for retrieving information like token balances, contract configuration, or any view/pure functions from Solidity contracts."
@@ -151,22 +157,21 @@ def read_contract(
151
157
"The exact name of the function to call on the contract (e.g., 'balanceOf', 'totalSupply'). Must match the function name in the contract's ABI exactly, including correct capitalization.",
152
158
],
153
159
function_args: Annotated[
154
-
list[Any]|None,
160
+
list[str|int|bool],
155
161
"An ordered list of arguments to pass to the function (e.g., [address, tokenId]). Must match the types and order expected by the function. For functions with no parameters, use an empty list or None.",
156
-
]=None,
162
+
],
157
163
chain_id: Annotated[
158
-
str|None,
164
+
str,
159
165
"The numeric blockchain network ID where the contract is deployed (e.g., '1' for Ethereum mainnet, '137' for Polygon). If not provided, uses the default chain ID configured in the Engine instance.",
description="Execute a state-changing function on a smart contract by sending a transaction. This allows you to modify on-chain data, such as transferring tokens, minting NFTs, or updating contract configuration. The transaction is automatically signed by your backend wallet and submitted to the blockchain."
@@ -182,25 +187,25 @@ def write_contract(
182
187
"The exact name of the function to call on the contract (e.g., 'mint', 'transfer', 'setApprovalForAll'). Must match the function name in the contract's ABI exactly, including correct capitalization.",
183
188
],
184
189
function_args: Annotated[
185
-
list[Any]|None,
190
+
list[str|int|bool],
186
191
"An ordered list of arguments to pass to the function (e.g., ['0x1234...', 5] for transferring 5 tokens to address '0x1234...'). Must match the types and order expected by the function. For functions with no parameters, use an empty list.",
187
-
]=None,
192
+
],
188
193
value: Annotated[
189
-
str|None,
190
-
"The amount of native currency (ETH, MATIC, etc.) to send with the transaction, in wei (e.g., '1000000000000000000' for 1 ETH). Required for payable functions, use '0' for non-payable functions.",
191
-
]="0",
194
+
str,
195
+
"The amount of native currency (ETH, MATIC, etc.) to send with the transaction, in wei (e.g., '1000000000000000000' for 1 ETH). Required for payable functions, use '0' for non-payable functions. Default to '0'.",
196
+
],
192
197
chain_id: Annotated[
193
-
str|None,
198
+
str,
194
199
"The numeric blockchain network ID where the contract is deployed (e.g., '1' for Ethereum mainnet, '137' for Polygon). If not provided, uses the default chain ID configured in the Engine instance.",
0 commit comments