File tree 2 files changed +15
-3
lines changed
packages/plugin-nft-collections/src/actions
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { Action , IAgentRuntime , Memory , State } from "@elizaos/core" ;
2
2
import { ReservoirService } from "../services/reservoir" ;
3
+ import { HandlerCallback } from "@elizaos/core" ;
3
4
4
5
// Helper function to extract NFT listing details from the message
5
6
function extractListingDetails ( text : string ) : {
@@ -39,7 +40,9 @@ export const listNFTAction = (nftService: ReservoirService): Action => {
39
40
handler : async (
40
41
runtime : IAgentRuntime ,
41
42
message : Memory ,
42
- state ?: State
43
+ state : State ,
44
+ options : any ,
45
+ callback : HandlerCallback
43
46
) => {
44
47
try {
45
48
const {
@@ -92,6 +95,10 @@ export const listNFTAction = (nftService: ReservoirService): Action => {
92
95
? `• Transaction: ${ listing . transactionHash } \n`
93
96
: "" ) ;
94
97
98
+ callback ( {
99
+ text : response ,
100
+ } ) ;
101
+
95
102
await runtime . messageManager . createMemory ( {
96
103
id : message . id ,
97
104
content : { text : response } ,
Original file line number Diff line number Diff line change 1
1
import { Action , IAgentRuntime , Memory , State } from "@elizaos/core" ;
2
2
import { ReservoirService } from "../services/reservoir" ;
3
+ import { HandlerCallback } from "@elizaos/core" ;
3
4
4
5
// Helper function to extract NFT details from the message
5
6
function extractNFTDetails ( text : string ) : {
@@ -34,7 +35,9 @@ export const sweepFloorAction = (nftService: ReservoirService): Action => {
34
35
handler : async (
35
36
runtime : IAgentRuntime ,
36
37
message : Memory ,
37
- state ?: State
38
+ state : State ,
39
+ options : any ,
40
+ callback : HandlerCallback
38
41
) => {
39
42
try {
40
43
const { collectionAddress, quantity } = extractNFTDetails (
@@ -80,7 +83,9 @@ export const sweepFloorAction = (nftService: ReservoirService): Action => {
80
83
`• Average Price: ${ ( totalPrice / quantity ) . toFixed ( 4 ) } ETH\n` +
81
84
`• Transaction Path: ${ result . path } \n` +
82
85
`• Status: ${ result . steps . map ( ( step ) => `${ step . action } - ${ step . status } ` ) . join ( ", " ) } ` ;
83
-
86
+ callback ( {
87
+ text : response ,
88
+ } ) ;
84
89
await runtime . messageManager . createMemory ( {
85
90
id : message . id ,
86
91
content : { text : response } ,
You can’t perform that action at this time.
0 commit comments