Working cosmos example!

You'll need to install Squid via npm first, then put in your cosmos wallet mnemonic and you're good!
import { RouteResponse, Squid } from "@0xsquid/sdk/src/index";
import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate";
import {
DirectSecp256k1HdWallet,
OfflineDirectSigner,
} from "@cosmjs/proto-signing";
(async () => {
const baseUrl = "https://testnet.api.0xsquid.com";
// instantiate the SDK
const squid = new Squid({
baseUrl: baseUrl,
});
// init the SDK
await squid.init();
console.log("Squid inited");
const mnemonic = "<your_mnemonic>";
const osmosisRpc = "https://rpc.osmotest5.osmosis.zone"; // osmosis testnet rpc endpoint
const getSignerFromMnemonic = async (): Promise<OfflineDirectSigner> => {
return DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
prefix: "osmo",
});
};
const offlineSigner: OfflineDirectSigner = await getSignerFromMnemonic();
const signerAddress = (await offlineSigner.getAccounts())[0].address;
const signer = await SigningStargateClient.connectWithSigner(
osmosisRpc,
offlineSigner
);
const params = {
fromChain: "osmo-test-5", // Osmosis Testnet
fromToken: "ibc/40F1B2458AEDA66431F9D44F48413240B8D28C072463E2BF53655728683583E3", // nUSDC on Osmosis
fromAmount: "1000000", // 1 nUSDC
toChain: 43113, // Avalanche Fuji Tesntet
toToken: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", // AVAX on Avalanche
fromAddress: "osmo1eaztm3pqrkw2xgt0lxppahtx5v5pndmjg6yfrh", // Cosmos Sender address
toAddress: "0x747A6e3824FAB0d1266306C3b492fcB941C5dd93", // the recipient of the trade
slippage: 1.00, // 1.00 = 1% max slippage across the entire route
enableForecall: true, // instant execution service, defaults to true
quoteOnly: false // optional, defaults to false
};
let { route }: RouteResponse = await squid.getRoute(params);
const cosmosTx = (await squid.executeRoute({
signer,
signerAddress,
route,
})) as DeliverTxResponse;
const txHash = cosmosTx.transactionHash;
const status = await squid.getStatus({
transactionId: txHash,
fromChainId: "osmo-test-5",
toChainId: 43113,
});
console.log(status);
})();