diff --git a/README.md b/README.md
index 81afb77..9f67e1c 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
*:star: Developed / Developing by [Cosmostation](https://www.cosmostation.io/)*
-A JavasSript Open Source Library for [Cosmos Network](https://cosmos.network/), [IRISnet](https://www.irisnet.org/), [Kava](https://www.kava.io/), [Band Protocol](https://bandprotocol.com/), [Starname](https://iov.one/), [Secret Network](https://scrt.network/), and [Akash Network](https://akash.network/).
+A JavasSript Open Source Library for [Cosmos Network](https://cosmos.network/), [IRISnet](https://www.irisnet.org/), [Kava](https://www.kava.io/), [Band Protocol](https://bandprotocol.com/), [Starname](https://iov.one/), [Secret Network](https://scrt.network/), [Akash Network](https://akash.network/), and [Certik](https://certik.foundation/).
This library supports cosmos address generation and verification. It enables you to create an offline signature functions of different types of transaction messages. It will eventually support all the other blockchains that are based on Tendermint in the future.
@@ -58,7 +58,7 @@ import cosmosjs from "@cosmostation/cosmosjs";
- You can see example file at [/example/browser-example.html](https://github.com/cosmostation/cosmosjs/tree/master/example/browser-example.html)
```js
-
+
```
## Usage
@@ -122,6 +122,14 @@ const chainId = "akashnet-1";
const akash = cosmosjs.network(lcdUrl, chainId);
akash.setBech32MainPrefix("akash");
```
+- Certik
+```js
+const cosmosjs = require("@cosmostation/cosmosjs");
+
+const chainId = "shentu-1";
+const certik = cosmosjs.network(lcdUrl, chainId);
+certik.setBech32MainPrefix("certik");
+```
Generate ECPairPriv value that is needed for signing signatures
```js
diff --git a/docs/msg_types/certik.md b/docs/msg_types/certik.md
new file mode 100644
index 0000000..66c5b1b
--- /dev/null
+++ b/docs/msg_types/certik.md
@@ -0,0 +1,406 @@
+# Certik
+
+In this docs, these are supporting message types in CTK.
+
+CertiK Chain, a security-first, delegated proof-of-stake blockchain, for trustworthy execution of mission-critical applications, including DeFi, NFTs, and autonomous vehicles.
+
+### Supporting Message Types
+
+- [bank/MsgSend](#msgsend)
+- [cosmos-sdk/MsgMultiSend](#msgmultisend)
+- [cosmos-sdk/MsgCreateValidator](#msgcreatevalidator)
+- [cosmos-sdk/MsgEditValidator](#msgeditvalidator)
+- [cosmos-sdk/MsgDelegate](#msgdelegate)
+- [cosmos-sdk/MsgUndelegate](#msgundelegate)
+- [cosmos-sdk/MsgBeginRedelegate](#msgbeginredelegate)
+- [cosmos-sdk/MsgWithdrawDelegationReward](#msgwithdrawdelegationreward)
+- [cosmos-sdk/MsgWithdrawValidatorCommission](#msgwithdrawvalidatorcommission)
+- [cosmos-sdk/MsgModifyWithdrawAddress](#msgmodifywithdrawaddress)
+- [cosmos-sdk/MsgSubmitProposal](#msgsubmitproposal)
+- [cosmos-sdk/MsgDeposit](#msgdeposit)
+- [cosmos-sdk/MsgVote](#msgvote)
+- [cosmos-sdk/MsgUnjail](#msgunjail)
+
+### MsgSend
+
+```js
+// cosmos-sdk/MsgSend
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "bank/MsgSend",
+ value: {
+ amount: [
+ {
+ amount: String(100000), // 6 decimal places (1000000 uctk = 1 CTK)
+ denom: "uctk"
+ }
+ ],
+ from_address: address,
+ to_address: "certik1zymhgddfc6hwwk6hw6hcsc88v9cnkl969xxch5"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgMultiSend
+
+```js
+// cosmos-sdk/MsgMultiSend
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgMultiSend",
+ value: {
+ inputs: [
+ {
+ address: address,
+ coins: [
+ {
+ amount: String(100000), // 6 decimal places (1000000 uctk = 1 CTK)
+ denom: "uctk"
+ }
+ ]
+ }
+ ],
+ outputs: [
+ {
+ address: "certik1zymhgddfc6hwwk6hw6hcsc88v9cnkl969xxch5",
+ coins: [
+ {
+ amount: String(100000),
+ denom: "uctk"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgCreateValidator
+
+```js
+// cosmos-sdk/MsgCreateValidator
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgCreateValidator",
+ value: {
+ description: {
+ moniker: "Test Validator",
+ identity: "",
+ website: "",
+ details: ""
+ },
+ commission: {
+ rate: "0.250000000000000000", // 25.0%
+ max_rate: "1.000000000000000000",
+ max_change_rate: "0.100000000000000000"
+ },
+ min_self_delegation: String(1),
+ delegator_address: address,
+ validator_address: "certikvaloper1hdcfct8yvc4069tku92txtjz0rf50dsugutdv4",
+ pubkey: "certikvalconspub1zcjduepqgl44x87cvcxq9emuv4em8u5e5gyh9zqyfksacg6p3rc2s96ann0s49d23w",
+ value: {
+ denom: "uctk",
+ amount: String(1)
+ }
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgEditValidator
+
+```js
+// cosmos-sdk/MsgEditValidator
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgEditValidator",
+ value: {
+ Description: {
+ moniker: "Best Validator",
+ identity: "[do-not-modify]",
+ website: "[do-not-modify]",
+ details: "[do-not-modify]"
+ },
+ address: "certikvaloper1hdcfct8yvc4069tku92txtjz0rf50dsugutdv4",
+ commission_rate: "0.220000000000000000", // 22.0%
+ min_self_delegation: null
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgDelegate
+
+```js
+// cosmos-sdk/MsgDelegate
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgDelegate",
+ value: {
+ amount: {
+ amount: String(1000000),
+ denom: "uctk"
+ },
+ delegator_address: address,
+ validator_address: "certikvaloper1hdcfct8yvc4069tku92txtjz0rf50dsugutdv4"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgUndelegate
+
+```js
+// cosmos-sdk/MsgUndelegate
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgUndelegate",
+ value: {
+ amount: {
+ amount: String(1000000),
+ denom: "uctk"
+ },
+ delegator_address: address,
+ validator_address: "certikvaloper1hdcfct8yvc4069tku92txtjz0rf50dsugutdv4"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgBeginRedelegate
+
+```js
+// cosmos-sdk/MsgBeginRedelegate
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgBeginRedelegate",
+ value: {
+ amount: {
+ amount: String(1000000),
+ denom: "uctk"
+ },
+ delegator_address: address,
+ validator_dst_address: "certikvaloper1hdcfct8yvc4069tku92txtjz0rf50dsugutdv4",
+ validator_src_address: "certikvaloper18tmu0lrfsdvke8e3a3jsd7fq2rs29krfpn43fr"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgWithdrawDelegationReward
+
+```js
+// cosmos-sdk/MsgWithdrawDelegationReward
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgWithdrawDelegationReward",
+ value: {
+ delegator_address: address,
+ validator_address: "certikvaloper1hdcfct8yvc4069tku92txtjz0rf50dsugutdv4"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgWithdrawValidatorCommission
+
+```js
+// cosmos-sdk/MsgWithdrawValidatorCommission
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgWithdrawValidatorCommission",
+ value: {
+ validator_address: "certikvaloper1hdcfct8yvc4069tku92txtjz0rf50dsugutdv4"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgModifyWithdrawAddress
+
+```js
+// cosmos-sdk/MsgModifyWithdrawAddress
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgModifyWithdrawAddress",
+ value: {
+ delegator_address: address,
+ withdraw_address: "certik1zymhgddfc6hwwk6hw6hcsc88v9cnkl969xxch5"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgSubmitProposal
+
+```js
+// cosmos-sdk/MsgSubmitProposal
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgSubmitProposal",
+ value: {
+ title: "Activate the Community Pool",
+ description: "Enable governance to spend funds from the community pool. Full proposal: https://ipfs.io/ipfs/QmNsVCsyRmEiep8rTQLxVNdMHm2uiZkmaSHCR6S72Y1sL1",
+ initial_deposit: [
+ {
+ amount: String(1000000),
+ denom: "uctk"
+ }
+ ],
+ proposal_type: "Text",
+ proposer: address
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgDeposit
+
+```js
+// cosmos-sdk/MsgDeposit
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgDeposit",
+ value: {
+ amount: [
+ {
+ amount: String(1000000),
+ denom: "uctk"
+ }
+ ],
+ depositor: address,
+ proposal_id: String(1)
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgVote
+
+```js
+// cosmos-sdk/MsgVote
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgVote",
+ value: {
+ option: "Yes", // Yes, No, NowithVeto, Abstain
+ proposal_id: String(1),
+ voter: address
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
+
+### MsgUnjail
+
+```js
+// cosmos-sdk/MsgUnjail
+let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "cosmos-sdk/MsgUnjail",
+ value: {
+ address: "certikvaloper18tmu0lrfsdvke8e3a3jsd7fq2rs29krfpn43fr"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+});
+```
diff --git a/example/certik.js b/example/certik.js
new file mode 100644
index 0000000..52d5ac7
--- /dev/null
+++ b/example/certik.js
@@ -0,0 +1,40 @@
+const cosmosjs = require("../src");
+
+// [WARNING] This mnemonic is just for the demo purpose. DO NOT USE THIS MNEMONIC for your own wallet.
+const mnemonic = "swear buyer security impulse public stereo peasant correct cross tornado bid discover anchor float venture deal patch property cool wreck eight dwarf december surface";
+const chainId = "shentu-1";
+// Please install and use rest server separately. (https://hub.cosmos.network/master/resources/service-providers.html#setting-up-the-rest-server)
+const certik = cosmosjs.network("https://certik.stakesystems.io", chainId);
+certik.setBech32MainPrefix("certik");
+certik.setPath("m/44'/118'/0'/0/0");
+const address = certik.getAddress(mnemonic);
+const ecpairPriv = certik.getECPairPriv(mnemonic);
+
+// Generate MsgSend transaction and broadcast
+certik.getAccounts(address).then(data => {
+ let stdSignMsg = certik.newStdMsg({
+ msgs: [
+ {
+ type: "bank/MsgSend",
+ value: {
+ amount: [
+ {
+ amount: String(100000), // 6 decimal places (1000000 uctk = 1 CTK)
+ denom: "uctk"
+ }
+ ],
+ from_address: address,
+ to_address: "certik1zymhgddfc6hwwk6hw6hcsc88v9cnkl969xxch5"
+ }
+ }
+ ],
+ chain_id: chainId,
+ fee: { amount: [ { amount: String(5000), denom: "uctk" } ], gas: String(200000) },
+ memo: "",
+ account_number: String(data.result.value.account_number),
+ sequence: String(data.result.value.sequence)
+ });
+
+ const signedTx = certik.sign(stdSignMsg, ecpairPriv);
+ certik.broadcast(signedTx).then(response => console.log(response));
+})
\ No newline at end of file
diff --git a/package.json b/package.json
index 01ada0d..184b3cd 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "@cosmostation/cosmosjs",
- "version": "0.7.2",
- "description": "A JavasSript Open Source Library for Cosmos Network, IRISnet, Kava, Band Protocol, Starname, Secret Network, and Akash. (HTML developers can use /dist/cosmos.js)",
+ "version": "0.8.0",
+ "description": "A JavasSript Open Source Library for Cosmos Network, IRISnet, Kava, Band Protocol, Starname, Secret Network, Akash, and Certik. (HTML developers can use /dist/cosmos.js)",
"main": "./src/index.js",
"repository": {
"type": "git",
@@ -25,7 +25,9 @@
"secret",
"scrt",
"akash",
- "akt"
+ "akt",
+ "certik",
+ "ctk"
],
"scripts": {
"test": "mocha"