Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
feat: update FE script
Browse files Browse the repository at this point in the history
  • Loading branch information
politeWall committed Nov 22, 2023
1 parent db64ae8 commit aeacc5b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ A spot order is fulfilled when the specified price set by the trader aligns with
- **Stop Loss Functionality**: Enable users to set automated orders that trigger when the asset's price reaches a specified lower limit, minimizing potential losses.
- **Limit Sell Functionality**: Allow users to set automated orders that execute when the asset's price reaches a specified upper limit, securing profits.
- **Limit Buy Fuctionality**: Allow user to set automated orders that execute when the limit price is reaches, securing profits.
- **Market Buy Fuctionality**: Allow users to set automated orders that will execute at market price

### Margin Order

Expand Down
22 changes: 22 additions & 0 deletions front_end_script/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,25 @@ async function getSpotOrders(pagination, order_type, owner_address) {
);
console.log(`Result: `, result);
}

async function SwapEstimationByDenom(amount, denom_in, denom_out) {
const sender_wallet = await DirectSecp256k1HdWallet.fromMnemonic(
sender.mnemonic,
{ prefix: "elys" }
);
const sender_client = await SigningCosmWasmClient.connectWithSigner(
rpcEndpoint,
sender_wallet
);
const result = await sender_client.queryContractSmart(
trade_shield_contract_addr,
{
swap_estimation_by_denom: {
amount: amount,
denom_in: denom_in,
denom_out: denom_out,
},
}
);
console.log(`Result: `, result);
}

0 comments on commit aeacc5b

Please sign in to comment.