Skip to content

Commit

Permalink
add request id to cosmos tx
Browse files Browse the repository at this point in the history
  • Loading branch information
nnoln committed Jun 17, 2024
1 parent 6cc3fe7 commit 3bcfcd0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsquid/sdk",
"version": "2.8.13",
"version": "2.8.14",
"description": "🛠 An SDK for building applications on top of 0xsquid",
"repository": {
"type": "git",
Expand Down Expand Up @@ -42,7 +42,7 @@
"semver": "^7.5.4"
},
"devDependencies": {
"@0xsquid/squid-types": "0.1.78",
"@0xsquid/squid-types": "0.1.80",
"@babel/core": "^7.18.10",
"@babel/preset-env": "^7.18.10",
"@babel/preset-typescript": "^7.18.6",
Expand Down
9 changes: 8 additions & 1 deletion src/handlers/cosmos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,18 @@ export class CosmosHandler {
const gasMultiplier = Number(route.transactionRequest?.maxFeePerGas) || 1.3;
const gasPrice = route.transactionRequest?.gasPrice as string;

let memo = "";
if (data.route.transactionRequest?.requestId) {
memo = JSON.stringify({
squidRequestId: data.route.transactionRequest?.requestId,
});
}

return signer.sign(
signerAddress,
msgs,
calculateFee(Math.trunc(estimatedGas * gasMultiplier), GasPrice.fromString(gasPrice)),
"",
memo,
);
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@0xsquid/squid-types@0.1.78":
version "0.1.78"
resolved "https://registry.npmjs.org/@0xsquid/squid-types/-/squid-types-0.1.78.tgz#6bfe6c3bce005b7feffda9a5048cec7f01ab74ad"
integrity sha512-bO9ezyLjHUYvGP+q9WKx3Qtnn7ZaitGj3FMylagRUJkI01wXlZiZID0eIKMQnL4j8U3GUs7HhCx5pSgalB7zfw==
"@0xsquid/squid-types@0.1.80":
version "0.1.80"
resolved "https://registry.yarnpkg.com/@0xsquid/squid-types/-/squid-types-0.1.80.tgz#c669861b15e221b9a70dee667e1f23720f55dfb5"
integrity sha512-Nj98/LUBiZTGRa7DQAGv3KNOiJ3NGtAiKYwK0pzrK/lcB6l+t6Q8qnD+m93DJ7ximzR+0AQsA2aa8C1phjk5BA==
dependencies:
"@axelar-network/axelarjs-sdk" "^0.16.1"
"@ethersproject/providers" "^5.7.2"
Expand Down

0 comments on commit 3bcfcd0

Please sign in to comment.