mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
cosmwasm-stargate: Update for removed coinFromProto
This commit is contained in:
parent
c6bbd5b60d
commit
08647312ba
@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { fromBase64, fromUtf8, toBase64, toUtf8 } from "@cosmjs/encoding";
|
||||
import { AminoConverter, Coin, coinFromProto } from "@cosmjs/stargate";
|
||||
import { AminoConverter, Coin } from "@cosmjs/stargate";
|
||||
import { assertDefinedAndNotNull } from "@cosmjs/utils";
|
||||
import Long from "long";
|
||||
|
||||
@ -167,7 +167,7 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
code_id: codeId.toString(),
|
||||
label: label,
|
||||
init_msg: JSON.parse(fromUtf8(initMsg)),
|
||||
funds: funds.map(coinFromProto),
|
||||
funds: funds,
|
||||
admin: admin ?? undefined,
|
||||
};
|
||||
},
|
||||
@ -231,7 +231,7 @@ export const cosmWasmTypes: Record<string, AminoConverter> = {
|
||||
sender: sender,
|
||||
contract: contract,
|
||||
msg: JSON.parse(fromUtf8(msg)),
|
||||
funds: funds.map(coinFromProto),
|
||||
funds: funds,
|
||||
};
|
||||
},
|
||||
fromAmino: ({ sender, contract, msg, funds }: AminoMsgExecuteContract["value"]): MsgExecuteContract => ({
|
||||
|
@ -16,7 +16,6 @@ import {
|
||||
Block,
|
||||
BroadcastTxResponse,
|
||||
Coin,
|
||||
coinFromProto,
|
||||
IndexedTx,
|
||||
isSearchByHeightQuery,
|
||||
isSearchBySentFromOrToQuery,
|
||||
@ -144,8 +143,7 @@ export class CosmWasmClient {
|
||||
}
|
||||
|
||||
public async getBalance(address: string, searchDenom: string): Promise<Coin | null> {
|
||||
const balance = await this.forceGetQueryClient().bank.balance(address, searchDenom);
|
||||
return balance ? coinFromProto(balance) : null;
|
||||
return this.forceGetQueryClient().bank.balance(address, searchDenom);
|
||||
}
|
||||
|
||||
public async getTx(id: string): Promise<IndexedTx | null> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user