aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/blockchain.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-08-30 14:41:09 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-08-31 04:36:44 +0800
commit660e670d381316f412e706a9d7ced66b6c48c18c (patch)
tree375ae8edf3aba7f6e04a407cccd88685c369901f /packages/website/ts/blockchain.ts
parent052824f4e30c6dce63f3b57591d0a5727c0bd4c2 (diff)
downloaddexon-0x-contracts-660e670d381316f412e706a9d7ced66b6c48c18c.tar.gz
dexon-0x-contracts-660e670d381316f412e706a9d7ced66b6c48c18c.tar.zst
dexon-0x-contracts-660e670d381316f412e706a9d7ced66b6c48c18c.zip
Update generate and fill order flows
Diffstat (limited to 'packages/website/ts/blockchain.ts')
-rw-r--r--packages/website/ts/blockchain.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index c2d0551bf..baf8002cd 100644
--- a/packages/website/ts/blockchain.ts
+++ b/packages/website/ts/blockchain.ts
@@ -414,6 +414,15 @@ export class Blockchain {
const lowercaseAddress = address.toLowerCase();
return Web3Wrapper.isAddress(lowercaseAddress);
}
+ public async isValidSignatureAsync(data: string, signature: string, signerAddress: string): Promise<boolean> {
+ const result = await signatureUtils.isValidSignatureAsync(
+ this._contractWrappers.getProvider(),
+ data,
+ signature,
+ signerAddress,
+ );
+ return result;
+ }
public async pollTokenBalanceAsync(token: Token): Promise<BigNumber> {
utils.assert(this._doesUserAddressExist(), BlockchainCallErrs.UserHasNoAssociatedAddresses);
@@ -451,10 +460,10 @@ export class Blockchain {
throw new Error('Tried to send a sign request but user has no associated addresses');
}
this._showFlashMessageIfLedger();
-
const provider = this._contractWrappers.getProvider();
const isLedgerSigner = !_.isUndefined(this._ledgerSubprovider);
- const isMetaMaskSigner = utils.getProviderType(provider) === Providers.Metamask;
+ const injectedProvider = Blockchain._getInjectedWeb3().currentProvider;
+ const isMetaMaskSigner = utils.getProviderType(injectedProvider) === Providers.Metamask;
let signerType = SignerType.Default;
if (isLedgerSigner) {
signerType = SignerType.Ledger;