Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buyNftFromAnyChain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"start": "ts-node src/index.ts"
},
"dependencies": {
"@0xsquid/sdk": "^1.4.1",
"@0xsquid/sdk": "1.12.0",
"dotenv": "^16.0.3",
"ethers": "^5.7.2"
}
Expand Down
1 change: 1 addition & 0 deletions buyNftFromAnyChain/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const getSDK = () => {
);

const { route } = await squid.getRoute({
fromAddress: signer.address,
toAddress: signer.address,
fromChain: avalancheId,
fromToken: nativeToken,
Expand Down
4,024 changes: 395 additions & 3,629 deletions buyNftFromAnyChain/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cosmos/cosmosContractCall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"start": "ts-node src/index.ts"
},
"dependencies": {
"@0xsquid/sdk": "1.4.6-beta.0",
"@cosmjs/stargate": "^0.30.1",
"@0xsquid/sdk": "1.12.1",
"@cosmjs/stargate": "^0.31.0",
"dotenv": "^16.0.3"
}
}
11 changes: 7 additions & 4 deletions cosmos/cosmosContractCall/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Squid } from "@0xsquid/sdk";
import { SigningStargateClient, DeliverTxResponse } from "@cosmjs/stargate";
import { SigningStargateClient } from "@cosmjs/stargate";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { fromBech32, toBech32 } from "@cosmjs/encoding";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";

// Environment
// add to a file named ".env" to prevent them being uploaded to github
Expand Down Expand Up @@ -54,7 +55,7 @@ const getSDK = () => {
fromChain: axelarChainId,
fromToken: uaxlAddressAxelar,
fromAmount: amount,
cosmosSignerAddress: signerAddress,
fromAddress: signerAddress,
toChain: osmosisChainId,
toToken: uaxlAddressOsmosis,
toAddress: osmosisAddress, // this address will be replaced with contract address
Expand Down Expand Up @@ -97,11 +98,13 @@ const getSDK = () => {

const { route } = await squid.getRoute(params);

const txInfo = (await squid.executeRoute({
const txRaw = (await squid.executeRoute({
signer,
signerAddress,
route,
})) as DeliverTxResponse;
})) as TxRaw;

const txInfo = await signer.broadcastTx(TxRaw.encode(txRaw).finish());

const txLink = `https://www.mintscan.io/axelar/txs/${txInfo.transactionHash}`;
console.log(`Finished! You can find your transaction here: ${txLink}`);
Expand Down
Loading