Skip to content

docs: add JS snippet for get grant spent amounts#796

Open
sidvishnoi wants to merge 2 commits into
mainfrom
docs-snippet-grant-spent-amount
Open

docs: add JS snippet for get grant spent amounts#796
sidvishnoi wants to merge 2 commits into
mainfrom
docs-snippet-grant-spent-amount

Conversation

@sidvishnoi
Copy link
Copy Markdown
Member

@sidvishnoi sidvishnoi commented May 22, 2026

Description of changes

See DOC-57
PR preview

Checklist

  • PR title is prefixed with docs:
  • PR title or description includes a fixes #
  • You've run pnpm format and pnpm lint
  • You've reviewed Vale errors and made changes where appropriate

@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

Deploy Preview for openpayments ready!

Name Link
🔨 Latest commit 9f65386
🔍 Latest deploy log https://app.netlify.com/projects/openpayments/deploys/6a14180c0dc1e700087df5b0
😎 Deploy Preview https://deploy-preview-796--openpayments.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sidvishnoi sidvishnoi marked this pull request as ready for review May 22, 2026 15:03
Comment on lines +46 to +58
// 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
}
}
})
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inclusion of those sections is already a compromise with other developers 😁

Copy link
Copy Markdown
Member Author

@sidvishnoi sidvishnoi May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants