Skip to content

Commit f0644c6

Browse files
author
James0126
authored
chore: readme
1 parent f446c6f commit f0644c6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# msg-reader
2+
Convert common terra.js msg to a sentence
3+
4+
## Installation
5+
6+
```
7+
npm i @terra-money/msg-parser
8+
```
9+
10+
## Example codes
11+
```typescript
12+
13+
import { Coins } from "@terra-money/terra.js"
14+
import { readMsg } from "@terra-money/msg-parser"
15+
16+
const coins = new Coins([new Coin("uluna", 1000000), new Coin("ukrw", 1000000)])
17+
18+
const address = "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v"
19+
const recipient = "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp"
20+
21+
const msg = new MsgSend(address, recipient, [coin])
22+
23+
console.log(readMsg(msg))
24+
// Send 1 Luna to terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp
25+
26+
```

0 commit comments

Comments
 (0)