From bb340d08b736be2bddbe6c1832801b23310f4f95 Mon Sep 17 00:00:00 2001 From: Elmar Kenigs Date: Tue, 10 Sep 2024 11:46:10 +0300 Subject: [PATCH] Using object for setAddresses --- examples/mrl-simple/index.ts | 5 ++++- packages/mrl/src/mrl.ts | 11 +++++++---- packages/sdk/src/sdk.ts | 11 +++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/examples/mrl-simple/index.ts b/examples/mrl-simple/index.ts index fe0555b9..78e59d32 100644 --- a/examples/mrl-simple/index.ts +++ b/examples/mrl-simple/index.ts @@ -57,7 +57,10 @@ async function main() { .setSource(fantomTestnet) .setDestination(peaqChain) .setAsset(ftmwh) - .setAddresses(account.address, pair.address); + .setAddresses({ + sourceAddress: account.address, + destinationAddress: pair.address, + }); console.log(data); } diff --git a/packages/mrl/src/mrl.ts b/packages/mrl/src/mrl.ts index c0310878..d1e4d724 100644 --- a/packages/mrl/src/mrl.ts +++ b/packages/mrl/src/mrl.ts @@ -33,10 +33,13 @@ export function Mrl(options?: MrlOptions) { }); return { - setAddresses( - sourceAddress: string, - destinationAddress: string, - ) { + setAddresses({ + sourceAddress, + destinationAddress, + }: { + sourceAddress: string; + destinationAddress: string; + }) { return getTransferData({ route, sourceAddress, diff --git a/packages/sdk/src/sdk.ts b/packages/sdk/src/sdk.ts index 54c0cfa0..26202a86 100644 --- a/packages/sdk/src/sdk.ts +++ b/packages/sdk/src/sdk.ts @@ -44,10 +44,13 @@ export function Sdk({ configService, ecosystem }: SdkOptions = {}) { }); return { - setAddresses( - sourceAddress: string, - destinationAddress: string, - ): Promise { + setAddresses({ + sourceAddress, + destinationAddress, + }: { + sourceAddress: string; + destinationAddress: string; + }): Promise { const sourceChain = service.getChain(source); if (!EvmParachain.isAnyParachain(sourceChain)) {