aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-26 04:32:37 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-26 04:32:37 +0800
commitc5e8bb17635d8710f0db62a8887f990cb6ad482f (patch)
tree7850c2f522aca88b327a8cdcbe07ce80f1109fc3 /packages/instant/src/components
parentacefeff5f08f123c7c5d372088f2af016e31c599 (diff)
downloaddexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar
dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar.gz
dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar.bz2
dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar.lz
dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar.xz
dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar.zst
dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.zip
txnHash -> txHash
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/buy_button.tsx20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 7004b6a18..841a9593b 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -13,9 +13,9 @@ export interface BuyButtonProps {
assetBuyer?: AssetBuyer;
onAwaitingSignature: (buyQuote: BuyQuote) => void;
onSignatureDenied: (buyQuote: BuyQuote, preventedError: Error) => void;
- onBuyProcessing: (buyQuote: BuyQuote, txnHash: string) => void;
- onBuySuccess: (buyQuote: BuyQuote, txnHash: string) => void;
- onBuyFailure: (buyQuote: BuyQuote, txnHash?: string) => void; // TODO: make this non-optional
+ onBuyProcessing: (buyQuote: BuyQuote, txHash: string) => void;
+ onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void;
+ onBuyFailure: (buyQuote: BuyQuote, txHash?: string) => void; // TODO: make this non-optional
}
export class BuyButton extends React.Component<BuyButtonProps> {
@@ -41,10 +41,10 @@ export class BuyButton extends React.Component<BuyButtonProps> {
return;
}
- let txnHash: string | undefined;
+ let txHash: string | undefined;
this.props.onAwaitingSignature(buyQuote);
try {
- txnHash = await assetBuyer.executeBuyQuoteAsync(buyQuote);
+ txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote);
} catch (e) {
if (e instanceof Error && e.message === AssetBuyerError.SignatureRequestDenied) {
this.props.onSignatureDenied(buyQuote, e);
@@ -54,20 +54,20 @@ export class BuyButton extends React.Component<BuyButtonProps> {
}
// Have to let TS know that txHash is definitely defined now
- if (!txnHash) {
+ if (!txHash) {
throw new Error('No txHash available');
}
- this.props.onBuyProcessing(buyQuote, txnHash);
+ this.props.onBuyProcessing(buyQuote, txHash);
try {
- await web3Wrapper.awaitTransactionSuccessAsync(txnHash);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash);
} catch (e) {
if (e instanceof Error && e.message.startsWith('Transaction failed')) {
- this.props.onBuyFailure(buyQuote, txnHash);
+ this.props.onBuyFailure(buyQuote, txHash);
return;
}
throw e;
}
- this.props.onBuySuccess(buyQuote, txnHash);
+ this.props.onBuySuccess(buyQuote, txHash);
};
}