bridge_ui: prep bridge_ui for sdk 0.1.5
This commit is contained in:
parent
0233f03a3c
commit
30a9d7410e
|
@ -8,7 +8,7 @@ import {
|
|||
updateWrappedOnEth,
|
||||
updateWrappedOnTerra,
|
||||
updateWrappedOnSolana,
|
||||
postVaaSolana,
|
||||
postVaaSolanaWithRetry,
|
||||
isEVMChain,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
import { WalletContextState } from "@solana/wallet-adapter-react";
|
||||
|
@ -31,6 +31,7 @@ import {
|
|||
} from "../store/selectors";
|
||||
import {
|
||||
getTokenBridgeAddressForChain,
|
||||
MAX_VAA_UPLOAD_RETRIES_SOLANA,
|
||||
SOLANA_HOST,
|
||||
SOL_BRIDGE_ADDRESS,
|
||||
SOL_TOKEN_BRIDGE_ADDRESS,
|
||||
|
@ -90,12 +91,13 @@ async function solana(
|
|||
throw new Error("wallet.signTransaction is undefined");
|
||||
}
|
||||
const connection = new Connection(SOLANA_HOST, "confirmed");
|
||||
await postVaaSolana(
|
||||
await postVaaSolanaWithRetry(
|
||||
connection,
|
||||
wallet.signTransaction,
|
||||
SOL_BRIDGE_ADDRESS,
|
||||
payerAddress,
|
||||
Buffer.from(signedVAA)
|
||||
Buffer.from(signedVAA),
|
||||
MAX_VAA_UPLOAD_RETRIES_SOLANA
|
||||
);
|
||||
const transaction = shouldUpdate
|
||||
? await updateWrappedOnSolana(
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
hexToUint8Array,
|
||||
isEVMChain,
|
||||
parseNFTPayload,
|
||||
postVaaSolana,
|
||||
postVaaSolanaWithRetry,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
import {
|
||||
createMetaOnSolana,
|
||||
|
@ -28,6 +28,7 @@ import { setIsRedeeming, setRedeemTx } from "../store/nftSlice";
|
|||
import { selectNFTIsRedeeming, selectNFTTargetChain } from "../store/selectors";
|
||||
import {
|
||||
getNFTBridgeAddressForChain,
|
||||
MAX_VAA_UPLOAD_RETRIES_SOLANA,
|
||||
SOLANA_HOST,
|
||||
SOL_BRIDGE_ADDRESS,
|
||||
SOL_NFT_BRIDGE_ADDRESS,
|
||||
|
@ -85,12 +86,13 @@ async function solana(
|
|||
const claimInfo = await connection.getAccountInfo(claimAddress);
|
||||
let txid;
|
||||
if (!claimInfo) {
|
||||
await postVaaSolana(
|
||||
await postVaaSolanaWithRetry(
|
||||
connection,
|
||||
wallet.signTransaction,
|
||||
SOL_BRIDGE_ADDRESS,
|
||||
payerAddress,
|
||||
Buffer.from(signedVAA)
|
||||
Buffer.from(signedVAA),
|
||||
MAX_VAA_UPLOAD_RETRIES_SOLANA
|
||||
);
|
||||
// TODO: how do we retry in between these steps
|
||||
const transaction = await redeemOnSolana(
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
CHAIN_ID_SOLANA,
|
||||
CHAIN_ID_TERRA,
|
||||
isEVMChain,
|
||||
postVaaSolana,
|
||||
postVaaSolanaWithRetry,
|
||||
redeemAndUnwrapOnSolana,
|
||||
redeemOnEth,
|
||||
redeemOnEthNative,
|
||||
|
@ -30,6 +30,7 @@ import {
|
|||
import { setIsRedeeming, setRedeemTx } from "../store/transferSlice";
|
||||
import {
|
||||
getTokenBridgeAddressForChain,
|
||||
MAX_VAA_UPLOAD_RETRIES_SOLANA,
|
||||
SOLANA_HOST,
|
||||
SOL_BRIDGE_ADDRESS,
|
||||
SOL_TOKEN_BRIDGE_ADDRESS,
|
||||
|
@ -89,12 +90,13 @@ async function solana(
|
|||
throw new Error("wallet.signTransaction is undefined");
|
||||
}
|
||||
const connection = new Connection(SOLANA_HOST, "confirmed");
|
||||
await postVaaSolana(
|
||||
await postVaaSolanaWithRetry(
|
||||
connection,
|
||||
wallet.signTransaction,
|
||||
SOL_BRIDGE_ADDRESS,
|
||||
payerAddress,
|
||||
Buffer.from(signedVAA)
|
||||
Buffer.from(signedVAA),
|
||||
MAX_VAA_UPLOAD_RETRIES_SOLANA
|
||||
);
|
||||
// TODO: how do we retry in between these steps
|
||||
const transaction = isNative
|
||||
|
|
|
@ -892,3 +892,4 @@ export const getHowToAddToTokenListUrl = (chainId: ChainId) => {
|
|||
|
||||
export const SOLANA_TOKEN_METADATA_PROGRAM_URL =
|
||||
"https://github.com/metaplex-foundation/metaplex/tree/master/rust/token-metadata/program";
|
||||
export const MAX_VAA_UPLOAD_RETRIES_SOLANA = 5;
|
||||
|
|
Loading…
Reference in New Issue