cli: Update for amino/launchpad refactor

This commit is contained in:
willclarktech 2021-03-24 19:12:04 +01:00
parent 2e8016c81b
commit dda02bc80f
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
4 changed files with 11 additions and 12 deletions

View File

@ -1,5 +1,5 @@
import { makeCosmoshubPath, Secp256k1HdWallet } from "@cosmjs/amino";
import { toBase64 } from "@cosmjs/encoding";
import { makeCosmoshubPath, Secp256k1HdWallet } from "@cosmjs/launchpad";
const mnemonic =
"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone";

View File

@ -1,5 +1,5 @@
import { encodeSecp256k1Pubkey, Secp256k1HdWallet } from "@cosmjs/amino";
import { Bip39, Random } from "@cosmjs/crypto";
import { encodeSecp256k1Pubkey, Secp256k1HdWallet } from "@cosmjs/launchpad";
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic);

View File

@ -1,5 +1,5 @@
import { Coin } from "@cosmjs/amino";
import { toBase64, toUtf8 } from "@cosmjs/encoding";
import { Coin } from "@cosmjs/launchpad";
// types auto-generated by wasm.glass and cleaned up manually
export type HandleMsg =
@ -36,8 +36,7 @@ export type HandleMsg =
};
};
export interface InitMsg {
}
export interface InitMsg {}
export interface OwnerResponse {
owner: string;
@ -62,9 +61,9 @@ const sendMsg = (from_address: string, to_address: string, amount: Coin[]) => {
from_address,
to_address,
amount,
}
},
};
}
};
const contractMsg = (contract_addr: string, msg: object, amount?: Coin[]) => {
return {
@ -72,14 +71,14 @@ const contractMsg = (contract_addr: string, msg: object, amount?: Coin[]) => {
contract_addr,
msg: base64Msg(msg),
send: amount || null,
}
},
};
}
};
const opaqueMsg = (data: object) => {
return {
opaque: {
data: base64Msg(data),
}
},
};
}
};

View File

@ -86,7 +86,7 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
Secp256k1HdWallet,
Secp256k1Wallet,
StdFee,
} from "@cosmjs/launchpad";
} from "@cosmjs/amino";
import { Decimal } from "@cosmjs/math";
import { assert, arrayContentEquals, sleep } from "@cosmjs/utils";