juno-network 0.1.5 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -16
- package/main/index.js +5 -1
- package/module/index.js +9 -1
- package/package.json +2 -2
package/README.md
CHANGED
@@ -18,6 +18,8 @@ TS library with Cosmos SDK and JunoSwap smart contracts.
|
|
18
18
|
npm install juno-network
|
19
19
|
```
|
20
20
|
|
21
|
+
### Cosmos SDK clients
|
22
|
+
|
21
23
|
```js
|
22
24
|
import { juno } from 'juno-network';
|
23
25
|
|
@@ -31,8 +33,59 @@ const main = async () => {
|
|
31
33
|
|
32
34
|
### JunoSwap contracts
|
33
35
|
|
36
|
+
## clients
|
37
|
+
|
34
38
|
```js
|
35
39
|
import { contracts } from 'juno-network';
|
40
|
+
const {
|
41
|
+
JunoSwap: {
|
42
|
+
JunoSwapClient,
|
43
|
+
JunoSwapQueryClient
|
44
|
+
}
|
45
|
+
} = contracts;
|
46
|
+
```
|
47
|
+
|
48
|
+
## Queries
|
49
|
+
|
50
|
+
```js
|
51
|
+
const queries = new JunoSwapQueryClient(
|
52
|
+
cosmwasmClient,
|
53
|
+
contractAddress
|
54
|
+
);
|
55
|
+
const amount = await queries.token1ForToken2Price({
|
56
|
+
token1Amount
|
57
|
+
});
|
58
|
+
```
|
59
|
+
## Mutations
|
60
|
+
|
61
|
+
```js
|
62
|
+
const client = new JunoSwapClient(
|
63
|
+
signingClient,
|
64
|
+
sender,
|
65
|
+
contractAddress
|
66
|
+
);
|
67
|
+
|
68
|
+
await client.addLiquidity({
|
69
|
+
maxToken2,
|
70
|
+
minLiquidity,
|
71
|
+
token1Amount,
|
72
|
+
expiration
|
73
|
+
});
|
74
|
+
```
|
75
|
+
|
76
|
+
### CosmWasm Messages
|
77
|
+
|
78
|
+
```js
|
79
|
+
import { cosmwasm } from "juno-network";
|
80
|
+
|
81
|
+
const {
|
82
|
+
clearAdmin,
|
83
|
+
executeContract,
|
84
|
+
instantiateContract,
|
85
|
+
migrateContract,
|
86
|
+
storeCode,
|
87
|
+
updateAdmin
|
88
|
+
} = cosmwasm.wasm.v1.MessageComposer.withTypeUrl;
|
36
89
|
```
|
37
90
|
|
38
91
|
### IBC Messages
|
@@ -77,22 +130,6 @@ const {
|
|
77
130
|
voteWeighted
|
78
131
|
} = cosmos.gov.v1beta1.MessageComposer.fromPartial;
|
79
132
|
```
|
80
|
-
|
81
|
-
### CosmWasm Messages
|
82
|
-
|
83
|
-
```js
|
84
|
-
import { cosmwasm } from "osmojs";
|
85
|
-
|
86
|
-
const {
|
87
|
-
clearAdmin,
|
88
|
-
executeContract,
|
89
|
-
instantiateContract,
|
90
|
-
migrateContract,
|
91
|
-
storeCode,
|
92
|
-
updateAdmin
|
93
|
-
} = cosmwasm.wasm.v1.MessageComposer.withTypeUrl;
|
94
|
-
```
|
95
|
-
|
96
133
|
## Credits
|
97
134
|
|
98
135
|
Code built with the help of these related projects:
|
package/main/index.js
CHANGED
@@ -15,4 +15,8 @@ Object.keys(_codegen).forEach(function (key) {
|
|
15
15
|
return _codegen[key];
|
16
16
|
}
|
17
17
|
});
|
18
|
-
});
|
18
|
+
});
|
19
|
+
// contracts.JunoSwap.JunoSwapClient
|
20
|
+
var _contracts$JunoSwap = _codegen.contracts.JunoSwap,
|
21
|
+
JunoSwapClient = _contracts$JunoSwap.JunoSwapClient,
|
22
|
+
JunoSwapQueryClient = _contracts$JunoSwap.JunoSwapQueryClient;
|
package/module/index.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "juno-network",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.8",
|
4
4
|
"description": "juno",
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
6
6
|
"homepage": "https://github.com/CosmosContracts/typescript#readme",
|
@@ -90,5 +90,5 @@
|
|
90
90
|
"@tanstack/react-query": "^4.1.3",
|
91
91
|
"protobufjs": "^6.11.2"
|
92
92
|
},
|
93
|
-
"gitHead": "
|
93
|
+
"gitHead": "bdbd73580f31a5ba79e613d55fc2539a2b8e6169"
|
94
94
|
}
|