File tree Expand file tree Collapse file tree 4 files changed +50
-3
lines changed
thirdweb/src/wallets/in-app/core Expand file tree Collapse file tree 4 files changed +50
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type { Config } from "@hey-api/client-fetch";
2
2
import { client } from "./client/client.gen.js" ;
3
3
4
4
export type InsightClientOptions = {
5
- readonly clientId : string ;
5
+ readonly clientId ? : string ;
6
6
readonly secretKey ?: string ;
7
7
} ;
8
8
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export async function getUserStatus({
25
25
method : "GET" ,
26
26
headers : {
27
27
"Content-Type" : "application/json" ,
28
- "x-thirdweb-client-id" : client . clientId ,
29
28
Authorization : `Bearer embedded-wallet-token:${ authToken } ` ,
30
29
} ,
31
30
} ,
Original file line number Diff line number Diff line change @@ -45,7 +45,12 @@ export async function guestAuthenticate(args: {
45
45
} ) ,
46
46
} ) ;
47
47
48
- if ( ! res . ok ) throw new Error ( "Failed to generate guest account" ) ;
48
+ if ( ! res . ok ) {
49
+ const error = await res . text ( ) ;
50
+ throw new Error (
51
+ `Failed to generate guest account: ${ res . status } ${ res . statusText } ${ error } ` ,
52
+ ) ;
53
+ }
49
54
50
55
return ( await res . json ( ) ) satisfies AuthStoredTokenWithCookieReturnType ;
51
56
}
Original file line number Diff line number Diff line change
1
+ import { describe , expect , it } from "vitest" ;
2
+ import { TEST_CLIENT } from "../../../../../test/src/test-clients.js" ;
3
+ import { baseSepolia } from "../../../../chains/chain-definitions/base-sepolia.js" ;
4
+ import { sendBatchTransaction } from "../../../../transaction/actions/send-batch-transaction.js" ;
5
+ import { prepareTransaction } from "../../../../transaction/prepare-transaction.js" ;
6
+ import { generateAccount } from "../../../utils/generateAccount.js" ;
7
+ import { inAppWallet } from "../../web/in-app.js" ;
8
+
9
+ const client = TEST_CLIENT ;
10
+ const chain = baseSepolia ;
11
+
12
+ describe . runIf ( process . env . TW_SECRET_KEY ) ( "7702 Minimal Account" , ( ) => {
13
+ it ( "should batch transactions" , async ( ) => {
14
+ const iaw = inAppWallet ( {
15
+ executionMode : {
16
+ mode : "EIP7702" ,
17
+ sponsorGas : true ,
18
+ } ,
19
+ } ) ;
20
+ const account = await iaw . connect ( {
21
+ client,
22
+ strategy : "guest" ,
23
+ chain,
24
+ } ) ;
25
+ const tx1 = prepareTransaction ( {
26
+ client,
27
+ chain,
28
+ to : ( await generateAccount ( { client } ) ) . address ,
29
+ value : 0n ,
30
+ } ) ;
31
+ const tx2 = prepareTransaction ( {
32
+ client,
33
+ chain,
34
+ to : ( await generateAccount ( { client } ) ) . address ,
35
+ value : 0n ,
36
+ } ) ;
37
+ const result = await sendBatchTransaction ( {
38
+ account,
39
+ transactions : [ tx1 , tx2 ] ,
40
+ } ) ;
41
+ expect ( result . transactionHash ) . toBeDefined ( ) ;
42
+ } ) ;
43
+ } ) ;
You can’t perform that action at this time.
0 commit comments