Use any instead of object, which allows accessing members unknown to the type system
This commit is contained in:
parent
fae28ab0e4
commit
a1f487ebb4
@ -101,10 +101,10 @@ export function parseMsg(
|
||||
};
|
||||
}
|
||||
|
||||
const recipient: string | undefined = (msg.value.msg as any).transfer?.recipient;
|
||||
const recipient: string | undefined = msg.value.msg.transfer?.recipient;
|
||||
if (!recipient) throw new Error("Could not read recipient");
|
||||
|
||||
const amount: string | undefined = (msg.value.msg as any).transfer?.amount;
|
||||
const amount: string | undefined = msg.value.msg.transfer?.amount;
|
||||
if (!amount) throw new Error("Could not read recipient");
|
||||
|
||||
const send: SendTransaction = {
|
||||
|
||||
@ -24,7 +24,7 @@ export interface CosmosSdkTx {
|
||||
|
||||
interface MsgTemplate {
|
||||
readonly type: string;
|
||||
readonly value: object;
|
||||
readonly value: any;
|
||||
}
|
||||
|
||||
/** A Cosmos SDK token transfer message */
|
||||
@ -73,7 +73,7 @@ export interface MsgInstantiateContract extends MsgTemplate {
|
||||
/** Human-readable label for this contract */
|
||||
readonly label: string;
|
||||
/** Init message as JavaScript object */
|
||||
readonly init_msg: object;
|
||||
readonly init_msg: any;
|
||||
readonly init_funds: ReadonlyArray<Coin>;
|
||||
};
|
||||
}
|
||||
@ -91,7 +91,7 @@ export interface MsgExecuteContract extends MsgTemplate {
|
||||
/** Bech32 account address */
|
||||
readonly contract: string;
|
||||
/** Handle message as JavaScript object */
|
||||
readonly msg: object;
|
||||
readonly msg: any;
|
||||
readonly sent_funds: ReadonlyArray<Coin>;
|
||||
};
|
||||
}
|
||||
|
||||
6
packages/sdk/types/types.d.ts
vendored
6
packages/sdk/types/types.d.ts
vendored
@ -12,7 +12,7 @@ export interface CosmosSdkTx {
|
||||
}
|
||||
interface MsgTemplate {
|
||||
readonly type: string;
|
||||
readonly value: object;
|
||||
readonly value: any;
|
||||
}
|
||||
/** A Cosmos SDK token transfer message */
|
||||
export interface MsgSend extends MsgTemplate {
|
||||
@ -58,7 +58,7 @@ export interface MsgInstantiateContract extends MsgTemplate {
|
||||
/** Human-readable label for this contract */
|
||||
readonly label: string;
|
||||
/** Init message as JavaScript object */
|
||||
readonly init_msg: object;
|
||||
readonly init_msg: any;
|
||||
readonly init_funds: ReadonlyArray<Coin>;
|
||||
};
|
||||
}
|
||||
@ -75,7 +75,7 @@ export interface MsgExecuteContract extends MsgTemplate {
|
||||
/** Bech32 account address */
|
||||
readonly contract: string;
|
||||
/** Handle message as JavaScript object */
|
||||
readonly msg: object;
|
||||
readonly msg: any;
|
||||
readonly sent_funds: ReadonlyArray<Coin>;
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user