diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bee4acf..cefc84b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: - name: setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: setup yarn run: npm install -g yarn diff --git a/Dockerfile b/Dockerfile index 9d80ac3..33cfd6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine as relayer +FROM node:18-alpine as relayer LABEL maintainer="hello@acala.network" USER node diff --git a/package.json b/package.json index 19720a6..c838f2f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "acala-wormhole-relayer", - "version": "1.6.0", + "version": "1.6.1", "description": "", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -22,7 +22,7 @@ }, "dependencies": { "@acala-network/api": "~6.0.4", - "@acala-network/asset-router": "~1.0.13", + "@acala-network/asset-router": "~1.0.16", "@acala-network/bodhi": "~2.7.13", "@acala-network/contracts": "^4.5.0", "@acala-network/eth-providers": "~2.7.14", diff --git a/src/api/route.ts b/src/api/route.ts index d3c5faa..991c6cf 100644 --- a/src/api/route.ts +++ b/src/api/route.ts @@ -1,5 +1,6 @@ import { DOT } from '@acala-network/contracts/utils/AcalaTokens'; import { EuphratesFactory__factory, Factory__factory, HomaFactory__factory } from '@acala-network/asset-router/dist/typechain-types'; +import { KSM } from '@acala-network/contracts/utils/KaruraTokens'; import { XcmInstructionsStruct } from '@acala-network/asset-router/dist/typechain-types/src/Factory'; import { @@ -166,8 +167,8 @@ export const shouldRouteHoma = async ({ chain, destAddr }: RouteParamsHoma) => }; export const routeHoma = async ({ chain, destAddr }: RouteParamsHoma) => { - const { homaFactory, feeAddr } = await prepareRouteHoma(chain); - const tx = await homaFactory.deployHomaRouterAndRoute(feeAddr, toAddr32(destAddr), DOT); + const { homaFactory, feeAddr, routeToken } = await prepareRouteHoma(chain); + const tx = await homaFactory.deployHomaRouterAndRoute(feeAddr, toAddr32(destAddr), routeToken); const receipt = await tx.wait(); return receipt.transactionHash; @@ -179,8 +180,9 @@ const prepareRouteHoma = async (chain: Mainnet) => { const { feeAddr, homaFactoryAddr, wallet } = chainConfig; const homaFactory = HomaFactory__factory.connect(homaFactoryAddr!, wallet); + const routeToken = chain === Mainnet.Acala ? DOT : KSM; - return { homaFactory, feeAddr }; + return { homaFactory, feeAddr, routeToken }; }; export const shouldRouteEuphrates = async (params: RouteParamsEuphrates) => { diff --git a/src/consts.ts b/src/consts.ts index 4f22d1e..80ee5c2 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -33,8 +33,8 @@ export const enum FUJI_TOKEN { }; export const WORMHOLE_GUARDIAN_RPC = { - TESTNET: ['https://wormhole-v2-testnet-api.certus.one'], - MAINNET: ['https://wormhole-v2-mainnet-api.certus.one'], + TESTNET: ['https://api.testnet.wormholescan.io'], + MAINNET: ['https://api.wormholescan.io'], }; const RELAYER_BASE_URL = 'http://localhost:3111'; @@ -249,4 +249,4 @@ export const TESTNET_MODE_WARNING = ` export const EUPHRATES_ADDR = '0x7Fe92EC600F15cD25253b421bc151c51b0276b7D'; export const EUPHRATES_POOLS = ['0', '1', '2', '3']; -export const VERSION = '1.6.0'; +export const VERSION = '1.6.1'; diff --git a/yarn.lock b/yarn.lock index 3e23e23..ac683cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,10 +17,10 @@ "@acala-network/api-derive" "6.0.4" "@acala-network/types" "6.0.4" -"@acala-network/asset-router@~1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@acala-network/asset-router/-/asset-router-1.0.13.tgz#0ad0e8ce8bd462a7291a6bf8f951bd24f83ea0e4" - integrity sha512-J0W5MSVKYIz/cgx9KVCqe9NLkg+FdRrAl6BqCZzZkj8JPcQhUlxgW7TP/s3yYr/5MXk3wDb69z/f2cBWGjhbxw== +"@acala-network/asset-router@~1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@acala-network/asset-router/-/asset-router-1.0.16.tgz#03e8ad6559fb7d84786ea34cbf6bb8ccfacefe3e" + integrity sha512-cgMU2d+kJVmPcaxyg0iIedi/Csl/5l8mPg4c4ZTkCZtYd8kB17WG2KqZ5sp2b6XvV/8+IAknagmtNEl3eXGwjQ== dependencies: "@acala-network/contracts" "^4.5.0" "@acala-network/eth-providers" "^2.7.13"