From 04f45eea6ade62561c5fa846e8a8c0a9c2fa4caf Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 26 Mar 2022 08:35:16 -0700 Subject: [PATCH] Adding production/script dir --- production/scripts/create-order.js | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 production/scripts/create-order.js diff --git a/production/scripts/create-order.js b/production/scripts/create-order.js new file mode 100644 index 0000000..b2514a0 --- /dev/null +++ b/production/scripts/create-order.js @@ -0,0 +1,40 @@ +/* + This script can be used to generate new Orders and Offers, until the UI for + that is built. + + Customize the settings below to add your own Order. The token must exist in + the DEX app wallet in order to be acceped. +*/ + +const axios = require('axios') + +// const LOCALHOST = 'http://localhost:5700' +const LOCALHOST = 'http://172.17.0.1:5700' + +async function start () { + try { + const mockOrder = { + lokadId: 'SWP', + messageType: 1, + messageClass: 1, + tokenId: + 'a4fb5c2da1aa064e25018a43f9165040071d9e984ba190c222a7f59053af84b2', + buyOrSell: 'sell', + rateInBaseUnit: 5000, + minUnitsToExchange: 5000, + numTokens: 1 + } + + const options = { + method: 'post', + url: `${LOCALHOST}/order`, + data: { order: mockOrder } + } + + const result = await axios(options) + console.log('result.data: ', result.data) + } catch (err) { + console.log(err) + } +} +start()