Skip to content

Commit

Permalink
include username in createTradePerformance
Browse files Browse the repository at this point in the history
Signed-off-by: MarcoMandar <malicemandar@gmail.com>
  • Loading branch information
MarcoMandar committed Nov 20, 2024
1 parent f354fbd commit ee1ea34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/plugin-solana/src/evaluators/trust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ async function handler(runtime: IAgentRuntime, message: Memory) {
runtime,
rec.contractAddress,
userId,
account.username, // we need this to create the recommender account in the BE
{
buy_amount: rec.buyAmount,
is_simulation: true,
Expand Down
5 changes: 4 additions & 1 deletion packages/plugin-solana/src/providers/trustScoreProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export class TrustScoreManager {
runtime: IAgentRuntime,
tokenAddress: string,
recommenderId: string,
username: string,
data: TradeData
): Promise<TradePerformance> {
const recommender =
Expand Down Expand Up @@ -405,7 +406,7 @@ export class TrustScoreManager {
this.trustScoreDb.addTransaction(transaction);
}
// api call to update trade performance
this.createTradeInBe(tokenAddress, recommenderId, data);
this.createTradeInBe(tokenAddress, recommenderId, username, data);
return creationData;
}

Expand All @@ -416,6 +417,7 @@ export class TrustScoreManager {
async createTradeInBe(
tokenAddress: string,
recommenderId: string,
username: string,
data: TradeData,
retries = 3,
delayMs = 2000
Expand All @@ -434,6 +436,7 @@ export class TrustScoreManager {
tokenAddress: tokenAddress,
tradeData: data,
recommenderId: recommenderId,
username: username,
}),
}
);
Expand Down

0 comments on commit ee1ea34

Please sign in to comment.