Skip to content

Commit 9d2233f

Browse files
resolve review comments
1 parent d9ec0fe commit 9d2233f

File tree

1 file changed

+16
-8
lines changed
  • src/components/PregenrateSmartAccount

1 file changed

+16
-8
lines changed

src/components/PregenrateSmartAccount/index.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export default function LookupSCWAPIPage() {
4141
smartAccountVersion: "",
4242
nonceKey: "",
4343
saltNonce: "",
44-
entryPointVersion: "0.7",
4544
factoryAddress: "",
45+
entryPointVersion: "0.7",
4646
});
4747
const [isLoading, setIsLoading] = useState(false);
4848
const [response, setResponse] = useState<string | null>(null);
@@ -77,7 +77,12 @@ export default function LookupSCWAPIPage() {
7777
const fetchInitialData = async () => {
7878
setIsLoading(true);
7979
try {
80-
const res = await axios.get(`https://lookup.web3auth.io/lookup/scw`, { params: formData });
80+
const filteredFormData = Object.fromEntries(
81+
Object.entries(formData).filter(([_, value]) => value !== ""),
82+
);
83+
const res = await axios.get(`https://lookup.web3auth.io/lookup/scw`, {
84+
params: filteredFormData,
85+
});
8186
setResponse(JSON.stringify(res.data, null, 2));
8287
} catch (err) {
8388
setError(err.message);
@@ -248,9 +253,12 @@ export default function LookupSCWAPIPage() {
248253
</tr>
249254
<tr>
250255
<td>
251-
<code>smartAccountVersion</code>
256+
<code>smartAccountVersion?</code>
257+
</td>
258+
<td>
259+
Smart Account version for the Smart Account Provider contract. This parameter is
260+
optional.
252261
</td>
253-
<td>Smart Account version for the Smart Account Provider contract.</td>
254262
<td>
255263
<input
256264
type="text"
@@ -262,11 +270,11 @@ export default function LookupSCWAPIPage() {
262270
</tr>
263271
<tr>
264272
<td>
265-
<code>saltNonce</code>
273+
<code>saltNonce?</code>
266274
</td>
267275
<td>
268276
Salt nonce for the Smart Account to add randomness or predictability when the
269-
address is generated.
277+
address is generated. This parameter is optional.
270278
</td>
271279
<td>
272280
<input
@@ -279,12 +287,12 @@ export default function LookupSCWAPIPage() {
279287
</tr>
280288
<tr>
281289
<td>
282-
<code>factoryAddress</code>
290+
<code>factoryAddress?</code>
283291
</td>
284292
<td>
285293
Specifies the address of the Factory Contract. While providers typically deploy the
286294
factory contract on popular chains, you have the option to deploy your own factory
287-
contract on any chain and pass its address.
295+
contract on any chain and pass its address. This parameter is optional.
288296
</td>
289297
<td>
290298
<input

0 commit comments

Comments
 (0)