Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(client): working on new doc #1861

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

docs(client): working on new doc #1861

wants to merge 16 commits into from

Conversation

javadkh2
Copy link
Collaborator

No description provided.

Copy link

changeset-bot bot commented Mar 21, 2024

⚠️ No Changeset found

Latest commit: bf7ee19

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Mar 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
proof-of-us ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 8:57pm
tools ❌ Failed (Inspect) Apr 30, 2024 8:57pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
alpha-docs ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 8:57pm
docs-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 8:57pm
react-ui ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2024 8:57pm

Copy link
Contributor

@lsgunnlsgunn lsgunnlsgunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly minor changes or nit picky things.
Stopped at line 1231.
I had a few questions in there and a little bit of creative license.
If you're okay with committing the changes. I'd be fine with pulling this into the docs this week and iterating further as a follow-on task

packages/libs/client/NEW_README.md Outdated Show resolved Hide resolved
Comment on lines 18 to 20
with smart contracts and the Kadena network. The library includes modules in
three categories: creating commands, signing transactions, and interacting with
the network.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with smart contracts and the Kadena network. The library includes modules in
three categories: creating commands, signing transactions, and interacting with
the network.
with smart contracts and Chainweb nodes on the Kadena network.
The library includes modules to help you with three types of common tasks:
- Create commands
- Sign transactions
- Interact with the network

Comment on lines 22 to 23
Do you only need to interact with the `coin` contract? Then check out
["@kadena/client-utils/coin"](../client-utils/README.md) for a simpler API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Do you only need to interact with the `coin` contract? Then check out
["@kadena/client-utils/coin"](../client-utils/README.md) for a simpler API.
If you only need to interact with the `coin` contract, see ["@kadena/client-utils/coin"](../client-utils/README.md) for a simpler API.

Comment on lines 25 to 27
In a nutshell, this library helps you create the command object with the
following structure and also send it to the network and listen for the result of
that.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In a nutshell, this library helps you create the command object with the
following structure and also send it to the network and listen for the result of
that.
In a nutshell, the Kadena client library helps you create **command** objects with the following structure that you can send to the network, then listen for the results returned:

Comment on lines 81 to 82
Do you prefer to learn from code? Then check out
[client-examples](../client-examples/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Do you prefer to learn from code? Then check out
[client-examples](../client-examples/).
If you prefer to learn from code, check out the
[client-examples](../client-examples/).

Comment on lines 1193 to 1199
fetch the result of the request.

#### Client: send

`send` is a deprecated alias for the `submit` function with the same interface.

#### Client: submitOne
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fetch the result of the request.
#### Client: send
`send` is a deprecated alias for the `submit` function with the same interface.
#### Client: submitOne

Copy link
Collaborator Author

@javadkh2 javadkh2 Apr 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean removing these lines? then don't we need documentation for Client: send and Client: submitOne


#### Client: submitOne

`submitOne` is an alias for the first overload of the `submit` function:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`submitOne` is an alias for the first overload of the `submit` function:
The `submitOne` function is the same as submitting one transaction using the `submit` function.
For example:


| Parameter | Type | Description |
| --------- | -------- | ---------------------------------- |
| tx | ICommand | The command object ready to submit |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| tx | ICommand | The command object ready to submit |
| tx | ICommand | The command object ready to submit |
Suggested change
| tx | ICommand | The command object ready to submit |
| tx | ICommand | The command object ready to submit. |

Comment on lines 1231 to 1232
No matter which function you use, the result of a transaction follows the
`ICommandResult` interface.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
No matter which function you use, the result of a transaction follows the
`ICommandResult` interface.
These functions all return the result of a transaction with the following `ICommandResult` interface:

Comment on lines 1215 to 1225
After you submit a transaction, you need to query for the result of the
transaction. You can do it by calling the `/listen` or `/poll` endpoint. There
are some differences between the two endpoints. `/listen` is a blocking request
that only accepts one request key and returns the results when it's ready. This
request keeps the HTTP request open for a while. On the other hand, `/poll`
accepts a list and responds immediately with the current status of the request
key.

The library exposes the following function which uses one of the endpoints and
designed for different scenarios:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After you submit a transaction, you need to query for the result of the
transaction. You can do it by calling the `/listen` or `/poll` endpoint. There
are some differences between the two endpoints. `/listen` is a blocking request
that only accepts one request key and returns the results when it's ready. This
request keeps the HTTP request open for a while. On the other hand, `/poll`
accepts a list and responds immediately with the current status of the request
key.
The library exposes the following function which uses one of the endpoints and
designed for different scenarios:
After you submit a transaction, you need to query for the result using a request key.
You can query transaction results by calling the `/listen` or `/poll` endpoint.
- The `/listen` endpoint is a blocking request. It only accepts one request key and returns the results when the transaction result is ready. If you use this endpoint, the HTTP request remains open for a while.
- The`/poll` endpoint accepts a list of request keys and responds immediately with the current status of the request key.
The Kadena client library exposes the following functions to use the /listen or /poll endpoint in different scenarios:

Copy link
Contributor

This PR is stale because it is open for 60 days with no activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants