Skip to content

Commit

Permalink
remove injective support from advanced tools, since injective will be…
Browse files Browse the repository at this point in the history
… deprecated in flavor of ibc transfers
  • Loading branch information
Sebastian Scatularo committed Oct 22, 2024
1 parent c7d6646 commit 239038b
Show file tree
Hide file tree
Showing 31 changed files with 3 additions and 1,194 deletions.
13 changes: 0 additions & 13 deletions docs/docs/faqs/liquid-markets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import EthAptos from './_liquid-markets/eth-aptos.md'
import EthAlgorand from './_liquid-markets/eth-algorand.md'
import SolAlgorand from './_liquid-markets/sol-algorand.md'
import AvaxAlgorand from './_liquid-markets/avax-algorand.md'
import SolInjective from './_liquid-markets/sol-injective.md'
import EthInjective from './_liquid-markets/eth-injective.md'
import EthSui from './_liquid-markets/eth-sui.md'
import SolSui from './_liquid-markets/sol-sui.md'
import AptosOsmosis from './_liquid-markets/aptos-osmosis.md'
Expand Down Expand Up @@ -201,17 +199,6 @@ Check out the [Wormhole Token list](https://github.com/certusone/wormhole-token-
</TabItem>
</Tabs>

## Target chain: Injective

<Tabs>
<TabItem value="SOL -> INJECTIVE" label="SOL -> INJECTIVE" default>
<SolInjective />
</TabItem>
<TabItem value="ETH -> INJECTIVE" label="ETH -> INJECTIVE" >
<EthInjective />
</TabItem>
</Tabs>

## Target chain: Sui

<Tabs>
Expand Down
4 changes: 0 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
"@certusone/wormhole-sdk": "^0.10.17",
"@cosmjs/cosmwasm-stargate": "^0.32.3",
"@cosmjs/tendermint-rpc": "^0.32.3",
"@injectivelabs/networks": "^1.14.4",
"@injectivelabs/sdk-ts": "^1.14.4",
"@injectivelabs/ts-types": "^1.14.4",
"@injectivelabs/wallet-ts": "^1.14.4",
"@manahippo/aptos-wallet-adapter": "^1.0.2",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.11.2",
Expand Down
2 changes: 0 additions & 2 deletions src/components/KeyAndBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
ChainId,
CHAIN_ID_ALGORAND,
CHAIN_ID_APTOS,
CHAIN_ID_INJECTIVE,
CHAIN_ID_NEAR,
CHAIN_ID_SOLANA,
CHAIN_ID_XPLA,
Expand All @@ -22,7 +21,6 @@ function isChainAllowed(chainId: ChainId) {
chainId === CHAIN_ID_NEAR ||
chainId === CHAIN_ID_XPLA ||
chainId === CHAIN_ID_APTOS ||
chainId === CHAIN_ID_INJECTIVE ||
chainId === CHAIN_ID_SUI ||
chainId === CHAIN_ID_SEI
);
Expand Down
66 changes: 1 addition & 65 deletions src/components/Recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
CHAIN_ID_ACALA,
CHAIN_ID_ALGORAND,
CHAIN_ID_APTOS,
CHAIN_ID_INJECTIVE,
CHAIN_ID_KARURA,
CHAIN_ID_NEAR,
CHAIN_ID_SOLANA,
Expand All @@ -12,7 +11,6 @@ import {
CHAIN_ID_SEI,
getEmitterAddressAlgorand,
getEmitterAddressEth,
getEmitterAddressInjective,
getEmitterAddressSolana,
getEmitterAddressTerra,
getEmitterAddressXpla,
Expand All @@ -25,14 +23,12 @@ import {
parseNFTPayload,
parseSequenceFromLogAlgorand,
parseSequenceFromLogEth,
parseSequenceFromLogInjective,
parseSequenceFromLogSolana,
parseSequenceFromLogTerra,
parseSequenceFromLogXpla,
parseTransferPayload,
parseVaa,
queryExternalId,
queryExternalIdInjective,
TerraChainId,
uint8ArrayToHex,
CHAIN_ID_SUI,
Expand Down Expand Up @@ -115,10 +111,6 @@ import {
getEmitterAddressAndSequenceFromResult,
} from "../utils/aptos";
import { Types } from "aptos";
import {
getInjectiveTxClient,
getInjectiveWasmClient,
} from "../utils/injective";
import { getSuiProvider } from "../utils/sui";
import {
getEmitterAddressAndSequenceFromResponseSui,
Expand Down Expand Up @@ -385,26 +377,6 @@ async function xpla(tx: string, enqueueSnackbar: any) {
}
}

async function injective(txHash: string, enqueueSnackbar: any) {
try {
const client = getInjectiveTxClient();
const tx = await client.fetchTx(txHash);
if (!tx) {
throw new Error("Unable to fetch transaction");
}
const sequence = parseSequenceFromLogInjective(tx);
if (!sequence) {
throw new Error("Sequence not found");
}
const emitterAddress = await getEmitterAddressInjective(
getTokenBridgeAddressForChain(CHAIN_ID_INJECTIVE)
);
return await fetchSignedVAA(CHAIN_ID_INJECTIVE, emitterAddress, sequence);
} catch (e) {
return handleError(e, enqueueSnackbar);
}
}

async function sui(digest: string, enqueueSnackbar: any) {
try {
const provider = getSuiProvider();
Expand Down Expand Up @@ -649,21 +621,6 @@ export default function Recovery() {
}
})();
}
if (parsedPayload && parsedPayload.targetChain === CHAIN_ID_INJECTIVE) {
(async () => {
const client = getInjectiveWasmClient();
const tokenBridgeAddress =
getTokenBridgeAddressForChain(CHAIN_ID_INJECTIVE);
const tokenId = await queryExternalIdInjective(
client as any,
tokenBridgeAddress,
parsedPayload.originAddress
);
if (!cancelled) {
setTokenId(tokenId || "");
}
})();
}

if (parsedPayload && parsedPayload.targetChain === CHAIN_ID_SUI) {
(async () => {
Expand Down Expand Up @@ -845,26 +802,6 @@ export default function Recovery() {
setIsVAAPending(isPending);
}
})();
} else if (recoverySourceChain === CHAIN_ID_INJECTIVE) {
setRecoverySourceTxError("");
setRecoverySourceTxIsLoading(true);
setTokenId("");
(async () => {
const { vaa, isPending, error } = await injective(
recoverySourceTx,
enqueueSnackbar
);
if (!cancelled) {
setRecoverySourceTxIsLoading(false);
if (vaa) {
setRecoverySignedVAA(vaa);
}
if (error) {
setRecoverySourceTxError(error);
}
setIsVAAPending(isPending);
}
})();
} else if (recoverySourceChain === CHAIN_ID_SUI) {
setRecoverySourceTxError("");
setRecoverySourceTxIsLoading(true);
Expand Down Expand Up @@ -1229,8 +1166,7 @@ export default function Recovery() {
value={
parsedPayload
? parsedPayload.targetChain === CHAIN_ID_TERRA2 ||
parsedPayload.targetChain === CHAIN_ID_XPLA ||
parsedPayload.targetChain === CHAIN_ID_INJECTIVE
parsedPayload.targetChain === CHAIN_ID_XPLA
? tokenId
: hexToNativeAssetString(
parsedPayload.originAddress,
Expand Down
5 changes: 0 additions & 5 deletions src/components/ShowTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
CHAIN_ID_XPLA,
CHAIN_ID_APTOS,
CHAIN_ID_ARBITRUM,
CHAIN_ID_INJECTIVE,
CHAIN_ID_OPTIMISM,
CHAIN_ID_SUI,
CHAIN_ID_BASE,
Expand Down Expand Up @@ -174,10 +173,6 @@ export default function ShowTx({
? `https://${
CLUSTER === "testnet" ? "goerli." : ""
}arbiscan.io/tx/${tx?.id}`
: chainId === CHAIN_ID_INJECTIVE
? `https://${
CLUSTER === "testnet" ? "testnet." : ""
}explorer.injective.network/transaction/${tx.id}`
: chainId === CHAIN_ID_OPTIMISM
? `https://${
CLUSTER === "testnet" ? "goerli-optimism." : "optimistic."
Expand Down
9 changes: 0 additions & 9 deletions src/components/SmartAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
CHAIN_ID_APTOS,
isValidAptosType,
CHAIN_ID_ARBITRUM,
CHAIN_ID_INJECTIVE,
terra,
CHAIN_ID_OPTIMISM,
CHAIN_ID_SUI,
Expand Down Expand Up @@ -235,14 +234,6 @@ export default function SmartAddress({
? `https://${CLUSTER === "testnet" ? "goerli." : ""}arbiscan.io/${
isAsset ? "token" : "address"
}/${useableAddress}`
: chainId === CHAIN_ID_INJECTIVE
? `https://${
CLUSTER === "testnet" ? "testnet." : ""
}explorer.injective.network/${
isAsset
? `asset/?tokenType=${isNative ? "native" : "cw20"}&tokenIdentifier=`
: "account/"
}${useableAddress}`
: chainId === CHAIN_ID_OPTIMISM
? `https://${
CLUSTER === "testnet" ? "goerli-optimism." : "optimistic."
Expand Down
Loading

0 comments on commit 239038b

Please sign in to comment.