Skip to content

Commit

Permalink
allow legacy MsgSend Amino (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrathCole authored Jun 20, 2024
1 parent 4633f94 commit 0648f8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/client/models/MsgSend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ type Data = DeepPrettify<PlainMessage<ProtoMsgSend>>;

export class MsgSend implements Adapter {
private readonly data: Data;
private readonly legacy: boolean;

constructor(data: Data) {
constructor(data: Data, legacy = false) {
this.data = data;
this.legacy = legacy;
}

public toProto() {
Expand All @@ -19,7 +21,7 @@ export class MsgSend implements Adapter {

public toAmino() {
return {
type: "cosmos-sdk/MsgSend",
type: this.legacy ? "bank/MsgSend" : "cosmos-sdk/MsgSend",
value: {
from_address: this.data.fromAddress,
to_address: this.data.toAddress,
Expand Down

0 comments on commit 0648f8a

Please sign in to comment.