How to use the @0x/assert.assert.isBoolean 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-wrappers / src / generated-wrappers / asset_proxy_owner.ts View on Github external
async callAsync(
            from: BigNumber,
            to: BigNumber,
            pending: boolean,
            executed: boolean,
            callData: Partial = {},
            defaultBlock?: BlockParam,
        ): Promise {
            assert.isBigNumber('from', from);
            assert.isBigNumber('to', to);
            assert.isBoolean('pending', pending);
            assert.isBoolean('executed', executed);
            assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
                schemas.addressSchema,
                schemas.numberSchema,
                schemas.jsNumber,
            ]);
            if (defaultBlock !== undefined) {
                assert.isBlockParam('defaultBlock', defaultBlock);
            }
            const self = this as any as AssetProxyOwnerContract;
            const encodedData = self._strictEncodeArguments('getTransactionIds(uint256,uint256,bool,bool)', [from,
        to,
        pending,
        executed
        ]);
            const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
                {
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / dummy_erc721_token.ts View on Github external
public setApprovalForAll(_operator: string, _approved: boolean): ContractTxFunctionObj {
        const self = (this as any) as DummyERC721TokenContract;
        assert.isString('_operator', _operator);
        assert.isBoolean('_approved', _approved);
        const functionSignature = 'setApprovalForAll(address,bool)';

        return {
            async sendTransactionAsync(
                txData?: Partial | undefined,
                opts: SendTransactionOpts = { shouldValidate: true },
            ): Promise {
                const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
                    { ...txData, data: this.getABIEncodedTransactionData() },
                    this.estimateGasAsync.bind(this),
                );
                if (opts.shouldValidate !== false) {
                    await this.callAsync(txDataWithDefaults);
                }
                return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
            },
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc1155_mintable.ts View on Github external
public setApprovalForAll(operator: string, approved: boolean): ContractTxFunctionObj {
        const self = (this as any) as ERC1155MintableContract;
        assert.isString('operator', operator);
        assert.isBoolean('approved', approved);
        const functionSignature = 'setApprovalForAll(address,bool)';

        return {
            async sendTransactionAsync(
                txData?: Partial | undefined,
                opts: SendTransactionOpts = { shouldValidate: true },
            ): Promise {
                const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
                    { ...txData, data: this.getABIEncodedTransactionData() },
                    this.estimateGasAsync.bind(this),
                );
                if (opts.shouldValidate !== false) {
                    await this.callAsync(txDataWithDefaults);
                }
                return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
            },
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc1155_mintable.ts View on Github external
public create(uri: string, isNF: boolean): ContractTxFunctionObj {
        const self = (this as any) as ERC1155MintableContract;
        assert.isString('uri', uri);
        assert.isBoolean('isNF', isNF);
        const functionSignature = 'create(string,bool)';

        return {
            async sendTransactionAsync(
                txData?: Partial | undefined,
                opts: SendTransactionOpts = { shouldValidate: true },
            ): Promise {
                const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
                    { ...txData, data: this.getABIEncodedTransactionData() },
                    this.estimateGasAsync.bind(this),
                );
                if (opts.shouldValidate !== false) {
                    await this.callAsync(txDataWithDefaults);
                }
                return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
            },
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / asset_proxy_owner.ts View on Github external
async callAsync(
            pending: boolean,
            executed: boolean,
            callData: Partial = {},
            defaultBlock?: BlockParam,
        ): Promise {
            assert.isBoolean('pending', pending);
            assert.isBoolean('executed', executed);
            assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
                schemas.addressSchema,
                schemas.numberSchema,
                schemas.jsNumber,
            ]);
            if (defaultBlock !== undefined) {
                assert.isBlockParam('defaultBlock', defaultBlock);
            }
            const self = this as any as AssetProxyOwnerContract;
            const encodedData = self._strictEncodeArguments('getTransactionCount(bool,bool)', [pending,
        executed
        ]);
            const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
                {
                    to: self.address,
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / asset_proxy_owner.ts View on Github external
async callAsync(
            assetProxyContract: string,
            isRegistered: boolean,
            callData: Partial = {},
            defaultBlock?: BlockParam,
        ): Promise {
            assert.isString('assetProxyContract', assetProxyContract);
            assert.isBoolean('isRegistered', isRegistered);
            assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [
                schemas.addressSchema,
                schemas.numberSchema,
                schemas.jsNumber,
            ]);
            if (defaultBlock !== undefined) {
                assert.isBlockParam('defaultBlock', defaultBlock);
            }
            const self = this as any as AssetProxyOwnerContract;
            const encodedData = self._strictEncodeArguments('registerAssetProxy(address,bool)', [assetProxyContract,
        isRegistered
        ]);
            const callDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
                {
                    to: self.address,
                    ...callData,
github 0xProject / 0x-monorepo / packages / contract-wrappers / src / generated-wrappers / erc721_token.ts View on Github external
public setApprovalForAll(_operator: string, _approved: boolean): ContractTxFunctionObj {
        const self = (this as any) as ERC721TokenContract;
        assert.isString('_operator', _operator);
        assert.isBoolean('_approved', _approved);
        const functionSignature = 'setApprovalForAll(address,bool)';

        return {
            async sendTransactionAsync(
                txData?: Partial | undefined,
                opts: SendTransactionOpts = { shouldValidate: true },
            ): Promise {
                const txDataWithDefaults = await self._applyDefaultsToTxDataAsync(
                    { ...txData, data: this.getABIEncodedTransactionData() },
                    this.estimateGasAsync.bind(this),
                );
                if (opts.shouldValidate !== false) {
                    await this.callAsync(txDataWithDefaults);
                }
                return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);
            },