Skip to content

Commit d809068

Browse files
authored
Improved and fixed doc typos
1 parent 1b7bdfb commit d809068

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

README.md

+35-10
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ communicate with BuyCoins Graphql api easily. Integrates easily with vanilla js
2424
```js
2525
const { setupBCoins } = require("bcoins");
2626

27-
//second parameter is supposed to the browser fetch, by default it uses node-fetch
27+
//second parameter is supposed to be the browser fetch, by default it uses node-fetch
2828
const bcoins = setupBCoins({
2929
publicKey: "pass_public_key",
3030
secretKey: "pass_secret_key",
3131
}, fetch);
3232

3333
//call an endpoint
34-
//bcoins returns several other methods see documentation down
34+
//bcoins returns several other methods, see documentation below
3535
bcoins
3636
.getDynamicPriceExpiry({ status: "open" })
3737
.then((res) => console.log(res));
@@ -40,7 +40,7 @@ bcoins
4040

4141
## In React with @apollo/client
4242

43-
###In your root component
43+
### In your root component
4444
```js
4545
import React from 'react';
4646
import { render } from 'react-dom';
@@ -56,7 +56,7 @@ function App() {
5656
return (
5757
<ApolloProvider client={bcoins.client}>
5858
<div>
59-
<h2>My first Apollo app 🚀</h2>
59+
<h2>My first BuyCoins Apollo app 🚀</h2>
6060
</div>
6161
</ApolloProvider>
6262
);
@@ -115,11 +115,11 @@ function AddTodo() {
115115
###
116116
```
117117
118-
Also Integates seamlesslly with Vue and Apollo Client
118+
Also Integates seamlessly with Vue and Apollo Client
119119
120120
# Documentation
121121
122-
You can check out the official BuyCoins Documentation on their [website](https://developers.buycoins.africa/) for more detailed explanations of how each query/mutuation works. This library implements all the possible queries and mutuations in the BuyCoins docs except for webhook section.
122+
You can check out the official BuyCoins Documentation on their [website](https://developers.buycoins.africa/) for more detailed explanations of how each query/mutuation works. This library implements all the possible queries and mutuations in the BuyCoins docs except the webhook section.
123123
124124
In order to support both usage in vanilla js and easy integration with Apollo client and other Js frameworks, the library export a setupBCoins function, which is used for the initial authorization setup and in addition exports all the methods which calls the different graphql queries and mutuations api calls
125125
@@ -133,9 +133,24 @@ const bcoins = setupBCoins({
133133
}, fetch);
134134

135135
//bcoins returns several other methods
136-
bcoins
137-
.getDynamicPriceExpiry({ status: "open" })
138-
.then((res) => console.log(res));
136+
// bcoins = {
137+
// client,
138+
// createVirtualDepositAccount: (request) => mutationWrapper(client, CREATE_VIRTUAL_DEPOSIT_ACCOUNT, request) ,
139+
// getBuyCoinsPrices: (request) => queryWrapper(client, CURRENT_BUYCOINS_PRICE, request),
140+
// getDynamicPriceExpiry: (request) => queryWrapper(client, DYNAMIC_PRICE_EXPIRY, request),
141+
// placeLimitingOrder: (request) => mutationWrapper(client, PLACING_LIMIT_ORDER, request),
142+
// placeMarketOrder: (request) => mutationWrapper(client, PLACING_MARKET_ORDER, request),
143+
// getOrders: (request) => queryWrapper(client, GET_ORDERS, request),
144+
// getMarketBook: (request) => queryWrapper(client, GET_MARKET_BOOK, request),
145+
// getSingleCryptoPrice: (request) => queryWrapper(client, GET_SINGLE_CRYPTO_PRICE,request),
146+
// getPrices: (request) => queryWrapper(client, GET_PRICES,request),
147+
// buyCrypto: (request) => mutationWrapper(client, BUY_CRYPTO, request),
148+
// sellCrypto: (request) => mutationWrapper(client, SELL_CRYPTO, request),
149+
// getEstimatedNetworkFee: (request) => queryWrapper(client, GET_ESTIMATED_NETWORK_FEE, request),
150+
// sendCrypto: (request) => mutationWrapper(client, SEND_CRYPTO, request),
151+
// getBalances: (request) => queryWrapper(client, GET_BALANCES, request),
152+
// createAddress: (request) => mutationWrapper(client, CREATE_ADDRESS, request),
153+
// };
139154
```
140155
141156
the client object returned from creating an Apolloclient instance (whcich contains our uri and authorization header is also returned from the setup client function and can be accessed thus:
@@ -144,6 +159,8 @@ the client object returned from creating an Apolloclient instance (whcich contai
144159
bcoins.client
145160
```
146161
162+
## Calling The API
163+
147164
```js
148165
//pass in objects with the field specied in each call as keys and with the appropriate values (please refer to the official docs)
149166

@@ -196,9 +213,17 @@ import {
196213
} from 'bcoins';
197214
```
198215
199-
for the queries call them with the needed arguments and pass result to the useQuery hooks from Apollo client as shown in the React - Apollo section, while for the mutuations just call them without any arguments and pass the result into the useMutation hook, then the resulting function (the first argument returned from the useMutation hook) will now be usedto pass in a variables object. (also refer to the React - Apollo section to see an example.
216+
for the queries call them with the needed arguments and pass result to the useQuery hooks from Apollo client as shown in the React - Apollo section above, while for the mutuations just call them without any arguments and pass the result into the useMutation hook, then the resulting function (the first argument returned from the useMutation hook) will now be used to pass in a variables object. (also refer to the React - Apollo section to see an example.
217+
218+
# Contributing
219+
220+
Bugs? Comments? Features? PRs and Issues happily welcomed!
221+
222+
# Moving Forward
200223
224+
- migration to typescript
201225
226+
- implementation of tests
202227
203228
204229

0 commit comments

Comments
 (0)