
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@huma-shan/request-logic
Advanced tools
@huma-shan/request-logic is a typescript library part of the Request Network protocol.
It is the default implementation of the Request Logic layer. This layer is responsible for the business logic: properties and actions of requests.
Request logic creates actions, that are signed and sends them to the layer below, Transaction.
npm install @huma-shan/request-logic
See packages/usage-examples/request-logic.ts.
createRequest : create a requestcreateEncryptedRequest : create an encrypted requestacceptRequest : accept a requestcancelRequest : cancel a requestincreaseExpectedAmountRequest : increase the amount of a requestreduceExpectedAmountRequest : reduce the amount of a requestgetFirstRequestFromTopic : get the first request from the actions indexed by a topic (should be used with requestId)getRequestsByTopic : get all the requests for a topiccomputeRequestId : compute the ID of a request before actually creating it.When an action is sent to the Transaction layer, strings named topics can be attached to it. These topics are used to index the action and, therefore, allow to retrieve it later in order to reconstruct the request.
Every action has at least its request id as a topic.
When creating a request, arbitrary topics can be attached to the createRequest action to index the request. For example, it can be the identity of the request creator in order to be able, later, to retrieve every request created by a user. Other actions than createRequest doesn't need additional topics since it contains the request id that can be linked to the corresponding createRequest action of the request.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Read the contributing guide
FAQs
Main package for the Request Network logic layer.
We found that @huma-shan/request-logic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.