@@ -82,7 +82,7 @@ export async function getAllCharges(apiKey: string) {
82
82
// Function to fetch details of a specific charge
83
83
export async function getChargeDetails ( apiKey : string , chargeId : string ) {
84
84
elizaLogger . debug ( "Starting getChargeDetails function" ) ;
85
- const getUrl = `${ url } ${ chargeId } ` ;
85
+ const getUrl = `${ url } / ${ chargeId } ` ;
86
86
87
87
try {
88
88
const response = await fetch ( getUrl , {
@@ -204,8 +204,8 @@ export const createCoinbaseChargeAction: Action = {
204
204
text : `Charge created successfully: ${ chargeResponse . hosted_url } ` ,
205
205
attachments : [
206
206
{
207
- id : crypto . randomUUID ( ) ,
208
- url : chargeResponse . id ,
207
+ id : chargeResponse . id ,
208
+ url : chargeResponse . hosted_url ,
209
209
title : "Coinbase Commerce Charge" ,
210
210
description : `Charge ID: ${ chargeResponse . id } ` ,
211
211
text : `Pay here: ${ chargeResponse . hosted_url } ` ,
@@ -351,6 +351,7 @@ export const getAllChargesAction: Action = {
351
351
callback (
352
352
{
353
353
text : `Successfully fetched all charges. Total charges: ${ charges . length } ` ,
354
+ attachments : charges ,
354
355
} ,
355
356
[ ]
356
357
) ;
@@ -439,17 +440,20 @@ export const getChargeDetailsAction: Action = {
439
440
440
441
elizaLogger . info ( "Fetched charge details:" , chargeDetails ) ;
441
442
443
+ const chargeData = chargeDetails . data ;
444
+
442
445
callback (
443
446
{
444
447
text : `Successfully fetched charge details for ID: ${ charge . id } ` ,
445
448
attachments : [
446
449
{
447
- id : crypto . randomUUID ( ) ,
448
- url : chargeDetails . hosted_url ,
450
+ id : chargeData . id ,
451
+ url : chargeData . hosted_url ,
449
452
title : `Charge Details for ${ charge . id } ` ,
450
- description : `Details: ${ JSON . stringify ( chargeDetails , null , 2 ) } ` ,
451
453
source : "coinbase" ,
452
- text : "" ,
454
+ description : JSON . stringify ( chargeDetails , null , 2 ) ,
455
+ text : `Pay here: ${ chargeData . hosted_url } ` ,
456
+ contentType : "application/json" ,
453
457
} ,
454
458
] ,
455
459
} ,
0 commit comments