0.0.83 • Published 1 month ago

@oraichain/cwtools v0.0.83

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Installation

You can install cwtools globally using npm npm install -g @oraichain/cwtools or yarn yarn global add @oraichain/cwtools

Usage

Type cwtools -h

cwtools [command]

Commands:
  cwtools genjs   generate JavaScript classes for the contract folders
  cwtools gents   generate TypeScript classes for the contract folders
  cwtools build   build a list of contract folders
  cwtools wasm    wasm commands
  cwtools script  run custom typescript file

Options:
  -h, --help        Show help                                          [boolean]
      --version     Show version number                                [boolean]
      --env         Path to JSON config file                   [default: ".env"]
      --file-input  Path to JSON config file

Cosmwasm commands with encrypted mnemonic

Custom script: scripts/show_account.ts

export default async (argv, common, exports) => {
  const { stringToPath } = exports['@cosmjs/crypto'];
  const { GasPrice } = exports['@cosmjs/stargate'];
  const { SigningCosmWasmClient } = exports['@cosmjs/cosmwasm-stargate'];
  const { DirectSecp256k1HdWallet } = exports['@cosmjs/proto-signing'];

  const prefix = process.env.PREFIX || 'orai';
  const mnemonic = argv.ENCRYPTED_MNEMONIC ? common.decryptMnemonic(argv.ENCRYPTED_MNEMONIC) : argv.MNEMONIC;
  const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
    hdPaths: [stringToPath(process.env.HD_PATH)],
    prefix
  });
  const [firstAccount] = await wallet.getAccounts();

  const client = await SigningCosmWasmClient.connectWithSigner(process.env.RPC_URL, wallet, {
    gasPrice: GasPrice.fromString(`${process.env.GAS_PRICES}${prefix}`)
  });

  console.log(firstAccount);
};
# generate encrypted mnemonic
cwtools script scripts/show_account.ts

# then put it into .env file then run
cwtools wasm -h
0.0.81

1 month ago

0.0.82

1 month ago

0.0.83

1 month ago

0.0.80

2 months ago

0.0.79

2 months ago

0.0.77

5 months ago

0.0.78

5 months ago

0.0.70

5 months ago

0.0.71

5 months ago

0.0.75

5 months ago

0.0.76

5 months ago

0.0.73

5 months ago

0.0.74

5 months ago

0.0.72

5 months ago

0.0.64

5 months ago

0.0.65

5 months ago

0.0.66

5 months ago

0.0.67

5 months ago

0.0.68

5 months ago

0.0.69

5 months ago

0.0.62

5 months ago

0.0.63

5 months ago

0.0.40

8 months ago

0.0.41

8 months ago

0.0.42

8 months ago

0.0.44

8 months ago

0.0.45

8 months ago

0.0.46

8 months ago

0.0.47

8 months ago

0.0.37

8 months ago

0.0.38

8 months ago

0.0.39

8 months ago

0.0.30

8 months ago

0.0.31

8 months ago

0.0.32

8 months ago

0.0.33

8 months ago

0.0.34

8 months ago

0.0.35

8 months ago

0.0.36

8 months ago

0.0.26

8 months ago

0.0.27

8 months ago

0.0.28

8 months ago

0.0.29

8 months ago

0.0.20

10 months ago

0.0.21

9 months ago

0.0.22

9 months ago

0.0.23

9 months ago

0.0.24

9 months ago

0.0.25

8 months ago

0.0.60

6 months ago

0.0.61

6 months ago

0.0.59

6 months ago

0.0.18

10 months ago

0.0.19

10 months ago

0.0.51

8 months ago

0.0.52

8 months ago

0.0.53

7 months ago

0.0.54

7 months ago

0.0.55

7 months ago

0.0.56

7 months ago

0.0.57

6 months ago

0.0.58

6 months ago

0.0.50

8 months ago

0.0.48

8 months ago

0.0.49

8 months ago

0.0.17

11 months ago

0.0.16

11 months ago

0.0.15

11 months ago

0.0.14

11 months ago

0.0.13

11 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago