-
Notifications
You must be signed in to change notification settings - Fork 4
Guide for using SDK with Two Party App Sessions #102
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
base: master
Are you sure you want to change the base?
Guide for using SDK with Two Party App Sessions #102
Conversation
Prefix env var with WALLET_1
6e687f1 to
d253712
Compare
| You'll need two wallet seed phrases in your `.env` file: | ||
|
|
||
| ```bash | ||
| WALLET_1_SEED_PHRASE="first wallet 12 or 24 word mnemonic here" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib/auth.ts in the tutorial repo explicitly checks for process.env.SEED_PHRASE (singular). Suggestion: Either update the tutorial code to accept WALLET_1... or update this instruction to include SEED_PHRASE. Ideally, update the code to match this guide, as WALLET_1... is more descriptive for a multi-party context.
|
|
||
| ```typescript | ||
| const yellow = new Client({ | ||
| url: 'wss://clearnet.yellow.com/ws', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ suggestion: This URL points to the Production environment. Users following the Quickstart will have ytest.usd funds, which are only available on the Sandbox. Action: Add a callout or tab for the Sandbox URL: wss://clearnet-sandbox.yellow.com/ws.
Example Callout:
:::info Sandbox Testing
For testing without real funds, use the sandbox endpoint: wss://clearnet-sandbox.yellow.com/ws
:::
| ```typescript | ||
| const allocations: RPCAppSessionAllocation[] = [ | ||
| { participant: address1, asset: 'usdc', amount: '0.01' }, | ||
| { participant: address2, asset: 'usdc', amount: '0.00' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛑 Blocker: Users interacting with the Sandbox environment (as encouraged for tutorials) will receive ytest.usd from the faucet, not usdc. Attempting to use usdc on the Sandbox results in an "unsupported token" error. Suggestion: Mention that ytest.usd should be used for Sandbox testing.
| ```typescript | ||
| const allocations = [ | ||
| { participant: wallet1Client.account.address, asset: 'usdc', amount: '0.01' }, | ||
| { participant: wallet2Client.account.address, asset: 'usdc', amount: '0.00' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for line 101 :)
|
|
||
| --- | ||
|
|
||
| ## Troubleshooting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Error: Add "Unsupported Token" to the troubleshooting section. Cause: Using usdc on the Sandbox environment or ytest.usd on Production. Solution: Ensure the asset matches the connected network (Sandbox = ytest.usd, Production = usdc).
Adds comprehensive documentation for multi-party application sessions, helping developers understand how to create, manage, and close app sessions with multiple participants using the Yellow Network and Nitrolite protocol. Includes reference to full working demo script in sdk-examples repo