@@ -20,6 +20,7 @@ export type CoreServiceConfig = {
2020 serviceApiKey : string ;
2121 serviceAction ?: string ;
2222 useWalletAuth ?: boolean ;
23+ includeUsage ?: boolean ;
2324} ;
2425
2526type Usage = {
@@ -85,8 +86,8 @@ export async function fetchKeyMetadataFromApi(
8586 clientId : string ,
8687 config : CoreServiceConfig ,
8788) : Promise < ApiResponse > {
88- const { apiUrl, serviceScope, serviceApiKey } = config ;
89- const url = `${ apiUrl } /v1/keys/use?clientId=${ clientId } &scope=${ serviceScope } &includeUsage=true ` ;
89+ const { apiUrl, serviceScope, serviceApiKey, includeUsage = true } = config ;
90+ const url = `${ apiUrl } /v1/keys/use?clientId=${ clientId } &scope=${ serviceScope } &includeUsage=${ includeUsage } ` ;
9091 const response = await fetch ( url , {
9192 method : "GET" ,
9293 headers : {
@@ -111,10 +112,10 @@ export async function fetchAccountFromApi(
111112 config : CoreServiceConfig ,
112113 useWalletAuth : boolean ,
113114) : Promise < ApiAccountResponse > {
114- const { apiUrl, serviceApiKey } = config ;
115+ const { apiUrl, serviceApiKey, includeUsage = true } = config ;
115116 const url = useWalletAuth
116- ? `${ apiUrl } /v1/wallet/me?includeUsage=true `
117- : `${ apiUrl } /v1/account/me?includeUsage=true ` ;
117+ ? `${ apiUrl } /v1/wallet/me?includeUsage=${ includeUsage } `
118+ : `${ apiUrl } /v1/account/me?includeUsage=${ includeUsage } ` ;
118119 const response = await fetch ( url , {
119120 method : "GET" ,
120121 headers : {
0 commit comments