How to use the @0x/base-contract.PromiseWithTransactionHash function in @0x/base-contract

To help you get started, we’ve selected a few @0x/base-contract 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 / expected-output / typescript / abi_gen_dummy.ts View on Github external
awaitTransactionSuccessAsync(
            txData?: Partial,
            pollingIntervalMs?: number,
            timeoutMs?: number,
        ): PromiseWithTransactionHash {
            const self = (this as any) as AbiGenDummyContract;
            const txHashPromise = self.nonPureMethod.sendTransactionAsync(txData);
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        pollingIntervalMs,
                        timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc20_proxy.ts View on Github external
awaitTransactionSuccessAsync(
            newOwner: string,
            txData?: Partial,
            opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
        ): PromiseWithTransactionHash {
            assert.isString('newOwner', newOwner);
            const self = (this as any) as ERC20ProxyContract;
            const txHashPromise = self.transferOwnership.sendTransactionAsync(newOwner.toLowerCase(), txData, opts);
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        opts.pollingIntervalMs,
                        opts.timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / contract-wrappers / src / generated-wrappers / erc20_proxy.ts View on Github external
awaitTransactionSuccessAsync(
            target: string,
            index: BigNumber,
            txData?: Partial,
            pollingIntervalMs?: number,
            timeoutMs?: number,
        ): PromiseWithTransactionHash {
            assert.isString('target', target);
            assert.isBigNumber('index', index);
            const self = (this as any) as ERC20ProxyContract;
            const txHashPromise = self.removeAuthorizedAddressAtIndex.sendTransactionAsync(
                target.toLowerCase(),
                index,
                txData,
            );
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        pollingIntervalMs,
                        timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / i_asset_proxy.ts View on Github external
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
        ): PromiseWithTransactionHash {
            assert.isString('assetData', assetData);
            assert.isString('from', from);
            assert.isString('to', to);
            assert.isBigNumber('amount', amount);
            const self = (this as any) as IAssetProxyContract;
            const txHashPromise = self.transferFrom.sendTransactionAsync(
                assetData,
                from.toLowerCase(),
                to.toLowerCase(),
                amount,
                txData,
                opts,
            );
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        opts.pollingIntervalMs,
                        opts.timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc721_proxy.ts View on Github external
awaitTransactionSuccessAsync(
            target: string,
            txData?: Partial,
            opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
        ): PromiseWithTransactionHash {
            assert.isString('target', target);
            const self = (this as any) as ERC721ProxyContract;
            const txHashPromise = self.removeAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData, opts);
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        opts.pollingIntervalMs,
                        opts.timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / erc1155_proxy.ts View on Github external
opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
        ): PromiseWithTransactionHash {
            assert.isString('assetData', assetData);
            assert.isString('from', from);
            assert.isString('to', to);
            assert.isBigNumber('amount', amount);
            const self = (this as any) as ERC1155ProxyContract;
            const txHashPromise = self.transferFrom.sendTransactionAsync(
                assetData,
                from.toLowerCase(),
                to.toLowerCase(),
                amount,
                txData,
                opts,
            );
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        opts.pollingIntervalMs,
                        opts.timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / dutch_auction.ts View on Github external
sellSignature: string,
            txData?: Partial,
            opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
        ): PromiseWithTransactionHash {
            assert.isString('buySignature', buySignature);
            assert.isString('sellSignature', sellSignature);
            const self = (this as any) as DutchAuctionContract;
            const txHashPromise = self.matchOrders.sendTransactionAsync(
                buyOrder,
                sellOrder,
                buySignature,
                sellSignature,
                txData,
                opts,
            );
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        opts.pollingIntervalMs,
                        opts.timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / asset_proxy_owner.ts View on Github external
awaitTransactionSuccessAsync(
            owner: string,
            newOwner: string,
            txData?: Partial,
            pollingIntervalMs?: number,
            timeoutMs?: number,
        ): PromiseWithTransactionHash {
        assert.isString('owner', owner);
        assert.isString('newOwner', newOwner);
        const self = this as any as AssetProxyOwnerContract;
        const txHashPromise = self.replaceOwner.sendTransactionAsync(owner,
    newOwner
    , txData);
        return new PromiseWithTransactionHash(
            txHashPromise,
            (async (): Promise => {
                // When the transaction hash resolves, wait for it to be mined.
                return self._web3Wrapper.awaitTransactionSuccessAsync(
                    await txHashPromise,
                    pollingIntervalMs,
                    timeoutMs,
                );
            })(),
        );
        },
        async estimateGasAsync(
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / multi_asset_proxy.ts View on Github external
awaitTransactionSuccessAsync(
            target: string,
            txData?: Partial,
            opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
        ): PromiseWithTransactionHash {
            assert.isString('target', target);
            const self = (this as any) as MultiAssetProxyContract;
            const txHashPromise = self.addAuthorizedAddress.sendTransactionAsync(target.toLowerCase(), txData, opts);
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        opts.pollingIntervalMs,
                        opts.timeoutMs,
                    );
                })(),
            );
        },
        /**
github 0xProject / 0x-monorepo / packages / abi-gen-wrappers / src / generated-wrappers / zrx_token.ts View on Github external
_value: BigNumber,
            txData?: Partial,
            opts: AwaitTransactionSuccessOpts = { shouldValidate: true },
        ): PromiseWithTransactionHash {
            assert.isString('_from', _from);
            assert.isString('_to', _to);
            assert.isBigNumber('_value', _value);
            const self = (this as any) as ZRXTokenContract;
            const txHashPromise = self.transferFrom.sendTransactionAsync(
                _from.toLowerCase(),
                _to.toLowerCase(),
                _value,
                txData,
                opts,
            );
            return new PromiseWithTransactionHash(
                txHashPromise,
                (async (): Promise => {
                    // When the transaction hash resolves, wait for it to be mined.
                    return self._web3Wrapper.awaitTransactionSuccessAsync(
                        await txHashPromise,
                        opts.pollingIntervalMs,
                        opts.timeoutMs,
                    );
                })(),
            );
        },
        /**