Skip to content

Commit 2304c44

Browse files
committed
docs: document only what works in tests
1 parent 8c09437 commit 2304c44

File tree

2 files changed

+22
-48
lines changed

2 files changed

+22
-48
lines changed

packages/cosmic-proto/README.md

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ import { agoric } from '@agoric/cosmic-proto';
3737
const { createRPCQueryClient } = agoric.ClientFactory;
3838
const client = await createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT });
3939

40-
// now you can query the cosmos modules
41-
const balance = await client.cosmos.bank.v1beta1
42-
.allBalances({ address: 'agoric1addresshere' });
43-
44-
// you can also query the agoric modules
4540
const swingsetParams = await client.agoric.swingset.params()
4641
```
4742

@@ -57,49 +52,6 @@ const {
5752
} = agoric.exchange.v1beta1.MessageComposer.withTypeUrl;
5853
```
5954

60-
#### IBC Messages
61-
62-
```js
63-
import { ibc } from '@agoric/cosmic-proto';
64-
65-
const {
66-
transfer
67-
} = ibc.applications.transfer.v1.MessageComposer.withTypeUrl
68-
```
69-
70-
#### Cosmos Messages
71-
72-
```js
73-
import { cosmos } from '@agoric/cosmic-proto';
74-
75-
const {
76-
fundCommunityPool,
77-
setWithdrawAddress,
78-
withdrawDelegatorReward,
79-
withdrawValidatorCommission
80-
} = cosmos.distribution.v1beta1.MessageComposer.fromPartial;
81-
82-
const {
83-
multiSend,
84-
send
85-
} = cosmos.bank.v1beta1.MessageComposer.fromPartial;
86-
87-
const {
88-
beginRedelegate,
89-
createValidator,
90-
delegate,
91-
editValidator,
92-
undelegate
93-
} = cosmos.staking.v1beta1.MessageComposer.fromPartial;
94-
95-
const {
96-
deposit,
97-
submitProposal,
98-
vote,
99-
voteWeighted
100-
} = cosmos.gov.v1beta1.MessageComposer.fromPartial;
101-
```
102-
10355
## Connecting with Wallets and Signing Messages
10456

10557
⚡️ For web interfaces, we recommend using [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit). Continue below to see how to manually construct signers and clients.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/** @file snippets from the README */
2+
/* eslint-disable import/no-extraneous-dependencies -- requiring the package itself to check exports map */
3+
/* eslint-disable import/no-unresolved -- not detecting the "exports" map */
4+
import test from 'ava';
5+
6+
import { agoric } from '../dist/index.js';
7+
8+
const RPC_ENDPOINT = '';
9+
10+
// Skip because we don't have a real endpoint, still tests the types
11+
test.skip('RPC Clients', async t => {
12+
const { createRPCQueryClient } = agoric.ClientFactory;
13+
const client = await createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT });
14+
15+
const swingsetParams = await client.agoric.swingset.params();
16+
t.truthy(swingsetParams);
17+
});
18+
19+
test('Composing Messages', t => {
20+
const { sendPacket } = agoric.vibc.MessageComposer.withTypeUrl;
21+
t.truthy(sendPacket);
22+
});

0 commit comments

Comments
 (0)