scripts: Update wasmd deploy scripts for sdk38 OfflineSigner
This commit is contained in:
parent
61a31cf1ed
commit
d8241e4f7d
@ -2,7 +2,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm");
|
||||
const { Secp256k1Pen } = require("@cosmjs/sdk38");
|
||||
const { Secp256k1OfflineWallet } = require("@cosmjs/sdk38");
|
||||
const fs = require("fs");
|
||||
|
||||
const httpUrl = "http://localhost:1317";
|
||||
@ -134,8 +134,8 @@ const initDataJade = {
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const pen = await Secp256k1Pen.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, (signBytes) => pen.sign(signBytes));
|
||||
const wallet = await Secp256k1OfflineWallet.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, wallet);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/cw-erc20.wasm");
|
||||
const uploadReceipt = await client.upload(wasm, codeMeta, "Upload ERC20 contract");
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm");
|
||||
const { Secp256k1Pen } = require("@cosmjs/sdk38");
|
||||
const { Secp256k1OfflineWallet } = require("@cosmjs/sdk38");
|
||||
const fs = require("fs");
|
||||
|
||||
const httpUrl = "http://localhost:1317";
|
||||
@ -36,8 +36,8 @@ const luxury = {
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const pen = await Secp256k1Pen.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, (signBytes) => pen.sign(signBytes));
|
||||
const wallet = await Secp256k1OfflineWallet.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, wallet);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/cw-nameservice.wasm");
|
||||
const uploadReceipt = await client.upload(wasm, codeMeta, "Upload Name Service code");
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
const { SigningCosmWasmClient } = require("@cosmjs/cosmwasm");
|
||||
const { coins, Secp256k1Pen } = require("@cosmjs/sdk38");
|
||||
const { coins, Secp256k1OfflineWallet } = require("@cosmjs/sdk38");
|
||||
const fs = require("fs");
|
||||
|
||||
const httpUrl = "http://localhost:1317";
|
||||
@ -38,8 +38,8 @@ const fees = {
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const pen = await Secp256k1Pen.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, (signBytes) => pen.sign(signBytes), fees);
|
||||
const wallet = await Secp256k1OfflineWallet.fromMnemonic(alice.mnemonic);
|
||||
const client = new SigningCosmWasmClient(httpUrl, alice.address0, wallet, fees);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/staking.wasm");
|
||||
const uploadReceipt = await client.upload(wasm, codeMeta, "Upload Staking code");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user