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

✨ Feature: Accept Native Units for Price/Amount #190

Open
PhearZero opened this issue Jun 9, 2022 · 0 comments
Open

✨ Feature: Accept Native Units for Price/Amount #190

PhearZero opened this issue Jun 9, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@PhearZero
Copy link
Contributor

ℹ Overview

This should include a new formatted key on the Order which should be set to false by default.

Base Units by Default:

// Native/Base Units
const sellOrders = await api.placeOrder({
    'asset': {
      'id': 31566704,
      'decimals': 6,
    },
    'address': 'WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI',
    'price': 2370001, // Price in ALGO Base Units, 
    'amount': 100000, // Amount in Asset Units
    'execution': 'taker',
    'type': 'sell',
  });

Formatted Units

// Formatted Values
const sellOrders = await api.placeOrder({
    'asset': {
      'id': 31566704,
      'decimals': 6,
    },
    'address': 'WYWRYK42XADLY3O62N52BOLT27DMPRA3WNBT2OBRT65N6OEZQWD4OSH6PI',
    'formatted': true, // Flag for using Formatted Values
    'price': 2.370001, // Price in ALGO Base Units, 
    'amount': 0.1, // Amount in Asset Units
    'execution': 'taker',
    'type': 'sell',
  });

📝 Related Issues

@PhearZero PhearZero added the enhancement New feature or request label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant