docs: add JS snippet for get grant spent amounts#796
Conversation
✅ Deploy Preview for openpayments ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| // Create an outgoing-payment grant, and get the access token after continuation | ||
| const OUTGOING_PAYMENT_ACCESS_TOKEN = await setupOutgoingPaymentGrant({ | ||
| client, | ||
| sender: walletAddress, | ||
| actions: ['read', 'create'], | ||
| limits: { | ||
| debitAmount: { | ||
| amount: '8000', | ||
| assetCode: walletAddress.assetCode, | ||
| assetScale: walletAddress.assetScale | ||
| } | ||
| } | ||
| }) |
There was a problem hiding this comment.
Do we have a way to direct users to specific pages from here?
I want them to have completed grant-create-outgoing and grant-continue at this step.
There was a problem hiding this comment.
The short answer is no, not in any nicely formatted way. Throw the links in here and we'll figure out what to do with them. We might have to format things a little differently than usual.
Having said that, I wonder if the snippet has too much information. If you're getting the spent amounts, I assume that the outgoing payment grant/outgoing payment is already created at this point. These SDK pages should be very specific to what the API does.
We have a different issue for updating the "Get an outgoing payment grant for future payments" guide with grant spent amount info. That's probably where the details should go.
There was a problem hiding this comment.
I was matching rest of the snippets, but I think create client, get wallet address etc. don't need to exist either on each individual snippet pages either.
There was a problem hiding this comment.
The inclusion of those sections is already a compromise with other developers 😁
There was a problem hiding this comment.
I'll remove the snippet for create payment and grant, that should reduce the burden from reader. Otherwise it matches more of guide than sdk snippet.
Description of changes
See DOC-57
PR preview
Checklist
docs:fixes #pnpm formatandpnpm lint