Skip to content

Commit

Permalink
Using object for setAddresses
Browse files Browse the repository at this point in the history
  • Loading branch information
ekenigs committed Sep 10, 2024
1 parent bbdb182 commit bb340d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
5 changes: 4 additions & 1 deletion examples/mrl-simple/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
11 changes: 7 additions & 4 deletions packages/mrl/src/mrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 7 additions & 4 deletions packages/sdk/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ export function Sdk({ configService, ecosystem }: SdkOptions = {}) {
});

return {
setAddresses(
sourceAddress: string,
destinationAddress: string,
): Promise<TransferData> {
setAddresses({
sourceAddress,
destinationAddress,
}: {
sourceAddress: string;
destinationAddress: string;
}): Promise<TransferData> {
const sourceChain = service.getChain(source);

if (!EvmParachain.isAnyParachain(sourceChain)) {
Expand Down

0 comments on commit bb340d0

Please sign in to comment.