clients/js: handle injective mainnet

This commit is contained in:
Evan Gray 2023-01-16 15:37:36 +00:00 committed by Evan Gray
parent 09aee3cfde
commit 004ccecaf8
2 changed files with 7 additions and 8 deletions

View File

@ -31,7 +31,7 @@ export async function execute_injective(
const network = getNetworkInfo(endPoint);
const walletPKHash = n.key;
const walletPK = PrivateKey.fromHex(walletPKHash);
const walletPK = PrivateKey.fromMnemonic(walletPKHash);
const walletInjAddr = walletPK.toBech32();
const walletPublicKey = walletPK.toPublicKey().toBase64();
@ -130,7 +130,9 @@ export async function execute_injective(
contractAddress: target_contract,
exec: {
action,
...execute_msg[action],
msg: {
...execute_msg[action],
},
},
});
console.log("transaction:", transaction);
@ -141,10 +143,6 @@ export async function execute_injective(
const { signBytes, txRaw } = createTransaction({
message: transaction.toDirectSign(),
memo: "",
fee: {
...DEFAULT_STD_FEE,
gas: (parseInt(DEFAULT_STD_FEE.gas, 10) * 2.5).toString(),
},
pubKey: walletPublicKey,
sequence: parseInt(accountDetails.account.base_account.sequence, 10),
accountNumber: parseInt(

View File

@ -86,8 +86,9 @@ const MAINNET = {
"85957f38de1768d6db9eab29bee9dd2a01462aff9c8d83daefb9bcd2506c32d2",
},
injective: {
rpc: undefined,
key: undefined,
rpc: "http://sentry0.injective.network:26657",
chain_id: "injective-1",
key: get_env_var("INJECTIVE_KEY"),
},
osmosis: {
rpc: undefined,