Skip to content

Commit 4d383c2

Browse files
committed
Remove unnecessary console.logs
1 parent 7ef4502 commit 4d383c2

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

packages/plugin-coinbase/src/index.ts

+3-11
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { ChargeContent, ChargeSchema, isChargeContent } from "./types";
1717
import { chargeTemplate, getChargeTemplate } from "./templates";
1818

19+
const url = "https://api.commerce.coinbase.com/charges";
1920
interface ChargeRequest {
2021
name: string;
2122
description: string;
@@ -27,8 +28,6 @@ interface ChargeRequest {
2728
}
2829

2930
export async function createCharge(apiKey: string, params: ChargeRequest) {
30-
const url = "https://api.commerce.coinbase.com/charges";
31-
3231
try {
3332
const response = await fetch(url, {
3433
method: "POST",
@@ -44,7 +43,6 @@ export async function createCharge(apiKey: string, params: ChargeRequest) {
4443
}
4544

4645
const data = await response.json();
47-
console.log("Charge created successfully:", data);
4846
return data.data;
4947
} catch (error) {
5048
console.error("Error creating charge:", error);
@@ -54,8 +52,6 @@ export async function createCharge(apiKey: string, params: ChargeRequest) {
5452

5553
// Function to fetch all charges
5654
export async function getAllCharges(apiKey: string) {
57-
const url = "https://api.commerce.coinbase.com/charges";
58-
5955
try {
6056
const response = await fetch(url, {
6157
method: "GET",
@@ -81,10 +77,10 @@ export async function getAllCharges(apiKey: string) {
8177

8278
// Function to fetch details of a specific charge
8379
export async function getChargeDetails(apiKey: string, chargeId: string) {
84-
const url = `https://api.commerce.coinbase.com/charges/${chargeId}`;
80+
const getUrl = `${url}${chargeId}`;
8581

8682
try {
87-
const response = await fetch(url, {
83+
const response = await fetch(getUrl, {
8884
method: "GET",
8985
headers: {
9086
"Content-Type": "application/json",
@@ -99,7 +95,6 @@ export async function getChargeDetails(apiKey: string, chargeId: string) {
9995
}
10096

10197
const data = await response.json();
102-
console.log(`Fetched charge details for ID ${chargeId}:`, data);
10398
return data;
10499
} catch (error) {
105100
console.error(
@@ -344,19 +339,16 @@ export const getChargeDetailsAction: Action = {
344339
state,
345340
template: getChargeTemplate,
346341
});
347-
console.log("context ", context);
348342
const chargeDetails = await generateObjectV2({
349343
runtime,
350344
context,
351345
modelClass: ModelClass.SMALL,
352346
schema: ChargeSchema,
353347
});
354-
console.log(chargeDetails);
355348
if (!isChargeContent(chargeDetails.object)) {
356349
throw new Error("Invalid content");
357350
}
358351
const charge = chargeDetails.object as ChargeContent;
359-
console.log("charge ", charge);
360352
if (!charge.id) {
361353
callback(
362354
{

0 commit comments

Comments
 (0)