Skip to content

Commit

Permalink
fix: update toAddress in ibc transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperKoza343 committed Jan 13, 2025
1 parent 907ed03 commit 64e6cb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
10 changes: 0 additions & 10 deletions packages/plugin-cosmos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ Yes

This plugin supports a token transfer action, which allows users to transfer tokens between addresses on Cosmos-compatible blockchains between different chains.

#### Requirements

You need to set both chain that you want to transfer founds between in env file. For example:

```
COSMOS_AVAILABLE_CHAINS=osmosistestnet,neutrontestnet
```

If you want to transfer your tokens between Osmosis Testnet and Neutron Testnet

#### Example Prompts

Below are examples of how the ibc transfer action can be initiated and confirmed:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
convertDisplayUnitToBaseUnit,
getAssetBySymbol,
getChainByChainId,
getChainByChainName,
} from "@chain-registry/utils";
import { assets, chains } from "chain-registry";
Expand Down Expand Up @@ -97,18 +96,17 @@ export class IBCTransferAction implements ICosmosActionService {
),
cumulativeAffiliateFeeBPS: "0",
});
const fromAddress = {
chainID: sourceChain.chain_id,
address: await this.cosmosWalletChains.getWalletAddress(params.chainName)
};

const userAddresses = await Promise.all(
route.requiredChainAddresses.map(async (chainID) => {
const chain = getChainByChainId(chains, chainID);
return {
chainID,
address: await this.cosmosWalletChains.getWalletAddress(
chain.chain_name
),
};
})
);
const toAddress = {
chainID: destChain.chain_id,
address: params.toAddress
};

const userAddresses = [fromAddress, toAddress];

let txHash: string | undefined;

Expand Down

0 comments on commit 64e6cb2

Please sign in to comment.