Skip to content

Commit 623198c

Browse files
committed
fix tx data array
1 parent 999102d commit 623198c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

libs/injective-vue/src/helper-func-types.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,15 @@ export function buildTx<TMsg>(opts: TxBuilderOptions) {
9595
client.addEncoders(opts.encoders ?? []);
9696
client.addConverters(opts.converters ?? []);
9797

98-
const data = [
99-
{
100-
typeUrl: opts.typeUrl,
101-
value: message,
102-
},
103-
];
98+
const data = Array.isArray(message)
99+
? message.map(msg => ({
100+
typeUrl: opts.typeUrl,
101+
value: msg,
102+
}))
103+
: [{
104+
typeUrl: opts.typeUrl,
105+
value: message,
106+
}];
104107
return client.signAndBroadcast!(signerAddress, data, fee, memo);
105108
};
106109
}

0 commit comments

Comments
 (0)