How to use the @0x/assert.assert.isFunction function in @0x/assert

To help you get started, we’ve selected a few @0x/assert 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 / abi-gen / test-cli / output / typescript / abi_gen_dummy.ts View on Github external
public subscribe(
        eventName: AbiGenDummyEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, AbiGenDummyEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            AbiGenDummyContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / asset-swapper / src / utils / assert.ts View on Github external
isValidOrderbook(variableName: string, orderFetcher: Orderbook): void {
        sharedAssert.isFunction(`${variableName}.getOrdersAsync`, orderFetcher.getOrdersAsync);
    },
    isValidOrderProviderRequest(variableName: string, orderFetcherRequest: OrderProviderRequest): void {
github 0xProject / 0x-monorepo / packages / contract-wrappers / src / generated-wrappers / erc20_token.ts View on Github external
public subscribe(
        eventName: ERC20TokenEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, ERC20TokenEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            ERC20TokenContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc1155_proxy.ts View on Github external
public subscribe(
        eventName: ERC1155ProxyEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, ERC1155ProxyEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            ERC1155ProxyContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc20_proxy.ts View on Github external
public subscribe(
        eventName: ERC20ProxyEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, ERC20ProxyEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            ERC20ProxyContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / zrx_token.ts View on Github external
public subscribe(
        eventName: ZRXTokenEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, ZRXTokenEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            ZRXTokenContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc1155_mintable.ts View on Github external
public subscribe(
        eventName: ERC1155MintableEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, ERC1155MintableEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            ERC1155MintableContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / contract-wrappers / src / generated-wrappers / forwarder.ts View on Github external
public subscribe(
        eventName: ForwarderEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, ForwarderEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            ForwarderContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc721_proxy.ts View on Github external
public subscribe(
        eventName: ERC721ProxyEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, ERC721ProxyEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            ERC721ProxyContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / dummy_erc721_token.ts View on Github external
public subscribe(
        eventName: DummyERC721TokenEvents,
        indexFilterValues: IndexedFilterValues,
        callback: EventCallback,
        isVerbose: boolean = false,
        blockPollingIntervalMs?: number,
    ): string {
        assert.doesBelongToStringEnum('eventName', eventName, DummyERC721TokenEvents);
        assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
        assert.isFunction('callback', callback);
        const subscriptionToken = this._subscriptionManager.subscribe(
            this.address,
            eventName,
            indexFilterValues,
            DummyERC721TokenContract.ABI(),
            callback,
            isVerbose,
            blockPollingIntervalMs,
        );
        return subscriptionToken;
    }
    /**