Skip to content

Commit

Permalink
fix: msgTransferCosmJs toAmino
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-moore committed Jul 24, 2024
1 parent bf19b4c commit 0561ad8
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions packages/sdk-ts/src/core/modules/ibc/msgs/MsgTransferCosmjs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { MsgTransferEncodeObject } from '@cosmjs/stargate'
import { MsgTransfer as BaseMsgTransferCosmjs } from 'cosmjs-types/ibc/applications/transfer/v1/tx'
import {
CosmosBaseV1Beta1Coin,
Expand Down Expand Up @@ -79,25 +78,27 @@ export default class MsgTransferCosmjs {
public toAmino() {
const { params } = this

const transferMsg: MsgTransferEncodeObject = {
typeUrl: '/ibc.applications.transfer.v1.MsgTransfer',
value: BaseMsgTransferCosmjs.fromPartial({
sourcePort: params.port,
sourceChannel: params.channelId,
token: params.amount,
sender: params.sender,
receiver: params.receiver,
timeoutHeight: params.height
? {
revisionHeight: BigInt(params.height.revisionHeight),
revisionNumber: BigInt(params.height.revisionNumber),
}
: undefined,
timeoutTimestamp: params.timeout ? BigInt(params.timeout) : undefined,
}),
}
const message = BaseMsgTransferCosmjs.fromPartial({
sourcePort: params.port,
sourceChannel: params.channelId,
sender: params.sender,
receiver: params.receiver,
token: params.amount,
timeoutHeight: params.height
? {
revisionHeight: BigInt(params.height.revisionHeight),
revisionNumber: BigInt(params.height.revisionNumber),
}
: undefined,
timeoutTimestamp: params.timeout ? BigInt(params.timeout) : undefined,
})

return transferMsg
return {
type: '/ibc.applications.transfer.v1.MsgTransfer',
value: {
...message,
},
}
}

public toWeb3() {
Expand Down

0 comments on commit 0561ad8

Please sign in to comment.