From 581c2b1fa54a1e0fe92f0ca2f0b9b7f42b7f3643 Mon Sep 17 00:00:00 2001 From: surangap Date: Tue, 22 Jun 2021 01:47:33 +0800 Subject: [PATCH 1/3] Added ICXOrderBook.getOrder() function, testing and documentation --- .../category/icxorderbook/getOrder.test.ts | 140 ++++++++++++++++++ .../src/category/icxorderbook.ts | 16 ++ website/docs/jellyfish/api/icxorderbook.md | 40 +++++ 3 files changed, 196 insertions(+) create mode 100644 packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts diff --git a/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts b/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts new file mode 100644 index 0000000000..994bcbfa74 --- /dev/null +++ b/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts @@ -0,0 +1,140 @@ +import { ContainerAdapterClient } from '../../container_adapter_client' +import { MasterNodeRegTestContainer } from '@defichain/testcontainers' +import { + ICXGenericResult, ICXOfferInfo, ICXOrderInfo, ICXOrder, ICXOffer +} from '../../../src/category/icxorderbook' +import BigNumber from 'bignumber.js' +import { accountBTC, accountDFI, checkBTCBuyOfferDetails, checkBTCSellOrderDetails, checkDFIBuyOfferDetails, checkDFISellOrderDetails, idDFI, setup } from './common.test' +import { RpcApiError } from '../../../src' + +describe('Should test ICXOrderBook.getOrder', () => { + const container = new MasterNodeRegTestContainer() + const client = new ContainerAdapterClient(container) + + beforeAll(async () => { + await container.start() + await container.waitForReady() + await container.waitForWalletCoinbaseMaturity() + await setup(container) + }) + + afterAll(async () => { + await container.stop() + }) + + afterEach(async () => { + // cleanup code here + }) + + it('Should get the correct order', async () => { + // create first order - maker + const order: ICXOrder = { + tokenFrom: idDFI, + chainTo: 'BTC', + ownerAddress: accountDFI, + receivePubkey: '037f9563f30c609b19fd435a19b8bde7d6db703012ba1aba72e9f42a87366d1941', + amountFrom: new BigNumber(15), + orderPrice: new BigNumber(0.01) + } + let result: ICXGenericResult = await client.icxorderbook.createOrder(order, []) + const createOrderTxId = result.txid + await container.generate(1) + + // get order createOrderTxId and check + let retrivedOrder: Record = await client.icxorderbook.getOrder(createOrderTxId) + await checkDFISellOrderDetails(container, order, createOrderTxId, retrivedOrder as Record) + + // create second order - maker + const order2: ICXOrder = { + chainFrom: 'BTC', + tokenTo: idDFI, + ownerAddress: accountDFI, + amountFrom: new BigNumber(2), + orderPrice: new BigNumber(100) + } + result = await client.icxorderbook.createOrder(order2, []) + const createOrder2TxId = result.txid + await container.generate(1) + + // get order createOrder2TxId and check + retrivedOrder = await client.icxorderbook.getOrder(createOrder2TxId) + // check details for createOrder2TxId + await checkBTCSellOrderDetails(container, order2, createOrder2TxId, retrivedOrder as Record) + }) + + it('Should get the correct offer', async () => { + // create two orders - maker + const order: ICXOrder = { + tokenFrom: idDFI, + chainTo: 'BTC', + ownerAddress: accountDFI, + receivePubkey: '037f9563f30c609b19fd435a19b8bde7d6db703012ba1aba72e9f42a87366d1941', + amountFrom: new BigNumber(15), + orderPrice: new BigNumber(0.01) + } + let result: ICXGenericResult = await client.icxorderbook.createOrder(order, []) + const createOrderTxId = result.txid + await container.generate(1) + + // create second order - maker + const order2: ICXOrder = { + chainFrom: 'BTC', + tokenTo: idDFI, + ownerAddress: accountDFI, + amountFrom: new BigNumber(2), + orderPrice: new BigNumber(100) + } + result = await client.icxorderbook.createOrder(order2, []) + const createOrder2TxId = result.txid + await container.generate(1) + + // create offer to order createOrderTxId + const offer: ICXOffer = { + orderTx: createOrderTxId, + amount: new BigNumber(0.1), // 10 DFI = 0.1 BTC + ownerAddress: accountBTC + } + result = await client.icxorderbook.makeOffer(offer, []) + const makeOfferTxId = result.txid + await container.generate(1) + + // create offer to order createOrderTxId + const offer2: ICXOffer = { + orderTx: createOrder2TxId, + amount: new BigNumber(1), // + ownerAddress: accountBTC, + receivePubkey: '0348790cb93b203a8ea5ce07279cb209d807b535b2ca8b0988a6f7a6578e41f7a5' + } + result = await client.icxorderbook.makeOffer(offer2, []) + const makeOffer2TxId = result.txid + await container.generate(1) + + // retrive makeOffer2TxId + let retrivedOrder: Record = await client.icxorderbook.getOrder(makeOffer2TxId) + await checkBTCBuyOfferDetails(container, offer2, makeOffer2TxId, retrivedOrder as Record) + + // retrive makeOfferTxId + retrivedOrder = await client.icxorderbook.getOrder(makeOfferTxId) + await checkDFIBuyOfferDetails(container, offer, makeOfferTxId, retrivedOrder as Record) + }) + + it('Should return an error when incorect order transaction Id is used', async () => { + // create an order - maker + const order: ICXOrder = { + tokenFrom: idDFI, + chainTo: 'BTC', + ownerAddress: accountDFI, + receivePubkey: '037f9563f30c609b19fd435a19b8bde7d6db703012ba1aba72e9f42a87366d1941', + amountFrom: new BigNumber(15), + orderPrice: new BigNumber(0.01) + } + await client.icxorderbook.createOrder(order, []) + await container.generate(1) + + // get order "123" and check + const promise = client.icxorderbook.getOrder('123') + + await expect(promise).rejects.toThrow(RpcApiError) + await expect(promise).rejects.toThrow('RpcApiError: \'orderTx (0000000000000000000000000000000000000000000000000000000000000123) does not exist\', code: -8, method: icx_getorder') + }) +}) diff --git a/packages/jellyfish-api-core/src/category/icxorderbook.ts b/packages/jellyfish-api-core/src/category/icxorderbook.ts index 8485220b6a..e2eb0dabae 100644 --- a/packages/jellyfish-api-core/src/category/icxorderbook.ts +++ b/packages/jellyfish-api-core/src/category/icxorderbook.ts @@ -80,6 +80,22 @@ export class ICXOrderBook { 'bignumber' ) } + + /** + * Returns information about order or fillorder + * + * @param {string} [orderTx] Transaction id of createorder or fulfillorder transaction + * @return {Promise>} Object indluding details of the transaction. + */ + async getOrder (orderTx: string): Promise> { + return await this.client.call( + 'icx_getorder', + [ + orderTx + ], + 'bignumber' + ) + } } /** ICX order */ export interface ICXOrder { diff --git a/website/docs/jellyfish/api/icxorderbook.md b/website/docs/jellyfish/api/icxorderbook.md index 2186f66109..35385a1cdc 100644 --- a/website/docs/jellyfish/api/icxorderbook.md +++ b/website/docs/jellyfish/api/icxorderbook.md @@ -92,3 +92,43 @@ interface ICXGenericResult { txid: string } ``` + +## getOrder + +Returns information about order or fillorder + +```ts title="client.icxorderbook.getOrder()" +interface icxorderbook { + getOrder (orderTx: string): Promise> +} + +interface ICXOrderInfo { + status: ICXOrderStatus + type: ICXOrderType + tokenFrom: string + chainTo?: string + receivePubkey?: string + chainFrom?: string + tokenTo?: string + ownerAddress: string + amountFrom: BigNumber + amountToFill: BigNumber + orderPrice: BigNumber + amountToFillInToAsset: BigNumber + height: number + expireHeight: number + closeHeight?: number + expired?: boolean +} + +interface ICXOfferInfo { + orderTx: string + status: ICXOrderStatus + amount: BigNumber + amountInFromAsset: BigNumber + ownerAddress: string + receivePubkey?: string + takerFee: BigNumber + expireHeight: number +} +``` From 50de7dc27a28a7cd3bebf1e87b6c04172ef45d18 Mon Sep 17 00:00:00 2001 From: surangap Date: Wed, 23 Jun 2021 18:29:15 +0800 Subject: [PATCH 2/3] Refactored code. --- .../category/icxorderbook/getOrder.test.ts | 81 ++++++++++++++++--- website/docs/jellyfish/api/icxorderbook.md | 8 +- 2 files changed, 74 insertions(+), 15 deletions(-) diff --git a/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts b/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts index 994bcbfa74..1ebdc9e0fa 100644 --- a/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts +++ b/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts @@ -1,21 +1,30 @@ import { ContainerAdapterClient } from '../../container_adapter_client' import { MasterNodeRegTestContainer } from '@defichain/testcontainers' import { - ICXGenericResult, ICXOfferInfo, ICXOrderInfo, ICXOrder, ICXOffer + ICXGenericResult, ICXOfferInfo, ICXOrderInfo, ICXOrder, ICXOffer, ICXOrderStatus, ICXOrderType } from '../../../src/category/icxorderbook' import BigNumber from 'bignumber.js' -import { accountBTC, accountDFI, checkBTCBuyOfferDetails, checkBTCSellOrderDetails, checkDFIBuyOfferDetails, checkDFISellOrderDetails, idDFI, setup } from './common.test' +import { accountBTC, accountDFI, DEX_DFI_PER_BTC_RATE, ICXSetup, ICX_TAKERFEE_PER_BTC, idDFI, symbolBTC, symbolDFI } from './icx_setup' import { RpcApiError } from '../../../src' -describe('Should test ICXOrderBook.getOrder', () => { +describe('ICXOrderBook.getOrder', () => { const container = new MasterNodeRegTestContainer() const client = new ContainerAdapterClient(container) + const icxSetup = new ICXSetup(container) beforeAll(async () => { await container.start() await container.waitForReady() await container.waitForWalletCoinbaseMaturity() - await setup(container) + await icxSetup.createAccounts() + await icxSetup.createBTCToken() + await icxSetup.initializeTokensIds() + await icxSetup.mintBTCtoken(100) + await icxSetup.fundAccount(accountDFI, symbolDFI, 500) + await icxSetup.fundAccount(accountBTC, symbolDFI, 10) // for fee + await icxSetup.createBTCDFIPool() + await icxSetup.addLiquidityToBTCDFIPool(1, 100) + await icxSetup.setTakerFee(0.001) }) afterAll(async () => { @@ -26,7 +35,7 @@ describe('Should test ICXOrderBook.getOrder', () => { // cleanup code here }) - it('Should get the correct order', async () => { + it('should get the correct order', async () => { // create first order - maker const order: ICXOrder = { tokenFrom: idDFI, @@ -42,7 +51,22 @@ describe('Should test ICXOrderBook.getOrder', () => { // get order createOrderTxId and check let retrivedOrder: Record = await client.icxorderbook.getOrder(createOrderTxId) - await checkDFISellOrderDetails(container, order, createOrderTxId, retrivedOrder as Record) + expect((retrivedOrder as Record)[createOrderTxId]).toStrictEqual( + { + // status: ICXOrderStatus.OPEN, //NOTE(surangap): status is not returned? + type: ICXOrderType.INTERNAL, + tokenFrom: order.tokenFrom === '0' ? symbolDFI : symbolBTC, + chainTo: order.chainTo, + receivePubkey: order.receivePubkey, + ownerAddress: order.ownerAddress, + amountFrom: order.amountFrom, + amountToFill: order.amountFrom, + orderPrice: order.orderPrice, + amountToFillInToAsset: order.amountFrom.multipliedBy(order.orderPrice), + height: expect.any(BigNumber), + expireHeight: expect.any(BigNumber) + } + ) // create second order - maker const order2: ICXOrder = { @@ -59,10 +83,24 @@ describe('Should test ICXOrderBook.getOrder', () => { // get order createOrder2TxId and check retrivedOrder = await client.icxorderbook.getOrder(createOrder2TxId) // check details for createOrder2TxId - await checkBTCSellOrderDetails(container, order2, createOrder2TxId, retrivedOrder as Record) + expect((retrivedOrder as Record)[createOrder2TxId]).toStrictEqual( + { + // status: ICXOrderStatus.OPEN, //NOTE(surangap): status is not returned? + type: ICXOrderType.EXTERNAL, + tokenTo: order2.tokenTo === '0' ? symbolDFI : symbolBTC, + chainFrom: order2.chainFrom, + ownerAddress: order2.ownerAddress, + amountFrom: order2.amountFrom, + amountToFill: order2.amountFrom, + orderPrice: order2.orderPrice, + amountToFillInToAsset: order2.amountFrom.multipliedBy(order2.orderPrice), + height: expect.any(BigNumber), + expireHeight: expect.any(BigNumber) + } + ) }) - it('Should get the correct offer', async () => { + it('should get the correct offer', async () => { // create two orders - maker const order: ICXOrder = { tokenFrom: idDFI, @@ -111,14 +149,35 @@ describe('Should test ICXOrderBook.getOrder', () => { // retrive makeOffer2TxId let retrivedOrder: Record = await client.icxorderbook.getOrder(makeOffer2TxId) - await checkBTCBuyOfferDetails(container, offer2, makeOffer2TxId, retrivedOrder as Record) + expect((retrivedOrder as Record)[makeOffer2TxId]).toStrictEqual( + { + orderTx: createOrder2TxId, + status: ICXOrderStatus.EXPIRED, // NOTE(surangap): why this is EXPIRED ? should be OPEN? + amount: offer2.amount, + amountInFromAsset: offer2.amount.dividedBy(order2.orderPrice), + ownerAddress: offer2.ownerAddress, + takerFee: offer2.amount.multipliedBy(ICX_TAKERFEE_PER_BTC), + expireHeight: expect.any(BigNumber), + receivePubkey: offer2.receivePubkey + } + ) // retrive makeOfferTxId retrivedOrder = await client.icxorderbook.getOrder(makeOfferTxId) - await checkDFIBuyOfferDetails(container, offer, makeOfferTxId, retrivedOrder as Record) + expect((retrivedOrder as Record)[makeOfferTxId]).toStrictEqual( + { + orderTx: createOrderTxId, + status: ICXOrderStatus.EXPIRED, // NOTE(surangap): why this is EXPIRED ? should be OPEN? + amount: offer.amount, + amountInFromAsset: offer.amount.dividedBy(order.orderPrice), + ownerAddress: offer.ownerAddress, + takerFee: offer.amount.multipliedBy(ICX_TAKERFEE_PER_BTC).multipliedBy(DEX_DFI_PER_BTC_RATE), + expireHeight: expect.any(BigNumber) + } + ) }) - it('Should return an error when incorect order transaction Id is used', async () => { + it('should return an error when incorect order transaction id is used', async () => { // create an order - maker const order: ICXOrder = { tokenFrom: idDFI, diff --git a/website/docs/jellyfish/api/icxorderbook.md b/website/docs/jellyfish/api/icxorderbook.md index 35385a1cdc..ff7be4cce1 100644 --- a/website/docs/jellyfish/api/icxorderbook.md +++ b/website/docs/jellyfish/api/icxorderbook.md @@ -115,9 +115,9 @@ interface ICXOrderInfo { amountToFill: BigNumber orderPrice: BigNumber amountToFillInToAsset: BigNumber - height: number - expireHeight: number - closeHeight?: number + height: BigNumber + expireHeight: BigNumber + closeHeight?: BigNumber expired?: boolean } @@ -129,6 +129,6 @@ interface ICXOfferInfo { ownerAddress: string receivePubkey?: string takerFee: BigNumber - expireHeight: number + expireHeight: BigNumber } ``` From 40f70704130ba314783e3d60a7955866c1e5af8e Mon Sep 17 00:00:00 2001 From: surangap Date: Wed, 30 Jun 2021 14:35:35 +0800 Subject: [PATCH 3/3] Refactored code. --- .../category/icxorderbook/getOrder.test.ts | 56 +++++++++---------- .../src/category/icxorderbook.ts | 4 +- website/docs/jellyfish/api/icxorderbook.md | 2 +- 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts b/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts index 1ebdc9e0fa..14b1442b88 100644 --- a/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts +++ b/packages/jellyfish-api-core/__tests__/category/icxorderbook/getOrder.test.ts @@ -4,7 +4,7 @@ import { ICXGenericResult, ICXOfferInfo, ICXOrderInfo, ICXOrder, ICXOffer, ICXOrderStatus, ICXOrderType } from '../../../src/category/icxorderbook' import BigNumber from 'bignumber.js' -import { accountBTC, accountDFI, DEX_DFI_PER_BTC_RATE, ICXSetup, ICX_TAKERFEE_PER_BTC, idDFI, symbolBTC, symbolDFI } from './icx_setup' +import { accountBTC, accountDFI, DEX_DFI_PER_BTC_RATE, ICXSetup, ICX_TAKERFEE_PER_BTC, idDFI, symbolDFI } from './icx_setup' import { RpcApiError } from '../../../src' describe('ICXOrderBook.getOrder', () => { @@ -31,10 +31,6 @@ describe('ICXOrderBook.getOrder', () => { await container.stop() }) - afterEach(async () => { - // cleanup code here - }) - it('should get the correct order', async () => { // create first order - maker const order: ICXOrder = { @@ -45,17 +41,17 @@ describe('ICXOrderBook.getOrder', () => { amountFrom: new BigNumber(15), orderPrice: new BigNumber(0.01) } - let result: ICXGenericResult = await client.icxorderbook.createOrder(order, []) - const createOrderTxId = result.txid + const createOrderResult: ICXGenericResult = await client.icxorderbook.createOrder(order, []) + const createOrderTxId = createOrderResult.txid await container.generate(1) // get order createOrderTxId and check - let retrivedOrder: Record = await client.icxorderbook.getOrder(createOrderTxId) - expect((retrivedOrder as Record)[createOrderTxId]).toStrictEqual( + const retrievedOrder: Record = await client.icxorderbook.getOrder(createOrderTxId) + expect((retrievedOrder as Record)[createOrderTxId]).toStrictEqual( { // status: ICXOrderStatus.OPEN, //NOTE(surangap): status is not returned? type: ICXOrderType.INTERNAL, - tokenFrom: order.tokenFrom === '0' ? symbolDFI : symbolBTC, + tokenFrom: symbolDFI, chainTo: order.chainTo, receivePubkey: order.receivePubkey, ownerAddress: order.ownerAddress, @@ -76,18 +72,18 @@ describe('ICXOrderBook.getOrder', () => { amountFrom: new BigNumber(2), orderPrice: new BigNumber(100) } - result = await client.icxorderbook.createOrder(order2, []) - const createOrder2TxId = result.txid + const createOrder2Result = await client.icxorderbook.createOrder(order2, []) + const createOrder2TxId = createOrder2Result.txid await container.generate(1) // get order createOrder2TxId and check - retrivedOrder = await client.icxorderbook.getOrder(createOrder2TxId) + const retrievedOrder2: Record = await client.icxorderbook.getOrder(createOrder2TxId) // check details for createOrder2TxId - expect((retrivedOrder as Record)[createOrder2TxId]).toStrictEqual( + expect((retrievedOrder2 as Record)[createOrder2TxId]).toStrictEqual( { // status: ICXOrderStatus.OPEN, //NOTE(surangap): status is not returned? type: ICXOrderType.EXTERNAL, - tokenTo: order2.tokenTo === '0' ? symbolDFI : symbolBTC, + tokenTo: symbolDFI, chainFrom: order2.chainFrom, ownerAddress: order2.ownerAddress, amountFrom: order2.amountFrom, @@ -110,8 +106,8 @@ describe('ICXOrderBook.getOrder', () => { amountFrom: new BigNumber(15), orderPrice: new BigNumber(0.01) } - let result: ICXGenericResult = await client.icxorderbook.createOrder(order, []) - const createOrderTxId = result.txid + const createOrderResult: ICXGenericResult = await client.icxorderbook.createOrder(order, []) + const createOrderTxId = createOrderResult.txid await container.generate(1) // create second order - maker @@ -122,8 +118,8 @@ describe('ICXOrderBook.getOrder', () => { amountFrom: new BigNumber(2), orderPrice: new BigNumber(100) } - result = await client.icxorderbook.createOrder(order2, []) - const createOrder2TxId = result.txid + const createOrder2Result = await client.icxorderbook.createOrder(order2, []) + const createOrder2TxId = createOrder2Result.txid await container.generate(1) // create offer to order createOrderTxId @@ -132,8 +128,8 @@ describe('ICXOrderBook.getOrder', () => { amount: new BigNumber(0.1), // 10 DFI = 0.1 BTC ownerAddress: accountBTC } - result = await client.icxorderbook.makeOffer(offer, []) - const makeOfferTxId = result.txid + const makeOfferResult = await client.icxorderbook.makeOffer(offer, []) + const makeOfferTxId = makeOfferResult.txid await container.generate(1) // create offer to order createOrderTxId @@ -143,13 +139,13 @@ describe('ICXOrderBook.getOrder', () => { ownerAddress: accountBTC, receivePubkey: '0348790cb93b203a8ea5ce07279cb209d807b535b2ca8b0988a6f7a6578e41f7a5' } - result = await client.icxorderbook.makeOffer(offer2, []) - const makeOffer2TxId = result.txid + const makeOffer2Result = await client.icxorderbook.makeOffer(offer2, []) + const makeOffer2TxId = makeOffer2Result.txid await container.generate(1) // retrive makeOffer2TxId - let retrivedOrder: Record = await client.icxorderbook.getOrder(makeOffer2TxId) - expect((retrivedOrder as Record)[makeOffer2TxId]).toStrictEqual( + const retrievedOrder: Record = await client.icxorderbook.getOrder(makeOffer2TxId) + expect((retrievedOrder as Record)[makeOffer2TxId]).toStrictEqual( { orderTx: createOrder2TxId, status: ICXOrderStatus.EXPIRED, // NOTE(surangap): why this is EXPIRED ? should be OPEN? @@ -163,8 +159,8 @@ describe('ICXOrderBook.getOrder', () => { ) // retrive makeOfferTxId - retrivedOrder = await client.icxorderbook.getOrder(makeOfferTxId) - expect((retrivedOrder as Record)[makeOfferTxId]).toStrictEqual( + const retrievedOrder2: Record = await client.icxorderbook.getOrder(makeOfferTxId) + expect((retrievedOrder2 as Record)[makeOfferTxId]).toStrictEqual( { orderTx: createOrderTxId, status: ICXOrderStatus.EXPIRED, // NOTE(surangap): why this is EXPIRED ? should be OPEN? @@ -190,10 +186,10 @@ describe('ICXOrderBook.getOrder', () => { await client.icxorderbook.createOrder(order, []) await container.generate(1) - // get order "123" and check - const promise = client.icxorderbook.getOrder('123') + // get order "INVALID_ORDER_TX_ID" and check + const promise = client.icxorderbook.getOrder('INVALID_ORDER_TX_ID') await expect(promise).rejects.toThrow(RpcApiError) - await expect(promise).rejects.toThrow('RpcApiError: \'orderTx (0000000000000000000000000000000000000000000000000000000000000123) does not exist\', code: -8, method: icx_getorder') + await expect(promise).rejects.toThrow('RpcApiError: \'orderTx (0000000000000000000000000000000000000000000000000000000000000000) does not exist\', code: -8, method: icx_getorder') }) }) diff --git a/packages/jellyfish-api-core/src/category/icxorderbook.ts b/packages/jellyfish-api-core/src/category/icxorderbook.ts index e2eb0dabae..197929cb5d 100644 --- a/packages/jellyfish-api-core/src/category/icxorderbook.ts +++ b/packages/jellyfish-api-core/src/category/icxorderbook.ts @@ -85,9 +85,9 @@ export class ICXOrderBook { * Returns information about order or fillorder * * @param {string} [orderTx] Transaction id of createorder or fulfillorder transaction - * @return {Promise>} Object indluding details of the transaction. + * @return {Promise>} Object indluding details of the transaction. */ - async getOrder (orderTx: string): Promise> { + async getOrder (orderTx: string): Promise> { return await this.client.call( 'icx_getorder', [ diff --git a/website/docs/jellyfish/api/icxorderbook.md b/website/docs/jellyfish/api/icxorderbook.md index ff7be4cce1..271709f79c 100644 --- a/website/docs/jellyfish/api/icxorderbook.md +++ b/website/docs/jellyfish/api/icxorderbook.md @@ -99,7 +99,7 @@ Returns information about order or fillorder ```ts title="client.icxorderbook.getOrder()" interface icxorderbook { - getOrder (orderTx: string): Promise> + getOrder (orderTx: string): Promise> } interface ICXOrderInfo {