Skip to content

Commit

Permalink
Merge pull request #826 from interlay/release/interlay/usdt
Browse files Browse the repository at this point in the history
Release/interlay/usdt
  • Loading branch information
tomjeatt authored Jan 23, 2023
2 parents 09600e2 + f539d13 commit 0ff3b16
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@headlessui/react": "^1.1.1",
"@heroicons/react": "^2.0.0",
"@hookform/resolvers": "^2.9.7",
"@interlay/bridge": "^0.1.12",
"@interlay/bridge": "^0.1.14",
"@interlay/interbtc-api": "1.19.0",
"@material-icons/svg": "^1.0.28",
"@polkadot/api": "9.8.1",
Expand Down
7 changes: 5 additions & 2 deletions src/config/relay-chains.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { InterlayAdapter, KintsugiAdapter } from '@interlay/bridge/build/adapters/interlay';
import { KusamaAdapter, PolkadotAdapter } from '@interlay/bridge/build/adapters/polkadot';
import { StatemineAdapter, StatemintAdapter } from '@interlay/bridge/build/adapters/statemint';
import { BaseCrossChainAdapter } from '@interlay/bridge/build/base-chain-adapter';
import {
CurrencyExt,
Expand Down Expand Up @@ -153,7 +154,8 @@ switch (process.env.REACT_APP_RELAY_CHAIN_NAME) {
TRANSACTION_FEE_AMOUNT = newMonetaryAmount(0.2, GOVERNANCE_TOKEN, true);
XCM_ADAPTERS = {
interlay: new InterlayAdapter(),
polkadot: new PolkadotAdapter()
polkadot: new PolkadotAdapter(),
statemint: new StatemintAdapter()
};

break;
Expand Down Expand Up @@ -193,7 +195,8 @@ switch (process.env.REACT_APP_RELAY_CHAIN_NAME) {
TRANSACTION_FEE_AMOUNT = newMonetaryAmount(0.01, GOVERNANCE_TOKEN, true);
XCM_ADAPTERS = {
kintsugi: new KintsugiAdapter(),
kusama: new KusamaAdapter()
kusama: new KusamaAdapter(),
statemine: new StatemineAdapter()
};
break;
}
Expand Down
22 changes: 21 additions & 1 deletion src/pages/Transfer/CrossChainTransferForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,30 @@ const CrossChainTransferForm = (): JSX.Element => {
};

const handleSetFromChain = (chain: ChainOption) => {
// Return from function is user clicks on current chain option
if (chain === fromChain) return;

// Note: this is a workaround but ok for now. Component will be refactored
// when we introduce support for multiple currencies per channel
setCurrency(undefined);
setToChain(undefined);
setValue(TRANSFER_AMOUNT, '');
setFromChain(chain);
};

const handleSetToChain = (chain: ChainOption) => {
// Return from function is user clicks on current chain option
if (chain === toChain) return;

// Note: this is a workaround but ok for now. Component will be refactored
// when we introduce support for multiple currencies per channel
setCurrency(undefined);
setValue(TRANSFER_AMOUNT, '');
setToChain(chain);
};

const handleClickBalance = () => {
setValue(TRANSFER_AMOUNT, transferableBalance);
setValue(TRANSFER_AMOUNT, transferableBalance.toString());
handleUpdateUsdAmount(transferableBalance);
trigger(TRANSFER_AMOUNT);
};
Expand Down Expand Up @@ -327,6 +346,7 @@ const CrossChainTransferForm = (): JSX.Element => {
chainOptions={toChains}
label={t('transfer_page.cross_chain_transfer_form.to_chain')}
selectedChain={toChain}
onChange={handleSetToChain}
/>
<Accounts
label={t('transfer_page.cross_chain_transfer_form.target_account')}
Expand Down
12 changes: 5 additions & 7 deletions src/utils/hooks/api/xcm/use-xcm-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ const getEndpoints = (chains: ChainName[]) => {
switch (true) {
case chains.includes('kusama'):
return {
kusama: [
'wss://kusama-rpc.polkadot.io',
'wss://kusama.api.onfinality.io/public-ws',
'wss://kusama-rpc.dwellir.com'
],
kintsugi: ['wss://api-kusama.interlay.io/parachain', 'wss://kintsugi.api.onfinality.io/public-ws']
kusama: ['wss://kusama-rpc.polkadot.io', 'wss://kusama.api.onfinality.io/public-ws'],
kintsugi: ['wss://api-kusama.interlay.io/parachain', 'wss://kintsugi.api.onfinality.io/public-ws'],
statemine: ['wss://statemine-rpc.polkadot.io', 'wss://statemine.api.onfinality.io/public-ws']
};
case chains.includes('polkadot'):
return {
polkadot: ['wss://rpc.polkadot.io', 'wss://polkadot.api.onfinality.io/public-ws'],
interlay: ['wss://api.interlay.io/parachain', 'wss://interlay.api.onfinality.io/public-ws']
interlay: ['wss://api.interlay.io/parachain', 'wss://interlay.api.onfinality.io/public-ws'],
statemint: ['wss://statemint-rpc.polkadot.io', 'wss://statemint.api.onfinality.io/public-ws']
};

default:
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3070,10 +3070,10 @@
dependencies:
browser-headers "^0.4.1"

"@interlay/bridge@^0.1.12":
version "0.1.12"
resolved "https://registry.yarnpkg.com/@interlay/bridge/-/bridge-0.1.12.tgz#74f00bd735eb5771220751d015bb4e1157bbe22b"
integrity sha512-yClLq+8xuVWnzybZET4hf+ZLVhQtmhuyBb7McgECaQX0bo6Twq1cDUO4yHvkcbZ/ykZQR8K2lLCa8uQfgcZuiA==
"@interlay/bridge@^0.1.14":
version "0.1.14"
resolved "https://registry.yarnpkg.com/@interlay/bridge/-/bridge-0.1.14.tgz#5b46aa15fbe430a4e99a5b135745d8d6b9b62553"
integrity sha512-FgfkfWjRooyEAONgK6rutmUanFVYfyLL3poWeGI/dDfbr0JhLcQBRRQXg7HY37hemJXnl2+BBMyeTDxoRK0D/w==
dependencies:
"@acala-network/api" "4.1.6-23"
"@acala-network/sdk" "4.1.6-23"
Expand Down

1 comment on commit 0ff3b16

@vercel
Copy link

@vercel vercel bot commented on 0ff3b16 Jan 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.