update web ui for mainnet

This commit is contained in:
Hendrik Hofstadt 2021-02-03 12:09:45 +01:00
parent 8735b587cb
commit 075658922f
4 changed files with 16 additions and 15 deletions

View File

@ -39,8 +39,8 @@ function App() {
<Layout style={{height: '100%'}}> <Layout style={{height: '100%'}}>
<Router> <Router>
<Header style={{position: 'fixed', zIndex: 1, width: '100%'}}> <Header style={{position: 'fixed', zIndex: 1, width: '100%'}}>
<Link to="/assistant" style={{paddingRight: 20}}>Assistant</Link> <Link to="/" style={{paddingRight: 20}}>Assistant</Link>
<Link to="/" style={{paddingRight: 20}}>Ethereum</Link> <Link to="/eth" style={{paddingRight: 20}}>Ethereum</Link>
<Link to="/solana">Solana</Link> <Link to="/solana">Solana</Link>
{ {
connected ? (<a style={{float: "right"}}> connected ? (<a style={{float: "right"}}>
@ -63,13 +63,13 @@ function App() {
<BridgeProvider> <BridgeProvider>
<SolanaTokenProvider> <SolanaTokenProvider>
<Switch> <Switch>
<Route path="/assistant"> <Route path="/">
<Assistant/> <Assistant/>
</Route> </Route>
<Route path="/solana"> <Route path="/solana">
<TransferSolana/> <TransferSolana/>
</Route> </Route>
<Route path="/"> <Route path="/eth">
<Transfer/> <Transfer/>
</Route> </Route>
</Switch> </Switch>
@ -84,7 +84,7 @@ function App() {
</div> </div>
</Content> </Content>
<Footer style={{textAlign: 'center'}}>nexantic GmbH 2020</Footer> <Footer style={{textAlign: 'center'}}>The Wormhole Project</Footer>
</Router> </Router>
</Layout> </Layout>
</div> </div>

View File

@ -70,11 +70,12 @@ async function createWrapped(c: Connection, b: SolanaBridge, wallet: Wallet, met
let tx = new Transaction(); let tx = new Transaction();
// @ts-ignore // @ts-ignore
let [ix_account, newSigner] = await b.createWrappedAssetAndAccountInstructions(key.publicKey, mint, meta); let [ix_account, newSigner] = await b.createWrappedAssetAndAccountInstructions(wallet.publicKey, mint, meta);
let recentHash = await c.getRecentBlockhash(); let recentHash = await c.getRecentBlockhash();
tx.recentBlockhash = recentHash.blockhash tx.recentBlockhash = recentHash.blockhash
tx.add(...ix_account) tx.add(...ix_account)
tx.feePayer = wallet.publicKey; tx.feePayer = wallet.publicKey;
tx.sign(newSigner);
let signed = await wallet.signTransaction(tx); let signed = await wallet.signTransaction(tx);
message.loading({content: "Waiting for transaction to be confirmed...", key: "tx", duration: 1000}) message.loading({content: "Waiting for transaction to be confirmed...", key: "tx", duration: 1000})
await c.sendRawTransaction(signed.serialize(), {preflightCommitment: "single"}) await c.sendRawTransaction(signed.serialize(), {preflightCommitment: "single"})
@ -240,7 +241,7 @@ export default function TransferInitiator(params: TransferInitiatorParams) {
<Form.Item label="Amount" name="layout" <Form.Item label="Amount" name="layout"
validateStatus={amountValid ? "success" : "error"}> validateStatus={amountValid ? "success" : "error"}>
<Input type={"number"} placeholder={"Amount"} <Input type={"number"} placeholder={"Amount"}
addonAfter={`Balance: ${coinInfo.balance.div(new BigNumber(10).pow(coinInfo.decimals))}`} addonAfter={`Balance: ${new BN(coinInfo.balance.toString()).div(new BN(10).pow(coinInfo.decimals))}`}
onChange={(v) => { onChange={(v) => {
if (v.target.value === "") { if (v.target.value === "") {
setAmount(new BigNumber(0)); setAmount(new BigNumber(0));

View File

@ -1,13 +1,13 @@
import {PublicKey} from "@solana/web3.js"; import {PublicKey} from "@solana/web3.js";
const BRIDGE_ADDRESS = "0xdae0Cba01eFc4bfEc1F7Fece73Fe8b8d2Eda65B0"; const BRIDGE_ADDRESS = "0xf92cD566Ea4864356C5491c177A430C222d7e678";
const WRAPPED_MASTER = "9f7bedd9ef2d57eccab2cb56a5bd395edbb77df8" const WRAPPED_MASTER = "9A5e27995309a03f8B583feBdE7eF289FcCdC6Ae"
const SOLANA_BRIDGE_PROGRAM = new PublicKey("BrdgiFmZN3BKkcY3danbPYyxPKwb8RhQzpM2VY5L97ED"); const SOLANA_BRIDGE_PROGRAM = new PublicKey("WormT3McKhFJ2RkiGpdw9GKvNCrB2aB54gb2uV9MfQC");
const TOKEN_PROGRAM = new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"); const TOKEN_PROGRAM = new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
const SOLANA_HOST = "https://testnet.solana.com"; const SOLANA_HOST = "https://solana-api.projectserum.com";
export { export {
BRIDGE_ADDRESS, BRIDGE_ADDRESS,

View File

@ -242,13 +242,13 @@ function Assistant() {
let startBlock = provider.blockNumber; let startBlock = provider.blockNumber;
let completed = false; let completed = false;
let blockHandler = (blockNumber: number) => { let blockHandler = (blockNumber: number) => {
if (blockNumber - startBlock < 5) { if (blockNumber - startBlock < 15) {
setLoading({ setLoading({
loading: true, loading: true,
message: "Awaiting ETH confirmations", message: "Awaiting ETH confirmations",
progress: { progress: {
completion: (blockNumber - startBlock) / 5 * 100, completion: (blockNumber - startBlock) / 15 * 100,
content: `${blockNumber - startBlock}/${5}` content: `${blockNumber - startBlock}/${15}`
} }
}) })
} else if (!completed) { } else if (!completed) {
@ -284,7 +284,7 @@ function Assistant() {
} }
}) })
} else { } else {
setLoading({loading: true, message: "Awaiting guardians (TODO ping)"}) setLoading({loading: true, message: "Awaiting guardian confirmation"})
} }
}) })