Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement submitOrder Method for Buy and Sell Orders #13

Open
7 tasks
AndreaDiazCorreia opened this issue Dec 12, 2024 · 0 comments
Open
7 tasks

Implement submitOrder Method for Buy and Sell Orders #13

AndreaDiazCorreia opened this issue Dec 12, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AndreaDiazCorreia
Copy link
Collaborator

Description

Implement the order submission functionality following the Mostro protocol specification for creating new buy and sell orders.

Implementation Requirements

  1. Implement submitOrder method:
async submitOrder(order: NewOrder): Promise<MostroMessage> {
  // Validation
  // Order creation
  // Event emission
}
  1. Support both order types:
interface NewOrder {
  kind: OrderType;
  status: OrderStatus;
  amount?: number;
  fiat_code: string;
  fiat_amount: number;
  payment_method: string;
  premium: number;
  created_at: number;
}

Testing Requirements

describe('submitOrder', () => {
  it('should create valid sell orders');
  it('should create valid buy orders');
  it('should validate order parameters');
  it('should handle market rate orders');
  it('should handle fixed price orders');
  it('should emit proper events');
});

Acceptance Criteria

  • Order creation works for both buy/sell
  • Market rate orders supported
  • Fixed price orders supported
  • Parameter validation implemented
  • Proper error handling
  • Event emission working
  • Tests passing

References

@grunch grunch added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants