Deduplicate and sort some types
This commit is contained in:
@@ -50,7 +50,7 @@ const { account_number, sequence } = (await client.authAccounts(faucetAddress)).
|
||||
// Craft a send transaction
|
||||
const emptyAddress = Bech32.encode("cosmos", Random.getBytes(20));
|
||||
const memo = "My first contract on chain";
|
||||
const sendTokensMsg: types.MsgSend = {
|
||||
const sendTokensMsg: MsgSend = {
|
||||
type: "cosmos-sdk/MsgSend",
|
||||
value: {
|
||||
from_address: faucetAddress,
|
||||
@@ -66,7 +66,7 @@ const sendTokensMsg: types.MsgSend = {
|
||||
|
||||
const signBytes = makeSignBytes([sendTokensMsg], defaultFee, defaultNetworkId, memo, account_number, sequence);
|
||||
const signature = await pen.sign(signBytes);
|
||||
const signedTx: types.StdTx = {
|
||||
const signedTx: StdTx = {
|
||||
msg: [sendTokensMsg],
|
||||
fee: defaultFee,
|
||||
memo: memo,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const defaultHttpUrl = "http://localhost:1317";
|
||||
const defaultNetworkId = "testing";
|
||||
const defaultFee: types.StdFee = {
|
||||
const defaultFee: StdFee = {
|
||||
amount: [
|
||||
{
|
||||
amount: "5000",
|
||||
|
||||
@@ -5,7 +5,7 @@ export type HandleMsg =
|
||||
msgs: (
|
||||
| {
|
||||
send: {
|
||||
amount: types.Coin[];
|
||||
amount: Coin[];
|
||||
from_address: string;
|
||||
to_address: string;
|
||||
};
|
||||
@@ -15,7 +15,7 @@ export type HandleMsg =
|
||||
contract_addr: string;
|
||||
// this had to be changed - is Base64 encoded string
|
||||
msg: string;
|
||||
send: types.Coin[] | null;
|
||||
send: Coin[] | null;
|
||||
};
|
||||
}
|
||||
| {
|
||||
@@ -53,7 +53,7 @@ export interface State {
|
||||
|
||||
const base64Msg = (msg: object): string => toBase64(toUtf8(JSON.stringify(msg)));
|
||||
|
||||
const sendMsg = (from_address: string, to_address: string, amount: types.Coin[]) => {
|
||||
const sendMsg = (from_address: string, to_address: string, amount: Coin[]) => {
|
||||
return {
|
||||
send: {
|
||||
from_address,
|
||||
@@ -63,7 +63,7 @@ const sendMsg = (from_address: string, to_address: string, amount: types.Coin[])
|
||||
};
|
||||
}
|
||||
|
||||
const contractMsg = (contract_addr: string, msg: object, amount?: types.Coin[]) => {
|
||||
const contractMsg = (contract_addr: string, msg: object, amount?: Coin[]) => {
|
||||
return {
|
||||
contract: {
|
||||
contract_addr,
|
||||
|
||||
@@ -62,18 +62,24 @@ export function main(originalArgs: readonly string[]): void {
|
||||
[
|
||||
"@cosmwasm/sdk38",
|
||||
[
|
||||
"coin",
|
||||
"coins",
|
||||
"encodeSecp256k1Pubkey",
|
||||
"encodeSecp256k1Signature",
|
||||
"logs",
|
||||
"makeCosmoshubPath",
|
||||
"makeSignBytes",
|
||||
"marshalTx",
|
||||
"IndexedTx",
|
||||
"Coin",
|
||||
"MsgSend",
|
||||
"Pen",
|
||||
"PubKey",
|
||||
"pubkeyToAddress",
|
||||
"RestClient",
|
||||
"Secp256k1Pen",
|
||||
"types",
|
||||
"IndexedTx",
|
||||
"StdFee",
|
||||
"StdTx",
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user