From e70469a0ab4cf2dd5403b88927a2715cd6e1fb80 Mon Sep 17 00:00:00 2001 From: TomL94 Date: Sun, 2 May 2021 18:47:32 +0300 Subject: [PATCH 1/5] wip --- src/pages/Swap/Cashback.tsx | 210 ++++++++++++++++++++++++++++++++++++ src/pages/Swap/SwapTab.tsx | 2 + src/pages/Swap/index.tsx | 20 ++++ 3 files changed, 232 insertions(+) create mode 100644 src/pages/Swap/Cashback.tsx diff --git a/src/pages/Swap/Cashback.tsx b/src/pages/Swap/Cashback.tsx new file mode 100644 index 00000000..6932f834 --- /dev/null +++ b/src/pages/Swap/Cashback.tsx @@ -0,0 +1,210 @@ +import BigNumber from 'bignumber.js'; +import { getFeeForExecute } from '../../blockchain-bridge'; +import { AsyncSender } from '../../blockchain-bridge/scrt/asyncSender'; +import { FlexRowSpace } from 'components/Swap/FlexRowSpace'; +import React from 'react'; +import { render } from 'react-dom'; +import Loader from 'react-loader-spinner'; +import { ExecuteResult, SigningCosmWasmClient } from 'secretjs'; +import { Button, Container, Message } from 'semantic-ui-react'; +import { useStores } from 'stores'; +import { canonicalizeBalance, displayHumanizedBalance, humanizeBalance } from 'utils/formatNumber'; +import { getNativeBalance, storeTxResultLocally, unlockJsx } from './utils'; +import { UserStoreEx } from 'stores/UserStore'; + +export class Cashback extends React.Component< + { + user: UserStoreEx; + secretjsSender: AsyncSender; + refreshBalances: CallableFunction; + balances; + tokens; + notify: (type: 'success' | 'error' | 'errorWithHash', msg: string, closesAfterMs?: number, txHash?: string) => void; + }, + { loadingSwap: boolean } +> { + constructor(props) { + super(props); + + this.state = { + loadingSwap: false, + }; + } + + extractError(result: any) { + if (result?.raw_log && result.raw_log.includes('Operation fell short of expected_return')) { + return 'Swap fell short of expected return (slippage error)'; + } + if (result?.raw_log) { + return result.raw_log; + } + console.error(result); + return `Unknown error`; + } + + render() { + const cashbackAddr = 'secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn'; + const sefiAddr = 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm'; + const cashbackBalance = this.props.balances[cashbackAddr]; + const sefiBalance = this.props.balances[sefiAddr]; + return ( + //
+
+ +
+

Cashback Beta

+
+

+
+ +
+ {'CSHBK Balance: '} + {(() => { + if (cashbackBalance === undefined) { + return ( + <> + + + + ); + } + + if (JSON.stringify(cashbackBalance).includes('View')) { + return cashbackBalance; + } + + if (this.props.tokens.size > 0) { + return displayHumanizedBalance( + humanizeBalance( + new BigNumber(cashbackBalance as BigNumber), + this.props.tokens.get(cashbackAddr).decimals, + ), + BigNumber.ROUND_DOWN, + ); + } + return undefined; + })()} +
+
+ + +
+ {'SEFI Balance: '} + {(() => { + if (sefiBalance === undefined) { + return ( + <> + + + + ); + } + + if (JSON.stringify(sefiBalance).includes('View')) { + return sefiBalance; + } + + if (this.props.tokens.size > 0) { + return displayHumanizedBalance( + humanizeBalance( + new BigNumber(sefiBalance as BigNumber), + this.props.tokens.get(sefiAddr).decimals, + ), + BigNumber.ROUND_DOWN, + ); + } + return undefined; + })()} +
+
+
+

+
+ +
+
+
+ ); + } +} diff --git a/src/pages/Swap/SwapTab.tsx b/src/pages/Swap/SwapTab.tsx index 67bad1d4..0a80a68f 100644 --- a/src/pages/Swap/SwapTab.tsx +++ b/src/pages/Swap/SwapTab.tsx @@ -744,6 +744,8 @@ export class SwapTab extends React.Component< isFromEstimated: false, isToEstimated: false, }); + const height = await this.props.user.secretjs.getHeight(); + await this.props.refreshPools({ tokens: ['secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn'], height }); }} > {buttonMessage} diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 2b752844..8006a948 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -28,6 +28,7 @@ import { NativeToken, Token } from './types/trade'; import { SecretSwapPairs } from 'stores/SecretSwapPairs'; import Graph from 'node-dijkstra'; import { SecretSwapPools } from 'stores/SecretSwapPools'; +import { Cashback } from './Cashback'; export const SwapPageWrapper = observer(() => { // SwapPageWrapper is necessary to get the user store from mobx 🤷‍♂️ @@ -80,6 +81,8 @@ export class SwapRouter extends React.Component< routerSupportedTokens: Set; routingGraph: { [token0: string]: { [token1: string]: number } }; selectedPairRoutes: string[][]; + cashback: string; + sefi: string; } > { private symbolUpdateHeightCache: { [symbol: string]: number } = {}; @@ -99,6 +102,8 @@ export class SwapRouter extends React.Component< routerSupportedTokens: new Set(), routingGraph: {}, selectedPairRoutes: [], + cashback: 'secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn', + sefi: 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm', }; } @@ -142,6 +147,9 @@ export class SwapRouter extends React.Component< newBalances[selectedToken1] = await this.refreshTokenBalance(selectedToken1); } + newBalances[this.state.cashback] = await this.refreshTokenBalance(this.state.cashback); + newBalances[this.state.sefi] = await this.refreshTokenBalance(this.state.sefi); + if (updateState) { console.log('updated state'); this.setState(currentState => ({ balances: { ...currentState.balances, ...newBalances } })); @@ -169,6 +177,9 @@ export class SwapRouter extends React.Component< const sScrtBalance = { [process.env.SSCRT_CONTRACT]: await this.refreshTokenBalance(process.env.SSCRT_CONTRACT) }; + sScrtBalance[this.state.cashback] = await this.refreshTokenBalance(this.state.cashback); + sScrtBalance[this.state.sefi] = await this.refreshTokenBalance(this.state.sefi); + this.setState({ balances: { ...this.state.balances, ...sScrtBalance } }); while (!this.props.user.secretjs) { @@ -260,6 +271,7 @@ export class SwapRouter extends React.Component< const tokenBalances = ( await Promise.all( tokens.map(async s => { + console.log(`$$$$$$$$$$ refreshing ${s}`); return { [s]: await this.refreshTokenBalance(s, height) }; }), ) @@ -711,6 +723,14 @@ export class SwapRouter extends React.Component< /> )} */} + From 61212a787ccbe0cb3b155887e7166f29c5363bbc Mon Sep 17 00:00:00 2001 From: TomL94 Date: Tue, 4 May 2021 18:57:36 +0300 Subject: [PATCH 2/5] cashback poc --- src/components/Swap/BetaWarning.tsx | 4 +- src/pages/Swap/Cashback.tsx | 141 ++++++++++++++++++---------- src/pages/Swap/index.tsx | 4 +- 3 files changed, 96 insertions(+), 53 deletions(-) diff --git a/src/components/Swap/BetaWarning.tsx b/src/components/Swap/BetaWarning.tsx index 630ac99b..f9d853c4 100644 --- a/src/components/Swap/BetaWarning.tsx +++ b/src/components/Swap/BetaWarning.tsx @@ -19,7 +19,7 @@ export const BetaWarning = ({ secretjs }: { secretjs: SigningCosmWasmClient }) =
  • - #🔀secret-swap + #🔀secret-swap-general {' '} on{' '} @@ -27,7 +27,7 @@ export const BetaWarning = ({ secretjs }: { secretjs: SigningCosmWasmClient }) =
  • - Tag @assafmo on{' '} + Tag @toml01 on{' '} Telegram diff --git a/src/pages/Swap/Cashback.tsx b/src/pages/Swap/Cashback.tsx index 6932f834..d7896d7e 100644 --- a/src/pages/Swap/Cashback.tsx +++ b/src/pages/Swap/Cashback.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { render } from 'react-dom'; import Loader from 'react-loader-spinner'; import { ExecuteResult, SigningCosmWasmClient } from 'secretjs'; -import { Button, Container, Message } from 'semantic-ui-react'; +import { Button, Container, Icon, Message, Popup } from 'semantic-ui-react'; import { useStores } from 'stores'; import { canonicalizeBalance, displayHumanizedBalance, humanizeBalance } from 'utils/formatNumber'; import { getNativeBalance, storeTxResultLocally, unlockJsx } from './utils'; @@ -49,7 +49,7 @@ export class Cashback extends React.Component< const sefiBalance = this.props.balances[sefiAddr]; return ( //
    -
    +
    -

    Cashback Beta

    +

    + Cashback Beta + + } + position="top center" + > + + Hello secret beta testers 🤫 This is a temporary proof of concept. Thanks for trying this out! +
      +
    • + You will accumulate CSHBK just by using Secret Swap.{' '} + Currently on testnet the only pair that will give you cashback is sSCRT/SCRT. +
    • +
    • + It will work even if the swapping route takes you through the sSCRT/SCRT pair along the route. +
    • +
    • Once you got CSHBK, you can convert it to SEFI.
    • +
    +
    +
    +



    - + } + position="top center" > - Convert CSHBK to SEFI - + + Conversion is basically burning your CSHBK to get SEFI.
    +
    + The conversion rate is based on CSHBK's total supply and accumulated SEFI rewards. +
    + +
    + Conversion Rate: Available Soon
    diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 8006a948..90479666 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -262,7 +262,7 @@ export class SwapRouter extends React.Component< }; } - private async refreshBalances({ pair, tokens, height }: { tokens: string[]; pair?: SwapPair; height?: number }) { + refreshBalances = async ({ pair, tokens, height }: { tokens: string[]; pair?: SwapPair; height?: number }) => { if (!height) { height = await this.props.user.secretjs.getHeight(); } @@ -309,7 +309,7 @@ export class SwapRouter extends React.Component< })); return newObject; - } + }; private async refreshPoolBalance(pair: SwapPair) { const balances = []; From 8220ded808579ca59f723a8d478bf9ac7186b8fb Mon Sep 17 00:00:00 2001 From: TomL94 Date: Wed, 5 May 2021 19:37:57 +0300 Subject: [PATCH 3/5] wip --- src/pages/Swap/Cashback.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/pages/Swap/Cashback.tsx b/src/pages/Swap/Cashback.tsx index d7896d7e..1f735879 100644 --- a/src/pages/Swap/Cashback.tsx +++ b/src/pages/Swap/Cashback.tsx @@ -42,6 +42,28 @@ export class Cashback extends React.Component< return `Unknown error`; } + async calcRatio(user: UserStoreEx, sefi: string, cashback: string): Promise { + const masterAddr = ''; + + const secretjs = user.secretjs; + + let result = await secretjs.queryContractSmart(cashback, { token_info: {} }); + const cbTotalSuppply = result.token_info.total_supply; + + result = await secretjs.queryContractSmart(cashback, { reward_balance: {} }); + const cbRewardBalance = result.balance; + + result = await secretjs.queryContractSmart(masterAddr, { + pending: { + spy_addr: '', + block: 0, + }, + }); + const cbPendingRewards = result.amount; + + return cbTotalSuppply / (cbRewardBalance + cbPendingRewards); //////////////////////////////////////// $$$ prices + } + render() { const cashbackAddr = 'secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn'; const sefiAddr = 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm'; From 805bb9f16f8a5f35f6f128ebff25c6bba520a45e Mon Sep 17 00:00:00 2001 From: TomL94 Date: Thu, 6 May 2021 17:21:22 +0300 Subject: [PATCH 4/5] cashback ratio wip --- src/pages/Swap/Cashback.tsx | 90 ++++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 17 deletions(-) diff --git a/src/pages/Swap/Cashback.tsx b/src/pages/Swap/Cashback.tsx index 1f735879..15b4277f 100644 --- a/src/pages/Swap/Cashback.tsx +++ b/src/pages/Swap/Cashback.tsx @@ -11,6 +11,7 @@ import { useStores } from 'stores'; import { canonicalizeBalance, displayHumanizedBalance, humanizeBalance } from 'utils/formatNumber'; import { getNativeBalance, storeTxResultLocally, unlockJsx } from './utils'; import { UserStoreEx } from 'stores/UserStore'; +import { Tokens } from 'stores/Tokens'; export class Cashback extends React.Component< { @@ -21,14 +22,25 @@ export class Cashback extends React.Component< tokens; notify: (type: 'success' | 'error' | 'errorWithHash', msg: string, closesAfterMs?: number, txHash?: string) => void; }, - { loadingSwap: boolean } + { loadingSwap: boolean; cbRatio: number | JSX.Element } > { constructor(props) { super(props); + const cashbackAddr = 'secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn'; + const sefiAddr = 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm'; + this.state = { loadingSwap: false, + cbRatio: undefined, }; + + this.calcRatio(this.props.user, this.props.tokens, sefiAddr, cashbackAddr).then(ratio => { + console.log('################## ratio'); + this.setState({ + cbRatio: ratio, + }); + }); } extractError(result: any) { @@ -42,26 +54,35 @@ export class Cashback extends React.Component< return `Unknown error`; } - async calcRatio(user: UserStoreEx, sefi: string, cashback: string): Promise { - const masterAddr = ''; + async calcRatio(user: UserStoreEx, tokens: Tokens, sefi: string, cashback: string): Promise { + try { + const masterAddr = 'secret13hqxweum28nj0c53nnvrpd23ygguhteqggf852'; - const secretjs = user.secretjs; + const secretjs = user.secretjs; - let result = await secretjs.queryContractSmart(cashback, { token_info: {} }); - const cbTotalSuppply = result.token_info.total_supply; + let result = await secretjs.queryContractSmart(cashback, { token_info: {} }); + const cbTotalSuppply = parseInt(result.token_info.total_supply); - result = await secretjs.queryContractSmart(cashback, { reward_balance: {} }); - const cbRewardBalance = result.balance; + result = await secretjs.queryContractSmart(cashback, { reward_balance: {} }); + const cbRewardBalance = parseInt(result.balance); - result = await secretjs.queryContractSmart(masterAddr, { - pending: { - spy_addr: '', - block: 0, - }, - }); - const cbPendingRewards = result.amount; + const block = await user.secretjs.getBlock(); + result = await secretjs.queryContractSmart(masterAddr, { + pending: { + spy_addr: 'cashback', + block, + }, + }); + const cbPendingRewards = parseInt(result.amount); - return cbTotalSuppply / (cbRewardBalance + cbPendingRewards); //////////////////////////////////////// $$$ prices + const sefiUSD = parseInt(tokens.allData.find(t => t.display_props.symbol === 'SEFI').price); + const scrtUSD = parseInt(tokens.allData.find(t => t.display_props.symbol === 'SSCRT').price); + + return (cbTotalSuppply * scrtUSD) / ((cbRewardBalance + cbPendingRewards) * sefiUSD); + } catch (e) { + console.log(e); + return undefined; + } } render() { @@ -69,6 +90,15 @@ export class Cashback extends React.Component< const sefiAddr = 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm'; const cashbackBalance = this.props.balances[cashbackAddr]; const sefiBalance = this.props.balances[sefiAddr]; + + // if (this.state.cbRatio === undefined) { + // this.calcRatio(this.props.user, this.props.tokens, sefiAddr, cashbackAddr).then(ratio => { + // this.setState({ + // cbRatio: ratio, + // }); + // }); + // } + return ( //
    @@ -266,7 +296,33 @@ export class Cashback extends React.Component<
    - Conversion Rate: Available Soon + Cashback Rate:{' '} + {(() => { + if (this.state.cbRatio === undefined) { + return ( + <> + + + + ); + } else { + return this.state.cbRatio; + } + })()} + {/* {await( + (async () => { + const ratio = await this.calcRatio(this.props.user, this.props.tokens, sefiAddr, cashbackAddr); + if (ratio === undefined) { + return ( + <> + + + + ); + } + return ratio.toString(); + })(), + )} */}
    From e844b15f154fcd71a212cdd2c232d6ce3c93d195 Mon Sep 17 00:00:00 2001 From: TomL94 Date: Thu, 6 May 2021 18:56:41 +0300 Subject: [PATCH 5/5] Cashback return --- src/pages/Swap/Cashback.tsx | 55 ++++++++++++++++---------- src/pages/Swap/LocalTokens/tokens.json | 6 +-- src/pages/Swap/SwapTab.tsx | 2 +- src/pages/Swap/index.tsx | 5 ++- 4 files changed, 41 insertions(+), 27 deletions(-) diff --git a/src/pages/Swap/Cashback.tsx b/src/pages/Swap/Cashback.tsx index 15b4277f..63910428 100644 --- a/src/pages/Swap/Cashback.tsx +++ b/src/pages/Swap/Cashback.tsx @@ -12,6 +12,7 @@ import { canonicalizeBalance, displayHumanizedBalance, humanizeBalance } from 'u import { getNativeBalance, storeTxResultLocally, unlockJsx } from './utils'; import { UserStoreEx } from 'stores/UserStore'; import { Tokens } from 'stores/Tokens'; +import { SwapTokenMap } from './types/SwapToken'; export class Cashback extends React.Component< { @@ -19,7 +20,8 @@ export class Cashback extends React.Component< secretjsSender: AsyncSender; refreshBalances: CallableFunction; balances; - tokens; + tokens: Tokens; + allTokens: SwapTokenMap; notify: (type: 'success' | 'error' | 'errorWithHash', msg: string, closesAfterMs?: number, txHash?: string) => void; }, { loadingSwap: boolean; cbRatio: number | JSX.Element } @@ -27,7 +29,7 @@ export class Cashback extends React.Component< constructor(props) { super(props); - const cashbackAddr = 'secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn'; + const cashbackAddr = 'secret1g022tjrppardjmal2e7jx2jljvgnkzatxfhtht'; const sefiAddr = 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm'; this.state = { @@ -35,12 +37,22 @@ export class Cashback extends React.Component< cbRatio: undefined, }; - this.calcRatio(this.props.user, this.props.tokens, sefiAddr, cashbackAddr).then(ratio => { - console.log('################## ratio'); - this.setState({ - cbRatio: ratio, + setTimeout(() => { + this.calcRatio(this.props.user, this.props.tokens, sefiAddr, cashbackAddr).then(ratio => { + console.log('################## ratio'); + this.setState({ + cbRatio: ratio, + }); }); - }); + }, 5000); + setInterval(() => { + this.calcRatio(this.props.user, this.props.tokens, sefiAddr, cashbackAddr).then(ratio => { + console.log('################## ratio'); + this.setState({ + cbRatio: ratio, + }); + }); + }, 5000); } extractError(result: any) { @@ -64,21 +76,22 @@ export class Cashback extends React.Component< const cbTotalSuppply = parseInt(result.token_info.total_supply); result = await secretjs.queryContractSmart(cashback, { reward_balance: {} }); - const cbRewardBalance = parseInt(result.balance); + const cbRewardBalance = parseInt(result.reward_balance.balance); - const block = await user.secretjs.getBlock(); + const block = (await user.secretjs.getBlock()).header.height; result = await secretjs.queryContractSmart(masterAddr, { pending: { - spy_addr: 'cashback', + spy_addr: cashback, block, }, }); - const cbPendingRewards = parseInt(result.amount); + const cbPendingRewards = parseInt(result.pending.amount); - const sefiUSD = parseInt(tokens.allData.find(t => t.display_props.symbol === 'SEFI').price); - const scrtUSD = parseInt(tokens.allData.find(t => t.display_props.symbol === 'SSCRT').price); + // Not working on testnet + // const sefiUSD = parseInt(tokens.allData.find(t => t.display_props.symbol === 'SEFI').price); + // const scrtUSD = parseInt(tokens.allData.find(t => t.display_props.symbol === 'SSCRT').price); - return (cbTotalSuppply * scrtUSD) / ((cbRewardBalance + cbPendingRewards) * sefiUSD); + return (((cbRewardBalance + cbPendingRewards) * 0.2) / (cbTotalSuppply * 3.8 * 0.003)) * 100; } catch (e) { console.log(e); return undefined; @@ -86,7 +99,7 @@ export class Cashback extends React.Component< } render() { - const cashbackAddr = 'secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn'; + const cashbackAddr = 'secret1g022tjrppardjmal2e7jx2jljvgnkzatxfhtht'; const sefiAddr = 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm'; const cashbackBalance = this.props.balances[cashbackAddr]; const sefiBalance = this.props.balances[sefiAddr]; @@ -176,11 +189,11 @@ export class Cashback extends React.Component< return cashbackBalance; } - if (this.props.tokens.size > 0) { + if (this.props.allTokens.size > 0) { return displayHumanizedBalance( humanizeBalance( new BigNumber(cashbackBalance as BigNumber), - this.props.tokens.get(cashbackAddr).decimals, + this.props.allTokens.get(cashbackAddr).decimals, ), BigNumber.ROUND_DOWN, ); @@ -213,11 +226,11 @@ export class Cashback extends React.Component< return sefiBalance; } - if (this.props.tokens.size > 0) { + if (this.props.allTokens.size > 0) { return displayHumanizedBalance( humanizeBalance( new BigNumber(sefiBalance as BigNumber), - this.props.tokens.get(sefiAddr).decimals, + this.props.allTokens.get(sefiAddr).decimals, ), BigNumber.ROUND_DOWN, ); @@ -241,7 +254,7 @@ export class Cashback extends React.Component< primary={true} onClick={async () => { this.setState({ loadingSwap: true }); - const { decimals } = this.props.tokens.get(cashbackAddr); + const { decimals } = this.props.allTokens.get(cashbackAddr); const humanBalance = humanizeBalance(cashbackBalance, decimals); try { @@ -306,7 +319,7 @@ export class Cashback extends React.Component< ); } else { - return this.state.cbRatio; + return `${this.state.cbRatio === Infinity ? '∞' : this.state.cbRatio}%`; } })()} {/* {await( diff --git a/src/pages/Swap/LocalTokens/tokens.json b/src/pages/Swap/LocalTokens/tokens.json index 3d940022..448bc65e 100644 --- a/src/pages/Swap/LocalTokens/tokens.json +++ b/src/pages/Swap/LocalTokens/tokens.json @@ -18,10 +18,10 @@ { "symbol": "CSHBK", "logo": "/static/scrt.svg", - "address": "secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn", + "address": "secret1g022tjrppardjmal2e7jx2jljvgnkzatxfhtht", "name": "Cashback", "decimals": 6, - "identifier": "secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn" + "identifier": "secret1g022tjrppardjmal2e7jx2jljvgnkzatxfhtht" } ], "secret-2": [ @@ -50,4 +50,4 @@ "name": "Secret" } ] -} +} \ No newline at end of file diff --git a/src/pages/Swap/SwapTab.tsx b/src/pages/Swap/SwapTab.tsx index 0a80a68f..2afcb500 100644 --- a/src/pages/Swap/SwapTab.tsx +++ b/src/pages/Swap/SwapTab.tsx @@ -745,7 +745,7 @@ export class SwapTab extends React.Component< isToEstimated: false, }); const height = await this.props.user.secretjs.getHeight(); - await this.props.refreshPools({ tokens: ['secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn'], height }); + await this.props.refreshPools({ tokens: ['secret1g022tjrppardjmal2e7jx2jljvgnkzatxfhtht'], height }); }} > {buttonMessage} diff --git a/src/pages/Swap/index.tsx b/src/pages/Swap/index.tsx index 90479666..ba48f5d0 100644 --- a/src/pages/Swap/index.tsx +++ b/src/pages/Swap/index.tsx @@ -102,7 +102,7 @@ export class SwapRouter extends React.Component< routerSupportedTokens: new Set(), routingGraph: {}, selectedPairRoutes: [], - cashback: 'secret1yj842qfez8fyajam885q4n5yhnjum8879u7pjn', + cashback: 'secret1g022tjrppardjmal2e7jx2jljvgnkzatxfhtht', sefi: 'secret12q2c5s5we5zn9pq43l0rlsygtql6646my0sqfm', }; } @@ -728,7 +728,8 @@ export class SwapRouter extends React.Component< secretjsSender={this.props.user.secretjsSend} refreshBalances={this.refreshBalances} balances={this.state.balances} - tokens={this.state.allTokens} + allTokens={this.state.allTokens} + tokens={this.props.tokens} notify={this.notify} />