Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
PT-64: add exchange flows (#201)
Browse files Browse the repository at this point in the history
* PT-64: Add exchange flow

* Add methods for Exchange

* Adding new line in the EOF for code standards.

* Adding line break in the EOF for code standards

* remove walletConnection where not used

* [PT-153] Add example for exchange transfer

* remove outaded comments

* update parameters for example

Co-authored-by: Anastasia Bashkirtseva <[email protected]>
Co-authored-by: Deepti Luthra <[email protected]>
Co-authored-by: Renato Lucas Chitolina <[email protected]>
Co-authored-by: Deepti Luthra <[email protected]>
  • Loading branch information
5 people authored Nov 10, 2022
1 parent 8bbb02c commit acbe8c6
Show file tree
Hide file tree
Showing 25 changed files with 2,090 additions and 12 deletions.
24 changes: 24 additions & 0 deletions examples/createExchangeTransfer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ImmutableX, Config, UnsignedExchangeTransferRequest } from '@imtbl/core-sdk';
import { generateWalletConnection } from './libs/walletConnection';

(async () => {
const walletConnection = await generateWalletConnection('goerli');

const imxClient = new ImmutableX(Config.SANDBOX);

const exchangeTransferParams: UnsignedExchangeTransferRequest = {
type: "ETH",
amount:'0.001',
transactionID: '0',
receiver: ''
};

try {
const exchangeTransferResponse = await imxClient.exchangeTransfer(walletConnection, exchangeTransferParams)

console.log('exchangeTransferResponse', exchangeTransferResponse);
} catch (error) {
console.error(error);
process.exit(1);
}
})();
1 change: 1 addition & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"create-order": "ts-node -r dotenv/config createOrder.ts",
"create-trade": "ts-node -r dotenv/config createTrade.ts",
"create-exchange-transfer": "ts-node -r dotenv/config createExchangeTransfer.ts",
"deposit-eth": "ts-node -r dotenv/config depositEth.ts",
"create-eth-withdrawal": "ts-node -r dotenv/config createEthWithdrawal.ts",
"complete-eth-withdrawal": "ts-node -r dotenv/config completeEthWithdrawal.ts",
Expand Down
Loading

0 comments on commit acbe8c6

Please sign in to comment.