From 3f2dbb163219395715b4b6f418903181be81f5bc Mon Sep 17 00:00:00 2001 From: Nikolay Topkaridi Date: Tue, 8 Nov 2022 00:48:40 +0300 Subject: [PATCH] fix: destination network selection (#104) destinatin network selection fix --- packages/sdk/src/Sygma.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/sdk/src/Sygma.ts b/packages/sdk/src/Sygma.ts index a96f7c665..bf9baf4eb 100644 --- a/packages/sdk/src/Sygma.ts +++ b/packages/sdk/src/Sygma.ts @@ -162,7 +162,7 @@ export class Sygma implements SygmaSDK { return this; } - public async setDestination(domainId: string) { + public setDestination(domainId: string) { let chain2: SygmaBridgeSetup | undefined; if (domainId) { chain2 = this.bridgeSetupList!.find(el => el.domainId === domainId); @@ -172,6 +172,8 @@ export class Sygma implements SygmaSDK { throw `Cannot find network with domainID: ${domainId} in config`; } + this.bridgeSetup!.chain2 = chain2 + const connector = setConnectorRPC(chain2.rpcUrl); this.providers!.chain2 = connector.provider; @@ -370,9 +372,9 @@ export class Sygma implements SygmaSDK { * @name depositGeneric * @description call generic handler to achieve general message passing * @param {string} resourceId - * @param {string} depositData - * @param {string} fee - * @returns + * @param {string} depositData + * @param {string} fee + * @returns */ public async depositGeneric( resourceId: string, depositData: string, fee: FeeDataResult