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";
22import { client } from "./client/client.gen.js" ;
33
44export type InsightClientOptions = {
5- readonly clientId : string ;
5+ readonly clientId ? : string ;
66 readonly secretKey ?: string ;
77} ;
88
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ export async function getUserStatus({
2525 method : "GET" ,
2626 headers : {
2727 "Content-Type" : "application/json" ,
28- "x-thirdweb-client-id" : client . clientId ,
2928 Authorization : `Bearer embedded-wallet-token:${ authToken } ` ,
3029 } ,
3130 } ,
Original file line number Diff line number Diff line change @@ -45,7 +45,12 @@ export async function guestAuthenticate(args: {
4545 } ) ,
4646 } ) ;
4747
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+ }
4954
5055 return ( await res . json ( ) ) satisfies AuthStoredTokenWithCookieReturnType ;
5156}
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