Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/social-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `intent` and optional `category` fields to `Trade` type ([#8410](https://github.com/MetaMask/core/pull/8410))

### Changed

- Bump `@metamask/messenger` from `^1.1.0` to `^1.1.1` ([#8373](https://github.com/MetaMask/core/pull/8373))
Expand Down
1 change: 1 addition & 0 deletions packages/social-controllers/src/SocialService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const mockSocialHandles = {

const mockTrade = {
direction: 'buy',
intent: 'enter',
tokenAmount: 1.5,
usdCost: 3000,
timestamp: 1700000000,
Expand Down
2 changes: 2 additions & 0 deletions packages/social-controllers/src/SocialService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const ProfileSummaryStruct = structType({

const TradeStruct = structType({
direction: string(),
intent: string(),
category: optional(string()),
tokenAmount: number(),
usdCost: number(),
timestamp: number(),
Expand Down
6 changes: 5 additions & 1 deletion packages/social-controllers/src/social-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ export type SocialHandles = {
* A single trade within a position.
*/
export type Trade = {
/** "buy" or "sell". */
/** "buy" or "sell" (semi-deprecated by Clicker in favor of intent). */
direction: string;
/** "enter" or "exit" — preferred over direction. */
intent: string;
/** Trade category from Clicker (e.g. "receive" for airdrops/transfers). */
category?: string;
/** Quantity traded. */
tokenAmount: number;
/** USD value of the trade. */
Expand Down
Loading