File tree Expand file tree Collapse file tree 2 files changed +22
-48
lines changed
Expand file tree Collapse file tree 2 files changed +22
-48
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,6 @@ import { agoric } from '@agoric/cosmic-proto';
3737const { createRPCQueryClient } = agoric .ClientFactory ;
3838const 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
4540const 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.
Original file line number Diff line number Diff line change 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+ } ) ;
You can’t perform that action at this time.
0 commit comments