Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Signing Support & TxDecoder #298

Merged
merged 280 commits into from
Aug 10, 2021
Merged
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
f1d6f2e
MsgSend Example case as per new approach
cdc-Hitesh May 29, 2021
2f9206c
Merge branch 'tx-revamp-dev' of https://github.com/cdc-Hitesh/chain-j…
cdc-Hitesh May 31, 2021
3e74f24
Refactoring and clean up.
cdc-Hitesh Jun 1, 2021
e2fb0df
Readme updated
cdc-Hitesh Jun 1, 2021
1887234
Support ''tx" attribute in the cosmos json decoding
cdc-Hitesh Jun 2, 2021
b8d8e5b
Merge branch 'feature-offlineSigning-MsgSend' of https://github.com/c…
cdc-Hitesh Jun 2, 2021
608ea32
Merge pull request #1 from cdc-Hitesh/feature-offlineSigning-MsgSend
cdc-Hitesh Jun 2, 2021
657a1f9
Merge pull request #2 from cdc-Hitesh/offlineSigning-documentation
cdc-Hitesh Jun 2, 2021
073af38
MsgBeginRedelegate support
cdc-Hitesh Jun 2, 2021
db196e5
typo fix
cdc-Hitesh Jun 2, 2021
8193cd6
Support MsgDelegate
cdc-Hitesh Jun 2, 2021
1d27afd
MsgUndelegate Support
cdc-Hitesh Jun 2, 2021
7551ca5
Typo fix
cdc-Hitesh Jun 2, 2021
5e69595
MsgEditValidator support
cdc-Hitesh Jun 2, 2021
53a2d4b
MsgCreateValidator support
cdc-Hitesh Jun 2, 2021
af8de2c
Eslint fixes, other refactoring
cdc-Hitesh Jun 2, 2021
bfe79cd
Merge branch 'dev' of https://github.com/crypto-org-chain/chain-jslib…
cdc-Hitesh Jun 3, 2021
d08a7e3
Eslint fixes
cdc-Hitesh Jun 3, 2021
654a123
Merge branch 'enhancement-offlineSigning-staking' of https://github.c…
cdc-Hitesh Jun 4, 2021
a9f2d32
MsgVote support under governance module
cdc-Hitesh Jun 4, 2021
c65e277
MsgDeposit support
cdc-Hitesh Jun 4, 2021
e9ff05e
- MsgSubmitProposal initial support
cdc-Hitesh Jun 4, 2021
c488dd3
- CancelSoftwareUpgradeProposal support
cdc-Hitesh Jun 4, 2021
6eaf381
SoftwareUpgradeProposal support
cdc-Hitesh Jun 4, 2021
d514aef
- Eslint fixes
cdc-Hitesh Jun 4, 2021
d205a17
Text Proposal Support
cdc-Hitesh Jun 4, 2021
843bde9
Update README.md
cdc-Hitesh Jun 4, 2021
9a95791
Merge branch 'dev' of https://github.com/crypto-org-chain/chain-jslib…
cdc-Hitesh Jun 4, 2021
46de42a
JS doc updated for Coin constructor
cdc-Hitesh Jun 4, 2021
ca7362f
Coin logic fix for UNITS and denoms
cdc-Hitesh Jun 4, 2021
f31481b
Eslint Disabling rules added
cdc-Hitesh Jun 4, 2021
ee65a17
Update lib/src/transaction/msg/bank/msgsend.ts
cdc-Hitesh Jun 4, 2021
2000075
Update lib/src/transaction/ow.types.ts
cdc-Hitesh Jun 4, 2021
abb5fb0
Optional renaming
cdc-Hitesh Jun 4, 2021
c984405
Make signer accounts optional.
cdc-Hitesh Jun 4, 2021
a0f9111
Merge branch 'tx-revamp-dev' of https://github.com/cdc-Hitesh/chain-j…
cdc-Hitesh Jun 4, 2021
c9c8a0f
Eslint Fixes
cdc-Hitesh Jun 4, 2021
2667115
Merge pull request #256 from crypto-org-chain/dev
calvinaco Jun 5, 2021
97a30ef
Merge branch 'tx-revamp-dev' into tx-revamp-dev
calvinaco Jun 5, 2021
35bea23
Update lib/src/utils/txDecoder.spec.ts
cdc-Hitesh Jun 5, 2021
95f5d52
Added an extra test case
cdc-Hitesh Jun 5, 2021
eeeae32
Feedabck improvement
cdc-Hitesh Jun 5, 2021
40e73a2
Function fix for asserting bech32 address
cdc-Hitesh Jun 5, 2021
9aeebd4
Update lib/src/transaction/signable.spec.ts
cdc-Hitesh Jun 5, 2021
acbb47e
Merge branch 'tx-revamp-dev' of https://github.com/cdc-Hitesh/chain-j…
cdc-Hitesh Jun 5, 2021
847ef58
signerAccounts stays optional.
cdc-Hitesh Jun 7, 2021
c64d8fa
Merge branch 'enhancement-MsgSubmitProposal-offlineSigning' of https:…
cdc-Hitesh Jun 8, 2021
28e3ab8
nft moduel typeurl mapping
cdc-Hitesh Jun 8, 2021
ca55d6d
unknown to string
cdc-Hitesh Jun 8, 2021
c9357cd
Merge branch 'dev' of https://github.com/crypto-org-chain/chain-jslib…
cdc-Hitesh Jun 8, 2021
fa75e50
MsgIssueDenom support
cdc-Hitesh Jun 8, 2021
991457c
MsgMintNFT support
cdc-Hitesh Jun 8, 2021
b4aa42e
MsgTransferNFT supported
cdc-Hitesh Jun 8, 2021
24595c4
MsgEditNFT support
cdc-Hitesh Jun 8, 2021
c1b25e4
Fix typeurl
cdc-Hitesh Jun 8, 2021
785dacf
Update lib/src/utils/address.ts
calvinaco Jun 9, 2021
33a5bc4
Exporting TxDecoder out of the BOX
cdc-Hitesh Jun 9, 2021
bba4b89
- Eslint Fixes
cdc-Hitesh Jun 9, 2021
e17e6db
Removed default value.
cdc-Hitesh Jun 9, 2021
97835a3
Merge branch 'tx-revamp-dev' of https://github.com/cdc-Hitesh/chain-j…
cdc-Hitesh Jun 9, 2021
b0157e3
remove tx from top body of cosmosJSON
cdc-Hitesh Jun 9, 2021
9fbbafb
Eslint fixes
cdc-Hitesh Jun 9, 2021
9e0c99b
Update lib/src/transaction/raw.ts
cdc-Hitesh Jun 10, 2021
0da938c
Merge branch 'dev' of https://github.com/crypto-org-chain/chain-jslib…
cdc-Hitesh Jun 10, 2021
568d3b9
Added test case for raw.ts
cdc-Hitesh Jun 10, 2021
ae91738
Added unit test case for coin.ts
cdc-Hitesh Jun 10, 2021
4753334
Merge pull request #273 from crypto-org-chain/dev
calvinaco Jun 10, 2021
a18d865
Merge branch 'tx-revamp-dev' into tx-revamp-dev
calvinaco Jun 10, 2021
e15ecd5
-owtypes renaming
cdc-Hitesh Jun 10, 2021
3ba4f9b
msgsend test cases added
cdc-Hitesh Jun 10, 2021
1d32988
Added strict value checking for JSON.
cdc-Hitesh Jun 10, 2021
81e935b
Merge branch 'tx-revamp-dev' of https://github.com/cdc-Hitesh/chain-j…
cdc-Hitesh Jun 10, 2021
e8c5a7f
Renamed gitignored folder name
cdc-Hitesh Jun 10, 2021
32af727
Import paths changed
cdc-Hitesh Jun 10, 2021
59c6086
SKip a few test cases
cdc-Hitesh Jun 10, 2021
f19fbbb
eslint disable for skipped tests
cdc-Hitesh Jun 10, 2021
ccbc5a7
Skip failing tests
cdc-Hitesh Jun 10, 2021
e7f042e
Merge pull request #241 from cdc-Hitesh/tx-revamp-dev
calvinaco Jun 10, 2021
7b08c40
Merge branch 'tx-revamp-dev' of https://github.com/cdc-Hitesh/chain-j…
cdc-Hitesh Jun 11, 2021
34fdbf0
Enabled staking module
cdc-Hitesh Jun 11, 2021
b96ed43
Fixed MsgEditValidator
cdc-Hitesh Jun 11, 2021
a068d7d
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jun 11, 2021
f87bde4
Merge branch 'enhancement-offlineSigning-staking' of https://github.c…
cdc-Hitesh Jun 11, 2021
74d6c46
Merge branch 'enhancement-MsgSubmitProposal-offlineSigning' of https:…
cdc-Hitesh Jun 11, 2021
0471f25
Added governance module support
cdc-Hitesh Jun 11, 2021
19a2da2
Merge branch 'tx-revamp-dev' into enhancement-offlineSigning-staking
calvinaco Jun 11, 2021
21fc056
Update lib/src/transaction/msg/staking/MsgBeginRedelegate.ts
cdc-Hitesh Jun 11, 2021
9fd8fb5
Merge branch 'enhancement-offlineSigning-GOVERNANCE' of https://githu…
cdc-Hitesh Jun 11, 2021
bee149f
Distribution module support.
cdc-Hitesh Jun 11, 2021
9becbdc
Update lib/src/transaction/msg/staking/MsgCreateValidator.ts
cdc-Hitesh Jun 12, 2021
0637266
Merge branch 'feature-offlineSigning-distribution' of https://github.…
cdc-Hitesh Jun 14, 2021
4373567
Fix test cases and support NFT module
cdc-Hitesh Jun 14, 2021
30f7f9e
Merge branch 'dev' into feature-ibc-queryExtension
cdc-Hitesh Jun 14, 2021
97993ae
Merge branch 'dev' into feature-ibc-tx-transfer
cdc-Hitesh Jun 14, 2021
8f9f850
Added `sub` to run in Unit test CI.
cdc-Hitesh Jun 14, 2021
9449b99
- Support Multiple Fee Amounts
cdc-Hitesh Jun 14, 2021
8127701
Merge pull request #242 from cdc-Hitesh/enhancement-offlineSigning-st…
calvinaco Jun 15, 2021
1388c57
Merge branch 'tx-revamp-dev' into feature-offlineSigning-distribution
calvinaco Jun 15, 2021
57a7fcf
Merge branch 'tx-revamp-dev' into enhancement-offlineSigning-GOVERNANCE
calvinaco Jun 15, 2021
f9804b4
Update lib/src/transaction/msg/gov/MsgSubmitProposal.spec.ts
cdc-Hitesh Jun 15, 2021
07059c2
Update lib/src/transaction/msg/gov/MsgSubmitProposal.ts
cdc-Hitesh Jun 15, 2021
4e0c80e
Update lib/src/transaction/msg/gov/MsgSubmitProposal.spec.ts
cdc-Hitesh Jun 15, 2021
6eb809f
Added structure integrity checks #274
cdc-Hitesh Jun 15, 2021
284c785
Merge pull request #253 from cdc-Hitesh/enhancement-offlineSigning-GO…
calvinaco Jun 16, 2021
23ddeaf
Merge branch 'tx-revamp-dev' into feature-offlineSigning-distribution
calvinaco Jun 16, 2021
cc9a82c
Merge pull request #249 from cdc-Hitesh/feature-offlineSigning-distri…
calvinaco Jun 16, 2021
e8368a1
Merge branch 'tx-revamp-dev' into 246/feature-nft-offlinesigning
calvinaco Jun 16, 2021
35b4d60
#278 - Support amount list for MsgSend
cdc-Hitesh Jun 16, 2021
916a1dc
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jun 16, 2021
eff510b
#278 - Eslint fixes
cdc-Hitesh Jun 16, 2021
3e15e34
REmove Todos
cdc-Hitesh Jun 16, 2021
87e329f
#281 / MsgFundCommunityPool Support
cdc-Hitesh Jun 16, 2021
f596f79
#281: Remove & fix Todo
cdc-Hitesh Jun 16, 2021
e25a03b
#281: Remove Todo
cdc-Hitesh Jun 16, 2021
1adbd77
Merge pull request #271 from cdc-Hitesh/246/feature-nft-offlinesigning
calvinaco Jun 18, 2021
e2cf4b3
Merge branch 'tx-revamp-dev' into #272/bugfix-authInfo
calvinaco Jun 18, 2021
489f127
#272: Add unit test
cdc-Hitesh Jun 21, 2021
b4cd088
#272: Integration test with `.setFee`
cdc-Hitesh Jun 21, 2021
433d44c
#272: Eslint
cdc-Hitesh Jun 21, 2021
fc0bab6
#272: Fix Integration test
cdc-Hitesh Jun 21, 2021
bdbf95d
#284:
cdc-Hitesh Jun 21, 2021
475e285
#284: Support MsgUpdateClient
cdc-Hitesh Jun 22, 2021
d19c60d
#284: Fix Owtypes & typo
cdc-Hitesh Jun 22, 2021
ae9445e
Merge branch '#284/ibc-MsgCreateClient' of https://github.com/cdc-Hit…
cdc-Hitesh Jun 22, 2021
c0d57b3
#284: Support MsgUpgradeClient
cdc-Hitesh Jun 22, 2021
91aff9b
#284: MsgSubmitMisbehaviour support
cdc-Hitesh Jun 22, 2021
184f865
#272 Feedback change .forEach to .map
cdc-Hitesh Jun 23, 2021
67ab8f1
#272: Typo fix
cdc-Hitesh Jun 23, 2021
4a3b227
Merge pull request #277 from cdc-Hitesh/#272/bugfix-authInfo
calvinaco Jun 23, 2021
8bf3523
Merge branch 'tx-revamp-dev' into #278/MsgSend-AmountList
calvinaco Jun 23, 2021
7768954
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jun 24, 2021
95efe24
Update lib/src/transaction/msg/bank/msgsend.ts
cdc-Hitesh Jun 4, 2021
40255fe
#278: Introduce v2 version & fixed test cases
cdc-Hitesh Jun 24, 2021
615af59
#278: Eslint fixes
cdc-Hitesh Jun 24, 2021
450ccc2
#278: Feedback improvement, change name
cdc-Hitesh Jun 28, 2021
dd7be09
Merge pull request #280 from cdc-Hitesh/#278/MsgSend-AmountList
calvinaco Jun 28, 2021
0f0f8af
Merge branch 'tx-revamp-dev' into #281/support-amountList
calvinaco Jun 28, 2021
3230f64
#281: Introduce v2 version for MsgFundCommunityPool
cdc-Hitesh Jun 29, 2021
3c0e97e
Fix: MsgSend legacy version #281
cdc-Hitesh Jun 29, 2021
27e7b7b
#281: `MsgDeposit` support for multiple denoms
cdc-Hitesh Jun 29, 2021
445451e
Typo Fix
cdc-Hitesh Jun 29, 2021
d23975b
#281: Support MsgFundCommunitypool for V2
cdc-Hitesh Jun 29, 2021
734a896
#281: MsgSubmitProposal supported for v2
cdc-Hitesh Jun 29, 2021
a837279
Undo file commit
cdc-Hitesh Jun 30, 2021
e21a3ce
#281: Bug fix
cdc-Hitesh Jul 2, 2021
792a001
Merge pull request #282 from cdc-Hitesh/#281/support-amountList
calvinaco Jul 5, 2021
4c00d3f
Merge branch 'tx-revamp-dev' of https://github.com/cdc-Hitesh/chain-j…
cdc-Hitesh Jul 7, 2021
36e1c60
#215: MsgTransfer fix ibc
cdc-Hitesh Jul 7, 2021
1a5a73a
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jul 7, 2021
71c5888
Merge pull request #216 from cdc-Hitesh/feature-ibc-tx-transfer
crypto-eddy Jul 7, 2021
fd3f439
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jul 8, 2021
b2f852c
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jul 8, 2021
3fc0f4c
Change MsgCreateClient #284
cdc-Hitesh Jul 8, 2021
44b1daf
Merge pull request #221 from cdc-Hitesh/feature-ibc-queryExtension
crypto-eddy Jul 8, 2021
768d4de
Merge branch 'tx-revamp-dev' into #284/ibc-MsgCreateClient
crypto-eddy Jul 8, 2021
d51008d
Merge pull request #285 from cdc-Hitesh/#284/ibc-MsgCreateClient
calvinaco Jul 8, 2021
4e432a3
Merge branch '#284/ibc-MsgCreateClient' of https://github.com/cdc-Hit…
cdc-Hitesh Jul 8, 2021
b36cb14
#284: Support MsgUpdateClient
cdc-Hitesh Jul 8, 2021
0065f3c
MsgCreateClient fixed.
cdc-Hitesh Jul 8, 2021
d7832d3
Merge branch 'tx-revamp-dev' into #284/ibc-MsgUpdateClient
crypto-eddy Jul 12, 2021
da8cc2f
Merge pull request #286 from cdc-Hitesh/#284/ibc-MsgUpdateClient
crypto-eddy Jul 12, 2021
bbbc4e5
Merge branch 'tx-revamp-dev' into #284/ibc-MsgUpgradeClient
crypto-eddy Jul 12, 2021
be902ce
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jul 12, 2021
9c82655
#284: Adding offline signing decoding support
cdc-Hitesh Jul 12, 2021
50b0e72
Merge branch '#284/ibc-MsgUpgradeClient' of https://github.com/cdc-Hi…
cdc-Hitesh Jul 12, 2021
44c04c4
Merge branch '#284/ibc-MsgUpgradeClient' of https://github.com/cdc-Hi…
cdc-Hitesh Jul 12, 2021
1eea6b1
#284: MsgSubmitBhevaiour supports offline signing
cdc-Hitesh Jul 12, 2021
30d24ff
Merge pull request #287 from cdc-Hitesh/#284/ibc-MsgUpgradeClient
crypto-eddy Jul 13, 2021
f7c33ba
Merge branch 'tx-revamp-dev' into #284/ibc-MsgSubmitMisbehaviour
crypto-eddy Jul 13, 2021
d6b1740
Merge pull request #288 from cdc-Hitesh/#284/ibc-MsgSubmitMisbehaviour
crypto-eddy Jul 13, 2021
f7d08fb
Add unit test coverage
cdc-Hitesh Jul 13, 2021
ba84216
Merge pull request #299 from cdc-Hitesh/add-unit-test-coverage
crypto-eddy Jul 13, 2021
82c3a0a
Feedback improvments
cdc-Hitesh Jul 13, 2021
11f7903
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Jul 13, 2021
974285f
Feedback reverse
cdc-Hitesh Jul 13, 2021
222d299
Merge pull request #301 from cdc-Hitesh/tx-revamp-dev
crypto-eddy Jul 13, 2021
be47e9e
Introduced V2 version for `SignableTransaction`
cdc-Hitesh Jul 14, 2021
543b800
- Restructure V2 Tx placements
cdc-Hitesh Jul 14, 2021
019ca52
Added test cases for V2 SignableTransaction
cdc-Hitesh Jul 14, 2021
4a0fcf4
e2e test case change, amino test case
cdc-Hitesh Jul 14, 2021
6a077fe
Add unit tests
cdc-Hitesh Jul 14, 2021
af7d4f3
Add unit tests
cdc-Hitesh Jul 14, 2021
d77df50
CommunityPoolSpend unit tests
cdc-Hitesh Jul 14, 2021
aed9c55
Add unit tests
cdc-Hitesh Jul 14, 2021
2b613f6
V2 Signable added unit tests
cdc-Hitesh Jul 14, 2021
1b655ed
Merge pull request #302 from cdc-Hitesh/tx-revamp-dev
crypto-eddy Jul 14, 2021
36ad82e
Introduced `CoinV2` and `Readme` updated
cdc-Hitesh Jul 15, 2021
ee39aa6
Merge pull request #303 from cdc-Hitesh/update-readme-offline
crypto-eddy Jul 15, 2021
980ec19
Indentation fixes for Readme.md
cdc-Hitesh Jul 19, 2021
3473819
Merge pull request #304 from cdc-Hitesh/tx-revamp-dev
calvinaco Jul 19, 2021
6fe50d9
Update package.json
cdc-Hitesh Jul 22, 2021
ac4e847
Update lib/src/transaction/msg/bank/msgsend.spec.ts
cdc-Hitesh Jul 22, 2021
0e07f3a
Feedback change,
cdc-Hitesh Jul 22, 2021
c9dca7a
COINV2 ADDED UNIT TESTS
cdc-Hitesh Jul 22, 2021
97ef99a
Merge pull request #307 from cdc-Hitesh/tx-revamp-dev
crypto-eddy Jul 23, 2021
c3a949d
(Fix #308) (Fix #309)
calvinaco Jul 25, 2021
f550975
Update README
calvinaco Jul 25, 2021
5958136
Fix test cases
calvinaco Jul 25, 2021
6824fcc
Add legacy multisig key to typeurls
calvinaco Jul 26, 2021
8039a7d
Fix GitHub actions warnings
calvinaco Jul 26, 2021
89d08a5
Update lint rules
calvinaco Jul 26, 2021
c58948a
Revert lint rules
calvinaco Jul 26, 2021
0edde94
Eslint rule changes
cdc-Hitesh Jul 26, 2021
801bf44
Eslint disable
cdc-Hitesh Jul 26, 2021
ddbce51
Add `MsgCreateValidator` fixes
cdc-Hitesh Jul 26, 2021
9a80f66
Handle `MsgEditValidator`
cdc-Hitesh Jul 26, 2021
2a9c2a2
Fix `MsgCreateValidator` class and TxDecoding
cdc-Hitesh Jul 26, 2021
7d04975
Remove unneccessary code
cdc-Hitesh Jul 26, 2021
1f5e24b
Add unit tests and change txDecoder
cdc-Hitesh Jul 26, 2021
d3cbfe5
Added unit test cases.
cdc-Hitesh Jul 27, 2021
2fed1b8
lint fix | remove unused code
cdc-Hitesh Jul 27, 2021
f73288e
Owtypes covered
cdc-Hitesh Jul 27, 2021
3a7ca39
Added IBC lightclients type definitions
cdc-Hitesh Jul 27, 2021
343c261
Update lib/src/transaction/v2.raw.ts
calvinaco Jul 27, 2021
a6ddca0
Introduced LightClient ClientState Message type
cdc-Hitesh Jul 27, 2021
fe3a2d8
Merge branch 'eslint-ruleFixes' of https://github.com/cdc-Hitesh/chai…
cdc-Hitesh Jul 27, 2021
5a9890c
Manual override tendermint package
cdc-Hitesh Jul 27, 2021
5e120bb
Added extra unit tests
cdc-Hitesh Jul 27, 2021
6b1a527
Added unit tests
cdc-Hitesh Jul 27, 2021
c1c6af5
ConsensusState Lightclient added.
cdc-Hitesh Jul 28, 2021
59d6677
- ClientState introduced
cdc-Hitesh Jul 28, 2021
82dc427
TxDecoder Added support for MsgCreateClient
cdc-Hitesh Jul 28, 2021
db34fe8
- Added Header for MsgUpdateClient
cdc-Hitesh Jul 29, 2021
9cefe3a
added msgHeader to core cro.ts
cdc-Hitesh Jul 29, 2021
80525d1
Renaming Unit tests and file name.
cdc-Hitesh Jul 29, 2021
892a568
Merge branch 'eslint-ruleFixes' of https://github.com/cdc-Hitesh/chai…
cdc-Hitesh Jul 29, 2021
3863129
merge branch 'IBC-ConsensusState' of https://github.com/cdc-Hitesh/ch…
cdc-Hitesh Jul 29, 2021
58c9bb1
Added Header and unit tests.
cdc-Hitesh Jul 29, 2021
8ece43b
Updated MsgUpdateClient
cdc-Hitesh Jul 29, 2021
8b5a2ce
Update lib/src/transaction/v2.raw.ts
calvinaco Jul 29, 2021
55fffcb
MsgUpdateClient .toCosmosJSON support
cdc-Hitesh Jul 30, 2021
e19d34b
MsgConnectionOpenConfirm support added
cdc-Hitesh Aug 2, 2021
95fee68
TxDecoder support #323
cdc-Hitesh Aug 2, 2021
c0cc1ec
MsgConnectionOpenTry introduce
cdc-Hitesh Aug 2, 2021
7a65a8a
Throw on unsupported param in SoftwareUpgradeProposal
cdc-Hitesh Aug 2, 2021
7e6fc7f
Merge branch 'eslint-ruleFixes' of https://github.com/cdc-Hitesh/chai…
cdc-Hitesh Aug 2, 2021
9de2ec6
Update lib/src/transaction/msg/gov/proposal/SoftwareUpgradeProposal.s…
calvinaco Aug 2, 2021
c34dc7a
Merge pull request #313 from cdc-Hitesh/eslint-ruleFixes
cdc-Hitesh Aug 2, 2021
5aadda2
MsgConnectionOpenTry Support | Unit tests | Typeurl
cdc-Hitesh Aug 2, 2021
57a99d9
Merge branch 'tx-revamp-dev' into IBC-ConsensusState
calvinaco Aug 2, 2021
d7e1e43
Merge pull request #315 from cdc-Hitesh/IBC-ConsensusState
calvinaco Aug 2, 2021
be38011
Merge branch 'tx-revamp-dev' into IBC-MsgUpdateClient
calvinaco Aug 2, 2021
286d52f
MsgConnectionOpenTry unit tests and TxDecoder support
cdc-Hitesh Aug 2, 2021
b32853a
Merge branch 'tx-revamp-dev' into IBC-connection-msgTypes
cdc-Hitesh Aug 2, 2021
9ee01d7
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Aug 2, 2021
1170733
Merge branch 'IBC-connection-msgTypes' of https://github.com/cdc-Hite…
cdc-Hitesh Aug 2, 2021
5ca04bd
- Added unit tests.
cdc-Hitesh Aug 2, 2021
1624ff8
Merge pull request #319 from cdc-Hitesh/IBC-MsgUpdateClient
calvinaco Aug 3, 2021
9c2a6a6
Merge branch 'tx-revamp-dev' of https://github.com/crypto-org-chain/c…
cdc-Hitesh Aug 3, 2021
c82b19b
Merge pull request #324 from cdc-Hitesh/IBC-connection-msgTypes
calvinaco Aug 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,5 @@
lib/**/codec/generated/codecimpl.*
lib/dist
docs
*/**/*.md
*/**/*.json
154 changes: 152 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -151,8 +151,158 @@ const queryResult = await client.query().<module>.<operation>
// example client.query().bank.allBalances(<address>)
```

### 1.6. Transaction Decoding/Encoding support
Our SDK supports transaction decoding from hex-encoded strings.

## 2. Cosmos Protobuf Definitions
```typescript
import { TxDecoder } from './txDecoder';
const txDecoder = new TxDecoder();
const decodedTx = txDecoder.fromHex('0a9b010a8c010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126c0a2b7463726f31667a63727a61336a3466323637376a667578756c6b6733337a36383532717371733868783530122b7463726f31667a63727a61336a3466323637376a667578756c6b6733337a363835327173717338687835301a100a08626173657463726f120431303030120a616d696e6f2074657374126b0a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a210223c9395d41013e6470c8d27da8b75850554faada3fe3e812660cbdf4534a85d712040a020801180112170a110a08626173657463726f1205313030303010a08d061a4031f4c489b98decb367972790747139c7706f54aafd9e5a3a5ada4f72c7b017646f1eb5cb1bdf518603d5d8991466a13c3f68844dcd9b168b5d4ca0cb5ea514bc');

//Prints decoded in Cosmos compatible JSON format
console.log(decodedTx.toCosmosJSON())

// Prints
// "{"tx":{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","amount":[{"denom":"basetcro","amount":"1000"}],"from_address":"tcro1fzcrza3j4f2677jfuxulkg33z6852qsqs8hx50","to_address":"tcro1fzcrza3j4f2677jfuxulkg33z6852qsqs8hx50"}],"memo":"amino test","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AiPJOV1BAT5kcMjSfai3WFBVT6raP+PoEmYMvfRTSoXX"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"1"}],"fee":{"amount":[{"denom":"basetcro","amount":"10000"}],"gas_limit":"100000","payer":"","granter":""}},"signatures":["MfTEibmN7LNnlyeQdHE5x3BvVKr9nlo6WtpPcsewF2RvHrXLG99RhgPV2JkUZqE8P2iETc2bFotdTKDLXqUUvA=="]}}"

```

### 1.7. Offline Signing
Our SDK supports offline signing for secure external transaction management.

#### Flow:
Machine 1 (Online):
1. Build a `RawTransactionV2` instance.
2. Export Cosmos compatible JSON by using `.toCosmosJSON()`.
3. Export Signer(s) list using `.exportSignerAccounts()`.

Machine 2 (Offline/Online):
1. Create a `SignableTransactionV2` instance from a stringified cosmos compatible JSON string.
2. You can import Signer(s) list using two methods:
1. call `importSignerAccounts()` on the instance above **OR**
2. (Advance usage) call `setSignerAccountNumberAtIndex()` to manually set AccountNumber at a specified index.
3. You can choose to export the signed hex encoded transaction and broadcast it manually

Eg:
```typescript
// import respective classes
// ....

/* Machine 1: */
const rawTx = new cro.v2.RawTransactionV2();
// .... Do rest operations here
const exportUnsignedCosmosJSON = rawTx.toCosmosJSON();
const exportSignerInfoToJSON = rawTx.exportSignerAccounts();

/* Machine 2: */
const signerAccountsOptional: SignerAccount[] = cro
.v2
.RawTransactionV2
.parseSignerAccounts(exportSignerInfoToJSON);
/* SignerAccount[] has the structure of
[{
publicKey: <Bytes>;
accountNumber: new Big(0);
signMode: SIGN_MODE.DIRECT;
}];
*/

const signableTx = new SignableTransactionV2({
rawTxJSON: exportUnsignedCosmosJSON,
network: <CroNetwork>,
signerAccounts: signerAccountsOptional,
});

/* `Import SignerAccounts` starts */

// METHOD 1: using importSignerAccounts()
signableTx.importSignerAccounts([
// SignerAccount 1
{
publicKey: Bytes.fromHexString('hexString');
accountNumber: new Big(0);
signMode: SIGN_MODE.DIRECT;
},
// SignerAccount 2
{
publicKey: Bytes.fromUint8Array(<Uint8>);
accountNumber: new Big(2);
signMode: SIGN_MODE.DIRECT;
}
]);

// METHOD 2 (For Advance Users): using setSignerAccountNumberAtIndex()
const signerInfoListINDEX: number = 1;
const newAccountNumber: Big = new Big(1);
signableTx.setSignerAccountNumberAtIndex(signerInfoListINDEX, newAccountNumber);

/* `Import SignerAccounts` ends */

// .... Do rest operations here on SignableTransaction

const signedTx = signableTx.toSigned();

console.log(signedTx.getHexEncoded());
// 0aa4010a8c010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e64126c0a2b7463726f313635747a63726832796c3833673871657178756567326735677a6775353779336665336b6333122b7463726f313635747a63726832796c3833673871657178756567326735677a6775353779336665336b63331a100a08626173657463726f120431323130120f48656c6c6f2054657374204d656d6f1896ef14126a0a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103c3d281a28592adce81bee3094f00eae26932cbc682fba239b90f47dac9fe703612040a020801180d12160a100a08626173657463726f12043635303010c08b111a40fe9b30f29bb9a83df3685f5bf8b7e6c34bae9ee8ba93115af4136289354c5bf947698ef3a3c0a1f6092ba7a2069616c436f4bcf6f3ecef11b92ad4d319ec0347

// Note that the result of signedTx.getHexEncoded() can be directly broadcasted to the network as a raw tx

```


### 1.8. Create a message from Cosmos compatible JSON
All **Cosmos message** types supported on our SDK can be instantiated using the function `.fromCosmosMsgJSON()` on respective classes. You need to pass a valid Msg `JSON` string and a `network` instance.
Eg.
```typescript
const msgSendJson ='{ "@type": "/cosmos.bank.v1beta1.MsgSend", "amount": [{ "denom": "basetcro", "amount": "3478499933290496" }], "from_address": "tcro1x07kkkepfj2hl8etlcuqhej7jj6myqrp48y4hg", "to_address": "tcro184lta2lsyu47vwyp2e8zmtca3k5yq85p6c4vp3" }';

const msgSend = cro.v2.bank.MsgSendV2.fromCosmosMsgJSON(msgSendJson, CroNetwork.Testnet);
// `msgSend` is a valid instance of `MsgSendV2` and can be used for Transaction building


const msgFundCommunityPoolJson = '{"@type":"/cosmos.distribution.v1beta1.MsgFundCommunityPool","amount":[{ "denom": "basetcro", "amount": "3478499933290496" }],"depositor":"tcro165tzcrh2yl83g8qeqxueg2g5gzgu57y3fe3kc3"}';

const msgFundCommPool = cro.v2.distribution.MsgFundCommunityPoolV2.fromCosmosMsgJSON(msgFundCommunityPoolJson, CroNetwork.Testnet);
// `msgFundCommPool`is a valid instance of `MsgFundCommunityPoolV2` and can be used for Transaction building

```

## 2. Introducing `V2` message types
Our SDK has introduced `V2` message types in order to support:
- Custom `denom`
- Multiple `amount` in several Cosmos Message types
- Multiple `fee` amount in `SignerInfo`

You can use the `v2` property on the `CroSDK` instance like in the example below:

```typescript
// imports here

const cro = CroSDK({ network: sdk.CroNetwork.Testnet });

// v2 methods below
const coin1 = new cro.Coin('88888888', Units.BASE);
const coin2 = new cro.Coin('99999999', Units.BASE);
const msgSendV2 = new cro.v2.bank.MsgSendV2({
fromAddress: 'tcro165tzcrh2yl83g8qeqxueg2g5gzgu57y3fe3kc3',
toAddress: 'tcro184lta2lsyu47vwyp2e8zmtca3k5yq85p6c4vp3',
amount: [coin1, coin2],
});
```

### 2.1 List of new `V2` methods

* New classes for external transaction management:
- `RawTransactionV2`
- `.toCosmosJSON()` : Get a Cosmos-sdk compatible JSON string
- `.exportSignerAccounts()` : Exports a human readable JSON of `SignerAccount`
- `appendFeeAmount(...)` : Add multiple fee amount to `SignerInfo` list
- `CoinV2` : Supports custom denom support
- `SignableTransactionV2` : Load your Cosmos Tx JSON for transaction management.

Please note new message types may be added under the `CroSDK` instance.

## 3. Cosmos Protobuf Definitions

### Generate Cosmos Protobuf Definitions in JavaScript

@@ -191,4 +341,4 @@ npm run docs:build
The resulting generated documentation will be created in the `docs/dist` directory

## 4. License
[Apache 2.0](./LICENSE)
[Apache 2.0](./LICENSE)
2 changes: 2 additions & 0 deletions lib/e2e/offline-signing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chain-maind
home/
23 changes: 23 additions & 0 deletions lib/e2e/offline-signing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Offline Signing End-to-End Test

This test will compare the offline signing results of chain-maind and the JSlib.

## How to run

### 1. Go to correct directory
```bash
cd ./lib/e2e/offling-signing
```

### 2. Download latest `chain-maind` release to the folder

https://github.com/crypto-com/chain-main/releases

### 3. Run compare tool
```bash
# Go to jslib root directory
cd ../../../
npm run test:e2e:offline-signing
```

The test will take some time to complete.
Loading