Skip to content

Commit

Permalink
update sdk for signing wasm tx type
Browse files Browse the repository at this point in the history
  • Loading branch information
nnoln committed Jun 3, 2024
1 parent 112c6a4 commit 42ddba4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/handlers/cosmos/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from "./cctpProto";

import { fromBech32, toBech32 } from "@cosmjs/encoding";
import { fromBech32, toBech32, toUtf8 } from "@cosmjs/encoding";
import { calculateFee, Coin, GasPrice, StargateClient } from "@cosmjs/stargate";

import {
Expand All @@ -15,8 +15,10 @@ import {
CCTP_TYPE,
RouteRequest,
IBC_TRANSFER_TYPE,
WASM_TYPE,
} from "../../types";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx";
import { MsgDepositForBurn } from "./cctpProto";
import { TokensChains } from "../../utils/TokensChains";

Expand Down Expand Up @@ -85,6 +87,15 @@ export class CosmosHandler {

break;

case WASM_TYPE:
// register execute wasm msg type for signer
signer.registry.register(WASM_TYPE, MsgExecuteContract);

cosmosMsg.value.msg = toUtf8(cosmosMsg.value.msg);
msgs.push(cosmosMsg);

break;

default:
throw new Error(`Cosmos message ${cosmosMsg.typeUrl} not supported`);
}
Expand Down

0 comments on commit 42ddba4

Please sign in to comment.