Once a user has clicked into a secondbrain and deposited sats, they are now ready to submit content to Second Brain.
User Story
As a user, I paste a link I want to submit to the Second Brain then click "Add".
I then see a success screen and the balance reduced.
Or I see a failed screen and the balance is preserved.
Technical Considerations
1. Specify 2B API Call
You can specify which 2B endpoint to hit by using this logic.
Endpoint = /node/content
Request:
{
"source": "{URL}"
}
2. Submit content through API call
When submitting the content, you must include the link in the body of the call as well as the L402 in the header. This is how the secondbrain knows which L402 to decrement 10 sats from.
Here is the getLsat function to identify the specific L402 that is being used.
3. Success/Fail
The API call should also tell us whether or not it was successful.
If successful, another call is made to check balance of the L402 using /balance. If the balance is different from before, amount should be updated with the correct amount. We should expect decrements of 10 sats each time.
If failed, then the user balance should be preserved in the Chrome Extension.
Designs
Inside 2BPaste URLSuccess Screen
Please note that the amount has decreased by 10 sats. This is visible for 3 seconds and can be exited before that by clicking anywhere inside the "added susccessfully" screen. They then returned to the Inside 2b screen again to be prompted to add another url.
Fail Screen
Account balance 0
If the account balance hits 0, they will be taken to the home screen and prompted to fund.
You can find the figma file here. Use dev mode for exact requirements.
Acceptance Criteria
[ ] I have tested on Chrome
[ ] I have posted a screenrecording of the flow in my PR
Once a user has clicked into a secondbrain and deposited sats, they are now ready to submit content to Second Brain.
User Story
As a user, I paste a link I want to submit to the Second Brain then click "Add". I then see a success screen and the balance reduced. Or I see a failed screen and the balance is preserved.
Technical Considerations
1. Specify 2B API Call You can specify which 2B endpoint to hit by using this logic.
Endpoint =
/node/content
Request:
2. Submit content through API call When submitting the content, you must include the link in the body of the call as well as the L402 in the header. This is how the secondbrain knows which L402 to decrement 10 sats from.
Here is the getLsat function to identify the specific L402 that is being used.
Here is an example getLsat call.
3. Success/Fail The API call should also tell us whether or not it was successful.
If successful, another call is made to check balance of the L402 using
/balance
. If the balance is different from before, amount should be updated with the correct amount. We should expect decrements of 10 sats each time.If failed, then the user balance should be preserved in the Chrome Extension.
Designs
Inside 2B
Paste URL
Success Screen
Please note that the amount has decreased by 10 sats. This is visible for 3 seconds and can be exited before that by clicking anywhere inside the "added susccessfully" screen. They then returned to the Inside 2b screen again to be prompted to add another url.
Fail Screen
![Add content - Error](https://github.com/stakwork/sphinx-js/assets/32662508/84ae3e87-451e-4cc4-840e-4fb849ac926e)
Account balance 0 If the account balance hits 0, they will be taken to the home screen and prompted to fund.![35](https://github.com/stakwork/sphinx-js/assets/32662508/ae705d61-b1b9-4930-a10c-541447db68cb)
You can find the figma file here. Use dev mode for exact requirements.
Acceptance Criteria