Skip to content

Commit

Permalink
Fix/self order book (#30)
Browse files Browse the repository at this point in the history
* fix post to self order book

* update version
  • Loading branch information
Anorth1997 committed Jan 13, 2024
1 parent 4c75804 commit 7000a65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nftgo/gotrading",
"version": "1.0.11",
"version": "1.0.12",
"main": "dist/index.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
Expand Down
14 changes: 8 additions & 6 deletions src/modules/utils/post-order/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ import { splitSignature } from 'ethers/lib/utils';

import { AggregatorApiException, BaseException } from '@/exceptions';

import { IPostOrderHandler } from './utils';
import * as Models from './utils';
import { IPostOrderHandler } from './utils';

import {
HTTPClient,
Config,
AggregatorApiResponse,
AggregatorApiStatusResponse,
PostOrderReq,
Config,
HTTPClient,
Orderbook,
OrderKind,
PostOrderReq,
} from '@/types';
import { SeaportV1D5Handler, LooksRareV2Handler, X2Y2Handler } from './handler';
import { LooksRareV2Handler, SeaportV1D5Handler, X2Y2Handler } from './handler';
import { HTTPClientStable } from '@/http';
import { SafeAny } from 'src/types/safe-any';

export class PostOrderHandler {
private handlers = new Map<OrderKind, IPostOrderHandler>();
private client: HTTPClient = new HTTPClientStable();
Expand All @@ -37,7 +39,7 @@ export class PostOrderHandler {

async handle(params: PostOrderReq, signature: string, endpoint: string): Promise<SafeAny> {
// given the orderKind, invoke NFTGo developer API or directly post order to marketplace
if (params.order.kind === OrderKind.Blur) {
if (params.order.kind === OrderKind.Blur || params.orderbook === Orderbook.SELF) {
const res = await this.post<AggregatorApiResponse, PostOrderReq & { signature: string }>(endpoint, {
...params,
signature,
Expand Down

0 comments on commit 7000a65

Please sign in to comment.