-
Notifications
You must be signed in to change notification settings - Fork 10
docs: update SDK quickstart and request update guide #134
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
Merged
MantisClone
merged 7 commits into
RequestNetwork:main
from
AllenAJ:feat/advocate-onboarding-and-sdk-docs
Jan 28, 2026
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7c6248a
docs: add advocate welcome kit and update SDK quickstart
AllenAJ 087dc01
fix: correct viem tab and restore addStakeholders in docs
MantisClone 26bd317
fix: use consistent Discord link format
MantisClone f0060af
chore: remove Advocates Welcome Kit from technical docs
MantisClone 66eb942
Merge branch 'main' into feat/advocate-onboarding-and-sdk-docs
MantisClone 487f609
fix: use payerIdentity for consistency in quickstart update example
MantisClone e42f66d
fix: use *Identity naming convention and fix repo URL typo
MantisClone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 84 additions & 3 deletions
87
docs/advanced/request-network-sdk/sdk-guides/request-client/updating-a-request.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,88 @@ | ||
| # Updating a Request | ||
|
|
||
| After a request is created, it can be updated: | ||
| After a request is created, it can be updated by the authorized parties. Each update requires a signature and is persisted to the Request Network. | ||
|
|
||
| <table data-full-width="true"><thead><tr><th>Name</th><th>Description</th><th>Role Authorized</th></tr></thead><tbody><tr><td><strong>accept</strong></td><td>accept a request, indicating that it will be paid</td><td>payer</td></tr><tr><td><strong>cancel</strong></td><td>cancel a request</td><td>payee, payer</td></tr><tr><td><strong>reduceExpectedAmount</strong></td><td>reduce the expected amount</td><td>payee</td></tr><tr><td><strong>increaseExpectedAmount</strong></td><td>increase the expected amount</td><td>payer</td></tr><tr><td><strong>addStakeholders</strong></td><td>grant 1 or more third parties access to view an encrypted request</td><td>payee, payer, third party</td></tr></tbody></table> | ||
| ## Summary of Actions | ||
|
|
||
| Feature exists. More docs coming soon... | ||
| | Action | Description | Authorized Role | | ||
| | :--- | :--- | :--- | | ||
| | **accept** | Accept a request, indicating that it will be paid | Payer | | ||
| | **cancel** | Cancel a request | Payee or Payer | | ||
| | **reduceExpectedAmount** | Reduce the expected amount | Payee | | ||
| | **increaseExpectedAmount** | Increase the expected amount | Payer | | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Initialize the Request Client | ||
|
|
||
| First, retrieve the request you want to update. You must provide a `signatureProvider` to sign the update transactions. | ||
|
|
||
| ```javascript | ||
| const { RequestNetwork, Types } = require("@requestnetwork/request-client.js"); | ||
|
|
||
| const requestClient = new RequestNetwork({ | ||
| nodeConnectionConfig: { baseURL: "https://sepolia.gateway.request.network/" }, | ||
| signatureProvider: epkSignatureProvider, // Required for updates | ||
MantisClone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| const request = await requestClient.fromRequestId('YOUR_REQUEST_ID'); | ||
| ``` | ||
|
|
||
| ### Accept a Request (Payer) | ||
|
|
||
| The payer can accept a request to signal their intention to pay. | ||
|
|
||
| ```javascript | ||
| const updatedRequestData = await request.accept({ | ||
| type: Types.Identity.TYPE.ETHEREUM_ADDRESS, | ||
| value: payerAddress, | ||
MantisClone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| // Wait for the update to be persisted | ||
| await request.waitForConfirmation(); | ||
| ``` | ||
|
|
||
| ### Cancel a Request (Payee or Payer) | ||
|
|
||
| Either the payee or the payer can cancel a request. | ||
|
|
||
| ```javascript | ||
| const updatedRequestData = await request.cancel({ | ||
| type: Types.Identity.TYPE.ETHEREUM_ADDRESS, | ||
| value: signerAddress, | ||
MantisClone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| await request.waitForConfirmation(); | ||
| ``` | ||
|
|
||
| ### Increase Expected Amount (Payer) | ||
|
|
||
| The payer can increase the expected amount (e.g., adding a tip or adjusting for additional services). | ||
|
|
||
| ```javascript | ||
| const updatedRequestData = await request.increaseExpectedAmountRequest( | ||
| '100000000000000000', // Amount to add in base units (e.g., 0.1 ETH) | ||
| { | ||
| type: Types.Identity.TYPE.ETHEREUM_ADDRESS, | ||
| value: payerAddress, | ||
MantisClone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| ); | ||
|
|
||
| await request.waitForConfirmation(); | ||
| ``` | ||
|
|
||
| ### Reduce Expected Amount (Payee) | ||
|
|
||
| The payee can reduce the expected amount (e.g., applying a discount). | ||
|
|
||
| ```javascript | ||
| const updatedRequestData = await request.reduceExpectedAmountRequest( | ||
| '100000000000000000', // Amount to subtract in base units | ||
| { | ||
| type: Types.Identity.TYPE.ETHEREUM_ADDRESS, | ||
| value: payeeAddress, | ||
MantisClone marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| ); | ||
|
|
||
| await request.waitForConfirmation(); | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Advocates Welcome Kit | ||
|
|
||
| Welcome to the Request Network Advocates program! We are excited to have you onboard to help us grow the protocol and support the developer community. | ||
|
|
||
| ## Mission & Vision | ||
|
|
||
| **Our Mission:** To rebuild the world of payments by creating a financial layer that is open, decentralized, and interoperable. | ||
|
|
||
| **Our Vision:** A world where every transaction is seamless, transparent, and controlled by the users, not by intermediaries. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| As an advocate, your first week is about getting to know the team and the tools. | ||
|
|
||
| ### 1. Join the Community | ||
| * **Discord:** Join our [Discord server](https://discord.gg/request) and introduce yourself in the `#advocates` channel. | ||
| * **Twitter/X:** Follow [@RequestNetwork](https://twitter.com/RequestNetwork) for updates. | ||
|
|
||
| ### 2. Access Your Tools | ||
| * **Notion:** You will receive an invite to our private Advocates workspace. | ||
| * **Canva:** Access our brand assets and templates for creating content. | ||
| * **GitHub:** Star our [repositories](https://github.com/RequestNetwork) and join the discussions. | ||
|
|
||
| ### 3. Your First Tasks | ||
| * Complete your onboarding profile. | ||
| * Read the [Technical Documentation](https://docs.request.network). | ||
| * Say hello to the team in the private advocate channel. | ||
|
|
||
| ## Reward Program | ||
|
|
||
| Advocates are rewarded in **REQ tokens** based on their monthly contributions. | ||
|
|
||
| ### Point Categories | ||
| 1. **Developer Support & Documentation:** GitHub PRs, tutorials, Discord support. | ||
| 2. **Content & Awareness:** Blog posts, X threads, videos, memes. | ||
| 3. **Community Engagement & Growth:** AMAs, moderation, onboarding new developers. | ||
|
|
||
| ### Reward Tiers | ||
| * **I'm around (5-9 points):** Share in 10% of the monthly REQ pool. | ||
| * **I'm active (10-14 points):** Share in 40% of the monthly REQ pool. | ||
| * **I'm a champ (15+ points):** Share in 50% of the monthly REQ pool. | ||
|
|
||
| *Total Monthly Pool: $1,200 USD worth of REQ.* | ||
|
|
||
| ## Support | ||
|
|
||
| If you have any questions, reach out to the program managers in Discord or via email at [email protected]. | ||
|
|
||
| Let's build the future of payments together! | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.