How to use the @0x/json-schemas.schemas.orderHashSchema function in @0x/json-schemas

To help you get started, we’ve selected a few @0x/json-schemas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / packages / order-watcher / src / order_watcher / order_watcher.ts View on Github external
public removeOrder(orderHash: string): void {
        assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
        const signedOrder = this._orderByOrderHash[orderHash];
        if (signedOrder === undefined) {
            return; // noop
        }
        this._dependentOrderHashesTracker.removeFromDependentOrderHashes(signedOrder);
        delete this._orderByOrderHash[orderHash];
        this._expirationWatcher.removeOrder(orderHash);
        delete this._orderStateByOrderHashCache[orderHash];
    }
    /**
github 0xProject / 0x-monorepo / packages / contract-wrappers / src / contract_wrappers / exchange_wrapper.ts View on Github external
public async isCancelledAsync(orderHash: string, methodOpts: MethodOpts = {}): Promise {
        assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
        assert.doesConformToSchema('methodOpts', methodOpts, methodOptsSchema);
        const callData = {};
        const isCancelled = await this._exchangeContract.cancelled.callAsync(
            orderHash,
            callData,
            methodOpts.defaultBlock,
        );
        return isCancelled;
    }
    /**
github 0xProject / 0x-monorepo / packages / connect / src / http_client.ts View on Github external
public async getOrderAsync(orderHash: string, requestOpts?: RequestOpts): Promise {
        if (requestOpts !== undefined) {
            assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema);
        }
        assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema);
        const httpRequestOpts = {
            params: requestOpts,
        };
        const responseJson = await this._requestAsync(`/order/${orderHash}`, HttpRequestType.Get, httpRequestOpts);
        const order = relayerResponseJsonParsers.parseAPIOrderJson(responseJson);
        return order;
    }
    /**