diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-27 16:59:37 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-27 16:59:37 +0800 |
commit | c308359f59cc24510ff3d42ae777226a599db376 (patch) | |
tree | 1b5523e4fbc3434abd4f66f87a6bb5b59ca7c52b /packages/website/ts/utils/utils.ts | |
parent | 375d667144e26253f8ff6b0ad1beb45d5b3ef228 (diff) | |
parent | 84bd54ba4025a33f4e311ec66d81d58b45e54d6b (diff) | |
download | dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.gz dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.bz2 dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.lz dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.xz dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.tar.zst dexon-sol-tools-c308359f59cc24510ff3d42ae777226a599db376.zip |
Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
Improve 'web3-provider-engine' typings
Fix build
Update artifacts
Add more revert reasons to tests
Make dispatchTransferFrom revert with reason from AssetProxy on failure
Remove redundant files, hard code function selector in dispatchTransferFrom, and modify revert reason
Updated offset of receiverData length to reflect new assetData encoding.
ERC20 Custom storage layout
Golf the authorization check
ERC20 manual memory layout
ERC20 inline return
ERC721 inline return
Golf ERC721 transferFrom
Inline ERC20 tranferFrom selector constant
Optimize ERC20 transferFrom
Polish asset picker layout
Update relayer grid fallback icon
Change metamask install link based on browser
Use ethereumjs-tx@1.3.5 instead of our fork
# Conflicts:
# packages/contracts/test/asset_proxy/proxies.ts
# packages/contracts/test/exchange/core.ts
# packages/migrations/artifacts/2.0.0/DummyERC721Token.json
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r-- | packages/website/ts/utils/utils.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 0cb965f05..ff06d923d 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -4,11 +4,13 @@ import { constants as sharedConstants, Networks } from '@0xproject/react-shared' import { ECSignature, Provider } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import * as bowser from 'bowser'; import deepEqual = require('deep-equal'); import * as _ from 'lodash'; import * as moment from 'moment'; import { BlockchainCallErrs, + BrowserType, Environments, Order, Providers, @@ -368,4 +370,15 @@ export const utils = { isMobile(screenWidth: ScreenWidths): boolean { return screenWidth === ScreenWidths.Sm; }, + getBrowserType(): BrowserType { + if (bowser.chrome) { + return BrowserType.Chrome; + } else if (bowser.firefox) { + return BrowserType.Firefox; + } else if (bowser.opera) { + return BrowserType.Opera; + } else { + return BrowserType.Other; + } + }, }; |