diff --git a/src/config.ts b/src/config.ts index 2aa79d2..de8294f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -40,7 +40,7 @@ export const bridgeTestChains = [ rpcURL: "https://testnet.hashio.io/api", nativeCoinSymbol: "HBAR", intialFund: "50000000000000000", - contractAddress: "0xf33e51DccC7727F1ac62782de7811712420841a0", + contractAddress: "0x0C687Dc235f8e461441d69Dc6aD123EAe7401744", chainType: "evm", lastBlock: 6959861, decimals: 18, @@ -62,7 +62,7 @@ export const bridgeTestChains = [ blockChunks: 1000, chainType: "scrt", chainId: "secret-4", - contractAddress: "secret1zyd2j3wqkeagcuzhklewfa6u26epn672cuktnm", + contractAddress: "secret1ym9jslryg6r8nlch2036py92gd50vejznwhuvx", decimals: 6, intialFund: "10000000", lastBlock: 16833475, @@ -73,7 +73,7 @@ export const bridgeTestChains = [ blockChunks: 1000, chain: "TEZOS", chainType: "tezos", - contractAddress: "KT1Fh6VH8BxA9xgJCn8hGZRxoo2vY3hrbqeV", + contractAddress: "KT1CFXpeB7RPAvzgGAVBkKZ5fXsAB61h72rs", decimals: 9, intialFund: "100000000", lastBlock: 7259145, @@ -163,6 +163,20 @@ export const bridgeTestChains = [ decimals: 18, blockChunks: 1000, }, + { + chain: "TERRA", + chainType: "cosmwasm", + blockChunks: 1000, + chainId: "pisco-1", + contractAddress: + "terra1sryye399v0wrq5aap0s9jlqn9s6wm34gmd27pnlmceghd9qsgyqsugalra", + decimals: 6, + intialFund: "1000000", + lastBlock: 14343708, + nativeCoinSymbol: "LUNA", + rpcURL: "https://rpc.testcosmos.directory/terra2testnet", + walletPrefix: "terra", + }, ] as const satisfies TChain[]; export const storageTestnetConfig: IEvmChainConfig = { diff --git a/src/handler/lock-listener/lock-listener.ts b/src/handler/lock-listener/lock-listener.ts index 6f4f616..a842ba8 100644 --- a/src/handler/lock-listener/lock-listener.ts +++ b/src/handler/lock-listener/lock-listener.ts @@ -14,7 +14,12 @@ import type { THandler, TNftTransferDetailsObject, } from "../types"; -import { fetchHttpOrIpfs, retry, useMutexAndRelease } from "../utils"; +import { + convertNumbToHexToString, + fetchHttpOrIpfs, + retry, + useMutexAndRelease, +} from "../utils"; import { unreachable } from "../utils/unreachable"; import { processEventsFailSafe } from "./process-fail-safe"; @@ -65,7 +70,9 @@ export async function listenEvents( } const nftDetails = await sourceChain.nftData( - ev.tokenId, + ev.sourceChain === "SECRET" + ? convertNumbToHexToString(ev.tokenId) + : ev.tokenId, ev.sourceNftContractAddress, log, ); @@ -90,7 +97,7 @@ export async function listenEvents( // ? ev.metaDataUri // : nftDetails.metadata || ev.metaDataUri; - if (ev.sourceChain === "CASPER") { + if (ev.sourceChain === "CASPER" || ev.sourceChain === "SECRET") { metadataUri = ev.metaDataUri; } else { metadataUri = nftDetails.metadata || ev.metaDataUri; @@ -200,7 +207,9 @@ export async function listenEvents( return await useMutexAndRelease(fetchStorage, async (storage) => { const feeData = await storageProvider.getFeeData(); log.info( - `Using nonce: ${nonce}, txHash: ${inft.transactionHash} ${new Date().getSeconds()} ${+new Date()}`, + `Using nonce: ${nonce}, txHash: ${ + inft.transactionHash + } ${new Date().getSeconds()} ${+new Date()}`, ); const response = await ( await storage.approveLockNft( @@ -217,7 +226,9 @@ export async function listenEvents( ).wait(); used(); log.info( - `Used nonce: ${nonce}, txHash: ${inft.transactionHash} ${new Date().getSeconds()} ${+new Date()}`, + `Used nonce: ${nonce}, txHash: ${ + inft.transactionHash + } ${new Date().getSeconds()} ${+new Date()}`, ); await setTimeout(5 * 1000); return response; diff --git a/validator.db-journal b/validator.db-journal new file mode 100644 index 0000000..e69de29